gpu: nvgpu: Refactor Clk, Volt sub-unit

As a part of refactoring, we need to move the volt unit from perf to pmu
as it belongs there and also move the arbitor specific functions under
CLK_ARB as they will be removed from safety build.
This patch does the following
*Move volt struct from perf to pmu
*Move volt setup from pmu_pstate to volt
*Move clk freq related functions into CLK_ARB

NVGPU-4491
NVGPU-4492

Change-Id: I7180cd12bbf91cc4d2e79b6e2d71c16e494c8ff0
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2268215
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Abdul Salam
2019-12-27 18:43:26 +05:30
committed by Alex Waterman
parent 933b62a36e
commit 14b218c284
18 changed files with 176 additions and 105 deletions

View File

@@ -445,7 +445,7 @@ static int volt_device_state_init(struct gk20a *g,
/* Build VOLT_RAIL SW state from VOLT_DEVICE SW state. */
/* If VOLT_RAIL isn't supported, exit. */
if (VOLT_RAIL_VOLT_3X_SUPPORTED(&g->perf_pmu->volt)) {
if (VOLT_RAIL_VOLT_3X_SUPPORTED(g->pmu->volt)) {
rail_idx = nvgpu_volt_rail_volt_domain_convert_to_idx(g,
pvolt_dev->volt_domain);
if (rail_idx == CTRL_BOARDOBJ_IDX_INVALID) {
@@ -455,7 +455,7 @@ static int volt_device_state_init(struct gk20a *g,
goto done;
}
pRail = VOLT_GET_VOLT_RAIL(&g->perf_pmu->volt, rail_idx);
pRail = VOLT_GET_VOLT_RAIL(g->pmu->volt, rail_idx);
if (pRail == NULL) {
nvgpu_err(g,
"could not obtain ptr to rail object from rail index");
@@ -487,7 +487,7 @@ int nvgpu_volt_dev_pmu_setup(struct gk20a *g)
nvgpu_log_info(g, " ");
pboardobjgrp = &g->perf_pmu->volt.volt_dev_metadata.volt_devices.super;
pboardobjgrp = &g->pmu->volt->volt_dev_metadata.volt_devices.super;
if (!pboardobjgrp->bconstructed) {
return -EINVAL;
@@ -509,7 +509,7 @@ int nvgpu_volt_dev_sw_setup(struct gk20a *g)
nvgpu_log_info(g, " ");
status = nvgpu_boardobjgrp_construct_e32(g,
&g->perf_pmu->volt.volt_dev_metadata.volt_devices);
&g->pmu->volt->volt_dev_metadata.volt_devices);
if (status != 0) {
nvgpu_err(g,
"error creating boardobjgrp for volt rail, "
@@ -517,12 +517,12 @@ int nvgpu_volt_dev_sw_setup(struct gk20a *g)
goto done;
}
pboardobjgrp = &g->perf_pmu->volt.volt_dev_metadata.volt_devices.super;
pboardobjgrp = &g->pmu->volt->volt_dev_metadata.volt_devices.super;
pboardobjgrp->pmudatainstget = _volt_device_devgrp_pmudata_instget;
/* Obtain Voltage Rail Table from VBIOS */
status = volt_get_volt_devices_table(g, &g->perf_pmu->volt.
status = volt_get_volt_devices_table(g, &g->pmu->volt->
volt_dev_metadata);
if (status != 0) {
goto done;
@@ -541,7 +541,7 @@ int nvgpu_volt_dev_sw_setup(struct gk20a *g)
}
/* update calibration to fuse */
BOARDOBJGRP_FOR_EACH(&(g->perf_pmu->volt.volt_dev_metadata.volt_devices.
BOARDOBJGRP_FOR_EACH(&(g->pmu->volt->volt_dev_metadata.volt_devices.
super),
struct voltage_device *, pvolt_device, i) {
status = volt_device_state_init(g, pvolt_device);