summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-08-29 12:42:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-31 21:57:15 -0400
commitb25d5d86caa049201ddcea77cf1a733a85090698 (patch)
tree949766369ec1cd28f993f9d7c936fdc5e5e96139 /drivers/gpu/nvgpu/gm20b
parent0dc9daf28e3fe6831bc535c8a45d28d974a11dad (diff)
gpu: nvgpu: Use debug sig for NVDEC if on dbg SKU
Debug fused chips do not have production signature. Use debug signature for memory unlock binary. Requires also exporting a HAL for checking debug mode from PMU. Bug 200445202 Change-Id: I7f88ed6db2fe1c614fe9d4074dbf974c3817f453 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1809225 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c8
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c1
-rw-r--r--drivers/gpu/nvgpu/gm20b/pmu_gm20b.c6
-rw-r--r--drivers/gpu/nvgpu/gm20b/pmu_gm20b.h1
4 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 9725ebe7..24112dd3 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -1141,12 +1141,6 @@ err_release_acr_fw:
1141 return err; 1141 return err;
1142} 1142}
1143 1143
1144static u8 pmu_is_debug_mode_en(struct gk20a *g)
1145{
1146 u32 ctl_stat = gk20a_readl(g, pwr_pmu_scpctl_stat_r());
1147 return pwr_pmu_scpctl_stat_debug_mode_v(ctl_stat);
1148}
1149
1150/* 1144/*
1151 * @brief Patch signatures into ucode image 1145 * @brief Patch signatures into ucode image
1152 */ 1146 */
@@ -1160,7 +1154,7 @@ int acr_ucode_patch_sig(struct gk20a *g,
1160 unsigned int i, *p_sig; 1154 unsigned int i, *p_sig;
1161 nvgpu_pmu_dbg(g, " "); 1155 nvgpu_pmu_dbg(g, " ");
1162 1156
1163 if (!pmu_is_debug_mode_en(g)) { 1157 if (!g->ops.pmu.is_debug_mode_enabled(g)) {
1164 p_sig = p_prod_sig; 1158 p_sig = p_prod_sig;
1165 nvgpu_pmu_dbg(g, "PRODUCTION MODE\n"); 1159 nvgpu_pmu_dbg(g, "PRODUCTION MODE\n");
1166 } else { 1160 } else {
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 835d18d4..a2b23cca 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -550,6 +550,7 @@ static const struct gpu_ops gm20b_ops = {
550 .reset_engine = gk20a_pmu_engine_reset, 550 .reset_engine = gk20a_pmu_engine_reset,
551 .is_engine_in_reset = gk20a_pmu_is_engine_in_reset, 551 .is_engine_in_reset = gk20a_pmu_is_engine_in_reset,
552 .get_irqdest = gk20a_pmu_get_irqdest, 552 .get_irqdest = gk20a_pmu_get_irqdest,
553 .is_debug_mode_enabled = gm20b_pmu_is_debug_mode_en,
553 }, 554 },
554 .clk = { 555 .clk = {
555 .init_clk_support = gm20b_init_clk_support, 556 .init_clk_support = gm20b_init_clk_support,
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
index 38970f73..a46f8807 100644
--- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
@@ -271,3 +271,9 @@ void pmu_dump_security_fuses_gm20b(struct gk20a *g)
271 nvgpu_tegra_fuse_read_gcplex_config_fuse(g, &val); 271 nvgpu_tegra_fuse_read_gcplex_config_fuse(g, &val);
272 nvgpu_err(g, "FUSE_GCPLEX_CONFIG_FUSE_0: 0x%x", val); 272 nvgpu_err(g, "FUSE_GCPLEX_CONFIG_FUSE_0: 0x%x", val);
273} 273}
274
275bool gm20b_pmu_is_debug_mode_en(struct gk20a *g)
276{
277 u32 ctl_stat = gk20a_readl(g, pwr_pmu_scpctl_stat_r());
278 return pwr_pmu_scpctl_stat_debug_mode_v(ctl_stat) != 0U;
279}
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.h b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.h
index ec50fb06..1923c047 100644
--- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.h
@@ -33,5 +33,6 @@ void pmu_dump_security_fuses_gm20b(struct gk20a *g);
33void gm20b_pmu_load_lsf(struct gk20a *g, u32 falcon_id, u32 flags); 33void gm20b_pmu_load_lsf(struct gk20a *g, u32 falcon_id, u32 flags);
34int gm20b_pmu_init_acr(struct gk20a *g); 34int gm20b_pmu_init_acr(struct gk20a *g);
35void gm20b_write_dmatrfbase(struct gk20a *g, u32 addr); 35void gm20b_write_dmatrfbase(struct gk20a *g, u32 addr);
36bool gm20b_pmu_is_debug_mode_en(struct gk20a *g);
36 37
37#endif /*__PMU_GM20B_H_*/ 38#endif /*__PMU_GM20B_H_*/