summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/vgpu.c
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2017-06-27 20:43:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-30 01:34:36 -0400
commitac292605b5d2c4c27c7d133601594b9692a32fed (patch)
tree5aa3104c9eb992c4ce3664d471046511a93dc0d1 /drivers/gpu/nvgpu/vgpu/vgpu.c
parent0a77330ac77d50d637492f591262a36bf48f2e5e (diff)
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 <rizhao@nvidia.com> Reviewed-on: https://git-master/r/1474716 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c13
1 files changed, 9 insertions, 4 deletions
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)
259{ 259{
260 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 260 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
261 struct gk20a *g = get_gk20a(&pdev->dev); 261 struct gk20a *g = get_gk20a(&pdev->dev);
262 void __iomem *regs;
262 int err = 0; 263 int err = 0;
263 264
264 if (!r) { 265 if (!r) {
@@ -267,13 +268,17 @@ static int vgpu_init_support(struct platform_device *pdev)
267 goto fail; 268 goto fail;
268 } 269 }
269 270
270 g->bar1 = devm_ioremap_resource(&pdev->dev, r); 271 regs = devm_ioremap_resource(&pdev->dev, r);
271 if (IS_ERR(g->bar1)) { 272 if (IS_ERR(regs)) {
272 dev_err(dev_from_gk20a(g), "failed to remap gk20a bar1\n"); 273 dev_err(dev_from_gk20a(g), "failed to remap gk20a regs\n");
273 err = PTR_ERR(g->bar1); 274 err = PTR_ERR(g->bar1);
274 goto fail; 275 goto fail;
275 } 276 }
276 g->bar1_mem = r; 277
278 if (r->name && !strcmp(r->name, "/vgpu")) {
279 g->bar1 = regs;
280 g->bar1_mem = r;
281 }
277 282
278 nvgpu_mutex_init(&g->dbg_sessions_lock); 283 nvgpu_mutex_init(&g->dbg_sessions_lock);
279 nvgpu_mutex_init(&g->client_lock); 284 nvgpu_mutex_init(&g->client_lock);