diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/ltc_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c index c265df02..0548105f 100644 --- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/jiffies.h> | 17 | #include <linux/jiffies.h> |
18 | 18 | ||
19 | #include "hw_mc_gm20b.h" | ||
19 | #include "hw_ltc_gm20b.h" | 20 | #include "hw_ltc_gm20b.h" |
20 | #include "hw_top_gm20b.h" | 21 | #include "hw_top_gm20b.h" |
21 | #include "hw_proj_gm20b.h" | 22 | #include "hw_proj_gm20b.h" |
@@ -172,6 +173,8 @@ out: | |||
172 | 173 | ||
173 | static void gm20b_ltc_init_fs_state(struct gk20a *g) | 174 | static void gm20b_ltc_init_fs_state(struct gk20a *g) |
174 | { | 175 | { |
176 | u32 reg; | ||
177 | |||
175 | gk20a_dbg_info("initialize gm20b l2"); | 178 | gk20a_dbg_info("initialize gm20b l2"); |
176 | 179 | ||
177 | g->max_ltc_count = gk20a_readl(g, top_num_ltcs_r()); | 180 | g->max_ltc_count = gk20a_readl(g, top_num_ltcs_r()); |
@@ -188,16 +191,34 @@ static void gm20b_ltc_init_fs_state(struct gk20a *g) | |||
188 | ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m()); | 191 | ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m()); |
189 | 192 | ||
190 | /* Disable LTC interrupts */ | 193 | /* Disable LTC interrupts */ |
191 | gk20a_writel(g, ltc_ltcs_ltss_intr_r(), 0); | 194 | reg = gk20a_readl(g, ltc_ltcs_ltss_intr_r()); |
195 | reg &= ~(1<<20); | ||
196 | gk20a_writel(g, ltc_ltcs_ltss_intr_r(), reg); | ||
192 | } | 197 | } |
193 | 198 | ||
194 | void gm20b_ltc_isr(struct gk20a *g) | 199 | void gm20b_ltc_isr(struct gk20a *g) |
195 | { | 200 | { |
196 | u32 intr; | 201 | u32 mc_intr, ltc_intr; |
202 | int ltc, slice; | ||
197 | 203 | ||
198 | intr = gk20a_readl(g, ltc_ltc0_ltss_intr_r()); | 204 | mc_intr = gk20a_readl(g, mc_intr_ltc_r()); |
199 | gk20a_err(dev_from_gk20a(g), "ltc: %08x\n", intr); | 205 | gk20a_err(dev_from_gk20a(g), "mc_ltc_intr: %08x", |
200 | gk20a_writel(g, ltc_ltc0_ltss_intr_r(), intr); | 206 | mc_intr); |
207 | for (ltc = 0; ltc < g->ltc_count; ltc++) { | ||
208 | if ((mc_intr & 1 << ltc) == 0) | ||
209 | continue; | ||
210 | for (slice = 0; slice < g->gr.slices_per_ltc; slice++) { | ||
211 | ltc_intr = gk20a_readl(g, ltc_ltc0_lts0_intr_r() + | ||
212 | proj_ltc_stride_v() * ltc + | ||
213 | proj_lts_stride_v() * slice); | ||
214 | gk20a_err(dev_from_gk20a(g), "ltc%d, slice %d: %08x", | ||
215 | ltc, slice, ltc_intr); | ||
216 | gk20a_writel(g, ltc_ltc0_lts0_intr_r() + | ||
217 | proj_ltc_stride_v() * ltc + | ||
218 | proj_lts_stride_v() * slice, | ||
219 | ltc_intr); | ||
220 | } | ||
221 | } | ||
201 | } | 222 | } |
202 | 223 | ||
203 | static void gm20b_ltc_g_elpg_flush_locked(struct gk20a *g) | 224 | static void gm20b_ltc_g_elpg_flush_locked(struct gk20a *g) |