diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-09-27 16:21:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:19:55 -0400 |
commit | be3750bc9eb60f8696c20b7298cc282eea17ac1b (patch) | |
tree | b36fb818ce58a96fc7f2822480433057bd28faf4 /drivers/gpu/nvgpu/common/linux/pci.c | |
parent | ff9c3fc20a27444cd1ff7d9402965023e425f404 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/pci.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/pci.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index 401080ed..50d079bb 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c | |||
@@ -348,20 +348,21 @@ static int nvgpu_pci_init_support(struct pci_dev *pdev) | |||
348 | { | 348 | { |
349 | int err = 0; | 349 | int err = 0; |
350 | struct gk20a *g = get_gk20a(&pdev->dev); | 350 | struct gk20a *g = get_gk20a(&pdev->dev); |
351 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
351 | 352 | ||
352 | g->regs = ioremap(pci_resource_start(pdev, 0), | 353 | l->regs = ioremap(pci_resource_start(pdev, 0), |
353 | pci_resource_len(pdev, 0)); | 354 | pci_resource_len(pdev, 0)); |
354 | if (IS_ERR(g->regs)) { | 355 | if (IS_ERR(l->regs)) { |
355 | nvgpu_err(g, "failed to remap gk20a registers"); | 356 | nvgpu_err(g, "failed to remap gk20a registers"); |
356 | err = PTR_ERR(g->regs); | 357 | err = PTR_ERR(l->regs); |
357 | goto fail; | 358 | goto fail; |
358 | } | 359 | } |
359 | 360 | ||
360 | g->bar1 = ioremap(pci_resource_start(pdev, 1), | 361 | l->bar1 = ioremap(pci_resource_start(pdev, 1), |
361 | pci_resource_len(pdev, 1)); | 362 | pci_resource_len(pdev, 1)); |
362 | if (IS_ERR(g->bar1)) { | 363 | if (IS_ERR(l->bar1)) { |
363 | nvgpu_err(g, "failed to remap gk20a bar1"); | 364 | nvgpu_err(g, "failed to remap gk20a bar1"); |
364 | err = PTR_ERR(g->bar1); | 365 | err = PTR_ERR(l->bar1); |
365 | goto fail; | 366 | goto fail; |
366 | } | 367 | } |
367 | 368 | ||