diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/fb/fb_gv100.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv100.c b/drivers/gpu/nvgpu/common/fb/fb_gv100.c index 859a3f9b..d092ff4a 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gv100.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gv100.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <nvgpu/timers.h> | 40 | #include <nvgpu/timers.h> |
41 | 41 | ||
42 | #include "gk20a/gk20a.h" | 42 | #include "gk20a/gk20a.h" |
43 | #include "gm20b/acr_gm20b.h" | ||
44 | 43 | ||
45 | #include "fb_gv100.h" | 44 | #include "fb_gv100.h" |
46 | 45 | ||
@@ -101,6 +100,23 @@ void gv100_fb_disable_hub_intr(struct gk20a *g) | |||
101 | mask); | 100 | mask); |
102 | } | 101 | } |
103 | 102 | ||
103 | /* | ||
104 | * @brief Patch signatures into ucode image | ||
105 | */ | ||
106 | static int gv100_fb_acr_ucode_patch_sig(struct gk20a *g, | ||
107 | unsigned int *p_img, | ||
108 | unsigned int *p_sig, | ||
109 | unsigned int *p_patch_loc, | ||
110 | unsigned int *p_patch_ind) | ||
111 | { | ||
112 | /* Patching logic. We have just one location to patch. */ | ||
113 | 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]; | ||
115 | p_img[(*p_patch_loc>>2)+2U] = p_sig[(*p_patch_ind<<2)+2U]; | ||
116 | p_img[(*p_patch_loc>>2)+3U] = p_sig[(*p_patch_ind<<2)+3U]; | ||
117 | return 0; | ||
118 | } | ||
119 | |||
104 | int gv100_fb_memory_unlock(struct gk20a *g) | 120 | int gv100_fb_memory_unlock(struct gk20a *g) |
105 | { | 121 | { |
106 | struct nvgpu_firmware *mem_unlock_fw = NULL; | 122 | struct nvgpu_firmware *mem_unlock_fw = NULL; |
@@ -143,9 +159,8 @@ int gv100_fb_memory_unlock(struct gk20a *g) | |||
143 | hsbin_hdr->data_offset); | 159 | hsbin_hdr->data_offset); |
144 | 160 | ||
145 | /* Patch Ucode singnatures */ | 161 | /* Patch Ucode singnatures */ |
146 | if (acr_ucode_patch_sig(g, mem_unlock_ucode, | 162 | if (gv100_fb_acr_ucode_patch_sig(g, mem_unlock_ucode, |
147 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_prod_offset), | 163 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_prod_offset), |
148 | (u32 *)(mem_unlock_fw->data + fw_hdr->sig_dbg_offset), | ||
149 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_loc), | 164 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_loc), |
150 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_sig)) < 0) { | 165 | (u32 *)(mem_unlock_fw->data + fw_hdr->patch_sig)) < 0) { |
151 | nvgpu_err(g, "mem unlock patch signatures fail"); | 166 | nvgpu_err(g, "mem unlock patch signatures fail"); |