summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2018-04-23 11:43:27 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-24 11:09:36 -0400
commit9265ad6a6a9d50d2765bbebca2f4392a32367a5c (patch)
treebb6920483280d287523419b2da4abad4e38a2850
parent2080a1c618c0967fc682b014515ed32ff229eeef (diff)
downloadtalos-hostboot-9265ad6a6a9d50d2765bbebca2f4392a32367a5c.tar.gz
talos-hostboot-9265ad6a6a9d50d2765bbebca2f4392a32367a5c.zip
HTMGT: Support AVSBus Config packet for Vdd Current roll over workaround
Change-Id: I1aa18500e227e3daf27564758b6301794fc436da RTC: 191241 CQ: SW424766 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57652 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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sheldon Bailey <baileysh@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/htmgt/htmgt_cfgdata.C33
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types_openpower.xml32
-rw-r--r--src/usr/targeting/common/xmltohb/target_types_openpower.xml2
3 files changed, 62 insertions, 5 deletions
diff --git a/src/usr/htmgt/htmgt_cfgdata.C b/src/usr/htmgt/htmgt_cfgdata.C
index f464b2345..20cff5a52 100644
--- a/src/usr/htmgt/htmgt_cfgdata.C
+++ b/src/usr/htmgt/htmgt_cfgdata.C
@@ -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,
};
@@ -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
@@ -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);
@@ -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;
}
diff --git a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml
index c49d2f75a..66adf8331 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml
@@ -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>
diff --git a/src/usr/targeting/common/xmltohb/target_types_openpower.xml b/src/usr/targeting/common/xmltohb/target_types_openpower.xml
index 83217b2da..5b6885902 100644
--- a/src/usr/targeting/common/xmltohb/target_types_openpower.xml
+++ b/src/usr/targeting/common/xmltohb/target_types_openpower.xml
@@ -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>
OpenPOWER on IntegriCloud