From 907fcae63816b68e43e07e3d7abaad87954b8326 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 5 Jul 2017 19:05:06 -0700 Subject: gpu: nvgpu: Reorg bus HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the bus 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: If03303c34d91480d41fc29e66069efd43e970d75 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1514660 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gp106/hal_gp106.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp106') diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index c54232aa..dde0468a 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -59,6 +59,7 @@ #include #include +#include #include @@ -278,6 +279,13 @@ static const struct gpu_ops gp106_ops = { .need_scatter_buffer = gp10b_need_scatter_buffer, .populate_scatter_buffer = gp10b_populate_scatter_buffer, }, + .bus = { + .init_hw = gk20a_bus_init_hw, + .isr = gk20a_bus_isr, + .read_ptimer = gk20a_read_ptimer, + .get_timestamps_zipper = nvgpu_get_timestamps_zipper, + .bar1_bind = gk20a_bus_bar1_bind, + }, #if defined(CONFIG_GK20A_CYCLE_STATS) .css = { .enable_snapshot = css_hw_enable_snapshot, @@ -324,6 +332,7 @@ int gp106_init_hal(struct gk20a *g) gops->debug = gp106_ops.debug; gops->dbg_session_ops = gp106_ops.dbg_session_ops; gops->cde = gp106_ops.cde; + gops->bus = gp106_ops.bus; #if defined(CONFIG_GK20A_CYCLE_STATS) gops->css = gp106_ops.css; #endif @@ -339,8 +348,8 @@ int gp106_init_hal(struct gk20a *g) gops->privsecurity = 1; gops->securegpccs = 1; gops->pmupstate = true; + g->bootstrap_owner = LSF_FALCON_ID_SEC2; - gk20a_init_bus(gops); gp10b_init_priv_ring(gops); gp106_init_gr(gops); gp10b_init_fecs_trace_ops(gops); -- cgit v1.2.2