summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b
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/gv11b
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/gv11b')
-rw-r--r--drivers/gpu/nvgpu/gv11b/acr_gv11b.c45
-rw-r--r--drivers/gpu/nvgpu/gv11b/acr_gv11b.h1
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c3
3 files changed, 24 insertions, 25 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/acr_gv11b.c b/drivers/gpu/nvgpu/gv11b/acr_gv11b.c
index b245dbc6..33a36596 100644
--- a/drivers/gpu/nvgpu/gv11b/acr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/acr_gv11b.c
@@ -237,20 +237,8 @@ static int bl_bootstrap(struct nvgpu_pmu *pmu,
237 return 0; 237 return 0;
238} 238}
239 239
240int gv11b_init_pmu_setup_hw1(struct gk20a *g, 240void gv11b_setup_apertures(struct gk20a *g)
241 void *desc, u32 bl_sz)
242{ 241{
243
244 struct nvgpu_pmu *pmu = &g->pmu;
245 int err;
246
247 gk20a_dbg_fn("");
248
249 nvgpu_mutex_acquire(&pmu->isr_mutex);
250 nvgpu_flcn_reset(pmu->flcn);
251 pmu->isr_enabled = true;
252 nvgpu_mutex_release(&pmu->isr_mutex);
253
254 /* setup apertures - virtual */ 242 /* setup apertures - virtual */
255 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_UCODE), 243 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_UCODE),
256 pwr_fbif_transcfg_mem_type_physical_f() | 244 pwr_fbif_transcfg_mem_type_physical_f() |
@@ -267,19 +255,26 @@ int gv11b_init_pmu_setup_hw1(struct gk20a *g,
267 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_NCOH), 255 gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_NCOH),
268 pwr_fbif_transcfg_mem_type_physical_f() | 256 pwr_fbif_transcfg_mem_type_physical_f() |
269 pwr_fbif_transcfg_target_noncoherent_sysmem_f()); 257 pwr_fbif_transcfg_target_noncoherent_sysmem_f());
258}
259
260int gv11b_init_pmu_setup_hw1(struct gk20a *g,
261 void *desc, u32 bl_sz)
262{
263 struct nvgpu_pmu *pmu = &g->pmu;
264 int err;
265
266 gk20a_dbg_fn("");
267
268 nvgpu_mutex_acquire(&pmu->isr_mutex);
269 nvgpu_flcn_reset(pmu->flcn);
270 pmu->isr_enabled = true;
271 nvgpu_mutex_release(&pmu->isr_mutex);
272
273 if (g->ops.pmu.setup_apertures)
274 g->ops.pmu.setup_apertures(g);
275 if (g->ops.pmu.update_lspmu_cmdline_args)
276 g->ops.pmu.update_lspmu_cmdline_args(g);
270 277
271 /*Copying pmu cmdline args*/
272 g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu,
273 g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_PWRCLK));
274 g->ops.pmu_ver.set_pmu_cmdline_args_secure_mode(pmu, 1);
275 g->ops.pmu_ver.set_pmu_cmdline_args_trace_size(
276 pmu, GK20A_PMU_TRACE_BUFSIZE);
277 g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_base(pmu);
278 g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_idx(
279 pmu, GK20A_PMU_DMAIDX_VIRT);
280 nvgpu_flcn_copy_to_dmem(pmu->flcn, g->acr.pmu_args,
281 (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)),
282 g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0);
283 /*disable irqs for hs falcon booting as we will poll for halt*/ 278 /*disable irqs for hs falcon booting as we will poll for halt*/
284 nvgpu_mutex_acquire(&pmu->isr_mutex); 279 nvgpu_mutex_acquire(&pmu->isr_mutex);
285 pmu_enable_irq(pmu, false); 280 pmu_enable_irq(pmu, false);
diff --git a/drivers/gpu/nvgpu/gv11b/acr_gv11b.h b/drivers/gpu/nvgpu/gv11b/acr_gv11b.h
index 72b3ec35..5fbe45e2 100644
--- a/drivers/gpu/nvgpu/gv11b/acr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/acr_gv11b.h
@@ -27,4 +27,5 @@
27int gv11b_bootstrap_hs_flcn(struct gk20a *g); 27int gv11b_bootstrap_hs_flcn(struct gk20a *g);
28int gv11b_init_pmu_setup_hw1(struct gk20a *g, 28int gv11b_init_pmu_setup_hw1(struct gk20a *g,
29 void *desc, u32 bl_sz); 29 void *desc, u32 bl_sz);
30void gv11b_setup_apertures(struct gk20a *g);
30#endif /*__PMU_GP106_H_*/ 31#endif /*__PMU_GP106_H_*/
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 8278d4e5..5649d758 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -747,6 +747,9 @@ int gv11b_init_hal(struct gk20a *g)
747 gops->pmu.falcon_clear_halt_interrupt_status = 747 gops->pmu.falcon_clear_halt_interrupt_status =
748 clear_halt_interrupt_status, 748 clear_halt_interrupt_status,
749 gops->pmu.init_falcon_setup_hw = gv11b_init_pmu_setup_hw1, 749 gops->pmu.init_falcon_setup_hw = gv11b_init_pmu_setup_hw1,
750 gops->pmu.update_lspmu_cmdline_args =
751 gm20b_update_lspmu_cmdline_args;
752 gops->pmu.setup_apertures = gv11b_setup_apertures;
750 753
751 gops->pmu.init_wpr_region = gm20b_pmu_init_acr; 754 gops->pmu.init_wpr_region = gm20b_pmu_init_acr;
752 gops->pmu.load_lsfalcon_ucode = gp10b_load_falcon_ucode; 755 gops->pmu.load_lsfalcon_ucode = gp10b_load_falcon_ucode;