diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-19 18:47:40 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-25 11:16:10 -0400 |
commit | b10e02f53769c6b8dcc58db09ae1cec0cdca4417 (patch) | |
tree | 8d58aec66ea50248a8821a99633e59afd82c67a5 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |
parent | 5765694f2a5eb52ad8710667821e381b233a70fd (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/gk20a/mm_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 12 |
1 files changed, 12 insertions, 0 deletions
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 | ||
427 | static int gk20a_alloc_sysmem_flush(struct gk20a *g) | ||
428 | { | ||
429 | return gk20a_gmmu_alloc(g, SZ_4K, &g->mm.sysmem_flush); | ||
430 | } | ||
431 | |||
427 | int gk20a_init_mm_setup_sw(struct gk20a *g) | 432 | int 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 | ||