From ac292605b5d2c4c27c7d133601594b9692a32fed Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 27 Jun 2017 17:43:00 -0700 Subject: gpu: nvgpu: vgpu: fixes for no bar1 support case - add check of is_bar1_supported - move vgpu_init_fifo_setup_hw to hal - assume it's bar1 reg if no "reg-names" in dts Jira VFND-3796 Change-Id: I022a0ed98144bb8f1e7e55f24fcaf928b4a3fe32 Signed-off-by: Richard Zhao Reviewed-on: https://git-master/r/1474716 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/vgpu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 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 1a6dbb35..d94543a8 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -259,6 +259,7 @@ static int vgpu_init_support(struct platform_device *pdev) { struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct gk20a *g = get_gk20a(&pdev->dev); + void __iomem *regs; int err = 0; if (!r) { @@ -267,13 +268,17 @@ static int vgpu_init_support(struct platform_device *pdev) goto fail; } - g->bar1 = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(g->bar1)) { - dev_err(dev_from_gk20a(g), "failed to remap gk20a bar1\n"); + 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; } - g->bar1_mem = r; + + if (r->name && !strcmp(r->name, "/vgpu")) { + g->bar1 = regs; + g->bar1_mem = r; + } nvgpu_mutex_init(&g->dbg_sessions_lock); nvgpu_mutex_init(&g->client_lock); -- cgit v1.2.2