mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: vgpu: remove bar1 support
All vgpu supported chips don't support bar1 anymore. Jira GVSCI-15779 Change-Id: Ia2dc4a69f3cb96df6650e663d2a40302fc826dd2 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2884174 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Santosh BS <santoshb@nvidia.com> Reviewed-by: Austin Tajiri <atajiri@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4e6be49eee
commit
678df244b9
@@ -72,18 +72,6 @@ struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g)
|
|||||||
return (struct vgpu_priv_data *)plat->vgpu_priv;
|
return (struct vgpu_priv_data *)plat->vgpu_priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vgpu_remove_support(struct gk20a *g)
|
|
||||||
{
|
|
||||||
vgpu_remove_support_common(g);
|
|
||||||
|
|
||||||
/* free mappings to registers, etc*/
|
|
||||||
|
|
||||||
if (g->bar1) {
|
|
||||||
iounmap((void __iomem *)g->bar1);
|
|
||||||
g->bar1 = 0U;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform)
|
static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform)
|
||||||
{
|
{
|
||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||||
@@ -103,7 +91,6 @@ static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform)
|
|||||||
nvgpu_init_list_node(&l->ctrl_privs);
|
nvgpu_init_list_node(&l->ctrl_privs);
|
||||||
|
|
||||||
g->regs_saved = g->regs;
|
g->regs_saved = g->regs;
|
||||||
g->bar1_saved = g->bar1;
|
|
||||||
|
|
||||||
nvgpu_atomic_set(&g->clk_arb_global_nr, 0);
|
nvgpu_atomic_set(&g->clk_arb_global_nr, 0);
|
||||||
|
|
||||||
@@ -125,31 +112,11 @@ static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vgpu_init_support(struct platform_device *pdev)
|
static int vgpu_init_support(struct gk20a *g)
|
||||||
{
|
{
|
||||||
struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
struct gk20a *g = get_gk20a(&pdev->dev);
|
struct gk20a *g = get_gk20a(&pdev->dev);
|
||||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
|
||||||
void __iomem *regs;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (!r) {
|
|
||||||
nvgpu_err(g, "failed to get gk20a bar1");
|
|
||||||
err = -ENXIO;
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r->name && !strcmp(r->name, "/vgpu")) {
|
|
||||||
regs = devm_ioremap_resource(&pdev->dev, r);
|
|
||||||
if (IS_ERR(regs)) {
|
|
||||||
nvgpu_err(g, "failed to remap gk20a bar1");
|
|
||||||
err = PTR_ERR(regs);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
g->bar1 = (uintptr_t)regs;
|
|
||||||
l->bar1_mem = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
nvgpu_mutex_init(&g->dbg_sessions_lock);
|
nvgpu_mutex_init(&g->dbg_sessions_lock);
|
||||||
#if defined(CONFIG_NVGPU_CYCLESTATS)
|
#if defined(CONFIG_NVGPU_CYCLESTATS)
|
||||||
nvgpu_mutex_init(&g->cs_lock);
|
nvgpu_mutex_init(&g->cs_lock);
|
||||||
@@ -169,11 +136,11 @@ static int vgpu_init_support(struct platform_device *pdev)
|
|||||||
SZ_4K / sizeof(g->dbg_regops_tmp_buf[0]);
|
SZ_4K / sizeof(g->dbg_regops_tmp_buf[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g->remove_support = vgpu_remove_support;
|
g->remove_support = vgpu_remove_support_common;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
vgpu_remove_support(g);
|
vgpu_remove_support_common(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +361,7 @@ int vgpu_probe(struct platform_device *pdev)
|
|||||||
platform->g = gk20a;
|
platform->g = gk20a;
|
||||||
platform->vgpu_priv = priv;
|
platform->vgpu_priv = priv;
|
||||||
|
|
||||||
err = vgpu_init_support(pdev);
|
err = vgpu_init_support(gk20a);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
kfree(l);
|
kfree(l);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user