summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-08-10 17:09:36 -0400
committerBo Yan <byan@nvidia.com>2018-08-20 14:00:59 -0400
commit227c6f7b7a499dd58e0db6859736cfe586ef0897 (patch)
treed354f8422647021693aefefa5124d865c29ecd32 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c
parent9e69e0cf978b53706f55ffb873e3966b4bb3a7a8 (diff)
gpu: nvgpu: Move fuse HAL to common
Move implementation of fuse HAL to common/fuse. Also implements new fuse query functions for FBIO, FBP, TPC floorsweeping and security fuses. JIRA NVGPU-957 Change-Id: I55e256a4f1b59d50a721d4942907f70dc57467c4 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1797177
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index abc39362..68ae91e8 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -40,7 +40,6 @@
40#include <nvgpu/hw/gm20b/hw_fifo_gm20b.h> 40#include <nvgpu/hw/gm20b/hw_fifo_gm20b.h>
41#include <nvgpu/hw/gm20b/hw_top_gm20b.h> 41#include <nvgpu/hw/gm20b/hw_top_gm20b.h>
42#include <nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h> 42#include <nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h>
43#include <nvgpu/hw/gm20b/hw_fuse_gm20b.h>
44#include <nvgpu/hw/gm20b/hw_perf_gm20b.h> 43#include <nvgpu/hw/gm20b/hw_perf_gm20b.h>
45 44
46void gr_gm20b_init_gpc_mmu(struct gk20a *g) 45void gr_gm20b_init_gpc_mmu(struct gk20a *g)
@@ -549,7 +548,7 @@ u32 gr_gm20b_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
549 struct gr_gk20a *gr = &g->gr; 548 struct gr_gk20a *gr = &g->gr;
550 549
551 /* Toggle the bits of NV_FUSE_STATUS_OPT_TPC_GPC */ 550 /* Toggle the bits of NV_FUSE_STATUS_OPT_TPC_GPC */
552 val = gk20a_readl(g, fuse_status_opt_tpc_gpc_r(gpc_index)); 551 val = g->ops.fuse.fuse_status_opt_tpc_gpc(g, gpc_index);
553 552
554 return (~val) & ((0x1 << gr->max_tpc_per_gpc_count) - 1); 553 return (~val) & ((0x1 << gr->max_tpc_per_gpc_count) - 1);
555} 554}
@@ -1076,7 +1075,7 @@ u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g)
1076 * flip the bits. 1075 * flip the bits.
1077 * Also set unused bits to zero 1076 * Also set unused bits to zero
1078 */ 1077 */
1079 fbp_en_mask = gk20a_readl(g, fuse_status_opt_fbp_r()); 1078 fbp_en_mask = g->ops.fuse.fuse_status_opt_fbp(g);
1080 fbp_en_mask = ~fbp_en_mask; 1079 fbp_en_mask = ~fbp_en_mask;
1081 fbp_en_mask = fbp_en_mask & ((1 << max_fbps_count) - 1); 1080 fbp_en_mask = fbp_en_mask & ((1 << max_fbps_count) - 1);
1082 1081
@@ -1114,7 +1113,7 @@ u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g)
1114 1113
1115 /* mask of Rop_L2 for each FBP */ 1114 /* mask of Rop_L2 for each FBP */
1116 for_each_set_bit(i, &fbp_en_mask, max_fbps_count) { 1115 for_each_set_bit(i, &fbp_en_mask, max_fbps_count) {
1117 tmp = gk20a_readl(g, fuse_status_opt_rop_l2_fbp_r(i)); 1116 tmp = g->ops.fuse.fuse_status_opt_rop_l2_fbp(g, i);
1118 gr->fbp_rop_l2_en_mask[i] = rop_l2_all_en ^ tmp; 1117 gr->fbp_rop_l2_en_mask[i] = rop_l2_all_en ^ tmp;
1119 } 1118 }
1120 1119