summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fb
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-08-16 16:29:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-28 00:44:30 -0400
commitdd71ad91b941d0159ae7758e2a3dd6627d7c7da2 (patch)
tree029e763c7bc983dcfa82314c58b9ebb6b71d60e8 /drivers/gpu/nvgpu/common/fb
parent6662188868b824d1fa99292cff0ce82b55d180ce (diff)
gpu: nvgpu: Implement own ACR code for scrubber
Implement HW scrubber specific code for filling in ACR header. The PMU code relied on PMU debug mode for choosing between dbg/prod signature, and also introduced a direct dependency from FB to ACR. Change-Id: I08fa31538bec3dcb5d161a6e7076ffad76129a97 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1801418 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/fb')
-rw-r--r--drivers/gpu/nvgpu/common/fb/fb_gv100.c21
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 */
106static 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
104int gv100_fb_memory_unlock(struct gk20a *g) 120int 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");