diff options
author | Chris Cain <cjcain@us.ibm.com> | 2017-05-12 16:08:49 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-05-15 11:46:29 -0400 |
commit | d1ca408e8bb617c208b3a012b0d8d8a89771f9e0 (patch) | |
tree | dea2bf800e2ecfa30db4bd7d27cd196f00ccf57a /src/usr/htmgt | |
parent | 6148a403bc643c4ed118f757edb984d706dc9b36 (diff) | |
download | talos-hostboot-d1ca408e8bb617c208b3a012b0d8d8a89771f9e0.tar.gz talos-hostboot-d1ca408e8bb617c208b3a012b0d8d8a89771f9e0.zip |
HTMGT Witherspoon updates
- Add internal flag to enable memory monitoring
- Fix power cap data
- Additional console traces on errors
Change-Id: I726260aa678c5b0ddd7ea60a8e0dfbd8d1e7ea4d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40469
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Sheldon R. Bailey <baileysh@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt')
-rw-r--r-- | src/usr/htmgt/htmgt_cfgdata.C | 76 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_cfgdata.H | 2 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occ.C | 17 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occcmd.C | 13 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occcmd.H | 11 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_utility.H | 11 | ||||
-rw-r--r-- | src/usr/htmgt/occError.C | 7 | ||||
-rw-r--r-- | src/usr/htmgt/test/htmgtcfgtest.H | 4 |
8 files changed, 87 insertions, 54 deletions
diff --git a/src/usr/htmgt/htmgt_cfgdata.C b/src/usr/htmgt/htmgt_cfgdata.C index 58605c342..a876a4535 100644 --- a/src/usr/htmgt/htmgt_cfgdata.C +++ b/src/usr/htmgt/htmgt_cfgdata.C @@ -145,7 +145,7 @@ namespace HTMGT break; case OCC_CFGDATA_MEM_CONFIG: - getMemConfigMessageData(occ->getTarget(), true, + getMemConfigMessageData(occ->getTarget(), cmdData, cmdDataLen); break; @@ -159,8 +159,11 @@ namespace HTMGT break; case OCC_CFGDATA_MEM_THROTTLE: - getMemThrottleMessageData(occ->getTarget(), + if (int_flags_set(FLAG_SEND_MEM_CONFIG)) + { + getMemThrottleMessageData(occ->getTarget(), cmdData, cmdDataLen); + } break; case OCC_CFGDATA_TCT_CONFIG: @@ -292,7 +295,6 @@ void writeMemConfigData( uint8_t *& o_data, void getMemConfigMessageData(const TargetHandle_t i_occ, - bool i_monitoringEnabled, uint8_t* o_data, uint64_t & o_size) { uint64_t index = 0; @@ -302,12 +304,10 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, o_data[index++] = OCC_CFGDATA_MEM_CONFIG; o_data[index++] = OCC_CFGDATA_MEM_CONFIG_VERSION; - //System reference needed for these ATTR. Target* sys = nullptr; targetService().getTopLevelTarget(sys); - if( is_sapphire_load() )//if OPAL then no "Power Control Default" support. { //Byte 3: Memory Power Control Default. @@ -326,14 +326,10 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, sys->getAttr<ATTR_MSS_MRW_IDLE_POWER_CONTROL_REQUESTED>(); } - - - //Byte 5: Number of data sets. size_t numSetsOffset = index++; //Will fill in numSets at the end - - if (i_monitoringEnabled) + if (int_flags_set(FLAG_SEND_MEM_CONFIG)) { TargetHandleList centaurs; TargetHandleList mbas; @@ -342,7 +338,6 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, uint8_t dimmPos = 0; uint8_t numSets = 0; - ConstTargetHandle_t proc = getParentChip(i_occ); assert(proc != nullptr); @@ -357,7 +352,6 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, proc->getAttr<ATTR_HUID>(), centaurs.size()); - for ( const auto & centaur : centaurs ) { numSets++; @@ -379,7 +373,6 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, 0, //" " index ); - mbas.clear(); getChildAffinityTargets(mbas, centaur, CLASS_UNIT, TYPE_MBA); @@ -449,7 +442,7 @@ void getMemConfigMessageData(const TargetHandle_t i_occ, numSets, i_occ->getAttr<ATTR_HUID>()); o_data[numSetsOffset] = numSets; - }//END i_monitoringEnabled + } else { TMGT_INF("getMemConfigMessageData: Mem monitoring is disabled"); @@ -652,44 +645,39 @@ void getPowerCapMessageData(uint8_t* o_data, uint64_t & o_size) o_data[index++] = OCC_CFGDATA_PCAP_CONFIG; o_data[index++] = OCC_CFGDATA_PCAP_CONFIG_VERSION; - // Minimum HARD Power Cap - ATTR_OPEN_POWER_MIN_POWER_CAP_WATTS_type pcap = + ATTR_OPEN_POWER_MIN_POWER_CAP_WATTS_type min_pcap = sys->getAttr<ATTR_OPEN_POWER_MIN_POWER_CAP_WATTS>(); - // Minimum SOFT Power Cap ATTR_OPEN_POWER_SOFT_MIN_PCAP_WATTS_type soft_pcap; - //if attr does not exists. if ( ! sys->tryGetAttr <ATTR_OPEN_POWER_SOFT_MIN_PCAP_WATTS>(soft_pcap)) { - soft_pcap = pcap; + // attr does not exist (us min) + soft_pcap = min_pcap; } - - - // Minimum Soft Power Cap - TMGT_INF("getPowerCapMessageData: minimum soft power cap =%dW",soft_pcap); - memcpy(&o_data[index], &soft_pcap, 2); + UINT16_PUT(&o_data[index], soft_pcap); index += 2; // Minimum Hard Power Cap - TMGT_INF("getPowerCapMessageData: minimum hard power cap = %dW",pcap); - memcpy(&o_data[index], &pcap, 2); + UINT16_PUT(&o_data[index], min_pcap); index += 2; // System Maximum Power Cap - pcap = getMaxPowerCap(sys); - memcpy(&o_data[index], &pcap, 2); + const uint16_t max_pcap = getMaxPowerCap(sys); + UINT16_PUT(&o_data[index], max_pcap); index += 2; // Quick Power Drop Power Cap - pcap = sys->getAttr<ATTR_OPEN_POWER_N_BULK_POWER_LIMIT_WATTS>(); - TMGT_INF("getPowerCapMessageData: oversubscription power cap = %dW", - pcap); - memcpy(&o_data[index], &pcap, 2); + ATTR_OPEN_POWER_N_BULK_POWER_LIMIT_WATTS_type qpd_pcap = + sys->getAttr<ATTR_OPEN_POWER_N_BULK_POWER_LIMIT_WATTS>(); + UINT16_PUT(&o_data[index], qpd_pcap); index += 2; + TMGT_INF("getPowerCapMessageData: pcaps - soft min: %d, min: %d, max: %d," + " qpd: %d (in Watts)", + soft_pcap, min_pcap, max_pcap, qpd_pcap); o_size = index; } @@ -942,7 +930,7 @@ void getFrequencyPointMessageData(uint8_t* o_data, turbo = sys->getAttr<ATTR_FREQ_CORE_MAX>(); //Ultra Turbo Frequency in MHz - const uint16_t wofSupported = sys->getAttr<ATTR_WOF_ENABLED>(); + const uint16_t wofSupported = sys->getAttr<ATTR_SYSTEM_WOF_ENABLED>(); if (0 != wofSupported) { ultra = sys->getAttr<ATTR_ULTRA_TURBO_FREQ_MHZ>(); @@ -1001,8 +989,8 @@ void getApssMessageData(uint8_t* o_data, ATTR_ADC_CHANNEL_FUNC_IDS_type function; sys->tryGetAttr<ATTR_ADC_CHANNEL_FUNC_IDS>(function); - ATTR_ADC_CHANNEL_GNDS_type ground; - sys->tryGetAttr<ATTR_ADC_CHANNEL_GNDS>(ground); + ATTR_ADC_CHANNEL_GROUNDS_type ground; + sys->tryGetAttr<ATTR_ADC_CHANNEL_GROUNDS>(ground); ATTR_ADC_CHANNEL_GAINS_type gain; sys->tryGetAttr<ATTR_ADC_CHANNEL_GAINS>(gain); @@ -1035,14 +1023,13 @@ void getApssMessageData(uint8_t* o_data, o_data[2] = 0; o_data[3] = 0; uint64_t idx = 4; - uint32_t sensorId = 0; for(uint64_t channel = 0; channel < sizeof(function); ++channel) { o_data[idx] = function[channel]; // ADC Channel assignement idx += sizeof(uint8_t); - sensorId = 0; + uint32_t sensorId = 0; if (sensors != nullptr) { sensorId = (*sensors)[channel]; @@ -1053,11 +1040,15 @@ void getApssMessageData(uint8_t* o_data, o_data[idx] = ground[channel]; // Ground Select idx += sizeof(uint8_t); - memcpy(o_data+idx, &gain[channel], sizeof(uint32_t)); // Gain - idx += sizeof(uint32_t); + INT32_PUT(o_data+idx, gain[channel]); + idx += sizeof(int32_t); - memcpy(o_data+idx, &offset[channel], sizeof(uint32_t)); // offset - idx += sizeof(uint32_t); + INT32_PUT(o_data+idx, offset[channel]); + idx += sizeof(int32_t); + + TMGT_INF("APSS channel[%2d]: 0x%02X 0x%08X 0x%02X 0x%08X 0x%08X", + channel, function[channel], sensorId, ground[channel], + gain[channel], offset[channel]); } ATTR_APSS_GPIO_PORT_MODES_type gpioMode; @@ -1077,6 +1068,9 @@ void getApssMessageData(uint8_t* o_data, o_data[idx] = 0; idx += sizeof(uint8_t); memcpy(o_data + idx, gpioPin+pinIdx, pinsPerPort); + TMGT_INF("APSS GPIO port[%2d]: 0x%02X 0x%08X 0x%08X", + port, gpioMode[port], UINT32_GET(o_data+idx), + UINT32_GET(o_data+idx+4)); idx += pinsPerPort; pinIdx += pinsPerPort; } diff --git a/src/usr/htmgt/htmgt_cfgdata.H b/src/usr/htmgt/htmgt_cfgdata.H index 72725c49c..c96e8b10c 100644 --- a/src/usr/htmgt/htmgt_cfgdata.H +++ b/src/usr/htmgt/htmgt_cfgdata.H @@ -131,13 +131,11 @@ namespace HTMGT * including the format and version numbers. * * @param[in] i_occ - the OCC to gather data for - * @param[in] i_monitoringEnabled - set it to true if mem monitoring on * @param[out] o_data - preallocated buffer to fill in * @param[out] o_size - set to the message size * @pre o_data is large enough. */ void getMemConfigMessageData(const TARGETING::TargetHandle_t i_occ, - bool i_monitoringEnabled, uint8_t* o_data, uint64_t & o_size); diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C index ad4680078..95ae8197a 100644 --- a/src/usr/htmgt/htmgt_occ.C +++ b/src/usr/htmgt/htmgt_occ.C @@ -260,7 +260,7 @@ namespace HTMGT l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6C217));//OCB_OCI_OCBICR1 l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6C218));//OCB_OCI_OCBLWCR1 l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6C21A));//OCB_OCI_OCBLWSR1 - l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6C21C));//OCB_OCI_OCBLWSBR1 + l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6C21C));//*_OCI_OCBLWSBR1 l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6D010));//OCB_PIB_OCBAR0 l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6D030));//OCB_PIB_OCBAR1 l_scom_data.addData(DEVICE_SCOM_ADDRESS(0x6D031));//OCB_PIB_OCBCSR1 @@ -318,6 +318,13 @@ namespace HTMGT l_dataSize, 1, //version SUBSEC_ADDITIONAL_SRC ); +#ifdef CONFIG_CONSOLE_OUTPUT_OCC_COMM + char header[64]; + sprintf(header, "OCC Trace 0x%08X: (0x%04X bytes)", + i_address, l_dataSize); + dumpToConsole(header, (const uint8_t *)l_sramData, + l_dataSize); +#endif } else @@ -467,7 +474,8 @@ namespace HTMGT TMGT_INF("_buildOccs: Found OCC%d - HUID: 0x%0lX, " "masterCapable: %c, homer: 0x%0lX", - instance, huid, masterCapable?'Y':'N', homer); + instance, huid, masterCapable?'Y':'N', + homer); _addOcc(instance, masterCapable, homer, occs[0]); } else @@ -490,8 +498,9 @@ namespace HTMGT * @reasoncode HTMGT_RC_OCC_CRIT_FAILURE * @userdata1 OCC Instance * @userdata2 homer virtual address - * @devdesc Homer pointer is nullptr, unable to communicate - * with the OCCs. Leaving system in safe mode. + * @devdesc Homer pointer is nullptr, unable to + * communicate with the OCCs. + * Leaving system in safe mode. */ bldErrLog(err, HTMGT_MOD_BUILD_OCCS, diff --git a/src/usr/htmgt/htmgt_occcmd.C b/src/usr/htmgt/htmgt_occcmd.C index a9740604b..9e1bf3022 100644 --- a/src/usr/htmgt/htmgt_occcmd.C +++ b/src/usr/htmgt/htmgt_occcmd.C @@ -862,6 +862,14 @@ namespace HTMGT (uint32_t)MAX_FFDC), 1, // version exceptionType); // subsection +#ifdef CONFIG_CONSOLE_OUTPUT_OCC_COMM + char header[64]; + sprintf(header, "OCC%d 0x%02X Exception: (0x%04X bytes)", + iv_Occ->iv_instance, exceptionType, + exceptionLength); + dumpToConsole(header, (const uint8_t *)sramRspPtr, + exceptionLength); +#endif if (0xE1 == exceptionType) { @@ -1062,8 +1070,7 @@ namespace HTMGT sprintf(header, "OCC%d Command: %s (0x%04X bytes)", iv_Occ->iv_instance, command_string(iv_OccCmd.cmdType), l_send_length); - dumpToConsole(header, cmdBuffer, - std::min(l_send_length,(uint16_t)256)); + dumpToConsole(header, cmdBuffer, l_send_length); #endif #ifdef SIMICS_TESTING @@ -1101,7 +1108,7 @@ namespace HTMGT char header[64]; sprintf(header, "OCC%d Response: (0x%04X bytes)", iv_Occ->iv_instance, rspLen); - dumpToConsole(header, rspBuffer, std::min(rspLen,(uint16_t)256)); + dumpToConsole(header, rspBuffer, rspLen); #endif iv_OccRsp.sequenceNumber = rspBuffer[l_index++]; iv_OccRsp.cmdType = (enum occCommandType)rspBuffer[l_index++]; diff --git a/src/usr/htmgt/htmgt_occcmd.H b/src/usr/htmgt/htmgt_occcmd.H index 26262f944..8bdb5270d 100644 --- a/src/usr/htmgt/htmgt_occcmd.H +++ b/src/usr/htmgt/htmgt_occcmd.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -144,6 +144,15 @@ namespace HTMGT }; +#ifdef CONFIG_CONSOLE_OUTPUT_OCC_COMM + // Dump header information and set of binary data to the console. + // NOTE: Data is dumped in groups of 16 bytes. If i_len is not a + // multiple of 16, additional data data will be dumped. + void dumpToConsole(const char * i_header, + const uint8_t * i_data, + uint16_t i_len); +#endif + /** * @class OccCmd diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H index d0c70ec20..721c1d916 100644 --- a/src/usr/htmgt/htmgt_utility.H +++ b/src/usr/htmgt/htmgt_utility.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -81,6 +81,14 @@ inline void UINT32_PUT(uint8_t * i_ptr, uint32_t i_value) *(i_ptr + 3) = (uint8_t)(i_value); } +inline void INT32_PUT(uint8_t * i_ptr, int32_t i_value) +{ + *i_ptr = (int8_t)(i_value >> 24); + *(i_ptr + 1) = (int8_t)(i_value >> 16); + *(i_ptr + 2) = (int8_t)(i_value >> 8); + *(i_ptr + 3) = (int8_t)(i_value); +} + namespace HTMGT { @@ -104,6 +112,7 @@ namespace HTMGT enum internalFlagTypes { FLAG_HALT_ON_OCC_SRC = 0x00800000, // Prevent resets after SRC + FLAG_SEND_MEM_CONFIG = 0x00000800, // Enables sending mem config FLAG_HALT_ON_RESET_FAIL = 0x00000100, // Stop additional resets FLAG_EXT_RESET_DISABLED = 0x00000080, // Ignore opal-prd/BMC resets FLAG_DISABLE_MEM_THROTTLE = 0x00000040, diff --git a/src/usr/htmgt/occError.C b/src/usr/htmgt/occError.C index 53287a51b..7bd4eab75 100644 --- a/src/usr/htmgt/occError.C +++ b/src/usr/htmgt/occError.C @@ -267,6 +267,13 @@ namespace HTMGT } } +#ifdef CONFIG_CONSOLE_OUTPUT_OCC_COMM + char header[64]; + sprintf(header, "OCC%d ELOG: (0x%04X bytes)", iv_instance, i_length); + dumpToConsole(header, (const uint8_t *)l_occElog, + std::min(i_length,(uint16_t)512)); +#endif + // Add full OCC error log data as a User Details section l_errlHndl->addFFDC(OCCC_COMP_ID, l_occElog, diff --git a/src/usr/htmgt/test/htmgtcfgtest.H b/src/usr/htmgt/test/htmgtcfgtest.H index 753b68f2e..aa3adfb20 100644 --- a/src/usr/htmgt/test/htmgtcfgtest.H +++ b/src/usr/htmgt/test/htmgtcfgtest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -232,7 +232,7 @@ public: { memset(data, 0, 4*KILOBYTE); - getMemConfigMessageData(*occ, true, data, size); + getMemConfigMessageData(*occ, data, size); if (data[0] != OCC_CFGDATA_MEM_CONFIG) { |