mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Read current_volt from vol_rail_get_status
-Latest ucode doesn't support get_voltage RPC, the data can be extracted from data obtained by volt_rail_get_status board_obj cmd. Updating the debugfs node to read the data from volt_rail_get_status. JIRA NVGPU-3815 Change-Id: I85f84a757425411725773802c20f05063b222afc Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com> Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2153387 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
89eec35887
commit
e786c3fc35
@@ -329,6 +329,8 @@ static int volt_rail_obj_update(struct gk20a *g,
|
|||||||
/* Updating only vmin as per requirement, later other fields can be added */
|
/* Updating only vmin as per requirement, later other fields can be added */
|
||||||
volt_rail_obj->vmin_limitu_v = pstatus->vmin_limitu_v;
|
volt_rail_obj->vmin_limitu_v = pstatus->vmin_limitu_v;
|
||||||
volt_rail_obj->max_limitu_v = pstatus->max_limitu_v;
|
volt_rail_obj->max_limitu_v = pstatus->max_limitu_v;
|
||||||
|
volt_rail_obj->current_volt_uv = pstatus->curr_volt_defaultu_v;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,6 +587,32 @@ int nvgpu_volt_get_vmin_vmax_ps35(struct gk20a *g, u32 *vmin_uv, u32 *vmax_uv)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int nvgpu_volt_get_curr_volt_ps35(struct gk20a *g, u32 *vcurr_uv)
|
||||||
|
{
|
||||||
|
struct boardobjgrp *pboardobjgrp;
|
||||||
|
struct boardobj *pboardobj = NULL;
|
||||||
|
struct voltage_rail *volt_rail = NULL;
|
||||||
|
int status;
|
||||||
|
u8 index;
|
||||||
|
|
||||||
|
status = nvgpu_volt_rail_boardobj_grp_get_status(g);
|
||||||
|
if (status != 0) {
|
||||||
|
nvgpu_err(g, "volt rail get status failed");
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
pboardobjgrp = &g->perf_pmu->volt.volt_rail_metadata.volt_rails.super;
|
||||||
|
|
||||||
|
BOARDOBJGRP_FOR_EACH(pboardobjgrp, struct boardobj*, pboardobj, index) {
|
||||||
|
volt_rail = (struct voltage_rail *)(void *)pboardobj;
|
||||||
|
if (volt_rail->current_volt_uv != 0U) {
|
||||||
|
*vcurr_uv = volt_rail->current_volt_uv;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
u8 nvgpu_volt_get_vmargin_ps35(struct gk20a *g)
|
u8 nvgpu_volt_get_vmargin_ps35(struct gk20a *g)
|
||||||
{
|
{
|
||||||
struct boardobjgrp *pboardobjgrp;
|
struct boardobjgrp *pboardobjgrp;
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ struct voltage_rail {
|
|||||||
s32 volt_delta_uv[CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES];
|
s32 volt_delta_uv[CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES];
|
||||||
u32 vmin_limitu_v;
|
u32 vmin_limitu_v;
|
||||||
u32 max_limitu_v;
|
u32 max_limitu_v;
|
||||||
|
u32 current_volt_uv;
|
||||||
};
|
};
|
||||||
|
|
||||||
int nvgpu_volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv,
|
int nvgpu_volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
@@ -110,5 +111,6 @@ int nvgpu_volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
|||||||
u8 nvgpu_volt_rail_vbios_volt_domain_convert_to_internal
|
u8 nvgpu_volt_rail_vbios_volt_domain_convert_to_internal
|
||||||
(struct gk20a *g, u8 vbios_volt_domain);
|
(struct gk20a *g, u8 vbios_volt_domain);
|
||||||
void nvgpu_pmu_volt_rpc_handler(struct gk20a *g, struct nv_pmu_rpc_header *rpc);
|
void nvgpu_pmu_volt_rpc_handler(struct gk20a *g, struct nv_pmu_rpc_header *rpc);
|
||||||
|
int nvgpu_volt_get_curr_volt_ps35(struct gk20a *g, u32 *vcurr_uv);
|
||||||
|
|
||||||
#endif /* NVGPU_PMU_VOLT_H */
|
#endif /* NVGPU_PMU_VOLT_H */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ static int get_curr_voltage(void *data, u64 *val)
|
|||||||
u32 readval;
|
u32 readval;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = nvgpu_volt_get_voltage(g, CTRL_VOLT_DOMAIN_LOGIC, &readval);
|
err = nvgpu_volt_get_curr_volt_ps35(g, &readval);
|
||||||
if (!err)
|
if (!err)
|
||||||
*val = readval;
|
*val = readval;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user