diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/fb/fb_gv100.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv100.c b/drivers/gpu/nvgpu/common/fb/fb_gv100.c index ce51a2c6..848d6efb 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gv100.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gv100.c | |||
@@ -104,11 +104,20 @@ void gv100_fb_disable_hub_intr(struct gk20a *g) | |||
104 | * @brief Patch signatures into ucode image | 104 | * @brief Patch signatures into ucode image |
105 | */ | 105 | */ |
106 | static int gv100_fb_acr_ucode_patch_sig(struct gk20a *g, | 106 | static int gv100_fb_acr_ucode_patch_sig(struct gk20a *g, |
107 | unsigned int *p_img, | 107 | u32 *p_img, |
108 | unsigned int *p_sig, | 108 | u32 *p_prod_sig, |
109 | unsigned int *p_patch_loc, | 109 | u32 *p_dbg_sig, |
110 | unsigned int *p_patch_ind) | 110 | u32 *p_patch_loc, |
111 | u32 *p_patch_ind) | ||
111 | { | 112 | { |
113 | u32 *p_sig; | ||
114 | |||
115 | if (!g->ops.pmu.is_debug_mode_enabled(g)) { | ||
116 | p_sig = p_prod_sig; | ||
117 | } else { | ||
118 | p_sig = p_dbg_sig; | ||
119 | } | ||
120 | |||
112 | /* Patching logic. We have just one location to patch. */ | 121 | /* Patching logic. We have just one location to patch. */ |
113 | p_img[(*p_patch_loc>>2)] = p_sig[(*p_patch_ind<<2)]; | 122 | p_img[(*p_patch_loc>>2)] = p_sig[(*p_patch_ind<<2)]; |
114 | p_img[(*p_patch_loc>>2)+1U] = p_sig[(*p_patch_ind<<2)+1U]; | 123 | p_img[(*p_patch_loc>>2)+1U] = p_sig[(*p_patch_ind<<2)+1U]; |
@@ -158,9 +167,10 @@ int gv100_fb_memory_unlock(struct gk20a *g) | |||
158 | mem_unlock_ucode = (u32 *)(mem_unlock_fw->data + | 167 | mem_unlock_ucode = (u32 *)(mem_unlock_fw->data + |
159 | hsbin_hdr->data_offset); | 168 | hsbin_hdr->data_offset); |
160 | 169 | ||
161 | /* Patch Ucode singnatures */ | 170 | /* Patch Ucode signatures */ |
162 | if (gv100_fb_acr_ucode_patch_sig(g, mem_unlock_ucode, | 171 | if (gv100_fb_acr_ucode_patch_sig(g, mem_unlock_ucode, |
163 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_prod_offset), | 172 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_prod_offset), |
173 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_dbg_offset), | ||
164 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_loc), | 174 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_loc), |
165 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_sig)) < 0) { | 175 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_sig)) < 0) { |
166 | nvgpu_err(g, "mem unlock patch signatures fail"); | 176 | nvgpu_err(g, "mem unlock patch signatures fail"); |