diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2017-08-15 16:44:36 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-09-01 09:38:11 -0400 |
commit | 3d4caf24f7e90f183f93cbcb915470f7205bb7f4 (patch) | |
tree | 2dfba534dc100960f8d4a40d9fbbfef9ff832b61 /src/usr/errl | |
parent | 7b2191a74ffc3b431c9ddb6c75b0fefc7f20d133 (diff) | |
download | talos-hostboot-3d4caf24f7e90f183f93cbcb915470f7205bb7f4.tar.gz talos-hostboot-3d4caf24f7e90f183f93cbcb915470f7205bb7f4.zip |
Added Error log support for new GPU sensors
Change-Id: I8a0de390516fd02df07860b960db506899b13f14
RTC:178218
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45116
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rw-r--r-- | src/usr/errl/errlentry.C | 49 | ||||
-rw-r--r-- | src/usr/errl/errlentry_consts.H | 13 | ||||
-rw-r--r-- | src/usr/errl/errlmanager_common.C | 4 | ||||
-rw-r--r-- | src/usr/errl/errludcallout.C | 27 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludcallout.H | 24 |
5 files changed, 116 insertions, 1 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index 251b24b6c..1ebbb2671 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -320,6 +320,17 @@ void ErrlEntry::addClockCallout(const TARGETING::Target *i_target, } // addClockCallout + +void ErrlEntry::addSensorCallout(const uint32_t i_sensorID, + const HWAS::sensorTypeEnum i_sensorType, + const HWAS::callOutPriority i_priority) +{ + TRACFCOMP(g_trac_errl, ENTER_MRK"addSensorCallout(0x%X, %d, 0x%x)", + i_sensorID, i_sensorType, i_priority); + + ErrlUserDetailsCallout(i_sensorID, i_sensorType, i_priority).addToLog(this); +} + //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// void ErrlEntry::addPartCallout(const TARGETING::Target *i_target, @@ -947,6 +958,13 @@ void ErrlEntry::setSubSystemIdBasedOnCallouts() "callout to determine SSID", pData->partType); iv_User.setSubSys(getSubSystem(pData->partType)); } + else if ( pData->type == HWAS::SENSOR_CALLOUT ) + { + TRACFCOMP(g_trac_errl, INFO_MRK + "mapping highest priority sensor type 0x%x " + "callout to determine SSID", pData->sensorType); + iv_User.setSubSys(getSubSystem(pData->sensorType)); + } else { TRACFCOMP(g_trac_errl, ERR_MRK @@ -1154,6 +1172,37 @@ epubSubSystem_t ErrlEntry::getSubSystem( HWAS::clockTypeEnum i_clockType ) const } /////////////////////////////////////////////////////////////////////////////// +// Map a Sensor type to a subsystem ID +epubSubSystem_t ErrlEntry::getSubSystem(HWAS::sensorTypeEnum i_sensorType) const +{ + TRACDCOMP(g_trac_errl, ENTER_MRK"getSubSystem() from sensor type 0x%x", + i_sensorType); + + epubSubSystem_t subsystem = EPUB_MISC_UNKNOWN; + + const uint32_t SENSOR_TO_SUBSYS_TABLE_ENTRIES = + sizeof(SENSOR_TO_SUBSYS_TABLE)/sizeof(SENSOR_TO_SUBSYS_TABLE[0]); + + for (uint32_t i = 0; i < SENSOR_TO_SUBSYS_TABLE_ENTRIES; i++) + { + if (SENSOR_TO_SUBSYS_TABLE[i].xType == i_sensorType) + { + subsystem = SENSOR_TO_SUBSYS_TABLE[i].xSubSys; + break; + } + } + + if(subsystem == EPUB_MISC_UNKNOWN) + { + TRACFCOMP(g_trac_errl,"WRN>> Failed to find subsystem ID for sensor type 0x%x", + i_sensorType); + } + + TRACDCOMP(g_trac_errl, EXIT_MRK"getSubSystem() ssid 0x%x", subsystem); + return subsystem; +} + +/////////////////////////////////////////////////////////////////////////////// // Map a Part type to a subsystem ID epubSubSystem_t ErrlEntry::getSubSystem( HWAS::partTypeEnum i_partType ) const { diff --git a/src/usr/errl/errlentry_consts.H b/src/usr/errl/errlentry_consts.H index 3f5762195..edd165057 100644 --- a/src/usr/errl/errlentry_consts.H +++ b/src/usr/errl/errlentry_consts.H @@ -149,6 +149,19 @@ const epubPartTypeToSub_t PART_TO_SUBSYS_TABLE[] = { HWAS::SPIVID_SLAVE_PART_TYPE , EPUB_POWER_SUBSYS }, }; +struct epubSensorTypeToSub_t +{ + HWAS::sensorTypeEnum xType; + epubSubSystem_t xSubSys; +}; + +struct epubSensorTypeToSub_t SENSOR_TO_SUBSYS_TABLE[] = +{ + { HWAS::GPU_FUNC_SENSOR , EPUB_IO_SUBSYS }, + { HWAS::GPU_TEMPERATURE_SENSOR , EPUB_IO_SUBSYS }, + { HWAS::GPU_MEMORY_TEMP_SENSOR , EPUB_IO_SUBSYS }, +}; + } //end namespace #endif //#ifndef ERRLENTRY_CONSTS_H diff --git a/src/usr/errl/errlmanager_common.C b/src/usr/errl/errlmanager_common.C index a0a54da5e..e69036195 100644 --- a/src/usr/errl/errlmanager_common.C +++ b/src/usr/errl/errlmanager_common.C @@ -842,6 +842,10 @@ uint8_t getSensorInfo(HWAS::callout_ud_t *i_ud, { *o_sensorNumber = SENSOR::getBackPlaneFaultSensor(); } + else if (i_ud->type == HWAS::SENSOR_CALLOUT ) + { + *o_sensorNumber = static_cast<uint8_t>(i_ud->sensorId); + } else { // for all other types there will be at least diff --git a/src/usr/errl/errludcallout.C b/src/usr/errl/errludcallout.C index 2aa851d64..334d3c9a2 100644 --- a/src/usr/errl/errludcallout.C +++ b/src/usr/errl/errludcallout.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -202,4 +202,29 @@ ErrlUserDetailsCallout::ErrlUserDetailsCallout( } // Procedure callout +//------------------------------------------------------------------------------ +// Sensor callout +ErrlUserDetailsCallout::ErrlUserDetailsCallout(const uint32_t i_sensorID, + const HWAS::sensorTypeEnum i_sensorType, + const HWAS::callOutPriority i_priority) +{ + TRACDCOMP(g_trac_errl, "Sensor Callout"); + + // Set up ErrlUserDetails instance variables + iv_CompId = ERRL_COMP_ID; + iv_Version = 1; + iv_SubSection = ERRL_UDT_CALLOUT; + + HWAS::callout_ud_t *pData; + pData = reinterpret_cast<HWAS::callout_ud_t *> + (reallocUsrBuf(sizeof(HWAS::callout_ud_t))); + + pData->type = HWAS::SENSOR_CALLOUT; + pData->priority = i_priority; + pData->sensorId = i_sensorID; + pData->sensorType = i_sensorType; + + TRACDCOMP(g_trac_errl, "Sensor Callout exit"); +} // Sensor callout + } diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H index 95e147083..abce1fb74 100644 --- a/src/usr/errl/plugins/errludcallout.H +++ b/src/usr/errl/plugins/errludcallout.H @@ -297,6 +297,30 @@ case HWAS::_type: i_parser.PrintString( "Procedure", #_type); break; #undef case_PROCEDURE break; // PROCEDURE_CALLOUT } + + case HWAS::SENSOR_CALLOUT: + { + i_parser.PrintString( "Callout type", "Sensor Callout"); + + i_parser.PrintNumber( "Sensor ID", "0x%X", + ntohl(pData->sensorId)); + + switch (ntohl(pData->sensorType)) + { +#define case_SENSOR_TYPE(_type) \ +case HWAS::_type: i_parser.PrintString( "Sensor Type", #_type); break; + case_SENSOR_TYPE(GPU_FUNC_SENSOR) + case_SENSOR_TYPE(GPU_TEMPERATURE_SENSOR) + case_SENSOR_TYPE(GPU_MEMORY_TEMP_SENSOR) + case_SENSOR_TYPE(UNKNOWN_SENSOR) + default: + i_parser.PrintNumber( "Sensor Type", "UNKNOWN: 0x%X", + ntohl(pData->sensorType) ); + break; + } // switch sensorType +#undef case_SENSOR_TYPE + break; + } default: i_parser.PrintNumber( "Callout type", "UNKNOWN: 0x%X", ntohl(pData->type) ); |