gpu: nvgpu: Reading Vmin and Volt_rail get status

Changes:
1) volt_rail_boardobj_grp_get_status function implemented.
2) nvgpu_volt_get_vmin_tu10x function implemented.
3) Only Vmin is updated into boardobjs.

Bug 200454682
Bug 2481917

Change-Id: Ie070b28a78503eeb3003493b5f130a4dcd9b1275
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996137
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:
rmylavarapu
2019-01-17 15:44:02 +05:30
committed by mobile promotions
parent c57cf00aa0
commit f048bb5a71
7 changed files with 109 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -387,3 +387,29 @@ int volt_set_noiseaware_vmin(struct gk20a *g, u32 logic_voltage_uv,
}
int nvgpu_volt_get_vmin_tu10x(struct gk20a *g, u32 *vmin_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, "Vfe_var 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->vmin_limitu_v != 0U) {
*vmin_uv = volt_rail->vmin_limitu_v;
return status;
}
}
return status;
}