summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-05 22:05:06 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-24 02:35:04 -0400
commit907fcae63816b68e43e07e3d7abaad87954b8326 (patch)
tree9be974cddd1c23d17488c23377d9a36ccf69499a /drivers/gpu/nvgpu/gp10b/hal_gp10b.c
parentd717c69d2b1992688589ae389380fedf0b06c720 (diff)
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 <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1514660 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/hal_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index e526af4c..fab1c238 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -50,6 +50,7 @@
50#include <nvgpu/debug.h> 50#include <nvgpu/debug.h>
51#include <nvgpu/bug.h> 51#include <nvgpu/bug.h>
52#include <nvgpu/enabled.h> 52#include <nvgpu/enabled.h>
53#include <nvgpu/bus.h>
53 54
54#include <nvgpu/hw/gp10b/hw_proj_gp10b.h> 55#include <nvgpu/hw/gp10b/hw_proj_gp10b.h>
55#include <nvgpu/hw/gp10b/hw_fuse_gp10b.h> 56#include <nvgpu/hw/gp10b/hw_fuse_gp10b.h>
@@ -245,6 +246,13 @@ static const struct gpu_ops gp10b_ops = {
245 .need_scatter_buffer = gp10b_need_scatter_buffer, 246 .need_scatter_buffer = gp10b_need_scatter_buffer,
246 .populate_scatter_buffer = gp10b_populate_scatter_buffer, 247 .populate_scatter_buffer = gp10b_populate_scatter_buffer,
247 }, 248 },
249 .bus = {
250 .init_hw = gk20a_bus_init_hw,
251 .isr = gk20a_bus_isr,
252 .read_ptimer = gk20a_read_ptimer,
253 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
254 .bar1_bind = gk20a_bus_bar1_bind,
255 },
248#if defined(CONFIG_GK20A_CYCLE_STATS) 256#if defined(CONFIG_GK20A_CYCLE_STATS)
249 .css = { 257 .css = {
250 .enable_snapshot = css_hw_enable_snapshot, 258 .enable_snapshot = css_hw_enable_snapshot,
@@ -274,6 +282,7 @@ int gp10b_init_hal(struct gk20a *g)
274 gops->debug = gp10b_ops.debug; 282 gops->debug = gp10b_ops.debug;
275 gops->dbg_session_ops = gp10b_ops.dbg_session_ops; 283 gops->dbg_session_ops = gp10b_ops.dbg_session_ops;
276 gops->cde = gp10b_ops.cde; 284 gops->cde = gp10b_ops.cde;
285 gops->bus = gp10b_ops.bus;
277#if defined(CONFIG_GK20A_CYCLE_STATS) 286#if defined(CONFIG_GK20A_CYCLE_STATS)
278 gops->css = gp10b_ops.css; 287 gops->css = gp10b_ops.css;
279#endif 288#endif
@@ -321,8 +330,8 @@ int gp10b_init_hal(struct gk20a *g)
321 } 330 }
322 } 331 }
323#endif 332#endif
333
324 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; 334 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT;
325 gk20a_init_bus(gops);
326 gp10b_init_priv_ring(gops); 335 gp10b_init_priv_ring(gops);
327 gp10b_init_gr(gops); 336 gp10b_init_gr(gops);
328 gp10b_init_fecs_trace_ops(gops); 337 gp10b_init_fecs_trace_ops(gops);