mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: Move rest of CDE structures to Linux
Move rest of CDE structures to common/linux. This includes moving the per-chip firmware file interpretation functions, and removing CDE ops from HAL and adding it to nvgpu_os_linux. JIRA NVGPU-259 Change-Id: I59d8f44bddadecef81ad3c455b363a14034c5e13 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1570403 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
5c5b52dce5
commit
b252653ac5
@@ -49,6 +49,8 @@
|
||||
#endif
|
||||
#endif
|
||||
#include "os_linux.h"
|
||||
#include "cde_gm20b.h"
|
||||
#include "cde_gp10b.h"
|
||||
|
||||
#define CLASS_NAME "nvidia-gpu"
|
||||
/* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */
|
||||
@@ -154,6 +156,26 @@ static int gk20a_restore_registers(struct gk20a *g)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) {
|
||||
struct gk20a *g = &l->g;
|
||||
u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
|
||||
|
||||
switch (ver) {
|
||||
case GK20A_GPUID_GM20B:
|
||||
case GK20A_GPUID_GM20B_B:
|
||||
l->ops.cde = gm20b_cde_ops.cde;
|
||||
break;
|
||||
case NVGPU_GPUID_GP10B:
|
||||
l->ops.cde = gp10b_cde_ops.cde;
|
||||
break;
|
||||
default:
|
||||
/* CDE is optional, so today ignoring unknown chip is fine */
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gk20a_pm_finalize_poweron(struct device *dev)
|
||||
{
|
||||
struct gk20a *g = get_gk20a(dev);
|
||||
@@ -198,6 +220,10 @@ int gk20a_pm_finalize_poweron(struct device *dev)
|
||||
|
||||
trace_gk20a_finalize_poweron_done(dev_name(dev));
|
||||
|
||||
err = nvgpu_init_os_linux_ops(l);
|
||||
if (err)
|
||||
goto done;
|
||||
|
||||
enable_irq(g->irq_stall);
|
||||
if (g->irq_stall != g->irq_nonstall)
|
||||
enable_irq(g->irq_nonstall);
|
||||
|
||||
Reference in New Issue
Block a user