diff options
author | Benjamin Weisenbeck <bweisenb@us.ibm.com> | 2017-05-09 12:39:49 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-06-12 14:28:57 -0400 |
commit | ba562c78d6d39f7280b39de3714254309c029c80 (patch) | |
tree | 8a0a1fc3b6f60a00ff3bd57e8772911a61ad6f12 /src/usr | |
parent | 40ac37664f6c02262770829af2b7ae7a29e6990a (diff) | |
download | talos-hostboot-ba562c78d6d39f7280b39de3714254309c029c80.tar.gz talos-hostboot-ba562c78d6d39f7280b39de3714254309c029c80.zip |
PRD: XBUS Lane Repair
Change-Id: I1e89bdcdd42fbeb720dc230506dba752b4ae1150
RTC: 136120
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40287
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41491
Tested-by: Jenkins OP Build CI <op-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/p9/p9_xbus.rule | 8 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_xbus_actions.rule | 53 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_xbus_regs.rule | 34 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C | 303 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.H | 74 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9ProcMbCommonExtraSig.H | 7 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9Xbus.C | 103 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | src/usr/diag/prdf/common/plat/prdfPlatServices_common.C | 223 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/prdfPlatServices_common.H | 54 | ||||
-rw-r--r-- | src/usr/diag/prdf/prdf_hb_only.mk | 9 |
11 files changed, 717 insertions, 155 deletions
diff --git a/src/usr/diag/prdf/common/plat/p9/p9_xbus.rule b/src/usr/diag/prdf/common/plat/p9/p9_xbus.rule index b563c3c91..2ace7c3d3 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_xbus.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_xbus.rule @@ -187,7 +187,7 @@ group gIOXBFIR filter singlebit, cs_root_cause /** IOXBFIR[2] * GCR_HANG_ERROR */ - (rIOXBFIR, bit(2)) ? defaultMaskedError; + (rIOXBFIR, bit(2)) ? calloutXbusInterface; /** IOXBFIR[3:7] * spare @@ -202,12 +202,12 @@ group gIOXBFIR filter singlebit, cs_root_cause /** IOXBFIR[9] * RX_BUS0_SPARE_DEPLOYED */ - (rIOXBFIR, bit(9)) ? defaultMaskedError; + (rIOXBFIR, bit(9)) ? spareDeployed; /** IOXBFIR[10] * RX_BUS0_MAX_SPARES_EXCEEDED */ - (rIOXBFIR, bit(10)) ? defaultMaskedError; + (rIOXBFIR, bit(10)) ? maxSparesExceeded; /** IOXBFIR[11] * RX_BUS0_RECAL_OR_DYN_REPAIR_ERROR @@ -217,7 +217,7 @@ group gIOXBFIR filter singlebit, cs_root_cause /** IOXBFIR[12] * RX_BUS0_TOO_MANY_BUS_ERRORS */ - (rIOXBFIR, bit(12)) ? defaultMaskedError; + (rIOXBFIR, bit(12)) ? tooManyBusErrors; /** IOXBFIR[13:15] * spare diff --git a/src/usr/diag/prdf/common/plat/p9/p9_xbus_actions.rule b/src/usr/diag/prdf/common/plat/p9/p9_xbus_actions.rule new file mode 100644 index 000000000..b0c367af7 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/p9_xbus_actions.rule @@ -0,0 +1,53 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/common/plat/p9/p9_xbus_actions.rule $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# [+] 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 +/** Callout the XBUS interface */ +actionclass calloutXbusInterface +{ + funccall("calloutInterface_xbus"); +}; + +/** Lane Repair: spare deployed */ +actionclass spareDeployed +{ + calloutXbusInterface; + funccall("spareDeployed"); +}; + +/** Lane Repair: max spares exceeded */ +actionclass maxSparesExceeded +{ + calloutXbusInterface; + threshold1; + funccall("maxSparesExceeded"); +}; + +/** Lane Repair: too many bus errors */ +actionclass tooManyBusErrors +{ + calloutXbusInterface; + threshold1; + funccall("tooManyBusErrors"); +}; + diff --git a/src/usr/diag/prdf/common/plat/p9/p9_xbus_regs.rule b/src/usr/diag/prdf/common/plat/p9/p9_xbus_regs.rule index d9e16d3ef..7838d0e50 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_xbus_regs.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_xbus_regs.rule @@ -44,3 +44,37 @@ capture group PllFIRs; }; + ######################################################################## + # Non-existent Registers for Capture + ######################################################################## + register VPD_FAILED_LANES_0TO63 + { + name "Bit map 0-63 of failed lanes read from VPD"; + scomaddr 0xFFFF0001; + access no_access; + capture group never; + }; + + register VPD_FAILED_LANES_64TO127 + { + name "Bit map 64-127 of failed lanes read from VPD"; + scomaddr 0xFFFF0002; + access no_access; + capture group never; + }; + + register ALL_FAILED_LANES_0TO63 + { + name "Bit map 0-63 of failed lanes from io_read_erepair"; + scomaddr 0xFFFF0003; + access no_access; + capture group never; + }; + + register ALL_FAILED_LANES_64TO127 + { + name "Bit map 64-127 of failed lanes from io_read_erepair"; + scomaddr 0xFFFF0004; + access no_access; + capture group never; + }; diff --git a/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C new file mode 100644 index 000000000..8b3f9b850 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C @@ -0,0 +1,303 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +/** @file prdfLaneRepair.C */ + +#include <prdfLaneRepair.H> + +// Framework includes +#include <prdfPlatServices.H> +#include <iipconst.h> +#include <prdfGlobal.H> +#include <iipSystem.h> +#include <iipServiceDataCollector.h> +#include <prdfExtensibleChip.H> +#include <UtilHash.H> + +#include <prdfP9ProcMbCommonExtraSig.H> +#include <hwas/common/hwasCallout.H> + +using namespace TARGETING; + +namespace PRDF +{ +using namespace PlatServices; + +namespace LaneRepair +{ + +TargetHandle_t getTxBusEndPt( TargetHandle_t i_rxTrgt) +{ + TargetHandle_t o_txTrgt = nullptr; + + PRDF_ASSERT(nullptr != i_rxTrgt); + + if ( TYPE_XBUS == getTargetType(i_rxTrgt) ) + { + o_txTrgt = getConnectedPeerTarget( i_rxTrgt ); + } + + PRDF_ASSERT(nullptr != o_txTrgt); + return o_txTrgt; +} + +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); + bool thrExceeded = true; + // Number of clock groups on this interface. (2 for xbus, 1 for all others) + uint8_t clkGrps = (busType == 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]; + // TX-side, previously failed laned lanes stored in VPD for each clk grp + std::vector<uint8_t> tx_vpdLanes[2]; + BitStringBuffer l_newLaneMap0to63(64); // FFDC Bitmap of newly failed lanes + BitStringBuffer l_newLaneMap64to127(64); + BitStringBuffer l_vpdLaneMap0to63(64); // FFDC Bitmap of VPD failed lanes + BitStringBuffer l_vpdLaneMap64to127(64); + + do + { + // Get the TX target + txBusTgt = getTxBusEndPt(rxBusTgt); + + // Call io_read_erepair for each group + for (uint8_t i=0; i<clkGrps; ++i) + { + l_rc = readErepairXbus(rxBusTgt, rx_lanes[i], i); + if (SUCCESS != l_rc) + { + PRDF_ERR( PRDF_FUNC "readErepair() failed: rxBusTgt=0x%08x", + getHuid(rxBusTgt) ); + break; + } + + // Add newly failed lanes to capture data + for ( auto & lane : rx_lanes[i] ) + { + if (lane < 64) + l_newLaneMap0to63.setBit(lane); + else if (lane < 128) + l_newLaneMap64to127.setBit(lane - 64); + else + { + PRDF_ERR( PRDF_FUNC "Invalid lane number %d: " + "rxBusTgt=0x%08x", lane, getHuid(rxBusTgt) ); + } + } + } + + if ( SUCCESS != l_rc) break; + + // Add failed lane capture data to errorlog + i_sc.service_data->GetCaptureData().Add(i_chip->GetChipHandle(), + ( Util::hashString("ALL_FAILED_LANES_0TO63") ^ + i_chip->getSignatureOffset() ), + l_newLaneMap0to63); + i_sc.service_data->GetCaptureData().Add(i_chip->GetChipHandle(), + ( Util::hashString("ALL_FAILED_LANES_64TO127") ^ + i_chip->getSignatureOffset() ), + 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()) ) + { + // Read Failed Lanes from VPD + for (uint8_t i=0; i<clkGrps; ++i) + { + l_rc = getVpdFailedLanesXbus(rxBusTgt, rx_vpdLanes[i], + tx_vpdLanes[i], i); + if (SUCCESS != l_rc) + { + PRDF_ERR( PRDF_FUNC "getVpdFailedLanes() failed: " + "rxBusTgt=0x%08x", getHuid(rxBusTgt) ); + break; + } + + // Add VPD lanes to capture data + for ( auto & lane : rx_vpdLanes[i] ) + { + if (lane < 64) + l_vpdLaneMap0to63.setBit(lane); + else if (lane < 128) + l_vpdLaneMap64to127.setBit(lane - 64); + else + { + PRDF_ERR( PRDF_FUNC "Invalid VPD lane number %d: " + "rxBusTgt=0x%08x", lane, getHuid(rxBusTgt) ); + } + } + } + + if ( SUCCESS != l_rc) break; + + // Add failed lane capture data to errorlog + i_sc.service_data->GetCaptureData().Add(i_chip->GetChipHandle(), + ( Util::hashString("VPD_FAILED_LANES_0TO63") ^ + i_chip->getSignatureOffset() ), + l_vpdLaneMap0to63); + i_sc.service_data->GetCaptureData().Add(i_chip->GetChipHandle(), + ( Util::hashString("VPD_FAILED_LANES_64TO127") ^ + i_chip->getSignatureOffset() ), + l_vpdLaneMap64to127); + + if (i_spareDeployed) + { + for (uint8_t i=0; i<clkGrps; ++i) + { + // Call Erepair to update VPD + l_rc = setVpdFailedLanesXbus(rxBusTgt, txBusTgt, + rx_lanes[i], thrExceeded, i); + if (SUCCESS != l_rc) + { + PRDF_ERR( PRDF_FUNC "setVpdFailedLanes() failed: " + "rxBusTgt=0x%08x txBusTgt=0x%08x", + getHuid(rxBusTgt), getHuid(txBusTgt) ); + break; + } + if( thrExceeded ) + { + i_sc.service_data->SetErrorSig( + PRDFSIG_ERepair_FWThrExceeded ); + i_sc.service_data->setServiceCall(); + break; + } + else + { + // 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); + if (SUCCESS != l_rc) + { + PRDF_ERR( PRDF_FUNC + "getVpdFailedLanes() before power down " + "failed: rxBusTgt=0x%08x", + getHuid(rxBusTgt) ); + break; + } + + // Power down all lanes that have been saved in VPD + l_rc = powerDownLanesXbus(rxBusTgt, rx_vpdLanes[i], + tx_vpdLanes[i], i); + if (SUCCESS != l_rc) + { + PRDF_ERR( PRDF_FUNC "powerDownLanes() failed: " + "rxBusTgt=0x%08x", getHuid(rxBusTgt) ); + break; + } + } + } + + if ( SUCCESS != l_rc) break; + + } + } + } while (0); + + // Clear FIRs + l_rc |= clearIOFirsXbus(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 + // understand. So far, there is no need return a special code, so always + // return SUCCESS. + if ( SUCCESS != l_rc ) + { + PRDF_ERR( PRDF_FUNC "i_chip: 0x%08x busType:%d", + i_chip->GetId(), busType ); + + i_sc.service_data->SetErrorSig(PRDFSIG_ERepair_ERROR); + 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; + + #undef PRDF_FUNC +} + +int32_t calloutBusInterface( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + PRDpriority i_priority ) +{ + #define PRDF_FUNC "[PrdfLaneRepair::calloutBusInterface] " + + int32_t rc = SUCCESS; + + do { + // Get both endpoints + TargetHandle_t i_rxTrgt = i_chip->getTrgt(); + TargetHandle_t i_txTrgt = getTxBusEndPt(i_rxTrgt); + + // Add the endpoint target callouts + i_sc.service_data->SetCallout( i_rxTrgt, MRU_MEDA ); + i_sc.service_data->SetCallout( i_txTrgt, MRU_MEDA); + + // Get the HWAS bus type. + HWAS::busTypeEnum hwasType; + + TYPE rxType = getTargetType(i_rxTrgt); + TYPE txType = getTargetType(i_txTrgt); + + if ( TYPE_XBUS == rxType && TYPE_XBUS == txType ) + { + hwasType = HWAS::X_BUS_TYPE; + } + else + { + PRDF_ASSERT( false ); + } + + // Get the global error log. + errlHndl_t errl = NULL; + errl = ServiceGeneratorClass::ThisServiceGenerator().getErrl(); + if ( NULL == errl ) + { + PRDF_ERR( PRDF_FUNC "Failed to get the global error log" ); + rc = FAIL; break; + } + + // Callout this bus interface. + PRDF_ADD_BUS_CALLOUT( errl, i_rxTrgt, i_txTrgt, hwasType, i_priority ); + + } while(0); + + return rc; + + #undef PRDF_FUNC +} + +} // end namespace LaneRepair +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.H b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.H new file mode 100644 index 000000000..afc834e29 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.H @@ -0,0 +1,74 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfLaneRepair.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 _PRDFLANEREPAIR_H +#define _PRDFLANEREPAIR_H + +/** @file prdfLaneRepair.H + * @brief Common Lane Repair code for Lane Spared, Spares Exceeded, and + * Too Many Bus Errors conditions. + */ + +#include <iipconst.h> +#include <targeting/common/target.H> +#include <prdfErrlUtil.H> +#include <prdfCalloutMap.H> + +namespace PRDF +{ + +class ExtensibleChip; +struct STEP_CODE_DATA_STRUCT; + +namespace LaneRepair +{ +/** + * @brief Handles a Lane Repair Event + * @param i_chip Chip that detected the lane repair event + * @param i_sc The step code data struct. + * @param i_spareDeployed True if FIR bit indicates a spare was deployed + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +int32_t handleLaneRepairEvent (ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + bool i_spareDeployed); +/** + * @brief Will add target bus interface endpoints and all parts in between the + * endpoints to the global error log in RasServices. + * @param i_chip RX-side chip of bus interface + * @param i_sc The step code data struct. + * @param i_priority Callout priority (default MRU_LOW). + * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise. + */ +int32_t calloutBusInterface( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_sc, + PRDpriority i_priority = MRU_LOW ); + + + +} // end namespace LaneRepair +} // end namespace PRDF + +#endif /* _PRDFLANEREPAIR_H */ + diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcMbCommonExtraSig.H b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcMbCommonExtraSig.H index c5aa1ceb5..13f75095e 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcMbCommonExtraSig.H +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcMbCommonExtraSig.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -28,6 +28,11 @@ #include <prdrSignatures.H> +/* ERepair Extra signatures */ +PRDR_ERROR_SIGNATURE( ERepair_ERROR, 0xffff0000, "","ERepair Internal error" ); +PRDR_ERROR_SIGNATURE( ERepair_FWThrExceeded, 0xffff0001, "", + "ERepair FW threshold exceeded" ); + /* PLL Extra signatures */ PRDR_ERROR_SIGNATURE( PLL_ERROR, 0x00ed0000, "","PLL error" ); #endif // __prdfP9ProcMbCommonExtraSig_H diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Xbus.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Xbus.C new file mode 100644 index 000000000..dff94ad74 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Xbus.C @@ -0,0 +1,103 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Xbus.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +// Framework includes +#include <prdfPluginDef.H> +#include <iipServiceDataCollector.h> +#include <prdfExtensibleChip.H> +#include <prdfPluginMap.H> + +#include <prdfLaneRepair.H> + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; +using namespace LaneRepair; + +namespace p9_xbus +{ + +/** + * @brief Handles Spare Lane Deployed Event + * @param i_chip XBUS chip. + * @param io_sc Step code data struct. + * @return SUCCESS always + */ +int32_t spareDeployed( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + if ( CHECK_STOP != io_sc.service_data->getPrimaryAttnType() ) + return handleLaneRepairEvent(i_chip, io_sc, true); + else + return SUCCESS; +} PRDF_PLUGIN_DEFINE( p9_xbus, spareDeployed ); + +/** + * @brief Handles Max Spares Exceeded Event + * @param i_chip XBUS chip. + * @param io_sc Step code data struct. + * @return SUCCESS always + */ +int32_t maxSparesExceeded( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + if ( CHECK_STOP != io_sc.service_data->getPrimaryAttnType() ) + return handleLaneRepairEvent(i_chip, io_sc, false); + else + return SUCCESS; +} PRDF_PLUGIN_DEFINE( p9_xbus, maxSparesExceeded ); + +/** + * @brief Handles Too Many Bus Errors Event + * @param i_chip XBUS chip. + * @param io_sc Step code data struct. + * @return SUCCESS always + */ +int32_t tooManyBusErrors( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + if ( CHECK_STOP != io_sc.service_data->getPrimaryAttnType() ) + return handleLaneRepairEvent(i_chip, io_sc, false); + else + return SUCCESS; +} PRDF_PLUGIN_DEFINE( p9_xbus, tooManyBusErrors ); + +/** + * @brief Add callouts for an XBUS interface + * @param i_chip XBUS chip. + * @param io_sc Step code data struct. + * @return SUCCESS always + */ +int32_t calloutInterface_xbus( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + calloutBusInterface(i_chip, io_sc, MRU_LOW); + return SUCCESS; +} PRDF_PLUGIN_DEFINE( p9_xbus, calloutInterface_xbus ); + +} // end namespace Proc +} // 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 cc0cfba8e..67a3172b5 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 @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2016 +# Contributors Listed Below - COPYRIGHT 2016,2017 # [+] International Business Machines Corp. # # @@ -43,10 +43,12 @@ prd_obj += prdfP9PllDomain.o prd_obj += prdfFsiCapUtil.o prd_obj += prdfP9ProcDomain.o prd_obj += prdfLineDelete.o +prd_obj += prdfLaneRepair.o # rule plugin related prd_rule_plugin += prdfP9Proc.o prd_rule_plugin += prdfP9Pll.o prd_rule_plugin += prdfCommonPlugins.o prd_rule_plugin += prdfP9Ex.o +prd_rule_plugin += prdfP9Xbus.o diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C index 6e8241ffa..e3f1fead4 100755..100644 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C @@ -45,13 +45,11 @@ //#include <dimmBadDqBitmapFuncs.H> // for dimm[S|G]etBadDqBitmap() TODO RTC 164707 -//#include <io_read_erepair.H> TODO RTC 136120 -//#include <io_power_down_lanes.H> TODO RTC 136120 -//#include <io_clear_firs.H> TODO RTC 136120 -//#include <erepairAccessorHwpFuncs.H> TODO RTC 136120 -//#include <io_fir_isolation.H> TODO RTC 136120 -//#include <fapiAttributeIds.H> TODO RTC 136120 #ifdef __HOSTBOOT_MODULE +#include <p9_io_xbus_read_erepair.H> +#include <p9_io_xbus_pdwn_lanes.H> +#include <p9_io_xbus_clear_firs.H> +//#include <erepairAccessorHwpFuncs.H> TODO RTC 174013 #include <config.h> #endif @@ -90,19 +88,24 @@ src/hwsv/server/hwpf2/fapi2/target_types.H for a list of all the TargetTypes //## Lane Repair functions //############################################################################## -/* TODO RTC 136120 -int32_t readErepair(TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes) +int32_t readErepairXbus(TargetHandle_t i_rxBusTgt, + std::vector<uint8_t> &o_rxFailLanes, uint8_t i_clkGrp) { int32_t o_rc = SUCCESS; - errlHndl_t err = NULL; + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_rxBusTgt) ); + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiTrgt (i_rxBusTgt); FAPI_INVOKE_HWP(err, - io_read_erepair, - getFapiTarget(i_rxBusTgt), + p9_io_xbus_read_erepair, + fapiTrgt, + i_clkGrp, o_rxFailLanes); - if(NULL != err) + if(nullptr != err) { PRDF_ERR( "[PlatServices::readErepair] HUID: 0x%08x io_read_erepair " "failed", getHuid(i_rxBusTgt) ); @@ -110,160 +113,146 @@ int32_t readErepair(TargetHandle_t i_rxBusTgt, o_rc = FAIL; } + #endif return o_rc; } -int32_t clearIOFirs(TargetHandle_t i_rxBusTgt) +int32_t clearIOFirsXbus(TargetHandle_t i_rxBusTgt) { - int32_t o_rc = SUCCESS; - errlHndl_t err = NULL; + int32_t o_rc = SUCCESS; - FAPI_INVOKE_HWP(err, - io_clear_firs, - getFapiTarget(i_rxBusTgt)); + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_rxBusTgt) ); + + errlHndl_t err = nullptr; - if(NULL != err) + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiTrgt (i_rxBusTgt); + + for (uint8_t i=0; i<2; ++i) // clear both clock groups { - PRDF_ERR( "[PlatServices::clearIOFirs] HUID: 0x%08x io_clear_firs " - "failed", getHuid(i_rxBusTgt) ); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; + 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_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } } + #endif return o_rc; } -int32_t powerDownLanes(TargetHandle_t i_rxBusTgt, - const std::vector<uint8_t> &i_rxFailLanes, - const std::vector<uint8_t> &i_txFailLanes) +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) { int32_t o_rc = SUCCESS; - errlHndl_t err = NULL; + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_rxBusTgt) ); + errlHndl_t err = nullptr; + + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiTrgt (i_rxBusTgt); FAPI_INVOKE_HWP(err, - io_power_down_lanes, - getFapiTarget(i_rxBusTgt), + p9_io_xbus_pdwn_lanes, + fapiTrgt, + i_clkGrp, i_txFailLanes, i_rxFailLanes); - if(NULL != err) + if(nullptr != err) { PRDF_ERR( "[PlatServices::powerDownLanes] HUID: 0x%08x " "io_power_down_lanes failed", getHuid(i_rxBusTgt) ); PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); o_rc = FAIL; } + + #endif return o_rc; } - -int32_t getVpdFailedLanes(TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, - std::vector<uint8_t> &o_txFailLanes) +int32_t getVpdFailedLanesXbus(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; - do - { - // Some hardware configurations do not have Memory Buffer VPD. - // Hence, reading of DMI lane eRepair data from MBVPD need - // to be skipped. -#if defined(__HOSTBOOT_MODULE) and !defined(CONFIG_HAVE_MBVPD) - if(TYPE_MEMBUF == getTargetType(i_rxBusTgt)) - { - // Return zero fail lanes when we are not reading the MBVPD. - o_rxFailLanes.clear(); - o_txFailLanes.clear(); - break; - } -#endif + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_rxBusTgt) ); - errlHndl_t err = NULL; - FAPI_INVOKE_HWP(err, - erepairGetFailedLanes, - getFapiTarget(i_rxBusTgt), - o_txFailLanes, - o_rxFailLanes); + errlHndl_t err = nullptr; - if(NULL != err) - { - PRDF_ERR( "[PlatServices::getVpdFailedLanes] HUID: 0x%08x " - "erepairGetFailedLanes failed", - getHuid(i_rxBusTgt)); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - break; - } - }while(0); + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiTrgt (i_rxBusTgt); + +// TODO RTC 174013 +// FAPI_INVOKE_HWP(err, +// erepairGetFailedLanes, +// fapiTrgt, +// o_txFailLanes, +// o_rxFailLanes, +// i_clkGrp); + if(nullptr != err) + { + PRDF_ERR( "[PlatServices::getVpdFailedLanes] HUID: 0x%08x " + "erepairGetFailedLanes failed", + getHuid(i_rxBusTgt)); + PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; + } + + #endif return o_rc; } -int32_t setVpdFailedLanes(TargetHandle_t i_rxBusTgt, - TargetHandle_t i_txBusTgt, - std::vector<uint8_t> &i_rxFailLanes, - bool & o_thrExceeded) +int32_t setVpdFailedLanesXbus(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; - do - { - // Some hardware configurations do not have Memory Buffer VPD. - // Hence, writing of DMI lane eRepair data into MBVPD need - // to be skipped. -#if defined(__HOSTBOOT_MODULE) and !defined(CONFIG_HAVE_MBVPD) - if(TYPE_MEMBUF == getTargetType(i_rxBusTgt) || - TYPE_MEMBUF == getTargetType(i_txBusTgt)) - { - // Threshold is not exceeded when there is no - // MBVPD and hence no checking of any existing faillanes. - o_thrExceeded = false; - break; - } -#endif - - errlHndl_t err = NULL; - FAPI_INVOKE_HWP(err, - erepairSetFailedLanes, - getFapiTarget(i_txBusTgt), - getFapiTarget(i_rxBusTgt), - i_rxFailLanes, - o_thrExceeded); - if(NULL != err) - { - PRDF_ERR( "[PlatServices::setVpdFailedLanes] rxHUID: 0x%08x " - "txHUID: 0x%08x erepairSetFailedLanes failed", - getHuid(i_rxBusTgt), getHuid(i_txBusTgt)); - PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); - o_rc = FAIL; - break; - } - }while(0); + #ifdef __HOSTBOOT_MODULE + PRDF_ASSERT( nullptr != i_rxBusTgt); + PRDF_ASSERT( nullptr != i_txBusTgt); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_rxBusTgt) ); + PRDF_ASSERT( TYPE_XBUS == getTargetType(i_txBusTgt) ); - return o_rc; -} -int32_t erepairFirIsolation(TargetHandle_t i_rxBusTgt) -{ - #define PRDF_FUNC "[PlatServices::erepairFirIsolation] " + errlHndl_t err = nullptr; - errlHndl_t err = NULL; + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiRxTrgt (i_rxBusTgt); + fapi2::Target<fapi2::TARGET_TYPE_XBUS> fapiTxTrgt (i_rxBusTgt); - FAPI_INVOKE_HWP(err, io_fir_isolation, getFapiTarget(i_rxBusTgt)); +// TODO RTC 174013 +// FAPI_INVOKE_HWP(err, +// erepairSetFailedLanes, +// fapiTxTrgt, +// fapiRxTrgt, +// i_rxFailLanes, +// o_thrExceeded); - if(NULL != err) + if(nullptr != err) { - PRDF_ERR( PRDF_FUNC "rxHUID: 0x%08x committing io_fir_isolation log", - getHuid(i_rxBusTgt)); + PRDF_ERR( "[PlatServices::setVpdFailedLanes] rxHUID: 0x%08x " + "txHUID: 0x%08x erepairSetFailedLanes failed", + getHuid(i_rxBusTgt), getHuid(i_txBusTgt)); PRDF_COMMIT_ERRL( err, ERRL_ACTION_REPORT ); + o_rc = FAIL; } - // Return SUCCESS since we expect this procedure to generate an error - return SUCCESS; - - #undef PRDF_FUNC + #endif + return o_rc; } -*/ //############################################################################## //## Memory specific functions diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H index 8688892ce..5a52bc530 100755 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H @@ -132,47 +132,46 @@ void collectSBE_FFDC(TARGETING::TargetHandle_t i_procTarget); * @brief Calls HWP to read newly failed bus lanes * @param i_rxBusTgt Target of the receiving end of the bus * @param o_rxFailLanes Vector of failed lanes + * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136120 -int32_t readErepair(TARGETING::TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes); -*/ +int32_t readErepairXbus(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 * @param i_rxBusTgt Target of the receiving end of the bus + * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136120 -int32_t clearIOFirs(TARGETING::TargetHandle_t i_rxBusTgt); -*/ +int32_t clearIOFirsXbus(TARGETING::TargetHandle_t i_rxBusTgt); /** * @brief Calls HWP to power down failed lanes * @param i_rxBusTgt Target of the receiving end of the bus * @param i_rxFailLanes Vector of rx failed lanes * @param i_txFailLanes Vector of tx failed lanes + * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136120 -int32_t powerDownLanes(TARGETING::TargetHandle_t i_rxBusTgt, - const std::vector<uint8_t> &i_rxFailLanes, - const std::vector<uint8_t> &i_txFailLanes); -*/ +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); /** * @brief Calls erepair accessor procedure get failed lanes from VPD * @param i_rxBusTgt Target of the receiving end of the bus * @param o_rxFailLanes Vector of rx failed lanes * @param o_txFailLanes Vector of tx failed lanes + * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136120 -int32_t getVpdFailedLanes(TARGETING::TargetHandle_t i_rxBusTgt, - std::vector<uint8_t> &o_rxFailLanes, - std::vector<uint8_t> &o_txFailLanes); -*/ +int32_t getVpdFailedLanesXbus(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 @@ -180,24 +179,15 @@ int32_t getVpdFailedLanes(TARGETING::TargetHandle_t i_rxBusTgt, * @param i_txBusTgt Target of the tranmitting end of the bus * @param i_rxFailLanes Vector of rx failed lanes * @param o_thrExceeded True if these failed lanes exceeded erepair threshold + * @param i_clkGrp Clock group * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136120 -int32_t setVpdFailedLanes(TARGETING::TargetHandle_t i_rxBusTgt, - TARGETING::TargetHandle_t i_txBusTgt, - std::vector<uint8_t> &i_rxFailLanes, - bool & o_thrExceeded); -*/ +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); -/** - * @brief Calls io_fir_isolation HWP and commits FAPI errorlog containing - * additional FFDC - * @param i_rxBusTgt Target of the receiving end of the bus - * @return SUCCESS - */ -/* TODO RTC 136120 -int32_t erepairFirIsolation(TARGETING::TargetHandle_t i_rxBusTgt); -*/ //############################################################################## //## Memory specific functions diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index 39f7eec4c..70867b1c6 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -60,6 +60,7 @@ prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/ prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/ prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/utils/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/io/ prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include prd_incpath += ${ROOTPATH}/src/import/ @@ -143,6 +144,12 @@ EXTRA_CLEAN += ${MFG_THRES_PATH} CLEAN_TARGETS += ${MFG_THRES_PATH} ################################################################################ +# Hardware procedure files needed for both IPL and RT +################################################################################ +prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/io/ +prd_obj_no_sim += p9_io_xbus_read_erepair.o + +################################################################################ # The following are hardware procedure utilities that we are pulling into the # PRD library (only needed here for HBRT). This code is already compiled in # istep14 for Hostboot @@ -153,6 +160,8 @@ ifeq (${HOSTBOOT_RUNTIME},1) # This is really the only file we need, but all of the other files below are # required because of dependencies. prd_obj_no_sim += memdiags.o +prd_obj_no_sim += p9_io_xbus_clear_firs.o +prd_obj_no_sim += p9_io_xbus_pdwn_lanes.o prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/ |