From ecf67ebbf69a9ab6481b1517b8920f7ac5828bb5 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 28 Jun 2017 17:56:44 -0700 Subject: gpu: nvgpu: Reorg falcon HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the falcon 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: Ib1aaaa248b079bb591ccfada3382b689452de0e9 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1514012 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/flcn_gp106.c | 7 +------ drivers/gpu/nvgpu/gp106/flcn_gp106.h | 8 ++++---- drivers/gpu/nvgpu/gp106/hal_gp106.c | 5 ++++- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106') diff --git a/drivers/gpu/nvgpu/gp106/flcn_gp106.c b/drivers/gpu/nvgpu/gp106/flcn_gp106.c index 6ae0b7af..3cb51dcc 100644 --- a/drivers/gpu/nvgpu/gp106/flcn_gp106.c +++ b/drivers/gpu/nvgpu/gp106/flcn_gp106.c @@ -40,7 +40,7 @@ static void gp106_falcon_ops(struct nvgpu_falcon *flcn) gp106_falcon_engine_dependency_ops(flcn); } -static void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) +void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) { struct gk20a *g = flcn->g; @@ -78,8 +78,3 @@ static void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) nvgpu_info(g, "falcon 0x%x not supported on %s", flcn->flcn_id, g->name); } - -void gp106_falcon_init_hal(struct gpu_ops *gops) -{ - gops->falcon.falcon_hal_sw_init = gp106_falcon_hal_sw_init; -} diff --git a/drivers/gpu/nvgpu/gp106/flcn_gp106.h b/drivers/gpu/nvgpu/gp106/flcn_gp106.h index d5ea14ae..e57100d5 100644 --- a/drivers/gpu/nvgpu/gp106/flcn_gp106.h +++ b/drivers/gpu/nvgpu/gp106/flcn_gp106.h @@ -10,9 +10,9 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ -#ifndef __FLCN_GK20A_H__ -#define __FLCN_GK20A_H__ +#ifndef __FLCN_GP106_H__ +#define __FLCN_GP106_H__ -void gp106_falcon_init_hal(struct gpu_ops *gops); +void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn); -#endif /* __FLCN_GK20A_H__ */ +#endif /* __FLCN_GP106_H__ */ diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 555a2192..29b52e44 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -259,6 +259,9 @@ static const struct gpu_ops gp106_ops = { .enable_shadow_rom = xve_enable_shadow_rom_gp106, .disable_shadow_rom = xve_disable_shadow_rom_gp106, }, + .falcon = { + .falcon_hal_sw_init = gp106_falcon_hal_sw_init, + }, .get_litter_value = gp106_get_litter_value, .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, .bios_init = gm206_bios_init, @@ -275,6 +278,7 @@ int gp106_init_hal(struct gk20a *g) gops->clock_gating = gp106_ops.clock_gating; gops->cde = gp106_ops.cde; gops->xve = gp106_ops.xve; + gops->falcon = gp106_ops.falcon; /* Lone functions */ gops->get_litter_value = gp106_ops.get_litter_value; @@ -295,7 +299,6 @@ int gp106_init_hal(struct gk20a *g) gp10b_init_ce(gops); gp106_init_gr_ctx(gops); gp106_init_mm(gops); - gp106_falcon_init_hal(gops); gp106_init_pmu_ops(gops); gk20a_init_debug_ops(gops); gk20a_init_dbg_session_ops(gops); -- cgit v1.2.2