summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorSupriya <ssharatkumar@nvidia.com>2017-10-31 02:24:53 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-27 04:49:17 -0500
commit6194cfdef52afcb17aa2921685f370e4c5d27819 (patch)
treedd890e3ea5bd61f204804236dffedd551f30b4fa /drivers/gpu/nvgpu/gm20b
parent536ec21b565ab1368b53a26d6ec7ed05857f0775 (diff)
gpu: nvgpu: split init_falcon_setup_hw
This CL is as part of phased changes to support NO LSPMU Changes done are to add new pmu ops : - setup_apertures - update_lspmu_cmdline_args These would be called from pmu op init_falcon_setup_hw JIRA NVGPU-296 Change-Id: Idbcec5c93ca3150df5c9fb81d65b9fce778cecb8 Signed-off-by: Supriya <ssharatkumar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1589004 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> 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.c45
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.h2
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c3
3 files changed, 34 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 09908df3..62d3a8fa 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -1233,20 +1233,8 @@ int gm20b_init_nspmu_setup_hw1(struct gk20a *g)
1233 return err; 1233 return err;
1234} 1234}
1235 1235
1236int gm20b_init_pmu_setup_hw1(struct gk20a *g, 1236void gm20b_setup_apertures(struct gk20a *g)
1237 void *desc, u32 bl_sz)
1238{ 1237{
1239
1240 struct nvgpu_pmu *pmu = &g->pmu;
1241 int err;
1242
1243 gk20a_dbg_fn("");
1244
1245 nvgpu_mutex_acquire(&pmu->isr_mutex);
1246 nvgpu_flcn_reset(pmu->flcn);
1247 pmu->isr_enabled = true;
1248 nvgpu_mutex_release(&pmu->isr_mutex);
1249
1250 /* setup apertures - virtual */ 1238 /* setup apertures - virtual */
1251 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_UCODE), 1239 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_UCODE),
1252 pwr_fbif_transcfg_mem_type_physical_f() | 1240 pwr_fbif_transcfg_mem_type_physical_f() |
@@ -1263,10 +1251,14 @@ int gm20b_init_pmu_setup_hw1(struct gk20a *g,
1263 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_NCOH), 1251 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_NCOH),
1264 pwr_fbif_transcfg_mem_type_physical_f() | 1252 pwr_fbif_transcfg_mem_type_physical_f() |
1265 pwr_fbif_transcfg_target_noncoherent_sysmem_f()); 1253 pwr_fbif_transcfg_target_noncoherent_sysmem_f());
1254}
1266 1255
1256void gm20b_update_lspmu_cmdline_args(struct gk20a *g)
1257{
1258 struct nvgpu_pmu *pmu = &g->pmu;
1267 /*Copying pmu cmdline args*/ 1259 /*Copying pmu cmdline args*/
1268 g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu, 1260 g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu,
1269 g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_PWRCLK)); 1261 g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_PWRCLK));
1270 g->ops.pmu_ver.set_pmu_cmdline_args_secure_mode(pmu, 1); 1262 g->ops.pmu_ver.set_pmu_cmdline_args_secure_mode(pmu, 1);
1271 g->ops.pmu_ver.set_pmu_cmdline_args_trace_size( 1263 g->ops.pmu_ver.set_pmu_cmdline_args_trace_size(
1272 pmu, GK20A_PMU_TRACE_BUFSIZE); 1264 pmu, GK20A_PMU_TRACE_BUFSIZE);
@@ -1274,8 +1266,29 @@ int gm20b_init_pmu_setup_hw1(struct gk20a *g,
1274 g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_idx( 1266 g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_idx(
1275 pmu, GK20A_PMU_DMAIDX_VIRT); 1267 pmu, GK20A_PMU_DMAIDX_VIRT);
1276 nvgpu_flcn_copy_to_dmem(pmu->flcn, g->acr.pmu_args, 1268 nvgpu_flcn_copy_to_dmem(pmu->flcn, g->acr.pmu_args,
1277 (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)), 1269 (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)),
1278 g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0); 1270 g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0);
1271}
1272
1273int gm20b_init_pmu_setup_hw1(struct gk20a *g,
1274 void *desc, u32 bl_sz)
1275{
1276
1277 struct nvgpu_pmu *pmu = &g->pmu;
1278 int err;
1279
1280 gk20a_dbg_fn("");
1281
1282 nvgpu_mutex_acquire(&pmu->isr_mutex);
1283 nvgpu_flcn_reset(pmu->flcn);
1284 pmu->isr_enabled = true;
1285 nvgpu_mutex_release(&pmu->isr_mutex);
1286
1287 if (g->ops.pmu.setup_apertures)
1288 g->ops.pmu.setup_apertures(g);
1289 if (g->ops.pmu.update_lspmu_cmdline_args)
1290 g->ops.pmu.update_lspmu_cmdline_args(g);
1291
1279 /*disable irqs for hs falcon booting as we will poll for halt*/ 1292 /*disable irqs for hs falcon booting as we will poll for halt*/
1280 nvgpu_mutex_acquire(&pmu->isr_mutex); 1293 nvgpu_mutex_acquire(&pmu->isr_mutex);
1281 pmu_enable_irq(pmu, false); 1294 pmu_enable_irq(pmu, false);
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.h b/drivers/gpu/nvgpu/gm20b/acr_gm20b.h
index 9d261aae..e22da730 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.h
@@ -47,6 +47,8 @@ int gm20b_flcn_populate_bl_dmem_desc(struct gk20a *g,
47int pmu_wait_for_halt(struct gk20a *g, unsigned int timeout_ms); 47int pmu_wait_for_halt(struct gk20a *g, unsigned int timeout_ms);
48int clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout); 48int clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout);
49int gm20b_init_pmu_setup_hw1(struct gk20a *g, void *desc, u32 bl_sz); 49int gm20b_init_pmu_setup_hw1(struct gk20a *g, void *desc, u32 bl_sz);
50void gm20b_update_lspmu_cmdline_args(struct gk20a *g);
51void gm20b_setup_apertures(struct gk20a *g);
50 52
51int gm20b_pmu_setup_sw(struct gk20a *g); 53int gm20b_pmu_setup_sw(struct gk20a *g);
52int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt); 54int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt);
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 779dde3d..920a3e9b 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -660,6 +660,9 @@ int gm20b_init_hal(struct gk20a *g)
660 gops->pmu.falcon_clear_halt_interrupt_status = 660 gops->pmu.falcon_clear_halt_interrupt_status =
661 clear_halt_interrupt_status; 661 clear_halt_interrupt_status;
662 gops->pmu.init_falcon_setup_hw = gm20b_init_pmu_setup_hw1; 662 gops->pmu.init_falcon_setup_hw = gm20b_init_pmu_setup_hw1;
663 gops->pmu.update_lspmu_cmdline_args =
664 gm20b_update_lspmu_cmdline_args;
665 gops->pmu.setup_apertures = gm20b_setup_apertures;
663 666
664 gops->pmu.init_wpr_region = gm20b_pmu_init_acr; 667 gops->pmu.init_wpr_region = gm20b_pmu_init_acr;
665 gops->pmu.load_lsfalcon_ucode = gm20b_load_falcon_ucode; 668 gops->pmu.load_lsfalcon_ucode = gm20b_load_falcon_ucode;