summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-08-16 17:05:02 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-04 19:15:21 -0400
commit8a76e8b4910480efcdeb47d18cb209e247d9eda8 (patch)
tree164a4034ffd72bb929da6837f8f0ae9fa9196d95 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c
parenta18f364fd28cf6a19edcb55b22a9b458d29a826d (diff)
gpu: nvgpu: Split HUB and GPC MMU debug mode set
HUB and GPC MMU debug modes were set in the same function. This introduced a dependency from FB code to GR registers. Split setting of GPC MMU debug mode to GR HAL. Change-Id: I003446f9dfa147f526bd01d3b6130f4037d9b183 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1801420 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 7ed36144..101f4211 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -1516,3 +1516,19 @@ u32 gr_gm20b_get_pmm_per_chiplet_offset(void)
1516{ 1516{
1517 return (perf_pmmsys_extent_v() - perf_pmmsys_base_v() + 1); 1517 return (perf_pmmsys_extent_v() - perf_pmmsys_base_v() + 1);
1518} 1518}
1519
1520void gm20b_gr_set_debug_mode(struct gk20a *g, bool enable)
1521{
1522 u32 reg_val, gpc_debug_ctrl;
1523
1524 if (enable) {
1525 gpc_debug_ctrl = gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_f();
1526 } else {
1527 gpc_debug_ctrl = gr_gpcs_pri_mmu_debug_ctrl_debug_disabled_f();
1528 }
1529
1530 reg_val = gk20a_readl(g, gr_gpcs_pri_mmu_debug_ctrl_r());
1531 reg_val = set_field(reg_val,
1532 gr_gpcs_pri_mmu_debug_ctrl_debug_m(), gpc_debug_ctrl);
1533 gk20a_writel(g, gr_gpcs_pri_mmu_debug_ctrl_r(), reg_val);
1534}