diff options
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 876b5748..33b0d955 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -31,14 +31,96 @@ | |||
31 | #include "gv11b/mm_gv11b.h" | 31 | #include "gv11b/mm_gv11b.h" |
32 | #include "gv11b/pmu_gv11b.h" | 32 | #include "gv11b/pmu_gv11b.h" |
33 | #include "gv11b/therm_gv11b.h" | 33 | #include "gv11b/therm_gv11b.h" |
34 | #include "gv11b/fb_gv11b.h" | ||
35 | #include "gv11b/fifo_gv11b.h" | ||
36 | #include "gv11b/hw_proj_gv11b.h" | ||
34 | 37 | ||
35 | #include "gm20b/gr_gm20b.h" | 38 | #include "gm20b/gr_gm20b.h" |
36 | 39 | ||
40 | static struct gpu_ops gv11b_ops; | ||
41 | |||
42 | static int gv11b_get_litter_value(struct gk20a *g, | ||
43 | enum nvgpu_litter_value value) | ||
44 | { | ||
45 | int ret = EINVAL; | ||
46 | switch (value) { | ||
47 | case GPU_LIT_NUM_GPCS: | ||
48 | ret = proj_scal_litter_num_gpcs_v(); | ||
49 | break; | ||
50 | case GPU_LIT_NUM_PES_PER_GPC: | ||
51 | ret = proj_scal_litter_num_pes_per_gpc_v(); | ||
52 | break; | ||
53 | case GPU_LIT_NUM_ZCULL_BANKS: | ||
54 | ret = proj_scal_litter_num_zcull_banks_v(); | ||
55 | break; | ||
56 | case GPU_LIT_NUM_TPC_PER_GPC: | ||
57 | ret = proj_scal_litter_num_tpc_per_gpc_v(); | ||
58 | break; | ||
59 | case GPU_LIT_NUM_FBPS: | ||
60 | ret = proj_scal_litter_num_fbps_v(); | ||
61 | break; | ||
62 | case GPU_LIT_GPC_BASE: | ||
63 | ret = proj_gpc_base_v(); | ||
64 | break; | ||
65 | case GPU_LIT_GPC_STRIDE: | ||
66 | ret = proj_gpc_stride_v(); | ||
67 | break; | ||
68 | case GPU_LIT_GPC_SHARED_BASE: | ||
69 | ret = proj_gpc_shared_base_v(); | ||
70 | break; | ||
71 | case GPU_LIT_TPC_IN_GPC_BASE: | ||
72 | ret = proj_tpc_in_gpc_base_v(); | ||
73 | break; | ||
74 | case GPU_LIT_TPC_IN_GPC_STRIDE: | ||
75 | ret = proj_tpc_in_gpc_stride_v(); | ||
76 | break; | ||
77 | case GPU_LIT_TPC_IN_GPC_SHARED_BASE: | ||
78 | ret = proj_tpc_in_gpc_shared_base_v(); | ||
79 | break; | ||
80 | case GPU_LIT_PPC_IN_GPC_STRIDE: | ||
81 | ret = proj_ppc_in_gpc_stride_v(); | ||
82 | break; | ||
83 | case GPU_LIT_ROP_BASE: | ||
84 | ret = proj_rop_base_v(); | ||
85 | break; | ||
86 | case GPU_LIT_ROP_STRIDE: | ||
87 | ret = proj_rop_stride_v(); | ||
88 | break; | ||
89 | case GPU_LIT_ROP_SHARED_BASE: | ||
90 | ret = proj_rop_shared_base_v(); | ||
91 | break; | ||
92 | case GPU_LIT_HOST_NUM_ENGINES: | ||
93 | ret = proj_host_num_engines_v(); | ||
94 | break; | ||
95 | case GPU_LIT_HOST_NUM_PBDMA: | ||
96 | ret = proj_host_num_pbdma_v(); | ||
97 | break; | ||
98 | case GPU_LIT_LTC_STRIDE: | ||
99 | ret = proj_ltc_stride_v(); | ||
100 | break; | ||
101 | case GPU_LIT_LTS_STRIDE: | ||
102 | ret = proj_lts_stride_v(); | ||
103 | break; | ||
104 | case GPU_LIT_NUM_FBPAS: | ||
105 | ret = proj_scal_litter_num_fbpas_v(); | ||
106 | break; | ||
107 | case GPU_LIT_FBPA_STRIDE: | ||
108 | ret = proj_fbpa_stride_v(); | ||
109 | break; | ||
110 | default: | ||
111 | break; | ||
112 | } | ||
113 | |||
114 | return ret; | ||
115 | } | ||
116 | |||
37 | int gv11b_init_hal(struct gk20a *g) | 117 | int gv11b_init_hal(struct gk20a *g) |
38 | { | 118 | { |
39 | struct gpu_ops *gops = &g->ops; | 119 | struct gpu_ops *gops = &g->ops; |
40 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; | 120 | struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; |
41 | 121 | ||
122 | *gops = gv11b_ops; | ||
123 | |||
42 | /* boot in non-secure modes for time beeing */ | 124 | /* boot in non-secure modes for time beeing */ |
43 | gops->privsecurity = 0; | 125 | gops->privsecurity = 0; |
44 | gops->securegpccs = 0; | 126 | gops->securegpccs = 0; |
@@ -47,14 +129,18 @@ int gv11b_init_hal(struct gk20a *g) | |||
47 | gv11b_init_ltc(gops); | 129 | gv11b_init_ltc(gops); |
48 | gv11b_init_gr(gops); | 130 | gv11b_init_gr(gops); |
49 | gv11b_init_fecs_trace_ops(gops); | 131 | gv11b_init_fecs_trace_ops(gops); |
132 | gv11b_init_fb(gops); | ||
133 | gv11b_init_fifo(gops); | ||
50 | gv11b_init_ce(gops); | 134 | gv11b_init_ce(gops); |
51 | gv11b_init_mm(gops); | 135 | gv11b_init_mm(gops); |
52 | gv11b_init_gr_ctx(gops); | 136 | gv11b_init_gr_ctx(gops); |
53 | gv11b_init_pmu_ops(gops); | 137 | gv11b_init_pmu_ops(gops); |
54 | gk20a_init_debug_ops(gops); | 138 | gk20a_init_debug_ops(gops); |
55 | gv11b_init_therm_ops(gops); | 139 | gv11b_init_therm_ops(gops); |
56 | gops->name = "gv11b"; | 140 | gops->name = "gv11b"; |
57 | gops->chip_init_gpu_characteristics = gv11b_init_gpu_characteristics; | 141 | gops->chip_init_gpu_characteristics = gv11b_init_gpu_characteristics; |
142 | gops->get_litter_value = gv11b_get_litter_value; | ||
143 | gops->read_ptimer = gk20a_read_ptimer; | ||
58 | 144 | ||
59 | c->twod_class = FERMI_TWOD_A; | 145 | c->twod_class = FERMI_TWOD_A; |
60 | c->threed_class = VOLTA_A; | 146 | c->threed_class = VOLTA_A; |