diff options
author | Sunny He <suhe@nvidia.com> | 2017-07-28 21:36:52 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-02 17:43:25 -0400 |
commit | a15e110a9b790f55a5c6e257cfbf7f7235f5a334 (patch) | |
tree | 199209146e3e67927c13e2ece240de40f973e1ea /drivers/gpu/nvgpu/gp106/hal_gp106.c | |
parent | 43ae97000be786e4118d431637f05b1462e296c4 (diff) |
gpu: nvgpu: Reorg regops HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
regops 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: I7e2ccf158a8e7efa453a3326e86146660f18926f
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1530135
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Tested-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hal_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 8077c5e1..0caf890f 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -353,6 +353,29 @@ static const struct gpu_ops gp106_ops = { | |||
353 | .get_internal_sensor_limits = gp106_get_internal_sensor_limits, | 353 | .get_internal_sensor_limits = gp106_get_internal_sensor_limits, |
354 | .configure_therm_alert = gp106_configure_therm_alert, | 354 | .configure_therm_alert = gp106_configure_therm_alert, |
355 | }, | 355 | }, |
356 | .regops = { | ||
357 | .get_global_whitelist_ranges = | ||
358 | gp106_get_global_whitelist_ranges, | ||
359 | .get_global_whitelist_ranges_count = | ||
360 | gp106_get_global_whitelist_ranges_count, | ||
361 | .get_context_whitelist_ranges = | ||
362 | gp106_get_context_whitelist_ranges, | ||
363 | .get_context_whitelist_ranges_count = | ||
364 | gp106_get_context_whitelist_ranges_count, | ||
365 | .get_runcontrol_whitelist = gp106_get_runcontrol_whitelist, | ||
366 | .get_runcontrol_whitelist_count = | ||
367 | gp106_get_runcontrol_whitelist_count, | ||
368 | .get_runcontrol_whitelist_ranges = | ||
369 | gp106_get_runcontrol_whitelist_ranges, | ||
370 | .get_runcontrol_whitelist_ranges_count = | ||
371 | gp106_get_runcontrol_whitelist_ranges_count, | ||
372 | .get_qctl_whitelist = gp106_get_qctl_whitelist, | ||
373 | .get_qctl_whitelist_count = gp106_get_qctl_whitelist_count, | ||
374 | .get_qctl_whitelist_ranges = gp106_get_qctl_whitelist_ranges, | ||
375 | .get_qctl_whitelist_ranges_count = | ||
376 | gp106_get_qctl_whitelist_ranges_count, | ||
377 | .apply_smpc_war = gp106_apply_smpc_war, | ||
378 | }, | ||
356 | .mc = { | 379 | .mc = { |
357 | .intr_enable = mc_gp10b_intr_enable, | 380 | .intr_enable = mc_gp10b_intr_enable, |
358 | .intr_unit_config = mc_gp10b_intr_unit_config, | 381 | .intr_unit_config = mc_gp10b_intr_unit_config, |
@@ -447,6 +470,7 @@ int gp106_init_hal(struct gk20a *g) | |||
447 | gops->fecs_trace = gp106_ops.fecs_trace; | 470 | gops->fecs_trace = gp106_ops.fecs_trace; |
448 | gops->pramin = gp106_ops.pramin; | 471 | gops->pramin = gp106_ops.pramin; |
449 | gops->therm = gp106_ops.therm; | 472 | gops->therm = gp106_ops.therm; |
473 | gops->regops = gp106_ops.regops; | ||
450 | gops->mc = gp106_ops.mc; | 474 | gops->mc = gp106_ops.mc; |
451 | gops->debug = gp106_ops.debug; | 475 | gops->debug = gp106_ops.debug; |
452 | gops->dbg_session_ops = gp106_ops.dbg_session_ops; | 476 | gops->dbg_session_ops = gp106_ops.dbg_session_ops; |
@@ -477,7 +501,6 @@ int gp106_init_hal(struct gk20a *g) | |||
477 | gp106_init_pmu_ops(g); | 501 | gp106_init_pmu_ops(g); |
478 | gp106_init_clk_ops(gops); | 502 | gp106_init_clk_ops(gops); |
479 | gp106_init_clk_arb_ops(gops); | 503 | gp106_init_clk_arb_ops(gops); |
480 | gp106_init_regops(gops); | ||
481 | 504 | ||
482 | g->name = "gp10x"; | 505 | g->name = "gp10x"; |
483 | 506 | ||