summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/pramin.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-09-27 18:13:45 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-10 11:49:05 -0400
commit37ec670601a879781e40ec71d9f713fa9c28564c (patch)
tree83573899a8c3620d66120da202a5518f3aabcc44 /drivers/gpu/nvgpu/common/pramin.c
parent3c37701377459fbea2b460e1b9c65a863dfb04b2 (diff)
gpu: nvgpu: Move PRAMIN functions to nvgpu_mem
PRAMIN batch access functions are only used by nvgpu_mem. The way the functions are written is Linux specific, so move the implementation from common PRAMIN code. JIRA NVGPU-259 Change-Id: I6e2aba08c98568c651a86fe8ca7f9f5220d67348 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1569697 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/pramin.c')
-rw-r--r--drivers/gpu/nvgpu/common/pramin.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/gpu/nvgpu/common/pramin.c b/drivers/gpu/nvgpu/common/pramin.c
index 56179a6b..abe5b561 100644
--- a/drivers/gpu/nvgpu/common/pramin.c
+++ b/drivers/gpu/nvgpu/common/pramin.c
@@ -34,55 +34,6 @@
34 */ 34 */
35#define GK20A_FORCE_PRAMIN_DEFAULT false 35#define GK20A_FORCE_PRAMIN_DEFAULT false
36 36
37void pramin_access_batch_rd_n(struct gk20a *g, u32 start, u32 words, u32 **arg)
38{
39 u32 r = start, *dest_u32 = *arg;
40
41 if (!g->regs) {
42 __gk20a_warn_on_no_regs();
43 return;
44 }
45
46 while (words--) {
47 *dest_u32++ = gk20a_readl(g, r);
48 r += sizeof(u32);
49 }
50
51 *arg = dest_u32;
52}
53
54void pramin_access_batch_wr_n(struct gk20a *g, u32 start, u32 words, u32 **arg)
55{
56 u32 r = start, *src_u32 = *arg;
57
58 if (!g->regs) {
59 __gk20a_warn_on_no_regs();
60 return;
61 }
62
63 while (words--) {
64 writel_relaxed(*src_u32++, g->regs + r);
65 r += sizeof(u32);
66 }
67
68 *arg = src_u32;
69}
70
71void pramin_access_batch_set(struct gk20a *g, u32 start, u32 words, u32 **arg)
72{
73 u32 r = start, repeat = **arg;
74
75 if (!g->regs) {
76 __gk20a_warn_on_no_regs();
77 return;
78 }
79
80 while (words--) {
81 writel_relaxed(repeat, g->regs + r);
82 r += sizeof(u32);
83 }
84}
85
86/* 37/*
87 * The PRAMIN range is 1 MB, must change base addr if a buffer crosses that. 38 * The PRAMIN range is 1 MB, must change base addr if a buffer crosses that.
88 * This same loop is used for read/write/memset. Offset and size in bytes. 39 * This same loop is used for read/write/memset. Offset and size in bytes.