diff options
author | Richard Zhao <rizhao@nvidia.com> | 2018-04-17 20:26:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-25 12:36:42 -0400 |
commit | 98dce7eaac374ccd5c4d7cf6d76decc4e9cd3896 (patch) | |
tree | cbf7869961ed89cccfebf4c94a233bf4bf41ba10 /drivers/gpu/nvgpu/common | |
parent | 687b1059f078daf41024b223065107bc16822e71 (diff) |
gpu: nvgpu: move mss nvlink credit init to os specific code
The code uses ioremap, readl_relaxed/writel_relaxed, which only exists
on linux. So move them to linux folder.
Also fix build errors on qnx.
Jira VQRM-2344
Change-Id: Ide1176d0bf954a804187aa842a6bbfdecbdb0286
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1698973
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/nvlink.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/nvlink.c b/drivers/gpu/nvgpu/common/linux/nvlink.c index f2faa682..5a2f4ded 100644 --- a/drivers/gpu/nvgpu/common/linux/nvlink.c +++ b/drivers/gpu/nvgpu/common/linux/nvlink.c | |||
@@ -539,3 +539,37 @@ free_ndev: | |||
539 | #endif | 539 | #endif |
540 | } | 540 | } |
541 | 541 | ||
542 | void nvgpu_mss_nvlink_init_credits(struct gk20a *g) | ||
543 | { | ||
544 | /* MSS_NVLINK_1_BASE */ | ||
545 | void __iomem *soc1 = ioremap(0x01f20010, 4096); | ||
546 | /* MSS_NVLINK_2_BASE */ | ||
547 | void __iomem *soc2 = ioremap(0x01f40010, 4096); | ||
548 | /* MSS_NVLINK_3_BASE */ | ||
549 | void __iomem *soc3 = ioremap(0x01f60010, 4096); | ||
550 | /* MSS_NVLINK_4_BASE */ | ||
551 | void __iomem *soc4 = ioremap(0x01f80010, 4096); | ||
552 | u32 val; | ||
553 | |||
554 | nvgpu_log(g, gpu_dbg_info, "init nvlink soc credits"); | ||
555 | |||
556 | val = readl_relaxed(soc1); | ||
557 | writel_relaxed(val, soc1); | ||
558 | val = readl_relaxed(soc1 + 4); | ||
559 | writel_relaxed(val, soc1 + 4); | ||
560 | |||
561 | val = readl_relaxed(soc2); | ||
562 | writel_relaxed(val, soc2); | ||
563 | val = readl_relaxed(soc2 + 4); | ||
564 | writel_relaxed(val, soc2 + 4); | ||
565 | |||
566 | val = readl_relaxed(soc3); | ||
567 | writel_relaxed(val, soc3); | ||
568 | val = readl_relaxed(soc3 + 4); | ||
569 | writel_relaxed(val, soc3 + 4); | ||
570 | |||
571 | val = readl_relaxed(soc4); | ||
572 | writel_relaxed(val, soc4); | ||
573 | val = readl_relaxed(soc4 + 4); | ||
574 | writel_relaxed(val, soc4 + 4); | ||
575 | } | ||