diff options
Diffstat (limited to 'src')
10 files changed, 160 insertions, 190 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C index 500fbcd72..c9ea58493 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C @@ -27,6 +27,7 @@ // Framework includes #include <iipCaptureData.h> +#include <prdfErrlUtil.H> // Platform includes #include <prdfPlatServices.H> @@ -100,6 +101,91 @@ void addEccData<TYPE_MBA>( ExtensibleChip * i_chip, //------------------------------------------------------------------------------ +void addExtMemMruData( const MemoryMru & i_memMru, errlHndl_t io_errl ) +{ + #define PRDF_FUNC "[addExtMemMruData] " + + MemoryMruData::ExtendedData extMemMru ( i_memMru.toUint32() ); + + do + { + int32_t l_rc = SUCCESS; + + TargetHandle_t trgt = i_memMru.getTrgt(); + + // Get the DRAM width. + extMemMru.isX4Dram = isDramWidthX4( trgt ) ? 1 : 0; + + // Get the DIMM type. + bool isBufDimm = false; + l_rc = isMembufOnDimm( trgt, isBufDimm ); + if ( SUCCESS != l_rc ) + { + PRDF_ERR( PRDF_FUNC "isMembufOnDimm() failed. Trgt:0x%08x", + getHuid(trgt) ); + break; + } + extMemMru.isBufDimm = isBufDimm ? 1 : 0; + + if ( isBufDimm ) + { + // TODO RTC 169956 + //// Get the raw card type (Centaur DIMMs only). + //CEN_SYMBOL::WiringType cardType = CEN_SYMBOL::WIRING_INVALID; + //l_rc = getMemBufRawCardType( trgt, cardType ); + //if ( SUCCESS != l_rc ) + //{ + // PRDF_ERR( PRDF_FUNC "getMemBufRawCardType() failed. MBA:0x%08x", + // getHuid(trgt) ); + // break; + //} + //extMemMru.cardType = cardType; + } + else + { + // Get the 80-byte DQ map (ISDIMMs only). This is only needed if the + // MemoryMru contains a single DIMM callout with a valid symbol. + if ( i_memMru.getSymbol().isValid() ) + { + TargetHandleList partList = i_memMru.getCalloutList(); + if ( 1 != partList.size() || + TYPE_DIMM != getTargetType(partList[0]) ) + { + PRDF_ERR( PRDF_FUNC "Symbol is valid but callout is not a " + "single DIMM." ); + break; + } + getDimmDqAttr( trgt, extMemMru.dqMapping ); + } + } + + // If we reach this point, nothing failed and the data is valid. + extMemMru.isValid = 1; + + }while(0); + + size_t sz_buf = sizeof(extMemMru); + BitStringBuffer bsb( sz_buf*8 ); + uint32_t curPos = 0; + + bsb.setFieldJustify( curPos, 32, extMemMru.mmMeld.u ); curPos+=32; + bsb.setFieldJustify( curPos, 8, extMemMru.cardType ); curPos+= 8; + bsb.setFieldJustify( curPos, 1, extMemMru.isBufDimm ); curPos+= 1; + bsb.setFieldJustify( curPos, 1, extMemMru.isX4Dram ); curPos+= 1; + bsb.setFieldJustify( curPos, 1, extMemMru.isValid ); curPos+= 1; + + BitString bs( sizeof(extMemMru.dqMapping)*8, + (CPU_WORD *)extMemMru.dqMapping ); + bsb.setString( bs, 0, bs.getBitLen(), curPos ); + + // Add the extended MemoryMru to the error log. + PRDF_ADD_FFDC( io_errl, bsb.getBufAddr(), sz_buf, ErrlVer1, ErrlMruData ); + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + } //end namespace MemCaptureData } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H index 2bd27327d..4f2e2e6ff 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,12 +37,20 @@ namespace MemCaptureData /** * @brief Adds memory ECC FFDC to an SDC. - * @param i_mbaChip MCBIST, MCA, or MBA. - * @param io_sc Step code data struct. + * @param i_chip MCBIST, MCA, or MBA. + * @param io_sc Step code data struct. */ template<TARGETING::TYPE T> void addEccData( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ); +/** + * @brief Adds a new user data section to the error log containing a MemoryMru + * plus extended data for extra FFDC. + * @param i_memMru The memory mru + * @param io_errl Target error log. + */ +void addExtMemMruData( const MemoryMru & i_memMru, errlHndl_t io_errl ); + } // end namespace MemCaptureData } // 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 a9ad47b6f..932aad510 100755 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -735,33 +735,32 @@ int32_t getDimmSpareConfig( TargetHandle_t i_mba, CenRank i_rank, */ //------------------------------------------------------------------------------ - -/* TODO RTC -errlHndl_t getFapiDimmDqAttr( TargetHandle_t i_target, - uint8_t *io_dqMapPtr ) +void getDimmDqAttr( TargetHandle_t i_target, + uint8_t (&o_dqMapPtr)[DQS_PER_DIMM] ) { - uint8_t (&l_wiringData)[DIMM_DQ_NUM_DQS] = - *(reinterpret_cast<uint8_t(*)[DIMM_DQ_NUM_DQS]>(io_dqMapPtr)); + #define PRDF_FUNC "[PlatServices::getDimmDqAttr] " - // We have a DIMM target to get the DQ map for - // (need FAPI target from normal HWSV target) - fapi::Target l_fapiDimm = getFapiTarget(i_target); + PRDF_ASSERT( TYPE_MCA == getTargetType(i_target) ); - // Read the attribute - // (suppose to return a 1:1 mapping for Centaur DIMMs) - fapi::ReturnCode l_fapiRc; - l_fapiRc = FAPI_ATTR_GET(ATTR_CEN_DQ_TO_DIMM_CONN_DQ, - &l_fapiDimm, l_wiringData ); + TargetHandle_t mcs = getConnectedParent( i_target, TYPE_MCS ); - errlHndl_t l_fapiElog = fapi::fapiRcToErrl(l_fapiRc); + uint32_t mcaRelMcs = getTargetPosition( i_target ) % MAX_MCA_PER_MCS; + uint8_t tmpData[MAX_MCA_PER_MCS][DQS_PER_DIMM]; - return(l_fapiElog); -} // end function getFapiDimmDqAttr -*/ + if ( !mcs->tryGetAttr<ATTR_MSS_VPD_DQ_MAP>(tmpData) ) + { + PRDF_ERR( PRDF_FUNC "Failed to get ATTR_MSS_VPD_DQ_MAP" ); + PRDF_ASSERT( false ); + } + + memcpy( &o_dqMapPtr[0], &tmpData[mcaRelMcs][0], DQS_PER_DIMM ); + + #undef PRDF_FUNC +} // end function getDimmDqAttr //------------------------------------------------------------------------------ -/* TODO RTC +/* TODO RTC 169956 int32_t getMemBufRawCardType( TargetHandle_t i_mba, WiringType & o_cardType ) { diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H index 434f45a77..55ff237f9 100755 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H +++ b/src/usr/diag/prdf/common/plat/prdfPlatServices_common.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -359,7 +359,7 @@ int32_t getDimmSpareConfig( TARGETING::TargetHandle_t i_mba, CenRank i_rank, * the raw card type currently is not supported. * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ -/* TODO RTC 136126 +/* TODO RTC 169956 int32_t getMemBufRawCardType( TARGETING::TargetHandle_t i_mbaTarget, CEN_SYMBOL::WiringType & o_wiringType ); */ @@ -370,10 +370,8 @@ int32_t getMemBufRawCardType( TARGETING::TargetHandle_t i_mbaTarget, * @param io_dqMapPtr Pointer to area to receive DIMM DQ map (80 bytes) * @return Non-Null if error log occurs */ -/* TODO RTC 136126 -errlHndl_t getFapiDimmDqAttr( TARGETING::TargetHandle_t i_target, - uint8_t *io_dqMapPtr ); -*/ +void getDimmDqAttr( TARGETING::TargetHandle_t i_target, + uint8_t (&io_dqMapPtr)[DQS_PER_DIMM] ); //############################################################################## //## Maintenance Command class wrapper diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index c459d12c8..bdb1372e1 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -52,6 +52,7 @@ //#include <prdfProcLogParse.H> TODO: RTC 136050 #include <prdfParserEnums.H> #include <prdfMemoryMruData.H> +#include <prdfBitString.H> #include <hwas/common/hwasCallout.H> @@ -764,20 +765,22 @@ bool parseExtMemMru( void * i_buffer, uint32_t i_buflen, } else { - uint8_t * buf = (uint8_t *)i_buffer; - MemoryMruData::ExtendedData extMemMru; - - extMemMru.mmMeld.u = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]; + BitString bs( (i_buflen*8), (CPU_WORD*)i_buffer ); + uint32_t curPos = 0; - extMemMru.cardType = buf[4]; + MemoryMruData::ExtendedData extMemMru; - extMemMru.isBufDimm = (buf[5] >> 7) & 0x1; - extMemMru.isX4Dram = (buf[5] >> 6) & 0x1; - extMemMru.isValid = (buf[5] >> 5) & 0x1; + extMemMru.mmMeld.u = bs.getFieldJustify( curPos, 32 ); curPos+=32; + extMemMru.cardType = bs.getFieldJustify( curPos, 8 ); curPos+= 8; + extMemMru.isBufDimm = bs.getFieldJustify( curPos, 1 ); curPos+= 1; + extMemMru.isX4Dram = bs.getFieldJustify( curPos, 1 ); curPos+= 1; + extMemMru.isValid = bs.getFieldJustify( curPos, 1 ); curPos+= 1; - memcpy( &extMemMru.dqMapping[0], &buf[8], - sizeof(extMemMru.dqMapping) ); + for ( uint32_t i = 0; i < sizeof(extMemMru.dqMapping); i++ ) + { + extMemMru.dqMapping[i] = bs.getFieldJustify( curPos+(i*8), 8 ); + } char heading[72]; snprintf( heading, 72, "Extended MemoryMru (0x%08x)", diff --git a/src/usr/diag/prdf/common/plugins/prdfMemoryMruData.H b/src/usr/diag/prdf/common/plugins/prdfMemoryMruData.H index c32e1645e..a9a4498d3 100644 --- a/src/usr/diag/prdf/common/plugins/prdfMemoryMruData.H +++ b/src/usr/diag/prdf/common/plugins/prdfMemoryMruData.H @@ -141,9 +141,9 @@ struct ExtendedData ///< 0=otherwise. Needed just in case there ///< was a failure to gather extended data. uint32_t reserved :21; ///< Future use / nice boundary - uint8_t dqMapping[80]; ///< Centaur DQ to DIMM DQ mapping (only used - ///< when the MemoryMru contains a single - ///< IS DIMM callout). + uint8_t dqMapping[DQS_PER_DIMM]; ///< Centaur DQ to DIMM DQ mapping + ///< (only used when the MemoryMru + ///< contains a single IS DIMM callout). /** Default contructor */ ExtendedData() : diff --git a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C index 147c6ec35..d2227240d 100755 --- a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C @@ -36,14 +36,14 @@ #include <prdfPfa5Data.h> #include <prdf_service_codes.H> -// Pegasus includes +// Mem includes #include <prdfP9McaExtraSig.H> #include <prdfMemIplCeStats.H> #include <prdfParserUtils.H> #include <prdfMemThresholds.H> #include <prdfMemUtils.H> #include <prdfMemoryMru.H> -//#include <prdfPlatCalloutUtil.H> +#include <prdfMemCaptureData.H> using namespace TARGETING; @@ -460,12 +460,16 @@ template<TYPE T> void MemIplCeStats<T>::addMruAndCommitErrl( const MemoryMru & i_memmru, errlHndl_t i_errl ) { - // Add MemoryMru callouts and FFDC - //TODO RTC 168770 - //CalloutUtil::calloutMemoryMru( i_errl, i_memmru, - // SRCI_PRIORITY_HIGH, - // HWAS::DELAYED_DECONFIG, - // HWAS::GARD_Predictive ); + // Add all parts to the error log. + TargetHandleList partList = i_memmru.getCalloutList(); + for ( auto &it : partList ) + { + i_errl->addHwCallout( it, SRCI_PRIORITY_HIGH, HWAS::DELAYED_DECONFIG, + HWAS::GARD_Predictive ); + } + + // Add the MemoryMru to the capture data. + MemCaptureData::addExtMemMruData( i_memmru, i_errl ); // Add traces i_errl->collectTrace( PRDF_COMP_NAME, 512 ); diff --git a/src/usr/diag/prdf/plat/pegasus/prdfDramRepairs.C b/src/usr/diag/prdf/plat/pegasus/prdfDramRepairs.C index 81a03f635..4b1c63067 100644 --- a/src/usr/diag/prdf/plat/pegasus/prdfDramRepairs.C +++ b/src/usr/diag/prdf/plat/pegasus/prdfDramRepairs.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -40,7 +40,6 @@ #include "common/plat/pegasus/prdfCenSymbol.H" #include "common/plat/pegasus/prdfMemoryMru.H" #include "framework/service/prdfPlatServices.H" -#include "plat/pegasus/prdfPlatCalloutUtil.H" using namespace HWAS; using namespace std; @@ -188,11 +187,17 @@ bool processRepairedRanks( TargetHandle_t i_mba, uint8_t i_repairedRankMask ) { if ( !it->isValid() ) continue; - CalloutUtil::calloutMemoryMru( errl, - MemoryMru(i_mba, rank, *it), - SRCI_PRIORITY_HIGH, - HWAS::DELAYED_DECONFIG, - HWAS::GARD_Predictive ); + // Add all parts to the error log. + TargetHandleList partList = i_memmru.getCalloutList(); + for ( auto &part : partList ) + { + errl->addHwCallout( part, SRCI_PRIORITY_HIGH, + HWAS::DELAYED_DECONFIG, + HWAS::GARD_Predictive ); + } + + // Add the MemoryMru to the capture data. + MemCaptureData::addExtMemMruData( i_memmru, errl ); } o_calloutMade = true; diff --git a/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.C b/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.C deleted file mode 100644 index 9d07558b0..000000000 --- a/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.C +++ /dev/null @@ -1,69 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ -/* [+] 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 prdfPlatCalloutUtil.C */ - -#include <prdfPlatCalloutUtil.H> - -// Framework includes -#include <prdfErrlUtil.H> -#include <prdfPfa5Data.h> -#include <prdfPlatServices.H> - -// Pegasus includes -#include <prdfMemoryMru.H> -#include <prdfCenMbaCaptureData.H> - -using namespace TARGETING; - -namespace PRDF -{ - -using namespace PlatServices; - -namespace CalloutUtil -{ - -void calloutMemoryMru( errlHndl_t io_errl, const MemoryMru & i_memmru, - const HWAS::callOutPriority i_priority, - const HWAS::DeconfigEnum i_deconfigState, - const HWAS::GARD_ErrorType i_gardType ) -{ - // Add all parts to the error log. - TargetHandleList partList = i_memmru.getCalloutList(); - for ( TargetHandleList::iterator it = partList.begin(); - it != partList.end(); it++ ) - { - io_errl->addHwCallout( *it, i_priority, i_deconfigState, i_gardType ); - } - - // Add the MemoryMru to the capture data. - CenMbaCaptureData::addExtMemMruData( i_memmru, io_errl ); -} - -} // end namespace CalloutUtil - -} // end namespace PRDF - diff --git a/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.H b/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.H deleted file mode 100644 index 144ddb073..000000000 --- a/src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.H +++ /dev/null @@ -1,64 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/plat/pegasus/prdfPlatCalloutUtil.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ -/* */ -/* 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 __prdfPlatCalloutUtil_H -#define __prdfPlatCalloutUtil_H - -/** @file prdfPlatCalloutUtil.H */ - -// Framework includes -#include <prdfEnums.H> - -namespace PRDF -{ - -class MemoryMru; - -namespace CalloutUtil -{ - -/** - * @brief Add all parts of a MemoryMru to the callout list of an error log. - * Also, adds the MemoryMru info to the capture data. - * - * This is only intended to be used by non-attention analysis code like Restore - * DRAM Repairs or MNFG IPL CE analysis. In these cases, there is no SDC to - * collect the callout info or capture data. - * - * @param io_errl The target error log. - * @param i_memmru The target MemoryMru. - * @param i_priority The callout priority - * @param i_deconfigState The deconfiguration state. - * @param i_gardType The GARD error type. - */ -void calloutMemoryMru( errlHndl_t io_errl, const MemoryMru & i_memmru, - const HWAS::callOutPriority i_priority, - const HWAS::DeconfigEnum i_deconfigState, - const HWAS::GARD_ErrorType i_gardType ); - -} // end namespace CalloutUtil - -} // end namespace PRDF - -#endif // __prdfPlatCalloutUtil_H - |