summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-31 21:54:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-11 17:16:52 -0400
commit8d63cd3995d4a650b478ad69d7e29ed2b1b2d927 (patch)
tree5acb73abbe5ef0b94d7147156fa23d707d6ed1c0 /drivers/gpu/nvgpu/gm20b/mm_gm20b.c
parent63b74d4b768e0c96367d4983fdd8f1db1d317d01 (diff)
gpu: nvgpu: Reorg mm HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the mm sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I289284e6e528fc7951c959c8765ccf9349eec33b Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1533351 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/mm_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/mm_gm20b.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
index bbcd6314..05752f03 100644
--- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c
@@ -20,7 +20,7 @@
20#include <nvgpu/hw/gm20b/hw_gmmu_gm20b.h> 20#include <nvgpu/hw/gm20b/hw_gmmu_gm20b.h>
21#include <nvgpu/hw/gm20b/hw_ram_gm20b.h> 21#include <nvgpu/hw/gm20b/hw_ram_gm20b.h>
22 22
23static void gm20b_mm_set_big_page_size(struct gk20a *g, 23void gm20b_mm_set_big_page_size(struct gk20a *g,
24 struct nvgpu_mem *mem, int size) 24 struct nvgpu_mem *mem, int size)
25{ 25{
26 u32 val; 26 u32 val;
@@ -40,22 +40,22 @@ static void gm20b_mm_set_big_page_size(struct gk20a *g,
40 gk20a_dbg_fn("done"); 40 gk20a_dbg_fn("done");
41} 41}
42 42
43static u32 gm20b_mm_get_big_page_sizes(void) 43u32 gm20b_mm_get_big_page_sizes(void)
44{ 44{
45 return SZ_64K | SZ_128K; 45 return SZ_64K | SZ_128K;
46} 46}
47 47
48static u32 gm20b_mm_get_default_big_page_size(void) 48u32 gm20b_mm_get_default_big_page_size(void)
49{ 49{
50 return SZ_128K; 50 return SZ_128K;
51} 51}
52 52
53static bool gm20b_mm_support_sparse(struct gk20a *g) 53bool gm20b_mm_support_sparse(struct gk20a *g)
54{ 54{
55 return true; 55 return true;
56} 56}
57 57
58static bool gm20b_mm_is_bar1_supported(struct gk20a *g) 58bool gm20b_mm_is_bar1_supported(struct gk20a *g)
59{ 59{
60 return true; 60 return true;
61} 61}
@@ -65,26 +65,3 @@ u64 gm20b_gpu_phys_addr(struct gk20a *g,
65{ 65{
66 return phys; 66 return phys;
67} 67}
68
69void gm20b_init_mm(struct gpu_ops *gops)
70{
71 gops->mm.support_sparse = gm20b_mm_support_sparse;
72 gops->mm.gmmu_map = gk20a_locked_gmmu_map;
73 gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap;
74 gops->mm.vm_bind_channel = gk20a_vm_bind_channel;
75 gops->mm.fb_flush = gk20a_mm_fb_flush;
76 gops->mm.l2_invalidate = gk20a_mm_l2_invalidate;
77 gops->mm.l2_flush = gk20a_mm_l2_flush;
78 gops->mm.cbc_clean = gk20a_mm_cbc_clean;
79 gops->mm.set_big_page_size = gm20b_mm_set_big_page_size;
80 gops->mm.get_big_page_sizes = gm20b_mm_get_big_page_sizes;
81 gops->mm.get_default_big_page_size = gm20b_mm_get_default_big_page_size;
82 gops->mm.gpu_phys_addr = gm20b_gpu_phys_addr;
83 gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits;
84 gops->mm.get_mmu_levels = gk20a_mm_get_mmu_levels;
85 gops->mm.init_pdb = gk20a_mm_init_pdb;
86 gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw;
87 gops->mm.is_bar1_supported = gm20b_mm_is_bar1_supported;
88 gops->mm.init_inst_block = gk20a_init_inst_block;
89 gops->mm.mmu_fault_pending = gk20a_fifo_mmu_fault_pending;
90}