mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Abstract IO aperture accessors
Add abstraction of IO aperture accessors. Add new functions gk20a_io_exists() and gk20a_io_valid_reg() to remove dependencies to aperture fields from common code. Implement Linux version of the abstraction by moving gk20a_readl() and gk20a_writel() to new Linux specific io.c. Move the fields defining IO aperture to nvgpu_os_linux. Add t19x specific IO aperture initialization functions and add t19x specific section to nvgpu_os_linux. JIRA NVGPU-259 Change-Id: I09e79cda60d11a20d1099a9aaa6d2375236e94ce Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1569698 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ff9c3fc20a
commit
be3750bc9e
@@ -348,20 +348,21 @@ static int nvgpu_pci_init_support(struct pci_dev *pdev)
|
||||
{
|
||||
int err = 0;
|
||||
struct gk20a *g = get_gk20a(&pdev->dev);
|
||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||
|
||||
g->regs = ioremap(pci_resource_start(pdev, 0),
|
||||
l->regs = ioremap(pci_resource_start(pdev, 0),
|
||||
pci_resource_len(pdev, 0));
|
||||
if (IS_ERR(g->regs)) {
|
||||
if (IS_ERR(l->regs)) {
|
||||
nvgpu_err(g, "failed to remap gk20a registers");
|
||||
err = PTR_ERR(g->regs);
|
||||
err = PTR_ERR(l->regs);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
g->bar1 = ioremap(pci_resource_start(pdev, 1),
|
||||
l->bar1 = ioremap(pci_resource_start(pdev, 1),
|
||||
pci_resource_len(pdev, 1));
|
||||
if (IS_ERR(g->bar1)) {
|
||||
if (IS_ERR(l->bar1)) {
|
||||
nvgpu_err(g, "failed to remap gk20a bar1");
|
||||
err = PTR_ERR(g->bar1);
|
||||
err = PTR_ERR(l->bar1);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user