diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/errl/errlentry.C | 95 | ||||
-rw-r--r-- | src/usr/errl/errludcallout.C | 37 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludcallout.H | 60 | ||||
-rw-r--r-- | src/usr/errl/test/errltest.H | 16 | ||||
-rw-r--r-- | src/usr/hwas/common/hwasCallout.C | 24 | ||||
-rw-r--r-- | src/usr/hwas/hwasPlatCallout.C | 23 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.C | 22 |
7 files changed, 267 insertions, 10 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index 52d4951bb..4e978eb59 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -135,6 +135,25 @@ static const epubClockTypeToSub_t CLOCK_TO_SUBSYS_TABLE[] = { HWAS::OSCPCICLK_TYPE , EPUB_CEC_HDW_CLK_CTL }, }; +struct epubPartTypeToSub_t +{ + HWAS::partTypeEnum xType; + epubSubSystem_t xSubSys; +}; + +// PART type to subsystem table +static const epubPartTypeToSub_t PART_TO_SUBSYS_TABLE[] = +{ + { HWAS::FLASH_CONTROLLER_PART_TYPE , EPUB_CEC_HDW_SUBSYS }, + { HWAS::PNOR_PART_TYPE , EPUB_CEC_HDW_SUBSYS }, + { HWAS::SBE_SEEPROM_PART_TYPE , EPUB_PROCESSOR_SUBSYS }, + { HWAS::BOARD_VPD_PART_TYPE , EPUB_CEC_HDW_SUBSYS }, + { HWAS::LPC_SLAVE_PART_TYPE , EPUB_CEC_HDW_SUBSYS }, + { HWAS::CENTAUR_GPIO_EXPANDER_PART_TYPE , EPUB_MEMORY_SUBSYS }, + { HWAS::VOLTAGE_REGULATOR_PART_TYPE , EPUB_POWER_SUBSYS }, +}; + + namespace ERRORLOG { @@ -393,6 +412,50 @@ void ErrlEntry::addClockCallout(const TARGETING::Target *i_target, } // addClockCallout +//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +void ErrlEntry::addPartCallout(const TARGETING::Target *i_target, + const HWAS::partTypeEnum i_partType, + const HWAS::callOutPriority i_priority, + const HWAS::DeconfigEnum i_deconfigState, + const HWAS::GARD_ErrorType i_gardErrorType) +{ + TRACFCOMP(g_trac_errl, ENTER_MRK"addPartCallout(%p, %d, 0x%x)", + i_target, i_partType, i_priority); + + TARGETING::EntityPath ep; + const void *pData; + uint32_t size; + + if (i_target == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) + { + size = sizeof(HWAS::TARGET_IS_SENTINEL); + pData = &HWAS::TARGET_IS_SENTINEL; + } + else + { // we got a non MASTER_SENTINEL target, therefore the targeting + // module is loaded, therefore we can make this call. + ep = i_target->getAttr<TARGETING::ATTR_PHYS_PATH>(); + // size is total EntityPath size minus unused path elements + size = sizeof(ep) - + (TARGETING::EntityPath::MAX_PATH_ELEMENTS - ep.size()) * + sizeof(TARGETING::EntityPath::PathElement); + pData = &ep; + } + + ErrlUserDetailsCallout( pData, size, i_partType, + i_priority, i_deconfigState, i_gardErrorType).addToLog(this); + + if (i_gardErrorType != GARD_NULL) + { + setGardBit(); + } + if (i_deconfigState != NO_DECONFIG) + { + setDeconfigBit(); + } + +} // addPartCallout //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// @@ -932,6 +995,38 @@ epubSubSystem_t ErrlEntry::getSubSystem( HWAS::clockTypeEnum i_clockType ) const } /////////////////////////////////////////////////////////////////////////////// +// Map a Part type to a subsystem ID +epubSubSystem_t ErrlEntry::getSubSystem( HWAS::partTypeEnum i_partType ) const +{ + TRACDCOMP(g_trac_errl, ENTER_MRK"getSubSystem() from part type 0x%x", + i_partType); + + epubSubSystem_t subsystem = EPUB_MISC_UNKNOWN; + + const uint32_t PART_TO_SUBSYS_TABLE_ENTRIES = + sizeof(PART_TO_SUBSYS_TABLE)/sizeof(PART_TO_SUBSYS_TABLE[0]); + + for (uint32_t i = 0; i < PART_TO_SUBSYS_TABLE_ENTRIES; i++) + { + if (PART_TO_SUBSYS_TABLE[i].xType == i_partType) + { + subsystem = PART_TO_SUBSYS_TABLE[i].xSubSys; + break; + } + } + + if(subsystem == EPUB_MISC_UNKNOWN) + { + TRACFCOMP(g_trac_errl,"WRN>> Failed to find subsystem ID for part type 0x%x", + i_partType); + } + + TRACDCOMP(g_trac_errl, EXIT_MRK"getSubSystem() ssid 0x%x", subsystem); + return subsystem; +} + + +/////////////////////////////////////////////////////////////////////////////// // for use by ErrlManager void ErrlEntry::processCallout() { diff --git a/src/usr/errl/errludcallout.C b/src/usr/errl/errludcallout.C index 380a901b0..2aa851d64 100644 --- a/src/usr/errl/errludcallout.C +++ b/src/usr/errl/errludcallout.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -70,6 +72,39 @@ ErrlUserDetailsCallout::ErrlUserDetailsCallout( } // Clock callout //------------------------------------------------------------------------------ +// Part callout +ErrlUserDetailsCallout::ErrlUserDetailsCallout( + const void *i_pTargetData, + uint32_t i_targetDataLength, + const HWAS::partTypeEnum i_partType, + const HWAS::callOutPriority i_priority, + const HWAS::DeconfigEnum i_deconfigState, + const HWAS::GARD_ErrorType i_gardErrorType) +{ + TRACDCOMP(g_trac_errl, "PartCallout entry"); + + // Set up ErrlUserDetails instance variables + iv_CompId = ERRL_COMP_ID; + iv_Version = 1; + iv_SubSection = ERRL_UDT_CALLOUT; + + uint32_t pDataLength = sizeof(HWAS::callout_ud_t) + i_targetDataLength; + HWAS::callout_ud_t *pData; + pData = reinterpret_cast<HWAS::callout_ud_t *> + (reallocUsrBuf(pDataLength)); + pData->type = HWAS::PART_CALLOUT; + pData->partType = i_partType; + pData->priority = i_priority; + pData->partDeconfigState = i_deconfigState; + pData->partGardErrorType = i_gardErrorType; + memcpy(pData + 1, i_pTargetData, i_targetDataLength); + + TRACDCOMP(g_trac_errl, "PartCallout exit; pDataLength %d", pDataLength); + +} // Part callout + + +//------------------------------------------------------------------------------ // Bus callout ErrlUserDetailsCallout::ErrlUserDetailsCallout( const void *i_pTarget1Data, diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H index 9b58e5b66..fad693e2d 100644 --- a/src/usr/errl/plugins/errludcallout.H +++ b/src/usr/errl/plugins/errludcallout.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -126,6 +128,62 @@ case HWAS::_type: i_parser.PrintString( "GARD Error Type", #_type); break; break; // CLOCK_CALLOUT } + case HWAS::PART_CALLOUT: + { + switch (ntohl(pData->partType)) + { +#define case_PART_TYPE(_type) \ +case HWAS::_type: i_parser.PrintString( "Part Type", #_type); break; + case_PART_TYPE(FLASH_CONTROLLER_PART_TYPE) + case_PART_TYPE(PNOR_PART_TYPE) + case_PART_TYPE(SBE_SEEPROM_PART_TYPE) + case_PART_TYPE(BOARD_VPD_PART_TYPE) + case_PART_TYPE(LPC_SLAVE_PART_TYPE) + case_PART_TYPE(CENTAUR_GPIO_EXPANDER_PART_TYPE) + case_PART_TYPE(VOLTAGE_REGULATOR_PART_TYPE) + default: + i_parser.PrintNumber( "Part Type", "UNKNOWN: 0x%X", + ntohl(pData->partType) ); + } // switch partType +#undef case_PART_TYPE + switch (ntohl(pData->partDeconfigState)) + { +#define case_DECONFIG_STATE(_type) \ +case HWAS::_type: i_parser.PrintString( "Deconfig State", #_type); break; + case_DECONFIG_STATE(NO_DECONFIG) + case_DECONFIG_STATE(DECONFIG) + case_DECONFIG_STATE(DELAYED_DECONFIG) + default: + i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", + ntohl(pData->partDeconfigState) ); + break; + } // switch partDeconfigState +#undef case_DECONFIG_STATE + switch (ntohl(pData->partGardErrorType)) + { +#define case_GARD_ERROR_TYPE(_type) \ +case HWAS::_type: i_parser.PrintString( "GARD Error Type", #_type); break; + case_GARD_ERROR_TYPE(GARD_NULL) + case_GARD_ERROR_TYPE(GARD_User_Manual) + case_GARD_ERROR_TYPE(GARD_Unrecoverable) + case_GARD_ERROR_TYPE(GARD_Fatal) + case_GARD_ERROR_TYPE(GARD_Predictive) + case_GARD_ERROR_TYPE(GARD_Power) + case_GARD_ERROR_TYPE(GARD_PHYP) + case_GARD_ERROR_TYPE(GARD_Void) + default: + i_parser.PrintNumber( "Deconfig State", "UNKNOWN: 0x%X", + ntohl(pData->partGardErrorType) ); + break; + } // switch partGardErrorType +#undef case_GARD_ERROR_TYPE + // what follows the pData structure is one entity path + // print it out + uint8_t *l_ptr = reinterpret_cast<uint8_t *>(pData+1); + printEntityPath(l_ptr, i_parser, "Target"); + + break; // PART_CALLOUT + } case HWAS::BUS_CALLOUT: { switch (ntohl(pData->busType)) diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index a08d49a8d..3ef76f3ec 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -454,6 +456,7 @@ public: deconfigCount++; errlCommit(errl, CXXTEST_COMP_ID); + errl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, ERRORLOG::ERRL_TEST_MOD_ID, @@ -464,6 +467,8 @@ public: HWAS::SRCI_PRIORITY_HIGH); errlCommit(errl, CXXTEST_COMP_ID); + + errl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, ERRORLOG::ERRL_TEST_MOD_ID, @@ -482,6 +487,15 @@ public: HWAS::NO_DECONFIG, HWAS::GARD_NULL); + // Part callout using deconfig/GARD parameters + errl->addPartCallout( + pExList[0], + HWAS::PNOR_PART_TYPE, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::NO_DECONFIG, + HWAS::GARD_NULL); + + if (pExList.size() > 1) { errl->addBusCallout( diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C index 511dc61eb..92c5a8e7b 100644 --- a/src/usr/hwas/common/hwasCallout.C +++ b/src/usr/hwas/common/hwasCallout.C @@ -210,6 +210,30 @@ void processCallout(errlHndl_t &io_errl, } break; } // CLOCK_CALLOUT + case (PART_CALLOUT): + { + TARGETING::Target *pTarget = NULL; + uint8_t * l_uData = (uint8_t *)(pCalloutUD + 1); + bool l_err = retrieveTarget(l_uData, pTarget, io_errl); + + if (!l_err) + { + errlHndl_t errl = platHandlePartCallout( + pTarget, + pCalloutUD->partType, + pCalloutUD->priority, + io_errl, + pCalloutUD->deconfigState, + pCalloutUD->gardErrorType); + if (errl) + { + HWAS_ERR("processCallout: error platHandlePartCallout"); + errlCommit(errl, HWAS_COMP_ID); + } + } + break; + } // PART_CALLOUT + default: { HWAS_ERR("bad data in Callout UD %x", pCalloutUD->type); diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C index 1419c8c36..42df78b7d 100644 --- a/src/usr/hwas/hwasPlatCallout.C +++ b/src/usr/hwas/hwasPlatCallout.C @@ -256,4 +256,27 @@ errlHndl_t platHandleClockCallout( return pError; } +//****************************************************************************** +// platHandleClockCallout +//****************************************************************************** +errlHndl_t platHandlePartCallout( + TARGETING::Target *i_pTarget, + partTypeEnum i_partType, + callOutPriority i_priority, + errlHndl_t &io_errl, + DeconfigEnum i_deconfigState, + GARD_ErrorType i_gardErrorType) +{ + // WARNING: + // this hostboot code should not change io_errl, unless the caller of the + // processCallouts() function also changes, as today it (errlentry.C) calls + // from the errlEntry object + + errlHndl_t errl = NULL; + + // Hostboot does not handle or do any action for part callouts + return errl; +} + + } // namespace HWAS diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 681e1211f..a6e72b243 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -1729,10 +1729,13 @@ namespace SBE sbeInfoSize_ECC)); err->collectTrace(SBE_COMP_NAME); - err->addHwCallout( io_sbeState.target, - HWAS::SRCI_PRIORITY_HIGH, - HWAS::NO_DECONFIG, - HWAS::GARD_NULL ); + + err->addPartCallout( + io_sbeState.target, + HWAS::SBE_SEEPROM_PART_TYPE, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::NO_DECONFIG, + HWAS::GARD_NULL ); ErrlUserDetailsTarget(io_sbeState.target).addToLog(err); @@ -3342,7 +3345,10 @@ namespace SBE mP); err->collectTrace(SBE_COMP_NAME); - err->addHwCallout( io_sbeStates_v[i].target, + + err->addPartCallout( + io_sbeStates_v[i].target, + HWAS::SBE_SEEPROM_PART_TYPE, HWAS::SRCI_PRIORITY_HIGH, HWAS::NO_DECONFIG, HWAS::GARD_NULL ); @@ -3546,9 +3552,11 @@ namespace SBE { // Add FFDC and Commit the error log created here err->collectTrace(SBE_COMP_NAME); - err->addHwCallout( io_sbeStates_v[i].target, + err->addPartCallout( + io_sbeStates_v[i].target, + HWAS::SBE_SEEPROM_PART_TYPE, HWAS::SRCI_PRIORITY_HIGH, - HWAS::DECONFIG, + HWAS::NO_DECONFIG, HWAS::GARD_NULL ); ErrlUserDetailsTarget(io_sbeStates_v[mP].target, |