diff options
Diffstat (limited to 'src/usr/diag/prdf')
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_nimbus.rule | 26 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C | 196 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C (renamed from src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.C) | 244 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.H | 66 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk | 1 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.H | 171 |
6 files changed, 386 insertions, 318 deletions
diff --git a/src/usr/diag/prdf/common/plat/p9/p9_nimbus.rule b/src/usr/diag/prdf/common/plat/p9/p9_nimbus.rule index 71d87b3c6..633790afe 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_nimbus.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_nimbus.rule @@ -716,6 +716,24 @@ chip p9_nimbus }; ############################################################################ + # N3 Chiplet PBEXTFIR + ############################################################################ + + # External checkstop register - Used for FFDC and Fabric sorting only + # Any attention generated from this FIR register indicates that there was a + # checkstop attention raised on another chip. Currently, we do not do any + # additional analysis in this FIR because we assume we will get an interrupt + # from the offending chip. This FIR will set PB_CHIPLET_FIR[2] which is + # currently ignored. + + register PBEXTFIR + { + name "PowerBus EH EXTFIR"; + scomaddr 0x05011C2E; + capture group default; + }; + + ############################################################################ # P9 chip N3_LFIR ############################################################################ @@ -1727,6 +1745,14 @@ chip p9_nimbus scomaddr 0x00002816; capture group never; }; + + register TODWOF + { + name "Time of Day / WOF Counter"; + scomaddr 0x00040020; + capture group default; + }; + }; ############################################################################## diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C index 643180e70..665099294 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C @@ -35,9 +35,13 @@ // Platform includes +using namespace TARGETING; + namespace PRDF { +using namespace PlatServices; + namespace Proc { @@ -59,13 +63,201 @@ int32_t CheckForRecovered( ExtensibleChip * i_chip, { o_hasRecovered = false; - // TODO: RTC 152590 Will be implemented later. + int32_t l_rc = SUCCESS; + + SCAN_COMM_REGISTER_CLASS * l_grer = i_chip->getRegister("GLOBAL_RE_FIR"); + l_rc = l_grer->Read(); + + if ( SUCCESS != l_rc ) + { + PRDF_ERR("[CheckForRecovered] GLOBAL_RE_FIR read failed" + "for 0x%08x", i_chip->GetId()); + } + else if ( 0 != l_grer->GetBitFieldJustified(1,55) ) + { + o_hasRecovered = true; + } return SUCCESS; } PRDF_PLUGIN_DEFINE_NS( p9_nimbus, Proc, CheckForRecovered ); +//------------------------------------------------------------------------------ +/** + * @brief Used when the chip is queried, by the fabric domain, for RECOVERED + * attentions to assign a severity to the attention for sorting. + * @param[in] i_chip - P8 chip + * @param[out] o_sev - Priority order (lowest to highest): + * 1 - Core chiplet checkstop + * 2 - Core chiplet error + * 3 - PCB chiplet error (TOD logic) + * 4 - Other error + * 5 - Memory controller chiplet + * + * @return SUCCESS + * + */ +int32_t CheckForRecoveredSev(ExtensibleChip * i_chip, uint32_t & o_sev) +{ + int32_t o_rc = SUCCESS; + bool l_runtime = atRuntime(); + + SCAN_COMM_REGISTER_CLASS * l_rer = NULL; + + SCAN_COMM_REGISTER_CLASS * l_unitxstp = NULL; + if ( l_runtime ) + { + l_unitxstp = i_chip->getRegister("GLOBAL_UCS_FIR"); + o_rc |= l_unitxstp->Read(); + } + + l_rer = i_chip->getRegister("GLOBAL_RE_FIR"); + o_rc |= l_rer->Read(); + + if (o_rc) + { + PRDF_ERR( "[CheckForRecoveredSev] SCOM fail on 0x%08x rc=%x", + i_chip->GetId(), o_rc); + return o_rc; + } + + if (l_rer->GetBitFieldJustified(7,2)) + { + // errors from MC chiplets + o_sev = 5; + } + else if(l_rer->GetBitFieldJustified(2, 4) || + l_rer->GetBitFieldJustified(9, 4) || + l_rer->GetBitFieldJustified(13,3) || + l_rer->IsBitSet(6)) + { + // errors from PB, Xbus, OB, or PCI chiplets + o_sev = 4; + } + else if(l_rer->IsBitSet(1)) + { + // error from TP + o_sev = 3; + } + else if (l_rer->GetBitFieldJustified(16,6)) + { + // error from EQ + o_sev = 2; + } + else if(l_runtime && + (l_rer->GetBitFieldJustified(32,24) & + l_unitxstp->GetBitFieldJustified(32,24)) == 0 ) + { + // core recoverable + o_sev = 2; + } + else + { + // core checkstop + o_sev = 1; + } + + return SUCCESS; + +} +PRDF_PLUGIN_DEFINE_NS( p9_nimbus, Proc, CheckForRecoveredSev ); + +/** @func GetCheckstopInfo + * To be called from the fabric domain to gather Checkstop information. This + * information is used in a sorting algorithm. + * + * This is a plugin function: GetCheckstopInfo + * + * @param i_chip - The chip. + * @param o_wasInternal - True if this chip has an internal checkstop. + * @param o_externalChips - List of external fabrics driving checkstop. + * @param o_wofValue - Current WOF value (unused for now). + */ +int32_t GetCheckstopInfo( ExtensibleChip * i_chip, + bool & o_wasInternal, + TargetHandleList & o_externalChips, + uint64_t & o_wofValue ) +{ + // Clear parameters. + o_wasInternal = false; + o_externalChips.clear(); + o_wofValue = 0; + + SCAN_COMM_REGISTER_CLASS * l_globalFir = + i_chip->getRegister("GLOBAL_CS_FIR"); + + SCAN_COMM_REGISTER_CLASS * l_pbXstpFir = + i_chip->getRegister("N3_CHIPLET_CS_FIR"); + + SCAN_COMM_REGISTER_CLASS * l_extXstpFir = + i_chip->getRegister("PBEXTFIR"); + + int32_t o_rc = SUCCESS; + o_rc |= l_globalFir->Read(); + o_rc |= l_pbXstpFir->Read(); + o_rc |= l_extXstpFir->Read(); + + if(o_rc) + { + PRDF_ERR( "[GetCheckstopInfo] SCOM fail on 0x%08x rc=%x", + i_chip->GetId(), o_rc); + return o_rc; + } + + uint8_t l_connectedXstps = l_extXstpFir->GetBitFieldJustified(0,7); + + bool pbXstpFromOtherChip = l_pbXstpFir->IsBitSet(2); + + if ((0 != l_globalFir->GetBitFieldJustified(0,56)) && + (!l_globalFir->IsBitSet(5) || !pbXstpFromOtherChip)) + o_wasInternal = true; + + // Get connected chips. + uint32_t l_positions[] = + { + 0, // bit 0 - XBUS 0 + 1, // bit 1 - XBUS 1 + 2, // bit 2 - XBUS 2 + 0, // bit 3 - OBUS 0 + 1, // bit 4 - OBUS 1 + 2, // bit 5 - OBUS 2 + 3 // bit 6 - OBUS 3 + }; + + for (uint8_t i = 0, j = 0x40; i < 7; i++, j >>= 1) + { + if (0 != (j & l_connectedXstps)) + { + TargetHandle_t l_connectedFab = + getConnectedPeerProc(i_chip->GetChipHandle(), + i<3 ? TYPE_XBUS : TYPE_OBUS, + l_positions[i]); + + if (NULL != l_connectedFab) + { + o_externalChips.push_back(l_connectedFab); + } + } + } + + // Read WOF value. + SCAN_COMM_REGISTER_CLASS * l_wof = i_chip->getRegister("TODWOF"); + o_rc |= l_wof->Read(); + + if(o_rc) + { + PRDF_ERR( "[GetCheckstopInfo] SCOM fail on 0x%08x rc=%x", + i_chip->GetId(), o_rc); + return o_rc; + } + + o_wofValue = l_wof->GetBitFieldJustified(0,64); + + return SUCCESS; + +} +PRDF_PLUGIN_DEFINE_NS( p9_nimbus, Proc, GetCheckstopInfo ); + } // end namespace Proc } // end namespace PRDF - diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.C b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C index 1bbbe1ce2..daaa33836 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.C +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.C $ */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ @@ -22,24 +22,15 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ - -// Module Description ************************************************** -// -// Description: -// -// End Module Description ********************************************** - //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- -#define prdfFabricDomain_C - #include <prdfGlobal.H> #include <iipstep.h> #include <iipsdbug.h> #include <iipErrorRegister.h> #include <iipServiceDataCollector.h> -#include <prdfFabricDomain.H> +#include <prdfP9ProcDomain.H> #include <UtilHash.H> #include <prdfPluginDef.H> @@ -47,8 +38,6 @@ #include <algorithm> -#undef prdfFabricDomain_C - using namespace TARGETING; namespace PRDF @@ -56,30 +45,7 @@ namespace PRDF using namespace PlatServices; -//---------------------------------------------------------------------- -// User Types -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Constants -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Macros -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Internal Function Prototypes -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Global Variables -//---------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// Member Function Specifications -//--------------------------------------------------------------------- -int32_t FabricDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, +int32_t ProcDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, ATTENTION_TYPE attentionType) { int32_t l_rc; @@ -88,33 +54,34 @@ int32_t FabricDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, if( l_rc == PRD_POWER_FAULT ) { - PRDF_ERR( "PrdfFabricDomain::Analyze::Power Fault detected!" ); + PRDF_ERR( "PrdfProcDomain::Analyze::Power Fault detected!" ); } else { - // Capture Global FIRs on xstp and recovered errors for domain. - if ((attentionType == MACHINE_CHECK) || (attentionType == RECOVERABLE)) - { - for (uint32_t i = 1; i < GetSize(); ++i) // start at 1 to skip analyzed. + // Capture Global FIRs on xstp and recovered errors for domain. + if ((attentionType == MACHINE_CHECK) || (attentionType == RECOVERABLE)) { - LookUp(i)->CaptureErrorData( - serviceData.service_data->GetCaptureData(), - Util::hashString("GlobalFIRs")); - - if (attentionType == MACHINE_CHECK) - { - LookUp(i)->CaptureErrorData( - serviceData.service_data->GetCaptureData(), - Util::hashString("AllFIRs")); - } + // start at 1 to skip analyzed + for (uint32_t i = 1; i < GetSize(); ++i) + { + LookUp(i)->CaptureErrorData( + serviceData.service_data->GetCaptureData(), + Util::hashString("GlobalFIRs")); + + if (attentionType == MACHINE_CHECK) + { + LookUp(i)->CaptureErrorData( + serviceData.service_data->GetCaptureData(), + Util::hashString("AllFIRs")); + } + } } - } } return l_rc; } -void FabricDomain::Order(ATTENTION_TYPE attentionType) +void ProcDomain::Order(ATTENTION_TYPE attentionType) { if (attentionType == MACHINE_CHECK) @@ -131,9 +98,9 @@ void FabricDomain::Order(ATTENTION_TYPE attentionType) SYSTEM_DEBUG_CLASS sysdbug; for (int32_t i = (GetSize() - 1); i >= 0; --i) { - RuleChip * l_fabChip = LookUp(i); + RuleChip * l_procChip = LookUp(i); TARGETING::TargetHandle_t l_pchipHandle = - l_fabChip->GetChipHandle(); + l_procChip->GetChipHandle(); bool l_analysisPending = sysdbug.isActiveAttentionPending(l_pchipHandle, attentionType ); if ( l_analysisPending ) @@ -145,11 +112,12 @@ void FabricDomain::Order(ATTENTION_TYPE attentionType) } } + // Determine the proper sorting for a checkstop based on: // 1. Find only a single chip with an internal checkstop // 2. Graph reduction algorithm // 3. WOF/TOD counters -void FabricDomain::SortForXstop() +void ProcDomain::SortForXstop() { using namespace PluginDef; using namespace TARGETING; @@ -165,7 +133,7 @@ void FabricDomain::SortForXstop() memset( &l_wofValues[0], 0x00, sizeof(l_wofValues) ); memset( &l_internalCS[0], 0x00, sizeof(l_internalCS) ); - union { uint64_t * u; CPU_WORD * c; } ptr; // zs01 + union { uint64_t * u; CPU_WORD * c; } ptr; SYSTEM_DEBUG_CLASS sysDebug; TargetHandle_t node = NULL; @@ -183,32 +151,33 @@ void FabricDomain::SortForXstop() // We should never reach here. Even if we reach here, as this is // XSTOP, we would like to go ahead with analysis to have as much // data as possible. So just print a trace. - PRDF_ERR("[FabricDomain::SortForXstop] Node is Null"); + PRDF_ERR("[ProcDomain::SortForXstop] Node is Null"); } } + // Get internal setting and external driver list for each chip. for(uint32_t i = 0; i < GetSize(); ++i) { l_externalDrivers[i] = 0; l_wofValues[i] = 0; - RuleChip * l_fabChip = LookUp(i); + RuleChip * l_procChip = LookUp(i); // if it is a node check stop, limit the scope of sorting only to the // node which is causing ATTN to invoke PRD. if ( ( NULL != node ) && ( node != getConnectedParent( - l_fabChip->GetChipHandle(), TYPE_NODE) )) + l_procChip->GetChipHandle(), TYPE_NODE) )) continue; - ptr.u = &l_externalDrivers[i]; // zs01 - BitString l_externalChips(GetSize(), ptr.c); // zs01 + ptr.u = &l_externalDrivers[i]; + BitString l_externalChips(GetSize(), ptr.c); TargetHandleList l_tmpList; // Call "GetCheckstopInfo" plugin. ExtensibleChipFunction * l_extFunc - = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); + = l_procChip->getExtensibleFunction("GetCheckstopInfo"); - (*l_extFunc)(l_fabChip, + (*l_extFunc)(l_procChip, bindParm<bool &, TargetHandleList &, uint64_t &> (l_internalCS[i], l_tmpList, @@ -218,7 +187,7 @@ void FabricDomain::SortForXstop() // Update bit buffer. - for (TargetHandleList::iterator j = l_tmpList.begin(); + for (auto j = l_tmpList.begin(); j != l_tmpList.end(); ++j) { for (uint32_t k = 0; k < GetSize(); k++) @@ -237,12 +206,12 @@ void FabricDomain::SortForXstop() // Check if we are done... only one with an internal error. if (1 == l_internalOnlyCount) { - MoveToFront(l_chip); //pw03 + MoveToFront(l_chip); return; } else if (0 == l_internalOnlyCount) { - PRDF_TRAC("[FabricDomain::SortForXstop] continue " + PRDF_TRAC("[ProcDomain::SortForXstop] continue " "with analysis to determine which chip " "sourced the error."); } @@ -270,7 +239,7 @@ void FabricDomain::SortForXstop() for (uint32_t j = 0; j < GetSize(); j++) { ptr.u = &l_externalDrivers[i]; // zs01 - if ( BitString(GetSize(), ptr.c).IsSet(j) ) // zs01 + if ( BitString(GetSize(), ptr.c).IsSet(j) ) l_current.Set(j); } } @@ -284,7 +253,7 @@ void FabricDomain::SortForXstop() if ((l_prev.IsSet(i)) && (l_internalCS[i] || (0 == l_internalOnlyCount))) { - MoveToFront(i); //pw03 + MoveToFront(i); return; } } @@ -300,12 +269,11 @@ void FabricDomain::SortForXstop() if ((l_internalCS[i] || (0 == l_internalOnlyCount))) l_minWof = i; } - MoveToFront(l_minWof); //pw03 + MoveToFront(l_minWof); return; +} -}; - -namespace __prdfFabricDomain // pw03 --- +namespace __prdfProcDomain { // This function is used for the std::max_element function in SortForRecov // to ensure that elements towards the end of the list are favored (and @@ -318,9 +286,9 @@ namespace __prdfFabricDomain // pw03 --- } return l < r; } -}; // --- pw03 +}; -void FabricDomain::SortForRecov() +void ProcDomain::SortForRecov() { using namespace PluginDef; @@ -331,101 +299,85 @@ void FabricDomain::SortForRecov() // Loop through all chips. for ( uint32_t i = 0; i < GetSize(); ++i ) { - RuleChip * l_fabChip = LookUp(i); - TARGETING::TargetHandle_t l_pchipHandle = l_fabChip->GetChipHandle(); + RuleChip * l_procChip = LookUp(i); + TARGETING::TargetHandle_t l_pchipHandle = l_procChip->GetChipHandle(); //check if chip has an attention which has not been analyzed as yet if( sysdbug.isActiveAttentionPending( l_pchipHandle, RECOVERABLE ) ) { // Find severity level. ExtensibleChipFunction * l_extFunc - = l_fabChip->getExtensibleFunction( + = l_procChip->getExtensibleFunction( "CheckForRecoveredSev"); - (*l_extFunc)(l_fabChip, bindParm<uint32_t &>( l_sev[i] )); + (*l_extFunc)(l_procChip, bindParm<uint32_t &>( l_sev[i] )); } } // Find item with highest severity. MoveToFront(std::distance(&l_sev[0], - std::max_element(&l_sev[0], - &l_sev[GetSize()], - __prdfFabricDomain::lessThanOperator)) - ); + std::max_element(&l_sev[0], + &l_sev[GetSize()], + __prdfProcDomain::lessThanOperator))); } - //Analyze a subset of chips in a Domain... -//This is a mini analysis of some of the chips in the Fabric Domain. -int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, - ATTENTION_TYPE attentionType, - TARGETING::TargetHandleList & i_chips) +//This is a mini analysis of some of the chips in the Proc Domain. +int32_t ProcDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips) { using namespace TARGETING ; - PRDF_DENTER( "FabricDomain::AnalyzeTheseChips" ); + PRDF_DENTER( "ProcDomain::AnalyzeTheseChips" ); int32_t l_rc = ~SUCCESS; - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips:: Domain ID = 0x%X", GetId() ); + PRDF_DTRAC( "ProcDomain::AnalyzeTheseChips:: Domain ID = 0x%X", GetId() ); if(i_chips.size() != 0) { - - for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) - { - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Before--chip=0x%X", - PlatServices::getHuid(*i)); - } - OrderTheseChips(attentionType, i_chips); - for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + // After the Order function is called the first chip should contain the + // chip to look at. + RuleChip * l_procChip = FindChipInTheseChips(i_chips[0], i_chips); + PRDF_DTRAC( "ProcDomain::AnalyzeTheseChips::Analyzing this one: 0x%X", + l_procChip->GetId() ); + if(NULL != l_procChip) { - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::After--chip=0x%X", - PlatServices::getHuid(*i) ); - } - //After the Order function is called the first chip should contain the chip to look at. - //Look here for the correct LookUp function. I don't think this is working. - RuleChip * l_fabChip = FindChipInTheseChips(i_chips[0], i_chips); - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Analyzing this one: 0x%X", - l_fabChip->GetId() ); - if(NULL != l_fabChip) - { - l_rc = l_fabChip->Analyze(serviceData, attentionType); + l_rc = l_procChip->Analyze(serviceData, attentionType); } else { - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::l_fabChip is NULL" ); + PRDF_TRAC( "ProcDomain::AnalyzeTheseChips::l_procChip is NULL" ); l_rc = ~SUCCESS; } } else { - PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::i_chips = %d", + PRDF_TRAC( "ProcDomain::AnalyzeTheseChips::i_chips = %d", i_chips.size() ); } - //Get P7 chip Global FIR data for FFDC - for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + //Get Proc chip Global FIR data for FFDC + for (auto i = i_chips.begin(); i != i_chips.end(); ++i) { - RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); - l_fabChip->CaptureErrorData( + RuleChip * l_procChip = FindChipInTheseChips(*i, i_chips); + l_procChip->CaptureErrorData( serviceData.service_data->GetCaptureData(), Util::hashString("GlobalFIRs")); } - - PRDF_DEXIT( "FabricDomain::AnalyzeTheseChips" ); + PRDF_DEXIT( "ProcDomain::AnalyzeTheseChips" ); return l_rc; } - -int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, +int32_t ProcDomain::OrderTheseChips(ATTENTION_TYPE attentionType, TARGETING::TargetHandleList & i_chips) { using namespace PluginDef; using namespace TARGETING; - PRDF_DENTER( "FabricDomain::OrderTheseChips" ); + PRDF_DENTER( "ProcDomain::OrderTheseChips" ); uint32_t l_internalOnlyCount = 0; uint64_t l_externalDrivers[i_chips.size()]; @@ -437,22 +389,23 @@ int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, uint32_t l_chip = 0; uint32_t l_chipToFront = 0; // Get internal setting and external driver list for each chip. - for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) + for (auto i = i_chips.begin(); + i != i_chips.end(); ++i) { - RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); + RuleChip * l_procChip = FindChipInTheseChips(*i, i_chips); ptr.u = &l_externalDrivers[l_chip]; BitString l_externalChips(i_chips.size(), ptr.c); TargetHandleList l_tmpList; - if(l_fabChip != NULL) + if(l_procChip != NULL) { // Call "GetCheckstopInfo" plugin. ExtensibleChipFunction * l_extFunc - = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); + = l_procChip->getExtensibleFunction("GetCheckstopInfo"); - (*l_extFunc)(l_fabChip, + (*l_extFunc)(l_procChip, bindParm<bool &, TargetHandleList &, uint64_t &> (l_internalCS[l_chip], l_tmpList, @@ -463,13 +416,13 @@ int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, else { l_internalCS[l_chip] = false; - PRDF_DTRAC( "FabricDomain::OrderTheseChips: l_fabChip is NULL" ); + PRDF_DTRAC( "ProcDomain::OrderTheseChips: l_procChip is NULL" ); } //If we are just checking for internal errors then there is no need for //a list of what chips sent checkstops where. // Update bit buffer. - for (TargetHandleList::iterator j = l_tmpList.begin(); + for (auto j = l_tmpList.begin(); j != l_tmpList.end(); ++j) { @@ -494,43 +447,44 @@ int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, return(SUCCESS); } - PRDF_DEXIT( "FabricDomain::OrderTheseChips" ); + PRDF_DEXIT( "ProcDomain::OrderTheseChips" ); return(SUCCESS); } -//This function is to ensure the order of the chip in the list is the correct chip. -//Because there is no garaunteed order within the domain container this is necessary. -RuleChip * FabricDomain::FindChipInTheseChips(TARGETING::TargetHandle_t i_pchipHandle, TARGETING::TargetHandleList & i_chips) +RuleChip * ProcDomain::FindChipInTheseChips(TargetHandle_t i_pchipHandle, + TargetHandleList & i_chips) { using namespace TARGETING; - PRDF_DENTER( "FabricDomain::FindChipNumber" ); - RuleChip * l_fabChip = NULL; - TargetHandle_t l_tmpfabHandle= NULL; + PRDF_DENTER( "ProcDomain::FindChipNumber" ); + RuleChip * l_procChip = NULL; + TargetHandle_t l_tmpprocHandle= NULL; // Loop through all chips. - for (TargetHandleList::iterator iter = i_chips.begin(); iter != i_chips.end(); ++iter) + for (auto iter = i_chips.begin(); + iter != i_chips.end(); ++iter) { for (uint32_t i = 0; i < GetSize(); ++i) { - l_fabChip = LookUp(i); - l_tmpfabHandle = l_fabChip->GetChipHandle(); - if( (l_tmpfabHandle == (*iter)) && (l_tmpfabHandle == i_pchipHandle) ) return(l_fabChip); + l_procChip = LookUp(i); + l_tmpprocHandle = l_procChip->GetChipHandle(); + if( (l_tmpprocHandle == (*iter)) && + (l_tmpprocHandle == i_pchipHandle) ) return(l_procChip); } } - PRDF_DEXIT( "FabricDomain::FindChipNumber" ); + PRDF_DEXIT( "ProcDomain::FindChipNumber" ); return(NULL); } //Swaps chip at location 0 with a chip at location i_chipToFront -void FabricDomain::MoveToFrontInTheseChips(uint32_t i_chipToFront, TARGETING::TargetHandleList & i_chips) +void ProcDomain::MoveToFrontInTheseChips(uint32_t i_chipToFront, + TargetHandleList & i_chips) { - using namespace TARGETING; - - for (TargetHandleList::iterator i = i_chips.begin()+i_chipToFront; i != i_chips.begin(); i--) + for (auto i = i_chips.begin()+i_chipToFront; + i != i_chips.begin(); i--) { std::swap((*i), (*(i-1))); } } -} //End namespace PRDF +} //end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.H b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.H index 8022f563c..cddc6612d 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.H +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.H @@ -44,6 +44,72 @@ class ProcDomain : public RuleChipDomain RuleChipDomain( i_did, i_size ) {} + /** + * @brief Determin which chip to Analyze and call it's Analyze() function + * @param serviceData Service data collector + * @param attentionType attention type + * @return return code (0 == SUCCESS) + */ + virtual int32_t Analyze( STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType ); + + /** + * @brief Determine which chip to Analyze in a list of chips in this domain + * @note This main only analyze one chip in the domain. + * Not the whole domain. + * @param serviceData Service data collector + * @param attentionType Attention of the chip + * @param i_chips List of chips in the domain to analyze + * @return SUCCESS + */ + virtual int32_t AnalyzeTheseChips( STEP_CODE_DATA_STRUCT & serviceData, + ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips ); + /** + * @brief Order chips in a list of chips in this domain. + * @note + * @param attentionType Attention of the chip + * @param i_chips List of chips in the domain to analyze + * @return SUCCESS + */ + virtual int32_t OrderTheseChips( ATTENTION_TYPE attentionType, + TARGETING::TargetHandleList & i_chips ); + + /** + * @brief Finds the pointer to the appropriate chip to do analysis or other + * @note Just a function to help keep order in a subset of the domain + * @param i_chipId Handle of the chip to find + * @param i_chips List of chips in the domain to analyze + * @return SUCCESS + */ + virtual RuleChip * FindChipInTheseChips( TARGETING::TargetHandle_t + i_chipId, + TARGETING::TargetHandleList & + i_chips ); + + /** + * @brief Moves the chip in question to the front of the list of chips. + * @param i_chipToFront The chip that should be in the front of the list. + * @param i_chips List of chips in the domain to analyze. + * @return SUCCESS + */ + virtual void MoveToFrontInTheseChips( uint32_t i_chipToFront, + TARGETING::TargetHandleList & i_chips ); + +protected: + + /** + * @brief Determine which chip to Analyze and call it's Analyze() function + * @param attentionType Attention of the chip + * @return SUCCESS + */ + virtual void Order(ATTENTION_TYPE attentionType); + + /** + @brief Determine which chip to Analyze and put at front of list. + */ + virtual void SortForXstop(); + virtual void SortForRecov(); }; } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk b/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk index 20563c656..7bcc19d32 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk +++ b/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk @@ -41,6 +41,7 @@ prd_incpath += ${PRD_SRC_PATH}/common/plat/p9 prd_obj += prdfP9Configurator.o prd_obj += prdfP9PllDomain.o prd_obj += prdfFsiCapUtil.o +prd_obj += prdfP9ProcDomain.o # rule plugin related prd_rule_plugin += prdfP9Proc.o diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.H b/src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.H deleted file mode 100755 index b5ae10f41..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.H +++ /dev/null @@ -1,171 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfFabricDomain.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* [+] 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. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef prdfFabricDomain_H -#define prdfFabricDomain_H - -//-------------------------------------------------------------------- -// Includes -//-------------------------------------------------------------------- -#if !defined(iipCallResolutionTemplate_h) - #include <iipCallResolutionTemplate.h> -#endif - -#include <prdfRuleChipDomain.H> -#include <prdfPlatServices.H> - -//-------------------------------------------------------------------- -// Forward References -//-------------------------------------------------------------------- -/** - @file prdfFabricDomain.H - @brief Fabric Domain, contains Fabric Chips - @author Mike Kobler -*/ - -namespace PRDF -{ - -class FabricDomain : public RuleChipDomain -{ - public: - - /** - * @brief Constructor - * @param i_did The domain ID - * @param i_size The projected size of the domain - */ - FabricDomain( DOMAIN_ID i_did, uint32_t i_size = PROC_DOMAIN_SIZE ) : - RuleChipDomain( i_did, i_size ) - {} - - /* - Destructor - <ul> - <br><b>Parameters: </b> None. - <br><b>Returns: </b> No value returned - <br><b>Requirements:</b> None. - <br><b>Promises: </b> None. - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> Compiler default sufficient - </ul><br> - */ - //~FabricDomain(); - - /* - Determin which chip to Analyze and call it's Analyze() function - <ul> - <br><b>Parameter: </b> serviceData (See iipServiceDataCollector.h) - <br><b>Parameter: </b> attentionType [MACHINE_CHECK|RECOVERED|SPECIAL] - <br><b>Returns: </b> return code (0 == SUCCESS) - <br><b>Requirements:</b> Query() == true, Initialize() - <br><b>Promises: </b> serviceData complete - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> This implementation calls Order() to determin - which chip to analyze and calls that chips - Analyze() function. - </ul><br> - */ - virtual int32_t Analyze( STEP_CODE_DATA_STRUCT & serviceData, - ATTENTION_TYPE attentionType ); - - /** - * @brief Determine which chip to Analyze in a list of chips in this domain. - * @note This main only analyze one chip in the domain. Not the whole domain. - * @param serviceData Service data collector. - * @param attentionType Attention of the chip. - * @param i_chips List of chips in the domain to analyze. - * @return SUCCESS - */ - virtual int32_t AnalyzeTheseChips( STEP_CODE_DATA_STRUCT & serviceData, - ATTENTION_TYPE attentionType, - TARGETING::TargetHandleList & i_chips ); - /** - * @brief Order chips in a list of chips in this domain. - * @note - * @param attentionType Attention of the chip. - * @param i_chips List of chips in the domain to analyze. - * @return SUCCESS - */ - virtual int32_t OrderTheseChips( ATTENTION_TYPE attentionType, - TARGETING::TargetHandleList & i_chips ); - - /** - * @brief Finds the pointer to the appropriate chip to do analysis or other. - * @note Just a function to help keep order in a subset of the domain. - * @param i_chipId Handle of the chip to find. - * @param i_chips List of chips in the domain to analyze. - * @return SUCCESS - */ - virtual RuleChip * FindChipInTheseChips( TARGETING::TargetHandle_t i_chipId, - TARGETING::TargetHandleList & i_chips ); - - /** - * @brief Moves the chip in question to the front of the list of chips. - * @note This gives analysis some good chance of finding the correct chip first. - * @param i_chipToFront The chip that should be in the front of the list. - * @param i_chips List of chips in the domain to analyze. - * @return SUCCESS - */ - virtual void MoveToFrontInTheseChips( uint32_t i_chipToFront, - TARGETING::TargetHandleList & i_chips ); - -protected: - - /** - Determin which chip to Analyze and call it's Analyze() function - <ul> - <br><b>Parameter: </b> attentionType [MACHINE_CHECK|RECOVERED|SPECIAL] - <br><b>Returns: </b> return code (0 == SUCCESS) - <br><b>Requirements:</b> Query() == true, Initialize() - <br><b>Promises: </b> chip at attention at top of list - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> - </ul><br> - */ - virtual void Order(ATTENTION_TYPE attentionType); - - /** - Determine which chip to Analyze on checkstop and put at front of list. - <ul> - <br><b>Parameters: </b> None. - <br><b>Returns: </b> None. - <br><b>Requirements:</b> Query() == true, Initialize() - <br><b>Promises: </b> chip at attention at top of list - <br><b>Exceptions: </b> None. - <br><b>Notes: </b> - </ul><br> - */ - virtual void SortForXstop(); - virtual void SortForRecov(); - -private: // functions -private: // Data - -}; - -} // end namespace PRDF - -#endif /* prdfFabricDomain_H */ |