From 0e423669a4ff3f00b06d86f8ca251ef99f3671ce Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 11 Apr 2016 13:01:59 -0700 Subject: gpu: nvgpu: Wait for BAR1 bind Wait for BAR1 bind to complete before continuing. The register to wait exists Maxwell onwards. Change-Id: Ie3736033fdb748c5da8d7a6085ad6d63acaf41f5 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1123941 --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 5c3f83a6..b5ec5e25 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -493,15 +493,7 @@ int gk20a_init_mm_setup_hw(struct gk20a *g) g->ops.fb.set_use_full_comp_tag_line(g); - inst_pa = (u32)(inst_pa >> bar1_instance_block_shift_gk20a()); - gk20a_dbg_info("bar1 inst block ptr: 0x%08x", (u32)inst_pa); - - gk20a_writel(g, bus_bar1_block_r(), - (g->mm.vidmem_is_vidmem ? - bus_bar1_block_target_sys_mem_ncoh_f() : - bus_bar1_block_target_vid_mem_f()) | - bus_bar1_block_mode_virtual_f() | - bus_bar1_block_ptr_f(inst_pa)); + g->ops.mm.bar1_bind(g, inst_pa); if (g->ops.mm.init_bar2_mm_hw_setup) { err = g->ops.mm.init_bar2_mm_hw_setup(g); @@ -516,6 +508,21 @@ int gk20a_init_mm_setup_hw(struct gk20a *g) return 0; } +static int gk20a_mm_bar1_bind(struct gk20a *g, u64 bar1_iova) +{ + u64 inst_pa = (u32)(bar1_iova >> bar1_instance_block_shift_gk20a()); + gk20a_dbg_info("bar1 inst block ptr: 0x%08x", (u32)inst_pa); + + gk20a_writel(g, bus_bar1_block_r(), + (g->mm.vidmem_is_vidmem ? + bus_bar1_block_target_sys_mem_ncoh_f() : + bus_bar1_block_target_vid_mem_f()) | + bus_bar1_block_mode_virtual_f() | + bus_bar1_block_ptr_f(inst_pa)); + + return 0; +} + int gk20a_init_mm_support(struct gk20a *g) { u32 err; @@ -3919,4 +3926,5 @@ void gk20a_init_mm(struct gpu_ops *gops) gops->mm.get_mmu_levels = gk20a_mm_get_mmu_levels; gops->mm.init_pdb = gk20a_mm_init_pdb; gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; + gops->mm.bar1_bind = gk20a_mm_bar1_bind; } -- cgit v1.2.2