summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-04-19 18:47:40 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-04-25 11:16:10 -0400
commitb10e02f53769c6b8dcc58db09ae1cec0cdca4417 (patch)
tree8d58aec66ea50248a8821a99633e59afd82c67a5 /drivers/gpu/nvgpu
parent5765694f2a5eb52ad8710667821e381b233a70fd (diff)
gpu: nvgpu: Program NISO sysmem flush addr
Program sysmem flush address to prevent random accesses of address 0. Change-Id: I886170395f036805f02e0bce7ecd3c8c46b921df Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1129216 GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c12
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_fb_gk20a.h
index 46846b21..b9e124b7 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)
250{ 250{
251 return 0x00000001; 251 return 0x00000001;
252} 252}
253static inline u32 fb_niso_flush_sysmem_addr_r(void)
254{
255 return 0x00100c10;
256}
253#endif 257#endif
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index b5ec5e25..452d3e9c 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)
424 gk20a_vm_remove_support_nofree(&mm->cde.vm); 424 gk20a_vm_remove_support_nofree(&mm->cde.vm);
425} 425}
426 426
427static int gk20a_alloc_sysmem_flush(struct gk20a *g)
428{
429 return gk20a_gmmu_alloc(g, SZ_4K, &g->mm.sysmem_flush);
430}
431
427int gk20a_init_mm_setup_sw(struct gk20a *g) 432int gk20a_init_mm_setup_sw(struct gk20a *g)
428{ 433{
429 struct mm_gk20a *mm = &g->mm; 434 struct mm_gk20a *mm = &g->mm;
@@ -447,6 +452,10 @@ int gk20a_init_mm_setup_sw(struct gk20a *g)
447 (int)(mm->channel.user_size >> 20), 452 (int)(mm->channel.user_size >> 20),
448 (int)(mm->channel.kernel_size >> 20)); 453 (int)(mm->channel.kernel_size >> 20));
449 454
455 err = gk20a_alloc_sysmem_flush(g);
456 if (err)
457 return err;
458
450 err = gk20a_init_bar1_vm(mm); 459 err = gk20a_init_bar1_vm(mm);
451 if (err) 460 if (err)
452 return err; 461 return err;
@@ -492,6 +501,9 @@ int gk20a_init_mm_setup_hw(struct gk20a *g)
492 mm->use_full_comp_tag_line = 501 mm->use_full_comp_tag_line =
493 g->ops.fb.set_use_full_comp_tag_line(g); 502 g->ops.fb.set_use_full_comp_tag_line(g);
494 503
504 gk20a_writel(g, fb_niso_flush_sysmem_addr_r(),
505 g->ops.mm.get_iova_addr(g, g->mm.sysmem_flush.sgt->sgl, 0)
506 >> 8);
495 507
496 g->ops.mm.bar1_bind(g, inst_pa); 508 g->ops.mm.bar1_bind(g, inst_pa);
497 509
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 2d137bbe..2c2df1a9 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -359,6 +359,8 @@ struct mm_gk20a {
359 bool has_physical_mode; 359 bool has_physical_mode;
360 /* false if vidmem aperture actually points to sysmem */ 360 /* false if vidmem aperture actually points to sysmem */
361 bool vidmem_is_vidmem; 361 bool vidmem_is_vidmem;
362
363 struct mem_desc sysmem_flush;
362}; 364};
363 365
364int gk20a_mm_init(struct mm_gk20a *mm); 366int gk20a_mm_init(struct mm_gk20a *mm);