summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c26
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
159static 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
157int gk20a_pm_finalize_poweron(struct device *dev) 179int 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);