diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 23144275..37b9737b 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |||
@@ -1028,8 +1028,15 @@ static int gr_gm20b_update_pc_sampling(struct channel_gk20a *c, | |||
1028 | static u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g) | 1028 | static u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g) |
1029 | { | 1029 | { |
1030 | u32 fbp_en_mask, opt_fbio; | 1030 | u32 fbp_en_mask, opt_fbio; |
1031 | opt_fbio = gk20a_readl(g, fuse_status_opt_fbio_r()); | 1031 | u32 tmp, max_fbps_count; |
1032 | fbp_en_mask = fuse_status_opt_fbio_data_v(opt_fbio); | 1032 | |
1033 | tmp = gk20a_readl(g, top_num_fbps_r()); | ||
1034 | max_fbps_count = top_num_fbps_value_v(tmp); | ||
1035 | |||
1036 | opt_fbio = gk20a_readl(g, fuse_status_opt_fbio_r()); | ||
1037 | fbp_en_mask = | ||
1038 | ((1 << max_fbps_count) - 1) ^ | ||
1039 | fuse_status_opt_fbio_data_v(opt_fbio); | ||
1033 | return fbp_en_mask; | 1040 | return fbp_en_mask; |
1034 | } | 1041 | } |
1035 | 1042 | ||
@@ -1051,16 +1058,22 @@ static u32 gr_gm20b_get_max_lts_per_ltc(struct gk20a *g) | |||
1051 | 1058 | ||
1052 | static u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g) | 1059 | static u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g) |
1053 | { | 1060 | { |
1054 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; | 1061 | struct gr_gk20a *gr = &g->gr; |
1055 | u32 i, tmp, max_fbps_count; | 1062 | u32 i, tmp, max_fbps_count, max_ltc_per_fbp; |
1063 | u32 rop_l2_all_en; | ||
1064 | |||
1056 | tmp = gk20a_readl(g, top_num_fbps_r()); | 1065 | tmp = gk20a_readl(g, top_num_fbps_r()); |
1057 | max_fbps_count = top_num_fbps_value_v(tmp); | 1066 | max_fbps_count = top_num_fbps_value_v(tmp); |
1067 | max_ltc_per_fbp = gr_gm20b_get_max_ltc_per_fbp(g); | ||
1068 | rop_l2_all_en = (1 << max_ltc_per_fbp) - 1; | ||
1058 | 1069 | ||
1059 | /* mask of Rop_L2 for each FBP */ | 1070 | /* mask of Rop_L2 for each FBP */ |
1060 | for (i = 0; i < max_fbps_count; i++) | 1071 | for (i = 0; i < max_fbps_count; i++) { |
1061 | gpu->rop_l2_en_mask[i] = fuse_status_opt_rop_l2_fbp_r(i); | 1072 | tmp = gk20a_readl(g, fuse_status_opt_rop_l2_fbp_r(i)); |
1073 | gr->fbp_rop_l2_en_mask[i] = rop_l2_all_en ^ tmp; | ||
1074 | } | ||
1062 | 1075 | ||
1063 | return gpu->rop_l2_en_mask; | 1076 | return gr->fbp_rop_l2_en_mask; |
1064 | } | 1077 | } |
1065 | 1078 | ||
1066 | static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g) | 1079 | static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g) |