summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-27 16:42:33 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-13 03:09:08 -0400
commite78153ea1b6b610f2307b86fc42ea33d678b250f (patch)
tree004e16c6b81c4b209cc2714e8722209db92edc2c /drivers/gpu/nvgpu/gp106
parentecf67ebbf69a9ab6481b1517b8920f7ac5828bb5 (diff)
gpu: nvgpu: Reorg mc HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the mc 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: I26d74c14661a193af7e8d90dd672b73010e5f841 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1509601 GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index 29b52e44..8521bf6d 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -18,6 +18,8 @@
18#include "gk20a/css_gr_gk20a.h" 18#include "gk20a/css_gr_gk20a.h"
19#include "gk20a/bus_gk20a.h" 19#include "gk20a/bus_gk20a.h"
20#include "gk20a/pramin_gk20a.h" 20#include "gk20a/pramin_gk20a.h"
21#include "gk20a/flcn_gk20a.h"
22#include "gk20a/mc_gk20a.h"
21 23
22#include "gp10b/ltc_gp10b.h" 24#include "gp10b/ltc_gp10b.h"
23#include "gp10b/gr_gp10b.h" 25#include "gp10b/gr_gp10b.h"
@@ -239,6 +241,22 @@ static const struct gpu_ops gp106_ops = {
239 .pg_gr_load_gating_prod = 241 .pg_gr_load_gating_prod =
240 gr_gp106_pg_gr_load_gating_prod, 242 gr_gp106_pg_gr_load_gating_prod,
241 }, 243 },
244 .mc = {
245 .intr_enable = mc_gp10b_intr_enable,
246 .intr_unit_config = mc_gp10b_intr_unit_config,
247 .isr_stall = mc_gp10b_isr_stall,
248 .intr_stall = mc_gp10b_intr_stall,
249 .intr_stall_pause = mc_gp10b_intr_stall_pause,
250 .intr_stall_resume = mc_gp10b_intr_stall_resume,
251 .intr_nonstall = mc_gp10b_intr_nonstall,
252 .intr_nonstall_pause = mc_gp10b_intr_nonstall_pause,
253 .intr_nonstall_resume = mc_gp10b_intr_nonstall_resume,
254 .enable = gk20a_mc_enable,
255 .disable = gk20a_mc_disable,
256 .reset = gk20a_mc_reset,
257 .boot_0 = gk20a_mc_boot_0,
258 .is_intr1_pending = mc_gp10b_is_intr1_pending,
259 },
242 .cde = { 260 .cde = {
243 .get_program_numbers = gp10b_cde_get_program_numbers, 261 .get_program_numbers = gp10b_cde_get_program_numbers,
244 .need_scatter_buffer = gp10b_need_scatter_buffer, 262 .need_scatter_buffer = gp10b_need_scatter_buffer,
@@ -276,6 +294,7 @@ int gp106_init_hal(struct gk20a *g)
276 294
277 gops->ltc = gp106_ops.ltc; 295 gops->ltc = gp106_ops.ltc;
278 gops->clock_gating = gp106_ops.clock_gating; 296 gops->clock_gating = gp106_ops.clock_gating;
297 gops->mc = gp106_ops.mc;
279 gops->cde = gp106_ops.cde; 298 gops->cde = gp106_ops.cde;
280 gops->xve = gp106_ops.xve; 299 gops->xve = gp106_ops.xve;
281 gops->falcon = gp106_ops.falcon; 300 gops->falcon = gp106_ops.falcon;
@@ -290,7 +309,6 @@ int gp106_init_hal(struct gk20a *g)
290 gops->securegpccs = 1; 309 gops->securegpccs = 1;
291 gops->pmupstate = true; 310 gops->pmupstate = true;
292 gk20a_init_bus(gops); 311 gk20a_init_bus(gops);
293 gp10b_init_mc(gops);
294 gp10b_init_priv_ring(gops); 312 gp10b_init_priv_ring(gops);
295 gp106_init_gr(gops); 313 gp106_init_gr(gops);
296 gp10b_init_fecs_trace_ops(gops); 314 gp10b_init_fecs_trace_ops(gops);