diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-09-28 13:34:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-17 13:43:39 -0400 |
commit | b252653ac5f2b12a9a84476f9dde6a844a77a602 (patch) | |
tree | d2ca5a3f56c652db2e30e21409f3f1ab1994d0a3 /drivers/gpu/nvgpu/common/linux/module.c | |
parent | 5c5b52dce54fa09d16ae38a232a0e17b4729b472 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index fe3e4e6f..b7d13f05 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -49,6 +49,8 @@ | |||
49 | #endif | 49 | #endif |
50 | #endif | 50 | #endif |
51 | #include "os_linux.h" | 51 | #include "os_linux.h" |
52 | #include "cde_gm20b.h" | ||
53 | #include "cde_gp10b.h" | ||
52 | 54 | ||
53 | #define CLASS_NAME "nvidia-gpu" | 55 | #define CLASS_NAME "nvidia-gpu" |
54 | /* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ | 56 | /* 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) | |||
154 | return 0; | 156 | return 0; |
155 | } | 157 | } |
156 | 158 | ||
159 | static int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l) { | ||
160 | struct gk20a *g = &l->g; | ||
161 | u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; | ||
162 | |||
163 | switch (ver) { | ||
164 | case GK20A_GPUID_GM20B: | ||
165 | case GK20A_GPUID_GM20B_B: | ||
166 | l->ops.cde = gm20b_cde_ops.cde; | ||
167 | break; | ||
168 | case NVGPU_GPUID_GP10B: | ||
169 | l->ops.cde = gp10b_cde_ops.cde; | ||
170 | break; | ||
171 | default: | ||
172 | /* CDE is optional, so today ignoring unknown chip is fine */ | ||
173 | break; | ||
174 | } | ||
175 | |||
176 | return 0; | ||
177 | } | ||
178 | |||
157 | int gk20a_pm_finalize_poweron(struct device *dev) | 179 | int gk20a_pm_finalize_poweron(struct device *dev) |
158 | { | 180 | { |
159 | struct gk20a *g = get_gk20a(dev); | 181 | struct gk20a *g = get_gk20a(dev); |
@@ -198,6 +220,10 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
198 | 220 | ||
199 | trace_gk20a_finalize_poweron_done(dev_name(dev)); | 221 | trace_gk20a_finalize_poweron_done(dev_name(dev)); |
200 | 222 | ||
223 | err = nvgpu_init_os_linux_ops(l); | ||
224 | if (err) | ||
225 | goto done; | ||
226 | |||
201 | enable_irq(g->irq_stall); | 227 | enable_irq(g->irq_stall); |
202 | if (g->irq_stall != g->irq_nonstall) | 228 | if (g->irq_stall != g->irq_nonstall) |
203 | enable_irq(g->irq_nonstall); | 229 | enable_irq(g->irq_nonstall); |