diff options
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index d94543a8..c4647e29 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <nvgpu/enabled.h> | 24 | #include <nvgpu/enabled.h> |
25 | #include <nvgpu/debug.h> | 25 | #include <nvgpu/debug.h> |
26 | #include <nvgpu/bus.h> | 26 | #include <nvgpu/bus.h> |
27 | #include <nvgpu/soc.h> | ||
27 | 28 | ||
28 | #include "vgpu/vgpu.h" | 29 | #include "vgpu/vgpu.h" |
29 | #include "vgpu/fecs_trace_vgpu.h" | 30 | #include "vgpu/fecs_trace_vgpu.h" |
@@ -38,6 +39,11 @@ | |||
38 | #include "common/linux/module.h" | 39 | #include "common/linux/module.h" |
39 | #include "common/linux/os_linux.h" | 40 | #include "common/linux/os_linux.h" |
40 | 41 | ||
42 | #ifdef CONFIG_TEGRA_19x_GPU | ||
43 | #include <vgpu/vgpu_t19x.h> | ||
44 | #include <nvgpu_gpuid_t19x.h> | ||
45 | #endif | ||
46 | |||
41 | #include <nvgpu/hw/gk20a/hw_mc_gk20a.h> | 47 | #include <nvgpu/hw/gk20a/hw_mc_gk20a.h> |
42 | 48 | ||
43 | static inline int vgpu_comm_init(struct platform_device *pdev) | 49 | static inline int vgpu_comm_init(struct platform_device *pdev) |
@@ -268,14 +274,14 @@ static int vgpu_init_support(struct platform_device *pdev) | |||
268 | goto fail; | 274 | goto fail; |
269 | } | 275 | } |
270 | 276 | ||
271 | regs = devm_ioremap_resource(&pdev->dev, r); | ||
272 | if (IS_ERR(regs)) { | ||
273 | dev_err(dev_from_gk20a(g), "failed to remap gk20a regs\n"); | ||
274 | err = PTR_ERR(g->bar1); | ||
275 | goto fail; | ||
276 | } | ||
277 | |||
278 | if (r->name && !strcmp(r->name, "/vgpu")) { | 277 | if (r->name && !strcmp(r->name, "/vgpu")) { |
278 | regs = devm_ioremap_resource(&pdev->dev, r); | ||
279 | if (IS_ERR(regs)) { | ||
280 | dev_err(dev_from_gk20a(g), | ||
281 | "failed to remap gk20a regs\n"); | ||
282 | err = PTR_ERR(regs); | ||
283 | goto fail; | ||
284 | } | ||
279 | g->bar1 = regs; | 285 | g->bar1 = regs; |
280 | g->bar1_mem = r; | 286 | g->bar1_mem = r; |
281 | } | 287 | } |
@@ -458,6 +464,11 @@ static int vgpu_init_hal(struct gk20a *g) | |||
458 | gk20a_dbg_info("gp10b detected"); | 464 | gk20a_dbg_info("gp10b detected"); |
459 | err = vgpu_gp10b_init_hal(g); | 465 | err = vgpu_gp10b_init_hal(g); |
460 | break; | 466 | break; |
467 | #ifdef CONFIG_TEGRA_19x_GPU | ||
468 | case TEGRA_19x_GPUID: | ||
469 | err = vgpu_t19x_init_hal(g); | ||
470 | break; | ||
471 | #endif | ||
461 | default: | 472 | default: |
462 | nvgpu_err(g, "no support for %x", ver); | 473 | nvgpu_err(g, "no support for %x", ver); |
463 | err = -ENODEV; | 474 | err = -ENODEV; |
@@ -581,6 +592,9 @@ static int vgpu_pm_init(struct device *dev) | |||
581 | 592 | ||
582 | gk20a_dbg_fn(""); | 593 | gk20a_dbg_fn(""); |
583 | 594 | ||
595 | if (nvgpu_platform_is_simulation(g)) | ||
596 | return 0; | ||
597 | |||
584 | __pm_runtime_disable(dev, false); | 598 | __pm_runtime_disable(dev, false); |
585 | 599 | ||
586 | if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) | 600 | if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) |