summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/hal_gp106.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/gp106/hal_gp106.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/gp106/hal_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c11
1 files changed, 10 insertions, 1 deletions
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 @@
59 59
60#include <nvgpu/debug.h> 60#include <nvgpu/debug.h>
61#include <nvgpu/bug.h> 61#include <nvgpu/bug.h>
62#include <nvgpu/bus.h>
62 63
63#include <nvgpu/hw/gp106/hw_proj_gp106.h> 64#include <nvgpu/hw/gp106/hw_proj_gp106.h>
64 65
@@ -278,6 +279,13 @@ static const struct gpu_ops gp106_ops = {
278 .need_scatter_buffer = gp10b_need_scatter_buffer, 279 .need_scatter_buffer = gp10b_need_scatter_buffer,
279 .populate_scatter_buffer = gp10b_populate_scatter_buffer, 280 .populate_scatter_buffer = gp10b_populate_scatter_buffer,
280 }, 281 },
282 .bus = {
283 .init_hw = gk20a_bus_init_hw,
284 .isr = gk20a_bus_isr,
285 .read_ptimer = gk20a_read_ptimer,
286 .get_timestamps_zipper = nvgpu_get_timestamps_zipper,
287 .bar1_bind = gk20a_bus_bar1_bind,
288 },
281#if defined(CONFIG_GK20A_CYCLE_STATS) 289#if defined(CONFIG_GK20A_CYCLE_STATS)
282 .css = { 290 .css = {
283 .enable_snapshot = css_hw_enable_snapshot, 291 .enable_snapshot = css_hw_enable_snapshot,
@@ -324,6 +332,7 @@ int gp106_init_hal(struct gk20a *g)
324 gops->debug = gp106_ops.debug; 332 gops->debug = gp106_ops.debug;
325 gops->dbg_session_ops = gp106_ops.dbg_session_ops; 333 gops->dbg_session_ops = gp106_ops.dbg_session_ops;
326 gops->cde = gp106_ops.cde; 334 gops->cde = gp106_ops.cde;
335 gops->bus = gp106_ops.bus;
327#if defined(CONFIG_GK20A_CYCLE_STATS) 336#if defined(CONFIG_GK20A_CYCLE_STATS)
328 gops->css = gp106_ops.css; 337 gops->css = gp106_ops.css;
329#endif 338#endif
@@ -339,8 +348,8 @@ int gp106_init_hal(struct gk20a *g)
339 gops->privsecurity = 1; 348 gops->privsecurity = 1;
340 gops->securegpccs = 1; 349 gops->securegpccs = 1;
341 gops->pmupstate = true; 350 gops->pmupstate = true;
351
342 g->bootstrap_owner = LSF_FALCON_ID_SEC2; 352 g->bootstrap_owner = LSF_FALCON_ID_SEC2;
343 gk20a_init_bus(gops);
344 gp10b_init_priv_ring(gops); 353 gp10b_init_priv_ring(gops);
345 gp106_init_gr(gops); 354 gp106_init_gr(gops);
346 gp10b_init_fecs_trace_ops(gops); 355 gp10b_init_fecs_trace_ops(gops);