summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/hal_gp106.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-28 21:18:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-07 13:35:24 -0400
commit997ea5cef3dcd55b2281a7a8dcf452b743bc01f3 (patch)
tree8c3b8d8a75b5622f711f740b0dc9fc3f2b5b4149 /drivers/gpu/nvgpu/gp106/hal_gp106.c
parent57abaabb7688016feaecbf529a46ad143c1e65a2 (diff)
gpu: nvgpu: Reorg xve HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the xve 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: Ieb9afc230199c341d2df1e9f75792a136a2a6067 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master/r/1510470 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-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.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index f31180cd..a13889ad 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -239,6 +239,21 @@ static const struct gpu_ops gp106_ops = {
239 .pg_gr_load_gating_prod = 239 .pg_gr_load_gating_prod =
240 gr_gp106_pg_gr_load_gating_prod, 240 gr_gp106_pg_gr_load_gating_prod,
241 }, 241 },
242 .xve = {
243 .sw_init = xve_sw_init_gp106,
244 .get_speed = xve_get_speed_gp106,
245 .set_speed = xve_set_speed_gp106,
246 .available_speeds = xve_available_speeds_gp106,
247 .xve_readl = xve_xve_readl_gp106,
248 .xve_writel = xve_xve_writel_gp106,
249 .disable_aspm = xve_disable_aspm_gp106,
250 .reset_gpu = xve_reset_gpu_gp106,
251#if defined(CONFIG_PCI_MSI)
252 .rearm_msi = xve_rearm_msi_gp106,
253#endif
254 .enable_shadow_rom = xve_enable_shadow_rom_gp106,
255 .disable_shadow_rom = xve_disable_shadow_rom_gp106,
256 },
242 .get_litter_value = gp106_get_litter_value, 257 .get_litter_value = gp106_get_litter_value,
243 .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, 258 .chip_init_gpu_characteristics = gp106_init_gpu_characteristics,
244 .bios_init = gm206_bios_init, 259 .bios_init = gm206_bios_init,
@@ -253,6 +268,7 @@ int gp106_init_hal(struct gk20a *g)
253 268
254 gops->ltc = gp106_ops.ltc; 269 gops->ltc = gp106_ops.ltc;
255 gops->clock_gating = gp106_ops.clock_gating; 270 gops->clock_gating = gp106_ops.clock_gating;
271 gops->xve = gp106_ops.xve;
256 272
257 /* Lone functions */ 273 /* Lone functions */
258 gops->get_litter_value = gp106_ops.get_litter_value; 274 gops->get_litter_value = gp106_ops.get_litter_value;
@@ -287,7 +303,6 @@ int gp106_init_hal(struct gk20a *g)
287 gk20a_init_css_ops(gops); 303 gk20a_init_css_ops(gops);
288#endif 304#endif
289 gp106_init_therm_ops(gops); 305 gp106_init_therm_ops(gops);
290 gp106_init_xve_ops(gops);
291 306
292 g->name = "gp10x"; 307 g->name = "gp10x";
293 gops->gr_ctx.use_dma_for_fw_bootstrap = true; 308 gops->gr_ctx.use_dma_for_fw_bootstrap = true;