diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 24 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h | 28 |
2 files changed, 52 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 8b4471ca..a9f1183e 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -284,6 +284,29 @@ static int gr_gv11b_handle_lrf_exception(struct gk20a *g, u32 gpc, u32 tpc, | |||
284 | 284 | ||
285 | } | 285 | } |
286 | 286 | ||
287 | static void gr_gv11b_enable_exceptions(struct gk20a *g) | ||
288 | { | ||
289 | struct gr_gk20a *gr = &g->gr; | ||
290 | u32 reg_val; | ||
291 | |||
292 | /* | ||
293 | * clear exceptions : | ||
294 | * other than SM : hww_esr are reset in *enable_hww_excetpions* | ||
295 | * SM : cleared in *set_hww_esr_report_mask* | ||
296 | */ | ||
297 | |||
298 | /* enable exceptions */ | ||
299 | gk20a_writel(g, gr_exception2_en_r(), 0x0); /* BE not enabled */ | ||
300 | gk20a_writel(g, gr_exception1_en_r(), (1 << gr->gpc_count) - 1); | ||
301 | |||
302 | reg_val = gr_exception_en_fe_enabled_f() | | ||
303 | gr_exception_en_memfmt_enabled_f() | | ||
304 | gr_exception_en_ds_enabled_f() | | ||
305 | gr_exception_en_gpc_enabled_f(); | ||
306 | gk20a_writel(g, gr_exception_en_r(), reg_val); | ||
307 | |||
308 | } | ||
309 | |||
287 | static int gr_gv11b_handle_cbu_exception(struct gk20a *g, u32 gpc, u32 tpc, | 310 | static int gr_gv11b_handle_cbu_exception(struct gk20a *g, u32 gpc, u32 tpc, |
288 | bool *post_event, struct channel_gk20a *fault_ch, | 311 | bool *post_event, struct channel_gk20a *fault_ch, |
289 | u32 *hww_global_esr) | 312 | u32 *hww_global_esr) |
@@ -2375,6 +2398,7 @@ void gv11b_init_gr(struct gpu_ops *gops) | |||
2375 | gops->gr.handle_gcc_exception = gr_gv11b_handle_gcc_exception; | 2398 | gops->gr.handle_gcc_exception = gr_gv11b_handle_gcc_exception; |
2376 | gops->gr.handle_tex_exception = gr_gv11b_handle_tex_exception; | 2399 | gops->gr.handle_tex_exception = gr_gv11b_handle_tex_exception; |
2377 | gops->gr.enable_gpc_exceptions = gr_gv11b_enable_gpc_exceptions; | 2400 | gops->gr.enable_gpc_exceptions = gr_gv11b_enable_gpc_exceptions; |
2401 | gops->gr.enable_exceptions = gr_gv11b_enable_exceptions; | ||
2378 | gops->gr.mask_hww_warp_esr = gv11b_mask_hww_warp_esr; | 2402 | gops->gr.mask_hww_warp_esr = gv11b_mask_hww_warp_esr; |
2379 | gops->gr.pre_process_sm_exception = | 2403 | gops->gr.pre_process_sm_exception = |
2380 | gr_gv11b_pre_process_sm_exception; | 2404 | gr_gv11b_pre_process_sm_exception; |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h index 9917f86d..2d5afb29 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_gr_gv11b.h | |||
@@ -194,6 +194,34 @@ static inline u32 gr_exception_en_fe_m(void) | |||
194 | { | 194 | { |
195 | return 0x1 << 0; | 195 | return 0x1 << 0; |
196 | } | 196 | } |
197 | static inline u32 gr_exception_en_fe_enabled_f(void) | ||
198 | { | ||
199 | return 0x1; | ||
200 | } | ||
201 | static inline u32 gr_exception_en_gpc_m(void) | ||
202 | { | ||
203 | return 0x1 << 24; | ||
204 | } | ||
205 | static inline u32 gr_exception_en_gpc_enabled_f(void) | ||
206 | { | ||
207 | return 0x1000000; | ||
208 | } | ||
209 | static inline u32 gr_exception_en_memfmt_m(void) | ||
210 | { | ||
211 | return 0x1 << 1; | ||
212 | } | ||
213 | static inline u32 gr_exception_en_memfmt_enabled_f(void) | ||
214 | { | ||
215 | return 0x2; | ||
216 | } | ||
217 | static inline u32 gr_exception_en_ds_m(void) | ||
218 | { | ||
219 | return 0x1 << 4; | ||
220 | } | ||
221 | static inline u32 gr_exception_en_ds_enabled_f(void) | ||
222 | { | ||
223 | return 0x10; | ||
224 | } | ||
197 | static inline u32 gr_exception1_en_r(void) | 225 | static inline u32 gr_exception1_en_r(void) |
198 | { | 226 | { |
199 | return 0x00400130; | 227 | return 0x00400130; |