Skip to content

Commit

Permalink
HTMGT: Support AVSBus Config packet for Vdd Current roll over workaround
Browse files Browse the repository at this point in the history
Change-Id: I45ec918774b55d23fdff52bab399808446b2be67
RTC: 191241
CQ: SW424766
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57651
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sheldon Bailey <baileysh@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
cjcain authored and dcrowell77 committed Apr 24, 2018
1 parent 4b25a2b commit ae5e20e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
33 changes: 28 additions & 5 deletions src/usr/htmgt/htmgt_cfgdata.C
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ enum occCfgDataVersion
OCC_CFGDATA_PCAP_CONFIG_VERSION = 0x20,
OCC_CFGDATA_SYS_CONFIG_VERSION = 0x21,
OCC_CFGDATA_TCT_CONFIG_VERSION = 0x20,
OCC_CFGDATA_AVSBUS_CONFIG_VERSION = 0X01,
};


Expand Down Expand Up @@ -1075,17 +1074,21 @@ void getAVSBusConfigMessageData( const TargetHandle_t i_occ,
uint64_t & o_size )
{
uint64_t index = 0;
uint8_t version = 0x01;
o_size = 0;

assert( o_data != nullptr );

Target* l_sys = nullptr;
targetService().getTopLevelTarget(l_sys);
assert(l_sys != nullptr);

// Get the parent processor
ConstTargetHandle_t l_proc = getParentChip( i_occ );
assert( l_proc != nullptr );

// Populate the data
o_data[index++] = OCC_CFGDATA_AVSBUS_CONFIG;
o_data[index++] = OCC_CFGDATA_AVSBUS_CONFIG_VERSION;
const uint64_t version_index = index++; // version updated later
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_BUSNUM>();//Vdd Bus
o_data[index++] = l_proc->getAttr<ATTR_VDD_AVSBUS_RAIL>(); //Vdd Rail Sel
o_data[index++] = 0xFF; //reserved
Expand All @@ -1094,8 +1097,8 @@ void getAVSBusConfigMessageData( const TargetHandle_t i_occ,
o_data[index++] = l_proc->getAttr<ATTR_VDN_AVSBUS_RAIL>(); //Vdn Rail sel

ATTR_NO_APSS_PROC_POWER_VCS_VIO_WATTS_type PowerAdder = 0;
if ( l_proc->tryGetAttr //if attr exists populate Proc Power Adder.
<ATTR_NO_APSS_PROC_POWER_VCS_VIO_WATTS>(PowerAdder))
if (l_proc->tryGetAttr //if attr exists populate Proc Power Adder.
<ATTR_NO_APSS_PROC_POWER_VCS_VIO_WATTS>(PowerAdder))
{
o_data[index++] = ((PowerAdder>>8)&0xFF);
o_data[index++] = ((PowerAdder)&0xFF);
Expand All @@ -1105,6 +1108,26 @@ void getAVSBusConfigMessageData( const TargetHandle_t i_occ,
o_data[index++] = 0x00;
o_data[index++] = 0x00;
}

ATTR_VDD_CURRENT_OVERFLOW_WORKAROUND_ENABLE_type overflow_enable = 0;
ATTR_MAX_VDD_CURRENT_READING_type max_vdd_current = 0;
if ((l_sys->tryGetAttr //if attr exists populate overflow_enable
<ATTR_VDD_CURRENT_OVERFLOW_WORKAROUND_ENABLE>(overflow_enable)) &&
(l_sys->tryGetAttr //if attr exists populate max_vdd_current
<ATTR_MAX_VDD_CURRENT_READING>(max_vdd_current)))
{
if (overflow_enable == 1)
{
// Additional config info for Vdd Current overflow workaround
version = 0x02;
o_data[index++] = 0x7F; // Hardcode Vdd Current Rollover Point
o_data[index++] = 0xFF;
o_data[index++] = (max_vdd_current>>8) & 0xFF;
o_data[index++] = max_vdd_current & 0xFF;
}
}

o_data[version_index] = version; // Version
o_size = index;

}
Expand Down
32 changes: 32 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types_openpower.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,38 @@ ID for the sensor number returned with the elog. -->
<writeable/>
</attribute>

<attribute>
<id>VDD_CURRENT_OVERFLOW_WORKAROUND_ENABLE</id>
<description>
Used to enable Vdd current overflow worakaround.
To enable this attribute should be set to 1 and
MAX_VDD_CURRENT_READING must be populated.
Set to 0 to disable.
</description>
<simpleType>
<uint16_t>
<default>0x0000</default>
</uint16_t>
</simpleType>
<persistency>non-volatile</persistency>
<readable/>
</attribute>

<attribute>
<id>MAX_VDD_CURRENT_READING</id>
<description>
Maximum theoretical Vdd current reading in 10mA units.
Used when VDD_CURRENT_OVERFLOW_WORKAROUND_ENABLE is set.
</description>
<simpleType>
<uint16_t>
<default>0x0000</default>
</uint16_t>
</simpleType>
<persistency>non-volatile</persistency>
<readable/>
</attribute>

<!-- end HTMGT attributes -->

<attribute>
Expand Down
2 changes: 2 additions & 0 deletions src/usr/targeting/common/xmltohb/target_types_openpower.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
<attribute><id>ALLOW_CALLHOME_ESELS_TO_BMC</id></attribute>
<attribute><id>REPORT_THROTTLE_BELOW_NOMINAL</id></attribute>
<attribute><id>HTMGT_SAVED_POWER_LIMIT</id></attribute>
<attribute><id>VDD_CURRENT_OVERFLOW_WORKAROUND_ENABLE</id></attribute>
<attribute><id>MAX_VDD_CURRENT_READING</id></attribute>
</targetTypeExtension>

<targetTypeExtension>
Expand Down

0 comments on commit ae5e20e

Please sign in to comment.