From 28093a374bef54b9b68fcb2f00ae7d0529e33a3f Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 10 Apr 2017 15:29:36 -0700 Subject: gpu: nvgpu: vgpu: add t19x support - add commit_inst hal ops - add t19x cmds to cmd big union - add t19x vgpu driver and call t19x hal init - get guest channel_base to calculate hw channel id Jira VFND-3796 Change-Id: Ic2431233fd174afc2c84c4794e20552e6e88b1dc Signed-off-by: Richard Zhao Reviewed-on: https://git-master/r/1474715 GVS: Gerrit_Virtual_Submit Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/vgpu.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c') 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 @@ #include #include #include +#include #include "vgpu/vgpu.h" #include "vgpu/fecs_trace_vgpu.h" @@ -38,6 +39,11 @@ #include "common/linux/module.h" #include "common/linux/os_linux.h" +#ifdef CONFIG_TEGRA_19x_GPU +#include +#include +#endif + #include static inline int vgpu_comm_init(struct platform_device *pdev) @@ -268,14 +274,14 @@ static int vgpu_init_support(struct platform_device *pdev) goto fail; } - regs = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(regs)) { - dev_err(dev_from_gk20a(g), "failed to remap gk20a regs\n"); - err = PTR_ERR(g->bar1); - goto fail; - } - if (r->name && !strcmp(r->name, "/vgpu")) { + regs = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(regs)) { + dev_err(dev_from_gk20a(g), + "failed to remap gk20a regs\n"); + err = PTR_ERR(regs); + goto fail; + } g->bar1 = regs; g->bar1_mem = r; } @@ -458,6 +464,11 @@ static int vgpu_init_hal(struct gk20a *g) gk20a_dbg_info("gp10b detected"); err = vgpu_gp10b_init_hal(g); break; +#ifdef CONFIG_TEGRA_19x_GPU + case TEGRA_19x_GPUID: + err = vgpu_t19x_init_hal(g); + break; +#endif default: nvgpu_err(g, "no support for %x", ver); err = -ENODEV; @@ -581,6 +592,9 @@ static int vgpu_pm_init(struct device *dev) gk20a_dbg_fn(""); + if (nvgpu_platform_is_simulation(g)) + return 0; + __pm_runtime_disable(dev, false); if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) -- cgit v1.2.2