gpu: nvgpu: PMU init update

Modified PMU subunits init sequence as they required during PMU RTOS
initialize stage, function nvgpu_pmu_early_init() allocates space for
all its subunit & its default values for further usage during runtime,
and function nvgpu_pmu_init() performs setup for sub units & starts
PMU-RTOS boot.

Deinit of all sub units allocated space will handled as part of
remove_support stage & also, during init stage upon failure of
init/setup sequence.

JIRA NVGPU-1972

Change-Id: I3ead9f9bb9e9c1178a02fc99eeec276660477325
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2110154
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mahantesh Kumbar
2019-05-08 09:43:41 +05:30
committed by mobile promotions
parent 5ec94e4a98
commit efe34ec6d7
9 changed files with 400 additions and 370 deletions

View File

@@ -100,7 +100,7 @@ int gk20a_prepare_poweroff(struct gk20a *g)
/* disable elpg before gr or fifo suspend */
if (g->support_ls_pmu) {
ret = nvgpu_pmu_destroy(g);
ret = nvgpu_pmu_destroy(g, &g->pmu);
}
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_SEC2_RTOS)) {
@@ -205,7 +205,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
goto done_gsp;
}
err = nvgpu_early_init_pmu_sw(g, &g->pmu);
err = nvgpu_pmu_early_init(g, &g->pmu);
if (err != 0) {
nvgpu_err(g, "failed to early init pmu sw");
goto done;
@@ -364,7 +364,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
}
}
err = nvgpu_init_pmu_support(g);
err = nvgpu_pmu_init(g, &g->pmu);
if (err != 0) {
nvgpu_err(g, "failed to init gk20a pmu");
nvgpu_mutex_release(&g->tpc_pg_lock);