Skip to content

Commit

Permalink
Data Type of ATTR_DPO_MIN_FREQ_PERCENT should be int32_t
Browse files Browse the repository at this point in the history
ATTR_DPO_MIN_FREQ_PERCENT is always a negative value, so it should be
int32_t type, instead of uint32_t.
Make corresponding changes to DPO frequency calculation.

Change-Id: I97d608d71a39b010b60b94bb740ba9fa9df7f17b
CQ: SW390623
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41337
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
  • Loading branch information
mgloff authored and ploetzma committed Jun 15, 2017
1 parent 727f9b3 commit 6a85bab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/usr/isteps/istep06/call_host_voltage_config.C
Expand Up @@ -415,13 +415,15 @@ void* call_host_voltage_config( void *io_pArgs )
l_sys->setAttr<ATTR_NOMINAL_FREQ_MHZ>( l_nominalFreq );

// raise the min freq if there is a system policy for it
uint32_t l_dpoPercent = l_sys->getAttr<ATTR_DPO_MIN_FREQ_PERCENT>();
int32_t l_dpoPercent = l_sys->getAttr<ATTR_DPO_MIN_FREQ_PERCENT>();
uint32_t l_dpoFreq = l_nominalFreq;
if( (l_dpoPercent != 0) && (l_dpoPercent < 100) )
if( (l_dpoPercent != 0) && (l_dpoPercent > -100) )
{
l_dpoFreq = (l_nominalFreq*l_dpoPercent)/100;
uint32_t l_multiplierPercent =
static_cast<uint32_t>(100 + l_dpoPercent);
l_dpoFreq = (l_nominalFreq*l_multiplierPercent)/100;
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Computed floor=%d, DPO=%d (percent=-%d)",
"Computed floor=%d, DPO=%d (percent=%d)",
l_floorFreq, l_dpoFreq, l_dpoPercent );
l_floorFreq = std::max( l_floorFreq, l_dpoFreq );
}
Expand Down
6 changes: 3 additions & 3 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Expand Up @@ -2657,13 +2657,13 @@
is used to explicitly raise the value of MIN_FREQ_MHZ above
what is specified by MVPD #V data. On FSP systems this
is sourced from the power_management def file.
Value must be between 0 and 100.
Value must be between 0 and -100.
A value of zero indicates no override.
</description>
<simpleType>
<uint32_t>
<int32_t>
<default>0</default>
</uint32_t>
</int32_t>
</simpleType>
<persistency>non-volatile</persistency>
<readable/>
Expand Down
2 changes: 1 addition & 1 deletion src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
Expand Up @@ -99,7 +99,7 @@
</attribute>
<attribute>
<id>DPO_MIN_FREQ_PERCENT</id>
<default>98</default>
<default>-2</default>
</attribute>
<attribute>
<id>REQUIRED_SYNCH_MODE</id>
Expand Down

0 comments on commit 6a85bab

Please sign in to comment.