From e78153ea1b6b610f2307b86fc42ea33d678b250f Mon Sep 17 00:00:00 2001 From: Sunny He Date: Tue, 27 Jun 2017 13:42:33 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1509601 GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao Reviewed-by: Alex Waterman Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/hal_gp106.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c') 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 @@ #include "gk20a/css_gr_gk20a.h" #include "gk20a/bus_gk20a.h" #include "gk20a/pramin_gk20a.h" +#include "gk20a/flcn_gk20a.h" +#include "gk20a/mc_gk20a.h" #include "gp10b/ltc_gp10b.h" #include "gp10b/gr_gp10b.h" @@ -239,6 +241,22 @@ static const struct gpu_ops gp106_ops = { .pg_gr_load_gating_prod = gr_gp106_pg_gr_load_gating_prod, }, + .mc = { + .intr_enable = mc_gp10b_intr_enable, + .intr_unit_config = mc_gp10b_intr_unit_config, + .isr_stall = mc_gp10b_isr_stall, + .intr_stall = mc_gp10b_intr_stall, + .intr_stall_pause = mc_gp10b_intr_stall_pause, + .intr_stall_resume = mc_gp10b_intr_stall_resume, + .intr_nonstall = mc_gp10b_intr_nonstall, + .intr_nonstall_pause = mc_gp10b_intr_nonstall_pause, + .intr_nonstall_resume = mc_gp10b_intr_nonstall_resume, + .enable = gk20a_mc_enable, + .disable = gk20a_mc_disable, + .reset = gk20a_mc_reset, + .boot_0 = gk20a_mc_boot_0, + .is_intr1_pending = mc_gp10b_is_intr1_pending, + }, .cde = { .get_program_numbers = gp10b_cde_get_program_numbers, .need_scatter_buffer = gp10b_need_scatter_buffer, @@ -276,6 +294,7 @@ int gp106_init_hal(struct gk20a *g) gops->ltc = gp106_ops.ltc; gops->clock_gating = gp106_ops.clock_gating; + gops->mc = gp106_ops.mc; gops->cde = gp106_ops.cde; gops->xve = gp106_ops.xve; gops->falcon = gp106_ops.falcon; @@ -290,7 +309,6 @@ int gp106_init_hal(struct gk20a *g) gops->securegpccs = 1; gops->pmupstate = true; gk20a_init_bus(gops); - gp10b_init_mc(gops); gp10b_init_priv_ring(gops); gp106_init_gr(gops); gp10b_init_fecs_trace_ops(gops); -- cgit v1.2.2