diff options
author | Chris Cain <cjcain@us.ibm.com> | 2018-04-23 11:43:27 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-04-24 11:09:36 -0400 |
commit | 9265ad6a6a9d50d2765bbebca2f4392a32367a5c (patch) | |
tree | bb6920483280d287523419b2da4abad4e38a2850 /src/usr/htmgt | |
parent | 2080a1c618c0967fc682b014515ed32ff229eeef (diff) | |
download | talos-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>
Diffstat (limited to 'src/usr/htmgt')
-rw-r--r-- | src/usr/htmgt/htmgt_cfgdata.C | 33 |
1 files changed, 28 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; } |