From c46b8cb8de9bac66b62969b0499b52153e4d1818 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 24 Apr 2018 21:13:30 -0500 Subject: Cap voltage offset when biased This fixes spurious (invalid) voltage requests when the bias frequency exceeds the maximum WoF frequency Signed-off-by: Timothy Pearson --- src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C b/src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C index 9dee852b2..12bbb914f 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pstate_parameter_block.C @@ -4689,11 +4689,15 @@ uint32_t ps2v_mv(const Pstate i_pstate, FAPI_INF ("l_SlopeValue %x",l_SlopeValue); - uint32_t x = (l_SlopeValue * (-i_pstate + i_operating_points[region_start].pstate)); + int32_t x_candidate = (l_SlopeValue * (-i_pstate + i_operating_points[region_start].pstate)); + uint32_t x = 0; uint32_t y = x >> VID_SLOPE_FP_SHIFT_12; + if (x_candidate > 0) + x = x_candidate; + uint32_t l_vdd = - (((l_SlopeValue * (-i_pstate + i_operating_points[region_start].pstate)) >> VID_SLOPE_FP_SHIFT_12) + ((x >> VID_SLOPE_FP_SHIFT_12) + revle32(i_operating_points[region_start].vdd_mv)); // Round up -- cgit v1.2.1