summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/pmu_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/pmu_gm20b.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
index c1ec4d8e..6e764ac5 100644
--- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
@@ -277,3 +277,63 @@ bool gm20b_pmu_is_debug_mode_en(struct gk20a *g)
277 u32 ctl_stat = gk20a_readl(g, pwr_pmu_scpctl_stat_r()); 277 u32 ctl_stat = gk20a_readl(g, pwr_pmu_scpctl_stat_r());
278 return pwr_pmu_scpctl_stat_debug_mode_v(ctl_stat) != 0U; 278 return pwr_pmu_scpctl_stat_debug_mode_v(ctl_stat) != 0U;
279} 279}
280
281
282static int gm20b_bl_bootstrap(struct gk20a *g,
283 struct nvgpu_falcon_bl_info *bl_info)
284{
285 struct mm_gk20a *mm = &g->mm;
286
287 nvgpu_log_fn(g, " ");
288
289 gk20a_writel(g, pwr_falcon_itfen_r(),
290 gk20a_readl(g, pwr_falcon_itfen_r()) |
291 pwr_falcon_itfen_ctxen_enable_f());
292 gk20a_writel(g, pwr_pmu_new_instblk_r(),
293 pwr_pmu_new_instblk_ptr_f(
294 nvgpu_inst_block_addr(g, &mm->pmu.inst_block) >> 12U) |
295 pwr_pmu_new_instblk_valid_f(1U) |
296 (nvgpu_is_enabled(g, NVGPU_USE_COHERENT_SYSMEM) ?
297 pwr_pmu_new_instblk_target_sys_coh_f() :
298 pwr_pmu_new_instblk_target_sys_ncoh_f())) ;
299
300 nvgpu_flcn_bl_bootstrap(&g->pmu_flcn, bl_info);
301
302 return 0;
303}
304
305int gm20b_pmu_setup_hw_and_bl_bootstrap(struct gk20a *g,
306 struct hs_acr *acr_desc,
307 struct nvgpu_falcon_bl_info *bl_info)
308{
309 struct nvgpu_pmu *pmu = &g->pmu;
310 int err;
311
312 nvgpu_log_fn(g, " ");
313
314 nvgpu_mutex_acquire(&pmu->isr_mutex);
315 /*
316 * disable irqs for hs falcon booting
317 * as we will poll for halt
318 */
319 g->ops.pmu.pmu_enable_irq(pmu, false);
320 pmu->isr_enabled = false;
321 err = nvgpu_flcn_reset(acr_desc->acr_flcn);
322 if (err != 0) {
323 nvgpu_mutex_release(&pmu->isr_mutex);
324 goto exit;
325 }
326 nvgpu_mutex_release(&pmu->isr_mutex);
327
328 if (g->ops.pmu.setup_apertures) {
329 g->ops.pmu.setup_apertures(g);
330 }
331
332 /*Clearing mailbox register used to reflect capabilities*/
333 gk20a_writel(g, pwr_falcon_mailbox1_r(), 0);
334
335 err = gm20b_bl_bootstrap(g, bl_info);
336
337exit:
338 return err;
339}