diff --git a/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h index 46846b213..b9e124b75 100644 --- a/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h @@ -250,4 +250,8 @@ static inline u32 fb_mmu_vpr_info_fetch_true_v(void) { return 0x00000001; } +static inline u32 fb_niso_flush_sysmem_addr_r(void) +{ + return 0x00100c10; +} #endif diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index b5ec5e25f..452d3e9c5 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -424,6 +424,11 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) gk20a_vm_remove_support_nofree(&mm->cde.vm); } +static int gk20a_alloc_sysmem_flush(struct gk20a *g) +{ + return gk20a_gmmu_alloc(g, SZ_4K, &g->mm.sysmem_flush); +} + int gk20a_init_mm_setup_sw(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; @@ -447,6 +452,10 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) (int)(mm->channel.user_size >> 20), (int)(mm->channel.kernel_size >> 20)); + err = gk20a_alloc_sysmem_flush(g); + if (err) + return err; + err = gk20a_init_bar1_vm(mm); if (err) return err; @@ -492,6 +501,9 @@ int gk20a_init_mm_setup_hw(struct gk20a *g) mm->use_full_comp_tag_line = g->ops.fb.set_use_full_comp_tag_line(g); + gk20a_writel(g, fb_niso_flush_sysmem_addr_r(), + g->ops.mm.get_iova_addr(g, g->mm.sysmem_flush.sgt->sgl, 0) + >> 8); g->ops.mm.bar1_bind(g, inst_pa); diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 2d137bbe1..2c2df1a9b 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -359,6 +359,8 @@ struct mm_gk20a { bool has_physical_mode; /* false if vidmem aperture actually points to sysmem */ bool vidmem_is_vidmem; + + struct mem_desc sysmem_flush; }; int gk20a_mm_init(struct mm_gk20a *mm);