diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/nvlink.c | 34 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fb_gv11b.c | 35 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/nvlink.h | 3 |
3 files changed, 39 insertions, 33 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 | } | ||
diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c index 4ad350d1..30a2bca2 100644 --- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c | |||
@@ -22,13 +22,12 @@ | |||
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | #include <nvgpu/dma.h> | 25 | #include <nvgpu/dma.h> |
28 | #include <nvgpu/log.h> | 26 | #include <nvgpu/log.h> |
29 | #include <nvgpu/enabled.h> | 27 | #include <nvgpu/enabled.h> |
30 | #include <nvgpu/gmmu.h> | 28 | #include <nvgpu/gmmu.h> |
31 | #include <nvgpu/barrier.h> | 29 | #include <nvgpu/barrier.h> |
30 | #include <nvgpu/bug.h> | ||
32 | #include <nvgpu/soc.h> | 31 | #include <nvgpu/soc.h> |
33 | 32 | ||
34 | #include "gk20a/gk20a.h" | 33 | #include "gk20a/gk20a.h" |
@@ -57,37 +56,7 @@ static void gv11b_init_nvlink_soc_credits(struct gk20a *g) | |||
57 | nvgpu_log(g, gpu_dbg_info, "nvlink soc credits init done by bpmp"); | 56 | nvgpu_log(g, gpu_dbg_info, "nvlink soc credits init done by bpmp"); |
58 | } else { | 57 | } else { |
59 | #ifndef __NVGPU_POSIX__ | 58 | #ifndef __NVGPU_POSIX__ |
60 | /* MSS_NVLINK_1_BASE */ | 59 | nvgpu_mss_nvlink_init_credits(g); |
61 | void __iomem *soc1 = ioremap(0x01f20010, 4096); | ||
62 | /* MSS_NVLINK_2_BASE */ | ||
63 | void __iomem *soc2 = ioremap(0x01f40010, 4096); | ||
64 | /* MSS_NVLINK_3_BASE */ | ||
65 | void __iomem *soc3 = ioremap(0x01f60010, 4096); | ||
66 | /* MSS_NVLINK_4_BASE */ | ||
67 | void __iomem *soc4 = ioremap(0x01f80010, 4096); | ||
68 | u32 val; | ||
69 | |||
70 | nvgpu_log(g, gpu_dbg_info, "init nvlink soc credits"); | ||
71 | |||
72 | val = readl_relaxed(soc1); | ||
73 | writel_relaxed(val, soc1); | ||
74 | val = readl_relaxed(soc1 + 4); | ||
75 | writel_relaxed(val, soc1 + 4); | ||
76 | |||
77 | val = readl_relaxed(soc2); | ||
78 | writel_relaxed(val, soc2); | ||
79 | val = readl_relaxed(soc2 + 4); | ||
80 | writel_relaxed(val, soc2 + 4); | ||
81 | |||
82 | val = readl_relaxed(soc3); | ||
83 | writel_relaxed(val, soc3); | ||
84 | val = readl_relaxed(soc3 + 4); | ||
85 | writel_relaxed(val, soc3 + 4); | ||
86 | |||
87 | val = readl_relaxed(soc4); | ||
88 | writel_relaxed(val, soc4); | ||
89 | val = readl_relaxed(soc4 + 4); | ||
90 | writel_relaxed(val, soc4 + 4); | ||
91 | #endif | 60 | #endif |
92 | } | 61 | } |
93 | } | 62 | } |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvlink.h b/drivers/gpu/nvgpu/include/nvgpu/nvlink.h index 0ef8a2f5..dfa3be3f 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvlink.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvlink.h | |||
@@ -211,4 +211,7 @@ struct nvgpu_nvlink_dev { | |||
211 | int nvgpu_nvlink_enumerate(struct gk20a *g); | 211 | int nvgpu_nvlink_enumerate(struct gk20a *g); |
212 | int nvgpu_nvlink_train(struct gk20a *g, u32 link_id, bool from_off); | 212 | int nvgpu_nvlink_train(struct gk20a *g, u32 link_id, bool from_off); |
213 | int nvgpu_nvlink_probe(struct gk20a *g); | 213 | int nvgpu_nvlink_probe(struct gk20a *g); |
214 | |||
215 | void nvgpu_mss_nvlink_init_credits(struct gk20a *g); | ||
216 | |||
214 | #endif | 217 | #endif |