summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mm_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index 729ccc39..5c17244d 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -27,17 +27,17 @@
27#include <nvgpu/hw/gp10b/hw_bus_gp10b.h> 27#include <nvgpu/hw/gp10b/hw_bus_gp10b.h>
28#include <nvgpu/hw/gp10b/hw_gmmu_gp10b.h> 28#include <nvgpu/hw/gp10b/hw_gmmu_gp10b.h>
29 29
30static u32 gp10b_mm_get_default_big_page_size(void) 30u32 gp10b_mm_get_default_big_page_size(void)
31{ 31{
32 return SZ_64K; 32 return SZ_64K;
33} 33}
34 34
35static u32 gp10b_mm_get_physical_addr_bits(struct gk20a *g) 35u32 gp10b_mm_get_physical_addr_bits(struct gk20a *g)
36{ 36{
37 return 36; 37 return 36;
38} 38}
39 39
40static int gp10b_init_mm_setup_hw(struct gk20a *g) 40int gp10b_init_mm_setup_hw(struct gk20a *g)
41{ 41{
42 struct mm_gk20a *mm = &g->mm; 42 struct mm_gk20a *mm = &g->mm;
43 struct nvgpu_mem *inst_block = &mm->bar1.inst_block; 43 struct nvgpu_mem *inst_block = &mm->bar1.inst_block;
@@ -68,7 +68,7 @@ static int gp10b_init_mm_setup_hw(struct gk20a *g)
68 68
69} 69}
70 70
71static int gb10b_init_bar2_vm(struct gk20a *g) 71int gb10b_init_bar2_vm(struct gk20a *g)
72{ 72{
73 int err; 73 int err;
74 struct mm_gk20a *mm = &g->mm; 74 struct mm_gk20a *mm = &g->mm;
@@ -99,7 +99,7 @@ clean_up_va:
99 return err; 99 return err;
100} 100}
101 101
102static int gb10b_init_bar2_mm_hw_setup(struct gk20a *g) 102int gb10b_init_bar2_mm_hw_setup(struct gk20a *g)
103{ 103{
104 struct mm_gk20a *mm = &g->mm; 104 struct mm_gk20a *mm = &g->mm;
105 struct nvgpu_mem *inst_block = &mm->bar2.inst_block; 105 struct nvgpu_mem *inst_block = &mm->bar2.inst_block;
@@ -333,13 +333,13 @@ static const struct gk20a_mmu_level gp10b_mm_levels[] = {
333 {.update_entry = NULL} 333 {.update_entry = NULL}
334}; 334};
335 335
336static const struct gk20a_mmu_level *gp10b_mm_get_mmu_levels(struct gk20a *g, 336const struct gk20a_mmu_level *gp10b_mm_get_mmu_levels(struct gk20a *g,
337 u32 big_page_size) 337 u32 big_page_size)
338{ 338{
339 return gp10b_mm_levels; 339 return gp10b_mm_levels;
340} 340}
341 341
342static void gp10b_mm_init_pdb(struct gk20a *g, struct nvgpu_mem *inst_block, 342void gp10b_mm_init_pdb(struct gk20a *g, struct nvgpu_mem *inst_block,
343 struct vm_gk20a *vm) 343 struct vm_gk20a *vm)
344{ 344{
345 u64 pdb_addr = nvgpu_mem_get_addr(g, vm->pdb.mem); 345 u64 pdb_addr = nvgpu_mem_get_addr(g, vm->pdb.mem);
@@ -360,7 +360,7 @@ static void gp10b_mm_init_pdb(struct gk20a *g, struct nvgpu_mem *inst_block,
360 ram_in_page_dir_base_hi_f(pdb_addr_hi)); 360 ram_in_page_dir_base_hi_f(pdb_addr_hi));
361} 361}
362 362
363static void gp10b_remove_bar2_vm(struct gk20a *g) 363void gp10b_remove_bar2_vm(struct gk20a *g)
364{ 364{
365 struct mm_gk20a *mm = &g->mm; 365 struct mm_gk20a *mm = &g->mm;
366 366
@@ -368,17 +368,3 @@ static void gp10b_remove_bar2_vm(struct gk20a *g)
368 gk20a_free_inst_block(g, &mm->bar2.inst_block); 368 gk20a_free_inst_block(g, &mm->bar2.inst_block);
369 nvgpu_vm_put(mm->bar2.vm); 369 nvgpu_vm_put(mm->bar2.vm);
370} 370}
371
372
373void gp10b_init_mm(struct gpu_ops *gops)
374{
375 gm20b_init_mm(gops);
376 gops->mm.get_default_big_page_size = gp10b_mm_get_default_big_page_size;
377 gops->mm.get_physical_addr_bits = gp10b_mm_get_physical_addr_bits;
378 gops->mm.init_mm_setup_hw = gp10b_init_mm_setup_hw;
379 gops->mm.init_bar2_vm = gb10b_init_bar2_vm;
380 gops->mm.init_bar2_mm_hw_setup = gb10b_init_bar2_mm_hw_setup;
381 gops->mm.get_mmu_levels = gp10b_mm_get_mmu_levels;
382 gops->mm.init_pdb = gp10b_mm_init_pdb;
383 gops->mm.remove_bar2_vm = gp10b_remove_bar2_vm;
384}