diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.c | 58 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.h | 2 |
3 files changed, 64 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 048c0a45..3a2fa71d 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -658,6 +658,10 @@ static const struct gpu_ops gp106_ops = { | |||
658 | .get_irqdest = gk20a_pmu_get_irqdest, | 658 | .get_irqdest = gk20a_pmu_get_irqdest, |
659 | .alloc_super_surface = NULL, | 659 | .alloc_super_surface = NULL, |
660 | .is_debug_mode_enabled = gm20b_pmu_is_debug_mode_en, | 660 | .is_debug_mode_enabled = gm20b_pmu_is_debug_mode_en, |
661 | .update_lspmu_cmdline_args = | ||
662 | gp106_update_lspmu_cmdline_args, | ||
663 | .setup_apertures = gp106_pmu_setup_apertures, | ||
664 | .secured_pmu_start = gm20b_secured_pmu_start, | ||
661 | }, | 665 | }, |
662 | .clk = { | 666 | .clk = { |
663 | .init_clk_support = gp106_init_clk_support, | 667 | .init_clk_support = gp106_init_clk_support, |
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 031ac7d8..3e4a7390 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c | |||
@@ -306,3 +306,61 @@ int gp106_load_falcon_ucode(struct gk20a *g, u32 falconidmask) | |||
306 | } | 306 | } |
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | |||
310 | void gp106_update_lspmu_cmdline_args(struct gk20a *g) | ||
311 | { | ||
312 | struct nvgpu_pmu *pmu = &g->pmu; | ||
313 | |||
314 | /*Copying pmu cmdline args*/ | ||
315 | g->ops.pmu_ver.set_pmu_cmdline_args_cpu_freq(pmu, 0); | ||
316 | g->ops.pmu_ver.set_pmu_cmdline_args_secure_mode(pmu, 1); | ||
317 | g->ops.pmu_ver.set_pmu_cmdline_args_trace_size( | ||
318 | pmu, GK20A_PMU_TRACE_BUFSIZE); | ||
319 | g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_base(pmu); | ||
320 | g->ops.pmu_ver.set_pmu_cmdline_args_trace_dma_idx( | ||
321 | pmu, GK20A_PMU_DMAIDX_VIRT); | ||
322 | if (g->ops.pmu_ver.config_pmu_cmdline_args_super_surface) { | ||
323 | g->ops.pmu_ver.config_pmu_cmdline_args_super_surface(pmu); | ||
324 | } | ||
325 | |||
326 | nvgpu_flcn_copy_to_dmem(pmu->flcn, g->acr.pmu_args, | ||
327 | (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)), | ||
328 | g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0); | ||
329 | |||
330 | } | ||
331 | |||
332 | void gp106_pmu_setup_apertures(struct gk20a *g) | ||
333 | { | ||
334 | struct mm_gk20a *mm = &g->mm; | ||
335 | |||
336 | /* PMU TRANSCFG */ | ||
337 | /* setup apertures - virtual */ | ||
338 | gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_UCODE), | ||
339 | pwr_fbif_transcfg_mem_type_physical_f() | | ||
340 | pwr_fbif_transcfg_target_local_fb_f()); | ||
341 | gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_VIRT), | ||
342 | pwr_fbif_transcfg_mem_type_virtual_f()); | ||
343 | /* setup apertures - physical */ | ||
344 | gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_VID), | ||
345 | pwr_fbif_transcfg_mem_type_physical_f() | | ||
346 | pwr_fbif_transcfg_target_local_fb_f()); | ||
347 | gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_COH), | ||
348 | pwr_fbif_transcfg_mem_type_physical_f() | | ||
349 | pwr_fbif_transcfg_target_coherent_sysmem_f()); | ||
350 | gk20a_writel(g, pwr_fbif_transcfg_r(GK20A_PMU_DMAIDX_PHYS_SYS_NCOH), | ||
351 | pwr_fbif_transcfg_mem_type_physical_f() | | ||
352 | pwr_fbif_transcfg_target_noncoherent_sysmem_f()); | ||
353 | |||
354 | /* PMU Config */ | ||
355 | gk20a_writel(g, pwr_falcon_itfen_r(), | ||
356 | gk20a_readl(g, pwr_falcon_itfen_r()) | | ||
357 | pwr_falcon_itfen_ctxen_enable_f()); | ||
358 | gk20a_writel(g, pwr_pmu_new_instblk_r(), | ||
359 | pwr_pmu_new_instblk_ptr_f( | ||
360 | nvgpu_inst_block_addr(g, &mm->pmu.inst_block) >> 12) | | ||
361 | pwr_pmu_new_instblk_valid_f(1) | | ||
362 | nvgpu_aperture_mask(g, &mm->pmu.inst_block, | ||
363 | pwr_pmu_new_instblk_target_sys_ncoh_f(), | ||
364 | pwr_pmu_new_instblk_target_sys_coh_f(), | ||
365 | pwr_pmu_new_instblk_target_fb_f())); | ||
366 | } | ||
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.h b/drivers/gpu/nvgpu/gp106/pmu_gp106.h index 9cf1202e..c9392d7b 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.h +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.h | |||
@@ -41,5 +41,7 @@ void gp106_pmu_elpg_statistics(struct gk20a *g, u32 pg_engine_id, | |||
41 | struct pmu_pg_stats_data *pg_stat_data); | 41 | struct pmu_pg_stats_data *pg_stat_data); |
42 | bool gp106_pmu_is_engine_in_reset(struct gk20a *g); | 42 | bool gp106_pmu_is_engine_in_reset(struct gk20a *g); |
43 | int gp106_pmu_engine_reset(struct gk20a *g, bool do_reset); | 43 | int gp106_pmu_engine_reset(struct gk20a *g, bool do_reset); |
44 | void gp106_update_lspmu_cmdline_args(struct gk20a *g); | ||
45 | void gp106_pmu_setup_apertures(struct gk20a *g); | ||
44 | 46 | ||
45 | #endif /* NVGPU_PMU_GP106_H */ | 47 | #endif /* NVGPU_PMU_GP106_H */ |