mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: store bus addr of gpu regs
Usermode submit needs to access the usermode region of registers from
userspace. Store the start address of register resource in struct
nvgpu_os_linux to be used in remap to userspace.
Bug 200145225
Bug 200541476
Change-Id: I3796b6bf67942af0cc16c86accb82a013032bfc8
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1811838
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 38c11db264
in dev-main)
Reviewed-on: https://git-master.nvidia.com/r/2169921
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
58ee7561f7
commit
eca2cf043e
@@ -680,6 +680,16 @@ void __iomem *nvgpu_devm_ioremap(struct device *dev, resource_size_t offset,
|
||||
return devm_ioremap(dev, offset, size);
|
||||
}
|
||||
|
||||
u64 nvgpu_resource_addr(struct platform_device *dev, int i)
|
||||
{
|
||||
struct resource *r = platform_get_resource(dev, IORESOURCE_MEM, i);
|
||||
|
||||
if (!r)
|
||||
return 0;
|
||||
|
||||
return r->start;
|
||||
}
|
||||
|
||||
static irqreturn_t gk20a_intr_isr_stall(int irq, void *dev_id)
|
||||
{
|
||||
struct gk20a *g = dev_id;
|
||||
@@ -764,6 +774,14 @@ static int gk20a_init_support(struct platform_device *pdev)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
l->regs_bus_addr = nvgpu_resource_addr(pdev,
|
||||
GK20A_BAR0_IORESOURCE_MEM);
|
||||
if (!l->regs_bus_addr) {
|
||||
nvgpu_err(g, "failed to read register bus offset");
|
||||
err = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
l->bar1 = nvgpu_devm_ioremap_resource(pdev,
|
||||
GK20A_BAR1_IORESOURCE_MEM,
|
||||
&l->bar1_mem);
|
||||
|
||||
Reference in New Issue
Block a user