diff options
author | Brian Stegmiller <bjs@us.ibm.com> | 2018-05-22 16:55:47 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2018-06-17 16:35:15 -0400 |
commit | 86cda996b3fb7aece0e393b0c3dedb8a74ebb3fd (patch) | |
tree | bf897bc2e19e6e080300c1af80ab31f68074326b /src/usr | |
parent | 34768601609c2ec3e9b60ef7663c5a7f485e5793 (diff) | |
download | talos-hostboot-86cda996b3fb7aece0e393b0c3dedb8a74ebb3fd.tar.gz talos-hostboot-86cda996b3fb7aece0e393b0c3dedb8a74ebb3fd.zip |
PRD: DMI Lane Repair
Change-Id: I0c96c32387cb068138c9a7de0f73fdfeaf02af6c
RTC:144057
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59208
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60586
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>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/diag/prdf/common/plat/cen/cen_centaur_actions.rule | 12 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_dmi_actions.rule | 3 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_mc_actions.rule | 87 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C | 303 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C | 51 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/prdfPlatServices_common.C | 409 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/prdfPlatServices_common.H | 40 | ||||
-rw-r--r-- | src/usr/diag/prdf/prdf_hb_only.mk | 9 |
8 files changed, 742 insertions, 172 deletions
diff --git a/src/usr/diag/prdf/common/plat/cen/cen_centaur_actions.rule b/src/usr/diag/prdf/common/plat/cen/cen_centaur_actions.rule index 226202dfa..059359bb7 100644 --- a/src/usr/diag/prdf/common/plat/cen/cen_centaur_actions.rule +++ b/src/usr/diag/prdf/common/plat/cen/cen_centaur_actions.rule @@ -85,8 +85,7 @@ actionclass pll_unlock_UERE /** Callout the DMI BUS interface */ actionclass calloutBusInterface_dmibus { -# TODO: RTC 144057 -# funccall("calloutBusInterfacePlugin"); + funccall("calloutBusInterfacePlugin"); }; /** Callout the DMI BUS interface, threshold 1 */ @@ -108,16 +107,14 @@ actionclass calloutBusInterface_dmibus_th1_UERE actionclass spareDeployed_dmibus { calloutBusInterface_dmibus; -# TODO: RTC 144057 -# funccall("spareDeployed"); + funccall("spareDeployed"); }; /** Lane Repair: max spares exceeded */ actionclass maxSparesExceeded_dmibus_UERE { calloutBusInterface_dmibus_th1; -# TODO: RTC 144057 -# funccall("maxSparesExceeded"); + funccall("maxSparesExceeded"); SueSource; # channel failure }; @@ -125,8 +122,7 @@ actionclass maxSparesExceeded_dmibus_UERE actionclass tooManyBusErrors_dmibus { calloutBusInterface_dmibus_th1; -# TODO: RTC 144057 -# funccall("tooManyBusErrors"); + funccall("tooManyBusErrors"); }; /** Callout the DMI bus, threshold 1. Also, clear secondary MBSFIR bits. */ diff --git a/src/usr/diag/prdf/common/plat/p9/p9_dmi_actions.rule b/src/usr/diag/prdf/common/plat/p9/p9_dmi_actions.rule index 7c9afa71e..7de1662ab 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_dmi_actions.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_dmi_actions.rule @@ -36,8 +36,7 @@ actionclass analyzeConnectedMembuf_UERE actionclass dmi_bus_th_1 { -# TODO: RTC 144057 -# funccall("calloutBusInterfacePlugin"); + funccall("calloutBusInterfacePlugin"); threshold1; }; diff --git a/src/usr/diag/prdf/common/plat/p9/p9_mc_actions.rule b/src/usr/diag/prdf/common/plat/p9/p9_mc_actions.rule index 2985dbff2..78327eb55 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_mc_actions.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_mc_actions.rule @@ -23,20 +23,73 @@ # # IBM_PROLOG_END_TAG -# TODO: RTC 144057 upate actions for all four DMI buses on this MC target. -actionclass calloutBusInterface_dmi0_th_1 {}; -actionclass calloutBusInterface_dmi1_th_1 {}; -actionclass calloutBusInterface_dmi2_th_1 {}; -actionclass calloutBusInterface_dmi3_th_1 {}; -actionclass spareDeployed_dmi0 {}; -actionclass spareDeployed_dmi1 {}; -actionclass spareDeployed_dmi2 {}; -actionclass spareDeployed_dmi3 {}; -actionclass maxSparesExceeded_dmi0 {}; -actionclass maxSparesExceeded_dmi1 {}; -actionclass maxSparesExceeded_dmi2 {}; -actionclass maxSparesExceeded_dmi3 {}; -actionclass tooManyBusErrors_dmi0_UERE {}; -actionclass tooManyBusErrors_dmi1_UERE {}; -actionclass tooManyBusErrors_dmi2_UERE {}; -actionclass tooManyBusErrors_dmi3_UERE {}; +/** Lane Repair: callout Bus Interface - DMI Bus */ +/** Callout the DMI bus 0 */ +actionclass calloutDmiBus0 +{ + funccall("calloutBusInterface_DMI0"); +}; +/** Callout the DMI bus 1 */ +actionclass calloutDmiBus1 +{ + funccall("calloutBusInterface_DMI1"); +}; +/** Callout the DMI bus 2 */ +actionclass calloutDmiBus2 +{ + funccall("calloutBusInterface_DMI2"); +}; +/** Callout the DMI bus 3 */ +actionclass calloutDmiBus3 +{ + funccall("calloutBusInterface_DMI3"); +}; + +actionclass calloutBusInterface_dmi0_th_1 { calloutDmiBus0; threshold1; }; +actionclass calloutBusInterface_dmi1_th_1 { calloutDmiBus1; threshold1; }; +actionclass calloutBusInterface_dmi2_th_1 { calloutDmiBus2; threshold1; }; +actionclass calloutBusInterface_dmi3_th_1 { calloutDmiBus3; threshold1; }; + + +/** Lane Repair: spare Deployed - DMI Bus */ +actionclass spareDeployed_dmi0 +{ calloutDmiBus0; funccall("spareDeployed_DMI0"); }; +actionclass spareDeployed_dmi1 +{ calloutDmiBus1; funccall("spareDeployed_DMI1"); }; +actionclass spareDeployed_dmi2 +{ calloutDmiBus2; funccall("spareDeployed_DMI2"); }; +actionclass spareDeployed_dmi3 +{ calloutDmiBus3; funccall("spareDeployed_DMI3"); }; + + +/** Lane Repair: max spares exceeded - DMI Bus */ +actionclass maxSparesExceeded_dmi0 +{ calloutBusInterface_dmi0_th_1; funccall("maxSparesExceeded_DMI0"); }; +actionclass maxSparesExceeded_dmi1 +{ calloutBusInterface_dmi1_th_1; funccall("maxSparesExceeded_DMI1"); }; +actionclass maxSparesExceeded_dmi2 +{ calloutBusInterface_dmi2_th_1; funccall("maxSparesExceeded_DMI2"); }; +actionclass maxSparesExceeded_dmi3 +{ calloutBusInterface_dmi3_th_1; funccall("maxSparesExceeded_DMI3"); }; + + +/** Lane Repair: too many Bus Errors - DMI Bus */ +actionclass tooManyBusErrors_dmi0_UERE +{ + calloutBusInterface_dmi0_th_1; funccall("tooManyBusErrors_DMI0"); +}; +actionclass tooManyBusErrors_dmi1_UERE +{ + calloutBusInterface_dmi1_th_1; funccall("tooManyBusErrors_DMI1"); +}; +actionclass tooManyBusErrors_dmi2_UERE +{ + calloutBusInterface_dmi2_th_1; funccall("tooManyBusErrors_DMI2"); +}; +actionclass tooManyBusErrors_dmi3_UERE +{ + calloutBusInterface_dmi3_th_1; funccall("tooManyBusErrors_DMI3"); +}; + + + diff --git a/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C index 028f8f7d8..0e29cc43a 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C +++ b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C @@ -40,6 +40,7 @@ #include <prdfP9ProcMbCommonExtraSig.H> #include <hwas/common/hwasCallout.H> + using namespace TARGETING; namespace PRDF @@ -60,51 +61,69 @@ TargetHandle_t getTxBusEndPt( TargetHandle_t i_rxTrgt) { o_txTrgt = getConnectedPeerTarget( i_rxTrgt ); } + else if (TYPE_DMI == busType) + { + // Get connected memory buffer + o_txTrgt = getConnectedChild( i_rxTrgt, TYPE_MEMBUF, 0 ); + } + else if (TYPE_MEMBUF == busType) + { + // grab connected DMI parent + o_txTrgt = getConnectedParent( i_rxTrgt, TYPE_DMI ); + } PRDF_ASSERT(nullptr != o_txTrgt); return o_txTrgt; } -int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, - STEP_CODE_DATA_STRUCT & i_sc, - bool i_spareDeployed ) +// Wrapper to check appropriate eRepair MNFG flag +template<TYPE T> +bool isLaneRepairDisabled(); + +template<> +bool isLaneRepairDisabled<TYPE_OBUS>() +{ + return isFabeRepairDisabled(); +} +template<> +bool isLaneRepairDisabled<TYPE_XBUS>() +{ + return isFabeRepairDisabled(); +} +template<> +bool isLaneRepairDisabled<TYPE_DMI>() +{ + return isMemeRepairDisabled(); +} +template<> +bool isLaneRepairDisabled<TYPE_MEMBUF>() +{ + return isMemeRepairDisabled(); +} + + +template< TYPE T_RX, TYPE T_TX > +int32_t __handleLaneRepairEvent( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + bool i_spareDeployed ) { #define PRDF_FUNC "[LaneRepair::handleLaneRepairEvent] " int32_t l_rc = SUCCESS; TargetHandle_t rxBusTgt = i_chip->getTrgt(); TargetHandle_t txBusTgt = nullptr; - TYPE busType = getTargetType(rxBusTgt); + // Make predictive on first occurrence in MFG - if (isFabeRepairDisabled()) + if ( isLaneRepairDisabled<T_RX>() ) { i_sc.service_data->setServiceCall(); } - // RTC 174485 - // Need HWPs for this. Just callout bus interface for now. - if (busType == TYPE_OBUS) - { - if ( obusInSmpMode(rxBusTgt) ) - { - calloutBusInterface( i_chip, i_sc, MRU_LOW ); - i_sc.service_data->setServiceCall(); - } - else - { - PRDF_ERR( PRDF_FUNC "Lane repair only supported in SMP mode " - "obus: 0x%08x", getHuid(rxBusTgt) ); - i_sc.service_data->SetCallout( LEVEL2_SUPPORT, MRU_MED, NO_GARD ); - i_sc.service_data->SetCallout( SP_CODE, MRU_MED, NO_GARD ); - i_sc.service_data->setServiceCall(); - } - return SUCCESS; - } bool thrExceeded; // Number of clock groups on this interface. (2 for xbus, 1 for all others) - uint8_t clkGrps = (busType == TYPE_XBUS) ? 2 : 1; + uint8_t clkGrps = (T_RX == TYPE_XBUS) ? 2 : 1; std::vector<uint8_t> rx_lanes[2]; // Failing lanes on clock group 0/1 // RX-side, previously failed laned lanes stored in VPD for each clk grp std::vector<uint8_t> rx_vpdLanes[2]; @@ -123,7 +142,7 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, // Call io_read_erepair for each group for (uint8_t i=0; i<clkGrps; ++i) { - l_rc = readErepairXbus(rxBusTgt, rx_lanes[i], i); + l_rc = readErepair<T_RX>(rxBusTgt, rx_lanes[i], i); if (SUCCESS != l_rc) { PRDF_ERR( PRDF_FUNC "readErepair() failed: rxBusTgt=0x%08x", @@ -159,14 +178,14 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, l_newLaneMap64to127); // Don't read/write VPD in mfg mode if erepair is disabled - // TODO RTC: 174485 - Add support for OBUS/DMI - if ( (TYPE_XBUS == busType) && (!isFabeRepairDisabled()) ) + if ( !isLaneRepairDisabled<T_RX>() ) { // Read Failed Lanes from VPD for (uint8_t i=0; i<clkGrps; ++i) { - l_rc = getVpdFailedLanesXbus(rxBusTgt, rx_vpdLanes[i], - tx_vpdLanes[i], i); + l_rc = getVpdFailedLanes<T_RX>(rxBusTgt, rx_vpdLanes[i], + tx_vpdLanes[i], i); + if (SUCCESS != l_rc) { PRDF_ERR( PRDF_FUNC "getVpdFailedLanes() failed: " @@ -187,7 +206,7 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, "rxBusTgt=0x%08x", lane, getHuid(rxBusTgt) ); } } - } + } // end Read Failed Lanes from VPD if ( SUCCESS != l_rc) break; @@ -209,8 +228,9 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, continue; // Call Erepair to update VPD - l_rc = setVpdFailedLanesXbus(rxBusTgt, txBusTgt, - rx_lanes[i], thrExceeded, i); + l_rc = setVpdFailedLanes<T_RX, T_TX>(rxBusTgt, txBusTgt, + rx_lanes[i], thrExceeded, i); + if (SUCCESS != l_rc) { PRDF_ERR( PRDF_FUNC "setVpdFailedLanes() failed: " @@ -229,8 +249,10 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, { // Update lists of lanes from VPD rx_vpdLanes[i].clear(); tx_vpdLanes[i].clear(); - l_rc = getVpdFailedLanesXbus(rxBusTgt, rx_vpdLanes[i], - tx_vpdLanes[i], i); + l_rc = getVpdFailedLanes<T_RX>( rxBusTgt, + rx_vpdLanes[i], + tx_vpdLanes[i], i ); + if (SUCCESS != l_rc) { PRDF_ERR( PRDF_FUNC @@ -241,8 +263,8 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, } // Power down all lanes that have been saved in VPD - l_rc = powerDownLanesXbus(rxBusTgt, rx_vpdLanes[i], - tx_vpdLanes[i], i); + l_rc = powerDownLanes<T_RX>( rxBusTgt, rx_vpdLanes[i], + tx_vpdLanes[i], i ); if (SUCCESS != l_rc) { PRDF_ERR( PRDF_FUNC "powerDownLanes() failed: " @@ -259,7 +281,7 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, } while (0); // Clear FIRs - l_rc |= clearIOFirsXbus(rxBusTgt); + l_rc |= clearIOFirs<T_RX>(rxBusTgt); // This return code gets returned by the plugin code back to the rule code. // So, we do not want to give a return code that the rule code does not @@ -268,7 +290,7 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, if ( SUCCESS != l_rc ) { PRDF_ERR( PRDF_FUNC "i_chip: 0x%08x busType:%d", - i_chip->GetId(), busType ); + i_chip->GetId(), T_RX ); i_sc.service_data->SetErrorSig(PRDFSIG_ERepair_ERROR); i_sc.service_data->SetCallout(LEVEL2_SUPPORT, MRU_MED, NO_GARD); @@ -281,6 +303,70 @@ int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, #undef PRDF_FUNC } +template<> +int32_t __handleLaneRepairEvent<TYPE_OBUS, TYPE_OBUS>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + bool i_spareDeployed ) +{ + TargetHandle_t rxBusTgt = i_chip->getTrgt(); + + // Make predictive on first occurrence in MFG + if ( isLaneRepairDisabled<TYPE_OBUS>() ) + { + i_sc.service_data->setServiceCall(); + } + + // RTC 174485 + // Need HWPs for this. Just callout bus interface for now. + if ( obusInSmpMode(rxBusTgt) ) + { + calloutBusInterface( i_chip, i_sc, MRU_LOW ); + i_sc.service_data->setServiceCall(); + } + else + { + PRDF_ERR( "__handleLaneRepairEvent: Lane repair only supported " + "in SMP mode obus: 0x%08x", getHuid(rxBusTgt) ); + i_sc.service_data->SetCallout( LEVEL2_SUPPORT, MRU_MED, NO_GARD ); + i_sc.service_data->SetCallout( SP_CODE, MRU_MED, NO_GARD ); + i_sc.service_data->setServiceCall(); + } + return SUCCESS; +} + + +int32_t handleLaneRepairEvent( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + bool i_spareDeployed ) +{ + int32_t rc = SUCCESS; + TYPE trgtType = getTargetType(i_chip->getTrgt()); + switch (trgtType) + { + case TYPE_OBUS: + rc = __handleLaneRepairEvent<TYPE_OBUS,TYPE_OBUS>( i_chip, i_sc, + i_spareDeployed ); + break; + case TYPE_XBUS: + rc = __handleLaneRepairEvent<TYPE_XBUS,TYPE_XBUS>( i_chip, i_sc, + i_spareDeployed ); + break; + case TYPE_DMI: + rc = __handleLaneRepairEvent<TYPE_DMI,TYPE_MEMBUF>( i_chip, i_sc, + i_spareDeployed ); + break; + case TYPE_MEMBUF: + rc = __handleLaneRepairEvent<TYPE_MEMBUF,TYPE_DMI>( i_chip, i_sc, + i_spareDeployed ); + break; + + default: + PRDF_ASSERT( false ); // Unsupported type for handleLaneRepairEvent + } + return rc; +} + + int32_t calloutBusInterface( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc, PRDpriority i_priority ) @@ -319,7 +405,6 @@ int32_t calloutBusInterface( ExtensibleChip * i_chip, // Get the HWAS bus type. HWAS::busTypeEnum hwasType = HWAS::X_BUS_TYPE; - if ( TYPE_XBUS == rxType && TYPE_XBUS == txType ) { hwasType = HWAS::X_BUS_TYPE; @@ -328,6 +413,11 @@ int32_t calloutBusInterface( ExtensibleChip * i_chip, { hwasType = HWAS::O_BUS_TYPE; } + else if ( (TYPE_DMI == rxType && TYPE_MEMBUF == txType) || + (TYPE_MEMBUF == rxType && TYPE_DMI == txType) ) + { + hwasType = HWAS::DMI_BUS_TYPE; + } else { PRDF_ASSERT( false ); @@ -352,11 +442,13 @@ int32_t calloutBusInterface( ExtensibleChip * i_chip, #undef PRDF_FUNC } + + // Lane Repair Rule Plugins /** * @brief Handles Spare Lane Deployed Event - * @param i_chip XBUS chip. + * @param i_chip chip. * @param io_sc Step code data struct. * @return SUCCESS always */ @@ -368,12 +460,13 @@ int32_t spareDeployed( ExtensibleChip * i_chip, else return SUCCESS; } -PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, spareDeployed ); -PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, spareDeployed ); +PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, spareDeployed ); +PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, spareDeployed ); +PRDF_PLUGIN_DEFINE_NS( cen_centaur, LaneRepair, spareDeployed ); /** * @brief Handles Max Spares Exceeded Event - * @param i_chip XBUS chip. + * @param i_chip chip. * @param io_sc Step code data struct. * @return SUCCESS always */ @@ -385,12 +478,13 @@ int32_t maxSparesExceeded( ExtensibleChip * i_chip, else return SUCCESS; } -PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, maxSparesExceeded ); -PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, maxSparesExceeded ); +PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, maxSparesExceeded ); +PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, maxSparesExceeded ); +PRDF_PLUGIN_DEFINE_NS( cen_centaur, LaneRepair, maxSparesExceeded ); /** * @brief Handles Too Many Bus Errors Event - * @param i_chip XBUS chip. + * @param i_chip chip * @param io_sc Step code data struct. * @return SUCCESS always */ @@ -402,8 +496,9 @@ int32_t tooManyBusErrors( ExtensibleChip * i_chip, else return SUCCESS; } -PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, tooManyBusErrors ); -PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, tooManyBusErrors ); +PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, tooManyBusErrors ); +PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, tooManyBusErrors ); +PRDF_PLUGIN_DEFINE_NS( cen_centaur, LaneRepair, tooManyBusErrors ); /** * @brief Add callouts for a BUS interface @@ -412,13 +507,117 @@ PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, tooManyBusErrors ); * @return SUCCESS always */ int32_t calloutBusInterfacePlugin( ExtensibleChip * i_chip, - STEP_CODE_DATA_STRUCT & io_sc ) + STEP_CODE_DATA_STRUCT & io_sc ) { calloutBusInterface(i_chip, io_sc, MRU_LOW); return SUCCESS; } -PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, calloutBusInterfacePlugin ); -PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, calloutBusInterfacePlugin ); +PRDF_PLUGIN_DEFINE_NS( p9_xbus, LaneRepair, calloutBusInterfacePlugin ); +PRDF_PLUGIN_DEFINE_NS( p9_obus, LaneRepair, calloutBusInterfacePlugin ); +PRDF_PLUGIN_DEFINE_NS( p9_dmi, LaneRepair, calloutBusInterfacePlugin ); +PRDF_PLUGIN_DEFINE_NS( cen_centaur, LaneRepair, calloutBusInterfacePlugin ); + + +//------------------------------------------------------------------------------ + +#define CREATE_CALL_CHILD_LANE_REPAIR_FUNCTION( PLUGIN_FUNCTION) \ +int32_t callChildLR_##PLUGIN_FUNCTION( ExtensibleChip * i_chip, \ + TARGETING::TYPE i_type, \ + uint32_t i_pos, \ + STEP_CODE_DATA_STRUCT & io_sc) \ +{ \ + ExtensibleChip * endPoint = getConnectedChild( i_chip, i_type, i_pos ); \ +\ + if ( nullptr == endPoint ) \ + { \ + PRDF_ERR( "[callLaneRepairRulePluginOnChild_##TYPE] Connection lookup failed:" \ + " 0x%08x 0x%02x %d", i_chip->getHuid(), i_type, i_pos ); \ + io_sc.service_data->SetCallout(LEVEL2_SUPPORT, MRU_HIGH); \ + io_sc.service_data->SetCallout(i_chip->getTrgt()); \ + io_sc.service_data->SetThresholdMaskId(0); \ + } \ + else \ + { \ + /* ignore rc as this is a plugin call */ \ + PLUGIN_FUNCTION( endPoint, io_sc ); \ + } \ +\ + /* Always return SUCCESS because other rc types (ie. FAIL) */ \ + /* are not necessarily understood by plugin rule code */ \ + return SUCCESS; \ +} + + +// Create plugin calling wrapper functions +CREATE_CALL_CHILD_LANE_REPAIR_FUNCTION( calloutBusInterfacePlugin) +CREATE_CALL_CHILD_LANE_REPAIR_FUNCTION( maxSparesExceeded) +CREATE_CALL_CHILD_LANE_REPAIR_FUNCTION( spareDeployed) +CREATE_CALL_CHILD_LANE_REPAIR_FUNCTION( tooManyBusErrors) + +//------------------------------------------------------------------------------ + +#define PLUGIN_CALLOUT_INTERFACE( TYPE, POS ) \ +int32_t calloutBusInterface_##TYPE##POS( ExtensibleChip * i_chip, \ + STEP_CODE_DATA_STRUCT & io_sc ) \ +{ \ + return callChildLR_calloutBusInterfacePlugin( i_chip, TYPE_##TYPE, POS, io_sc ); \ +} \ +PRDF_PLUGIN_DEFINE_NS(p9_nimbus, LaneRepair, calloutBusInterface_##TYPE##POS);\ +PRDF_PLUGIN_DEFINE_NS(p9_cumulus, LaneRepair, calloutBusInterface_##TYPE##POS); + +PLUGIN_CALLOUT_INTERFACE( XBUS, 0 ) +PLUGIN_CALLOUT_INTERFACE( XBUS, 1 ) +PLUGIN_CALLOUT_INTERFACE( XBUS, 2 ) +PLUGIN_CALLOUT_INTERFACE( OBUS, 0 ) +PLUGIN_CALLOUT_INTERFACE( OBUS, 1 ) +PLUGIN_CALLOUT_INTERFACE( OBUS, 2 ) +PLUGIN_CALLOUT_INTERFACE( OBUS, 3 ) + + + +#undef PLUGIN_CALLOUT_INTERFACE + +//------------------------------------------------------------------------------ + +#define PLUGIN_LANE_REPAIR_DMI( TYPE, POS ) \ +int32_t calloutBusInterface_##TYPE##POS( ExtensibleChip * i_chip, \ + STEP_CODE_DATA_STRUCT & io_sc ) \ +{ \ + return callChildLR_calloutBusInterfacePlugin( i_chip, TYPE_##TYPE, POS, io_sc ); \ +} \ +PRDF_PLUGIN_DEFINE_NS( p9_mc, LaneRepair, calloutBusInterface_##TYPE##POS ); \ +\ +int32_t maxSparesExceeded_##TYPE##POS( ExtensibleChip * i_chip, \ + STEP_CODE_DATA_STRUCT & io_sc ) \ +{ \ + return callChildLR_maxSparesExceeded( i_chip, TYPE_##TYPE, POS, io_sc ); \ +} \ +PRDF_PLUGIN_DEFINE_NS( p9_mc, LaneRepair, maxSparesExceeded_##TYPE##POS ); \ +\ +int32_t spareDeployed_##TYPE##POS( ExtensibleChip * i_chip, \ + STEP_CODE_DATA_STRUCT & io_sc ) \ +{ \ + return callChildLR_spareDeployed( i_chip, TYPE_##TYPE, POS, io_sc ); \ +} \ +PRDF_PLUGIN_DEFINE_NS( p9_mc, LaneRepair, spareDeployed_##TYPE##POS ); \ +\ +int32_t tooManyBusErrors_##TYPE##POS( ExtensibleChip * i_chip, \ + STEP_CODE_DATA_STRUCT & io_sc ) \ +{ \ + return callChildLR_tooManyBusErrors( i_chip, TYPE_##TYPE, POS, io_sc ); \ +} \ +PRDF_PLUGIN_DEFINE_NS( p9_mc, LaneRepair, tooManyBusErrors_##TYPE##POS ); + +// Handle the MC chip target to DMI conversion +PLUGIN_LANE_REPAIR_DMI( DMI, 0 ) +PLUGIN_LANE_REPAIR_DMI( DMI, 1 ) +PLUGIN_LANE_REPAIR_DMI( DMI, 2 ) +PLUGIN_LANE_REPAIR_DMI( DMI, 3 ) + +#undef PLUGIN_LANE_REPAIR_DMI + +//------------------------------------------------------------------------------ + } // end namespace LaneRepair diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C index af1d304ce..c75470b74 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Proc.C @@ -493,57 +493,6 @@ PRDF_PLUGIN_DEFINE_NS( p9_cumulus, Proc, PmRecovery ); //------------------------------------------------------------------------------ -/** - * @brief Callout a bus interface (i.e. XBUS, OBUS, DMI, etc.) - * @param i_chip PROC chip. - * @param i_type The bus endpoint type. - * @param i_pos The bus endpoint position relative to the processor. - * @param io_sc The step code data struct. - * @return SUCCESS - */ -int32_t calloutBusInterface( ExtensibleChip * i_chip, TARGETING::TYPE i_type, - uint32_t i_pos, STEP_CODE_DATA_STRUCT & io_sc ) -{ - ExtensibleChip * endPoint = getConnectedChild( i_chip, i_type, i_pos ); - if ( nullptr == endPoint ) - { - PRDF_ERR( "[calloutBusInterface] connection lookup failed: 0x%08x " - "0x%02x %d", i_chip->getHuid(), i_type, i_pos ); - io_sc.service_data->SetCallout(LEVEL2_SUPPORT, MRU_HIGH); - io_sc.service_data->SetCallout(i_chip->getTrgt()); - io_sc.service_data->SetThresholdMaskId(0); - } - else - { - LaneRepair::calloutBusInterface( endPoint, io_sc, MRU_LOW ); - } - - return SUCCESS; -} -PRDF_PLUGIN_DEFINE_NS( p9_nimbus, Proc, calloutBusInterface ); -PRDF_PLUGIN_DEFINE_NS( p9_cumulus, Proc, calloutBusInterface ); - -#define PLUGIN_CALLOUT_INTERFACE( TYPE, POS ) \ -int32_t calloutBusInterface_##TYPE##POS( ExtensibleChip * i_chip, \ - STEP_CODE_DATA_STRUCT & io_sc ) \ -{ \ - return calloutBusInterface( i_chip, TYPE_##TYPE, POS, io_sc ); \ -} \ -PRDF_PLUGIN_DEFINE_NS( p9_nimbus, Proc, calloutBusInterface_##TYPE##POS ); \ -PRDF_PLUGIN_DEFINE_NS( p9_cumulus, Proc, calloutBusInterface_##TYPE##POS ); - -PLUGIN_CALLOUT_INTERFACE( XBUS, 0 ) -PLUGIN_CALLOUT_INTERFACE( XBUS, 1 ) -PLUGIN_CALLOUT_INTERFACE( XBUS, 2 ) -PLUGIN_CALLOUT_INTERFACE( OBUS, 0 ) -PLUGIN_CALLOUT_INTERFACE( OBUS, 1 ) -PLUGIN_CALLOUT_INTERFACE( OBUS, 2 ) -PLUGIN_CALLOUT_INTERFACE( OBUS, 3 ) - -#undef PLUGIN_CALLOUT_INTERFACE - -//------------------------------------------------------------------------------ - } // end namespace Proc } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C index 240266908..d11255001 100644 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C @@ -49,6 +49,11 @@ #include <p9_io_xbus_clear_firs.H> #include <p9_io_erepairAccessorHwpFuncs.H> #include <config.h> +#include <p9_io_cen_read_erepair.H> +#include <p9_io_cen_pdwn_lanes.H> +#include <p9_io_dmi_read_erepair.H> +#include <p9_io_dmi_clear_firs.H> +#include <p9_io_dmi_pdwn_lanes.H> #endif using namespace TARGETING; @@ -86,8 +91,10 @@ src/hwsv/server/hwpf2/fapi2/target_types.H for a list of all the TargetTypes //## Lane Repair functions //############################################################################## -int32_t readErepairXbus(TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, uint8_t i_clkGrp) +template<> +int32_t readErepair<TYPE_XBUS>(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + uint8_t i_clkGrp) { int32_t o_rc = SUCCESS; @@ -105,8 +112,68 @@ int32_t readErepairXbus(TargetHandle_t i_rxBusTgt, if(nullptr != err) { - PRDF_ERR( "[PlatServices::readErepair] HUID: 0x%08x io_read_erepair " - "failed", getHuid(i_rxBusTgt) ); + PRDF_ERR( "[PlatServices::readErepair] HUID: 0x%08x " + "p9_io_xbus_read_erepair failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +template<> +int32_t readErepair<TYPE_MEMBUF>(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + uint8_t i_clkGrp) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_rxBusTgt) ); + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiTrgt (i_rxBusTgt); + FAPI_INVOKE_HWP(err, + p9_io_cen_read_erepair, + fapiTrgt, + o_rxFailLanes); + + if (nullptr != err) + { + PRDF_ERR( "[PlatServices::readErepairMembuf] HUID: 0x%08x " + "p9_io_cen_restore_erepair failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +template<> +int32_t readErepair<TYPE_DMI>(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + uint8_t i_clkGrp) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_rxBusTgt) ); + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiTrgt (i_rxBusTgt); + FAPI_INVOKE_HWP(err, + p9_io_dmi_read_erepair, + fapiTrgt, + o_rxFailLanes); + + if (nullptr != err) + { + PRDF_ERR( "[PlatServices::readErepairDmi] HUID: 0x%08x " + "p9_io_dmi_read_erepair failed", getHuid(i_rxBusTgt) ); PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); o_rc = FAIL; } @@ -115,7 +182,9 @@ int32_t readErepairXbus(TargetHandle_t i_rxBusTgt, return o_rc; } -int32_t clearIOFirsXbus(TargetHandle_t i_rxBusTgt) +//------------------------------------------------------------------------------ +template<> +int32_t clearIOFirs<TYPE_XBUS>(TargetHandle_t i_rxBusTgt) { int32_t o_rc = SUCCESS; @@ -132,21 +201,82 @@ int32_t clearIOFirsXbus(TargetHandle_t i_rxBusTgt) FAPI_INVOKE_HWP(err, p9_io_xbus_clear_firs, fapiTrgt, i); if(nullptr != err) { - PRDF_ERR( "[PlatServices::clearIOFirs] HUID: 0x%08x io_clear_firs " - "failed", getHuid(i_rxBusTgt) ); + PRDF_ERR( "[PlatServices::clearIOFirs<TYPE_XBUS>] HUID: 0x%08x " + "p9_io_xbus_clear_firs failed", getHuid(i_rxBusTgt) ); PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); o_rc = FAIL; } } #endif + + return o_rc; +} + +template<> +int32_t clearIOFirs<TYPE_MEMBUF>(TargetHandle_t i_rxBusTgt) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiCenTrgt (i_rxBusTgt); + // Clear Centaur side + FAPI_INVOKE_HWP(err, + p9_io_dmi_cn_clear_firs, + fapiCenTrgt); + + if (nullptr != err) + { + PRDF_ERR( "[PlatServices::clearIOFirs<TYPE_MEMBUF>] HUID: 0x%08x " + "p9_io_dmi_cn_clear_firs failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +template<> +int32_t clearIOFirs<TYPE_DMI>(TargetHandle_t i_rxBusTgt) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiTrgt (i_rxBusTgt); + + FAPI_INVOKE_HWP(err, + p9_io_dmi_proc_clear_firs, + fapiTrgt); + + if (nullptr != err) + { + PRDF_ERR( "[PlatServices::clearIOFirs<TYPE_DMI>] HUID: 0x%08x " + "p9_io_dmi_proc_clear_firs failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif return o_rc; } -int32_t powerDownLanesXbus(TargetHandle_t i_rxBusTgt, - const std::vector<uint8_t> &i_rxFailLanes, - const std::vector<uint8_t> &i_txFailLanes, - uint8_t i_clkGrp) +//------------------------------------------------------------------------------ +template<> +int32_t powerDownLanes<TYPE_XBUS>( TargetHandle_t i_rxBusTgt, + const std::vector<uint8_t> &i_rxFailLanes, + const std::vector<uint8_t> &i_txFailLanes, + uint8_t i_clkGrp ) { int32_t o_rc = SUCCESS; @@ -166,7 +296,7 @@ int32_t powerDownLanesXbus(TargetHandle_t i_rxBusTgt, if(nullptr != err) { PRDF_ERR( "[PlatServices::powerDownLanes] HUID: 0x%08x " - "io_power_down_lanes failed", getHuid(i_rxBusTgt) ); + "p9_io_xbus_pdwn_lanes failed", getHuid(i_rxBusTgt) ); PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); o_rc = FAIL; } @@ -175,10 +305,78 @@ int32_t powerDownLanesXbus(TargetHandle_t i_rxBusTgt, return o_rc; } -int32_t getVpdFailedLanesXbus(TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, - std::vector<uint8_t> &o_txFailLanes, - uint8_t i_clkGrp) +template<> +int32_t powerDownLanes<TYPE_MEMBUF>(TargetHandle_t i_rxBusTgt, + const std::vector<uint8_t> &i_rxFailLanes, + const std::vector<uint8_t> &i_txFailLanes, + uint8_t i_clkGrp ) +{ + + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiTrgt (i_rxBusTgt); + FAPI_INVOKE_HWP(err, + p9_io_cen_pdwn_lanes, + fapiTrgt, + i_txFailLanes, + i_rxFailLanes); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::powerDownLanesMembuf] HUID: 0x%08x " + "p9_io_cen_pdwn_lanes failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +template<> +int32_t powerDownLanes<TYPE_DMI>(TargetHandle_t i_rxBusTgt, + const std::vector<uint8_t> &i_rxFailLanes, + const std::vector<uint8_t> &i_txFailLanes, + uint8_t i_clkGrp ) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_rxBusTgt) ); + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiTrgt (i_rxBusTgt); + FAPI_INVOKE_HWP(err, + p9_io_dmi_pdwn_lanes, + fapiTrgt, + i_txFailLanes, + i_rxFailLanes); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::powerDownLanesDmi] HUID: 0x%08x " + "p9_io_dmi_pdwn_lanes failed", getHuid(i_rxBusTgt) ); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +//------------------------------------------------------------------------------ +template<> +int32_t getVpdFailedLanes<TYPE_XBUS>(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + std::vector<uint8_t> &o_txFailLanes, + uint8_t i_clkGrp) { int32_t o_rc = SUCCESS; @@ -210,13 +408,88 @@ int32_t getVpdFailedLanesXbus(TargetHandle_t i_rxBusTgt, return o_rc; } -int32_t setVpdFailedLanesXbus(TargetHandle_t i_rxBusTgt, - TargetHandle_t i_txBusTgt, - std::vector<uint8_t> &i_rxFailLanes, - bool & o_thrExceeded, +template<> +int32_t getVpdFailedLanes<TYPE_MEMBUF>(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + std::vector<uint8_t> &o_txFailLanes, uint8_t i_clkGrp) { int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiTrgt (i_rxBusTgt); + + FAPI_INVOKE_HWP(err, + erepairGetFailedLanes, + fapiTrgt, + i_clkGrp, + o_txFailLanes, + o_rxFailLanes); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::getVpdFailedLanesMembuf] HUID: 0x%08x " + "erepairGetFailedLanes failed", + getHuid(i_rxBusTgt)); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +template<> +int32_t getVpdFailedLanes<TYPE_DMI>( TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + std::vector<uint8_t> &o_txFailLanes, + uint8_t i_clkGrp ) +{ + int32_t o_rc = SUCCESS; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiTrgt (i_rxBusTgt); + + FAPI_INVOKE_HWP(err, + erepairGetFailedLanes, + fapiTrgt, + i_clkGrp, + o_txFailLanes, + o_rxFailLanes); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::getVpdFailedLanesDmi] HUID: 0x%08x " + "erepairGetFailedLanes failed", + getHuid(i_rxBusTgt)); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +//------------------------------------------------------------------------------ +template<> +int32_t setVpdFailedLanes<TYPE_XBUS,TYPE_XBUS>( + TargetHandle_t i_rxBusTgt, + TargetHandle_t i_txBusTgt, + std::vector<uint8_t> &i_rxFailLanes, + bool & o_thrExceeded, + uint8_t i_clkGrp ) +{ + int32_t o_rc = SUCCESS; o_thrExceeded = false; #ifdef __HOSTBOOT_MODULE @@ -252,11 +525,103 @@ int32_t setVpdFailedLanesXbus(TargetHandle_t i_rxBusTgt, return o_rc; } + +template<> +int32_t setVpdFailedLanes<TYPE_MEMBUF, TYPE_DMI>( + TargetHandle_t i_rxBusTgt, + TargetHandle_t i_txBusTgt, + std::vector<uint8_t> &i_rxFailLanes, + bool & o_thrExceeded, + uint8_t i_clkGrp ) +{ + int32_t o_rc = SUCCESS; + o_thrExceeded = false; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( nullptr != i_txBusTgt); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_rxBusTgt) ); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_txBusTgt) ); + + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiRxTrgt (i_rxBusTgt); + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiTxTrgt (i_txBusTgt); + + FAPI_INVOKE_HWP(err, + erepairSetFailedLanes, + fapiTxTrgt, + fapiRxTrgt, + i_clkGrp, + i_rxFailLanes, + o_thrExceeded); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::setVpdFailedLanesMembuf] rxHUID: 0x%08x " + "txHUID: 0x%08x erepairSetFailedLanes failed", + getHuid(i_rxBusTgt), getHuid(i_txBusTgt)); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + + +template<> +int32_t setVpdFailedLanes<TYPE_DMI,TYPE_MEMBUF>( + TargetHandle_t i_rxBusTgt, + TargetHandle_t i_txBusTgt, + std::vector<uint8_t> &i_rxFailLanes, + bool & o_thrExceeded, + uint8_t i_clkGrp ) +{ + int32_t o_rc = SUCCESS; + o_thrExceeded = false; + + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( nullptr != i_txBusTgt); + PRDF_ASSERT( TYPE_DMI == getTargetType(i_rxBusTgt) ); + PRDF_ASSERT( TYPE_MEMBUF == getTargetType(i_txBusTgt) ); + + + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_DMI> fapiRxTrgt (i_rxBusTgt); + fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> fapiTxTrgt (i_txBusTgt); + + FAPI_INVOKE_HWP(err, + erepairSetFailedLanes, + fapiTxTrgt, + fapiRxTrgt, + i_clkGrp, + i_rxFailLanes, + o_thrExceeded); + + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::setVpdFailedLanesDmi] rxHUID: 0x%08x " + "txHUID: 0x%08x erepairSetFailedLanes failed", + getHuid(i_rxBusTgt), getHuid(i_txBusTgt)); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif + return o_rc; +} + +//------------------------------------------------------------------------------ bool obusInSmpMode( TargetHandle_t obus ) { return obus->getAttr<ATTR_OPTICS_CONFIG_MODE>() == OPTICS_CONFIG_MODE_SMP; } + //############################################################################## //## Memory specific functions //############################################################################## @@ -589,10 +954,6 @@ int32_t getDimmSpareConfig<TYPE_MBA>( TargetHandle_t i_mba, MemRank i_rank, } - - - - //------------------------------------------------------------------------------ template<> diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H index de41a416a..b9d18f7ed 100755 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H @@ -117,7 +117,6 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget); //############################################################################## //## Lane Repair functions //############################################################################## - /** * @brief Calls HWP to read newly failed bus lanes * @param i_rxBusTgt Target of the receiving end of the bus @@ -125,9 +124,10 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget); * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -int32_t readErepairXbus(TARGETING::TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, - uint8_t i_clkGrp); +template <TARGETING::TYPE> +int32_t readErepair(TARGETING::TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + uint8_t i_clkGrp); /** * @brief Calls HWP to clear FIRs after a lane repair event @@ -135,7 +135,8 @@ int32_t readErepairXbus(TARGETING::TargetHandle_t i_rxBusTgt, * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -int32_t clearIOFirsXbus(TARGETING::TargetHandle_t i_rxBusTgt); +template <TARGETING::TYPE> +int32_t clearIOFirs(TARGETING::TargetHandle_t i_rxBusTgt); /** * @brief Calls HWP to power down failed lanes @@ -145,10 +146,11 @@ int32_t clearIOFirsXbus(TARGETING::TargetHandle_t i_rxBusTgt); * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -int32_t powerDownLanesXbus(TARGETING::TargetHandle_t i_rxBusTgt, - const std::vector<uint8_t> &i_rxFailLanes, - const std::vector<uint8_t> &i_txFailLanes, - uint8_t i_clkGrp); +template <TARGETING::TYPE> +int32_t powerDownLanes(TARGETING::TargetHandle_t i_rxBusTgt, + const std::vector<uint8_t> &i_rxFailLanes, + const std::vector<uint8_t> &i_txFailLanes, + uint8_t i_clkGrp); /** * @brief Calls erepair accessor procedure get failed lanes from VPD @@ -158,10 +160,11 @@ int32_t powerDownLanesXbus(TARGETING::TargetHandle_t i_rxBusTgt, * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -int32_t getVpdFailedLanesXbus(TARGETING::TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, - std::vector<uint8_t> &o_txFailLanes, - uint8_t i_clkGrp); +template <TARGETING::TYPE> +int32_t getVpdFailedLanes(TARGETING::TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, + std::vector<uint8_t> &o_txFailLanes, + uint8_t i_clkGrp); /** * @brief Calls erepair prcd to set failed lanes in vpd and check threshold @@ -172,11 +175,12 @@ int32_t getVpdFailedLanesXbus(TARGETING::TargetHandle_t i_rxBusTgt, * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -int32_t setVpdFailedLanesXbus(TARGETING::TargetHandle_t i_rxBusTgt, - TARGETING::TargetHandle_t i_txBusTgt, - std::vector<uint8_t> &i_rxFailLanes, - bool & o_thrExceeded, - uint8_t i_clkGrp); +template <TARGETING::TYPE T_RX, TARGETING::TYPE T_TX> +int32_t setVpdFailedLanes(TARGETING::TargetHandle_t i_rxBusTgt, + TARGETING::TargetHandle_t i_txBusTgt, + std::vector<uint8_t> &i_rxFailLanes, + bool & o_thrExceeded, + uint8_t i_clkGrp); /** * @brief Checks if OBUS target is configured in SMP (ABUS) mode diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index 5f9aed43c..8e8ed58fd 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -78,6 +78,7 @@ prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ prd_incpath += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/ prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include prd_incpath += ${ROOTPATH}/src/import/ +prd_incpath += ${ROOTPATH}/src/import/chips/centaur/procedures/hwp/io/ ################################################################################ # Hostboot only object files common to both IPL and runtime @@ -163,6 +164,14 @@ CLEAN_TARGETS += ${MFG_THRES_PATH} prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/io/ prd_obj_no_sim += p9_io_erepairAccessorHwpFuncs.o prd_obj_no_sim += p9_io_xbus_read_erepair.o +prd_obj_no_sim += p9_io_dmi_read_erepair.o +prd_obj_no_sim += p9_io_dmi_pdwn_lanes.o +prd_obj_no_sim += p9_io_dmi_clear_firs.o + +prd_vpath += ${ROOTPATH}/src/import/chips/centaur/procedures/hwp/io/ +prd_obj_no_sim += p9_io_cen_read_erepair.o +prd_obj_no_sim += p9_io_cen_pdwn_lanes.o + prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/ prd_obj_no_sim += p9_proc_gettracearray.o prd_obj_no_sim += p9_sbe_tracearray.o |