diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 47 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/mm_gv11b.c | 8 |
2 files changed, 53 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 35b36ec5..c6e0f0a2 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | |||
@@ -12,17 +12,17 @@ | |||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
13 | * more details. | 13 | * more details. |
14 | */ | 14 | */ |
15 | |||
16 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
18 | |||
19 | #include "gk20a/gk20a.h" | 17 | #include "gk20a/gk20a.h" |
18 | #include "gk20a/fifo_gk20a.h" | ||
20 | #include "gp10b/fifo_gp10b.h" | 19 | #include "gp10b/fifo_gp10b.h" |
21 | #include "hw_pbdma_gv11b.h" | 20 | #include "hw_pbdma_gv11b.h" |
22 | #include "fifo_gv11b.h" | 21 | #include "fifo_gv11b.h" |
23 | #include "hw_fifo_gv11b.h" | 22 | #include "hw_fifo_gv11b.h" |
24 | #include "hw_ram_gv11b.h" | 23 | #include "hw_ram_gv11b.h" |
25 | #include "hw_ccsr_gv11b.h" | 24 | #include "hw_ccsr_gv11b.h" |
25 | #include "hw_usermode_gv11b.h" | ||
26 | 26 | ||
27 | static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist) | 27 | static void gv11b_get_tsg_runlist_entry(struct tsg_gk20a *tsg, u32 *runlist) |
28 | { | 28 | { |
@@ -82,10 +82,53 @@ static void gv11b_get_ch_runlist_entry(struct channel_gk20a *c, u32 *runlist) | |||
82 | runlist[0], runlist[1], runlist[2], runlist[3]); | 82 | runlist[0], runlist[1], runlist[2], runlist[3]); |
83 | } | 83 | } |
84 | 84 | ||
85 | static void gv11b_ring_channel_doorbell(struct channel_gk20a *c) | ||
86 | { | ||
87 | gk20a_dbg_info("channel ring door bell %d\n", c->hw_chid); | ||
88 | |||
89 | gk20a_writel(c->g, usermode_notify_channel_pending_r(), | ||
90 | usermode_notify_channel_pending_id_f(c->hw_chid)); | ||
91 | } | ||
92 | |||
93 | static u32 gv11b_userd_gp_get(struct gk20a *g, struct channel_gk20a *c) | ||
94 | { | ||
95 | struct mem_desc *userd_mem = &g->fifo.userd; | ||
96 | u32 offset = c->hw_chid * (g->fifo.userd_entry_size / sizeof(u32)); | ||
97 | |||
98 | return gk20a_mem_rd32(g, userd_mem, | ||
99 | offset + ram_userd_gp_get_w()); | ||
100 | |||
101 | } | ||
102 | |||
103 | static void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c) | ||
104 | { | ||
105 | struct mem_desc *userd_mem = &g->fifo.userd; | ||
106 | u32 offset = c->hw_chid * (g->fifo.userd_entry_size / sizeof(u32)); | ||
107 | |||
108 | gk20a_mem_wr32(g, userd_mem, offset + ram_userd_gp_put_w(), | ||
109 | c->gpfifo.put); | ||
110 | /* commit everything to cpu */ | ||
111 | smp_mb(); | ||
112 | |||
113 | gv11b_ring_channel_doorbell(c); | ||
114 | |||
115 | } | ||
116 | |||
117 | |||
118 | static u32 gv11b_fifo_get_num_fifos(struct gk20a *g) | ||
119 | { | ||
120 | return ccsr_channel__size_1_v(); | ||
121 | } | ||
122 | |||
85 | void gv11b_init_fifo(struct gpu_ops *gops) | 123 | void gv11b_init_fifo(struct gpu_ops *gops) |
86 | { | 124 | { |
87 | gp10b_init_fifo(gops); | 125 | gp10b_init_fifo(gops); |
126 | /* for gv11b no need to do any thing special for fifo hw setup */ | ||
127 | gops->fifo.init_fifo_setup_hw = NULL; | ||
88 | gops->fifo.runlist_entry_size = ram_rl_entry_size_v; | 128 | gops->fifo.runlist_entry_size = ram_rl_entry_size_v; |
89 | gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry; | 129 | gops->fifo.get_tsg_runlist_entry = gv11b_get_tsg_runlist_entry; |
90 | gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry; | 130 | gops->fifo.get_ch_runlist_entry = gv11b_get_ch_runlist_entry; |
131 | gops->fifo.get_num_fifos = gv11b_fifo_get_num_fifos; | ||
132 | gops->fifo.userd_gp_get = gv11b_userd_gp_get; | ||
133 | gops->fifo.userd_gp_put = gv11b_userd_gp_put; | ||
91 | } | 134 | } |
diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c index 0ac18a91..54df6745 100644 --- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c | |||
@@ -18,8 +18,16 @@ | |||
18 | #include "gk20a/gk20a.h" | 18 | #include "gk20a/gk20a.h" |
19 | #include "gp10b/mm_gp10b.h" | 19 | #include "gp10b/mm_gp10b.h" |
20 | #include "mm_gv11b.h" | 20 | #include "mm_gv11b.h" |
21 | #include "hw_fb_gv11b.h" | ||
22 | |||
23 | bool gv11b_mm_is_bar1_supported(struct gk20a *g) | ||
24 | { | ||
25 | return false; | ||
26 | } | ||
21 | 27 | ||
22 | void gv11b_init_mm(struct gpu_ops *gops) | 28 | void gv11b_init_mm(struct gpu_ops *gops) |
23 | { | 29 | { |
24 | gp10b_init_mm(gops); | 30 | gp10b_init_mm(gops); |
31 | gops->mm.bar1_bind = NULL; | ||
32 | gops->mm.is_bar1_supported = gv11b_mm_is_bar1_supported; | ||
25 | } | 33 | } |