diff options
Diffstat (limited to 'src/usr/diag/prdf')
-rw-r--r-- | src/usr/diag/prdf/common/plat/cen/prdfCenMembufDataBundle.H | 84 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C | 21 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C | 225 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H | 21 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/p9_mc_regs.rule | 41 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9Dmi_common.C | 76 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdfP9Mc_common.C | 78 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk | 3 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C | 28 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/pegasus/prdfCenMembufDataBundle.H | 148 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C | 32 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C | 10 |
12 files changed, 422 insertions, 345 deletions
diff --git a/src/usr/diag/prdf/common/plat/cen/prdfCenMembufDataBundle.H b/src/usr/diag/prdf/common/plat/cen/prdfCenMembufDataBundle.H new file mode 100644 index 000000000..bbf4d378b --- /dev/null +++ b/src/usr/diag/prdf/common/plat/cen/prdfCenMembufDataBundle.H @@ -0,0 +1,84 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/cen/prdfCenMembufDataBundle.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* [+] 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 __prdfCenMembufDataBundle_H +#define __prdfCenMembufDataBundle_H + +// Framework includes +#include <prdfExtensibleChip.H> + +namespace PRDF +{ + +/** @brief Centaur MEMBUF data bundle. */ +class MembufDataBundle : public DataBundle +{ + public: + + /** + * @brief Constructor. + * @param i_chip The MEMBUF chip. + */ + explicit MembufDataBundle( ExtensibleChip * i_chip ) : iv_chip(i_chip) {} + + /** @brief Destructor */ + ~MembufDataBundle() {} + + private: // functions + + MembufDataBundle( const MembufDataBundle & ); + const MembufDataBundle & operator=( const MembufDataBundle & ); + + private: // instance variables + + /** The MEMBUF chip associated with this data bundle. */ + ExtensibleChip * const iv_chip; + + public: // instance variables + + /** If there is a channel failure detected on this bus, there will be some + * required cleanup after analysis to mask off all further attentions from + * the bus. A channel failure could occur on either side of the bus and it + * is possible the cleanup function could be called in multiple + * PostAnalysis plugins depending on where the channel failure occurred. + * Since we only want to do one cleanup, we will use this variable to + * indicate if a cleanup is still required or has already been done. */ + bool iv_doChnlFailCleanup = false; +}; + +/** + * @brief Wrapper function for the MembufDataBundle. + * @param i_membChip The centaur chip. + * @return This centaur's data bundle. + */ +inline MembufDataBundle * getMembufDataBundle( ExtensibleChip * i_membChip ) +{ + return static_cast<MembufDataBundle *>(i_membChip->getDataBundle()); +} + +} // end namespace PRDF + +#endif // __prdfCenMembufDataBundle_H + diff --git a/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C b/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C index 00c3bf656..eda3cea48 100644 --- a/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C +++ b/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C @@ -31,6 +31,7 @@ // Platform includes #include <prdfCenMbaDataBundle.H> +#include <prdfCenMembufDataBundle.H> #include <prdfMemEccAnalysis.H> #include <prdfMemUtils.H> @@ -51,6 +52,18 @@ namespace cen_centaur //############################################################################## /** + * @brief Plugin that initializes the data bundle. + * @param i_chip A MEMBUF chip. + * @return SUCCESS + */ +int32_t Initialize( ExtensibleChip * i_chip ) +{ + i_chip->getDataBundle() = new MembufDataBundle( i_chip ); + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( cen_centaur, Initialize ); + +/** * @brief Plugin function called after analysis is complete but before PRD * exits. * @param i_chip A MEMBUF chip. @@ -61,14 +74,14 @@ namespace cen_centaur */ int32_t PostAnalysis( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ) { - #define PRDF_FUNC "[cen_centaur::PostAnalysis] " - // Cleanup processor FIR bits on the other side of the channel. MemUtils::cleanupChnlAttns<TYPE_MEMBUF>( i_chip, io_sc ); - return SUCCESS; + // If there was a channel failure some cleanup is required to ensure + // there are no more attentions from this channel. + MemUtils::cleanupChnlFail<TYPE_MEMBUF>( i_chip, io_sc ); - #undef PRDF_FUNC + return SUCCESS; } PRDF_PLUGIN_DEFINE( cen_centaur, PostAnalysis ); diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C index cc6d18143..d2dfea2bd 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C @@ -35,6 +35,7 @@ // Platform includes #include <prdfCenMbaDataBundle.H> +#include <prdfCenMembufDataBundle.H> #include <prdfMemSymbol.H> #include <prdfParserUtils.H> #include <prdfPlatServices.H> @@ -542,6 +543,9 @@ int32_t checkMcsChannelFail( ExtensibleChip * i_mcsChip, io_sc.service_data->setSecondaryAttnType(UNIT_CS); io_sc.service_data->SetThresholdMaskId(0); + // Set it as SUE generation point. + io_sc.service_data->SetUERE(); + // Indicate that cleanup is required. P8McsDataBundle * mcsdb = getMcsDataBundle( i_mcsChip ); ExtensibleChip * membChip = mcsdb->getMembChip(); @@ -564,151 +568,142 @@ int32_t checkMcsChannelFail( ExtensibleChip * i_mcsChip, #undef PRDF_FUNC } +*/ //------------------------------------------------------------------------------ -int32_t chnlCsCleanup( ExtensibleChip *i_mbChip, - STEP_CODE_DATA_STRUCT & i_sc ) +template<TARGETING::TYPE T1, TARGETING::TYPE T2> +void __cleanupChnlFail( ExtensibleChip * i_chip1, ExtensibleChip * i_chip2, + STEP_CODE_DATA_STRUCT & io_sc ); + +template<> +void __cleanupChnlFail<TYPE_DMI,TYPE_MEMBUF>( ExtensibleChip * i_dmiChip, + ExtensibleChip * i_membChip, + STEP_CODE_DATA_STRUCT & io_sc ) { - #define PRDF_FUNC "[MemUtils::chnlCsCleanup] " + #define PRDF_FUNC "[MemUtils::__cleanupChnlFail] " - int32_t o_rc = SUCCESS; + PRDF_ASSERT( nullptr != i_dmiChip ); + PRDF_ASSERT( TYPE_DMI == i_dmiChip->getType() ); - do - { - if( ( NULL == i_mbChip ) || - ( TYPE_MEMBUF != getTargetType( i_mbChip->GetChipHandle() ))) - { - PRDF_ERR( PRDF_FUNC "Invalid parameters" ); - o_rc = FAIL; break; - } + PRDF_ASSERT( nullptr != i_membChip ); + PRDF_ASSERT( TYPE_MEMBUF == i_membChip->getType() ); - if (( ! i_sc.service_data->IsUnitCS() ) || - (CHECK_STOP == i_sc.service_data->getPrimaryAttnType()) ) - break; + // No cleanup if this is a checkstop attention. + if ( CHECK_STOP == io_sc.service_data->getPrimaryAttnType() ) return; - CenMembufDataBundle * mbdb = getMembufDataBundle( i_mbChip ); - if ( !mbdb->iv_doChnlFailCleanup ) - break; // Cleanup has already been done. + // Check if cleanup is still required or has already been done. + if ( ! getMembufDataBundle(i_membChip)->iv_doChnlFailCleanup ) return; - // Set it as SUE generation point. - i_sc.service_data->SetUERE(); - - ExtensibleChip * mcsChip = mbdb->getMcsChip(); - if ( NULL == mcsChip ) - { - PRDF_ERR( PRDF_FUNC "MCS chip is NULL for Membuf:0x%08X", - i_mbChip->GetId() ); - o_rc = FAIL; break; - } + // Cleanup is complete and no longer required on this channel. + getMembufDataBundle(i_membChip)->iv_doChnlFailCleanup = false; - TargetHandle_t mcs = mcsChip->GetChipHandle(); - ExtensibleChip * procChip = NULL; - uint8_t pos = getTargetPosition( mcs ); - TargetHandle_t proc = getParentChip ( mcs ); + #ifdef __HOSTBOOT_MODULE // only do cleanup in Hostboot, no-op in FSP - if ( NULL == proc ) - { - PRDF_ERR( PRDF_FUNC "Proc is NULL for Mcs:0x%08X", getHuid( mcs ) ); - o_rc = FAIL; break; - } + // Note that this is a clean up function. If there are any SCOM errors + // we will just move on and try the rest. - procChip = (ExtensibleChip *)systemPtr->GetChip( proc ); + SCAN_COMM_REGISTER_CLASS * reg = nullptr; + ExtensibleChip * mcChip = getConnectedParent( i_dmiChip, TYPE_MC ); + uint32_t dmiPos = i_dmiChip->getPos() % MAX_DMI_PER_MC; - if( NULL == procChip ) - { - PRDF_ERR( PRDF_FUNC "Can not find Proc chip for HUID:0x%08X", - getHuid( proc) ); - o_rc = FAIL; break; - } + // Mask off all attentions from the DMI target in the chiplet FIRs. + reg = mcChip->getRegister( "MC_CHIPLET_FIR_MASK" ); + if ( SUCCESS == reg->Read() ) + { + reg->SetBit( 4 + (dmiPos * 2) ); // 4, 6, 8, 10 + reg->Write(); + } - // This is a cleanup function. If we get any error from scom - // operations, we will still continue with cleanup. - SCAN_COMM_REGISTER_CLASS * l_tpMask = - procChip->getRegister("TP_CHIPLET_FIR_MASK"); - o_rc |= l_tpMask->Read(); - if ( SUCCESS == o_rc ) - { - // Bits 5-12 maps to attentions from MCS0-MCS7. - l_tpMask->SetBit( 5 + pos ); - o_rc |= l_tpMask->Write(); - } + reg = mcChip->getRegister( "MC_CHIPLET_UCS_FIR_MASK" ); + if ( SUCCESS == reg->Read() ) + { + reg->SetBit( 1 + (dmiPos * 2) ); // 1, 3, 5, 7 + reg->Write(); + } - // Mask attentions from the Centaur - const char *iomcFirMask = ( pos < 4 )? - "IOMCFIR_0_MASK_OR":"IOMCFIR_1_MASK_OR"; + reg = mcChip->getRegister( "MC_CHIPLET_HA_FIR_MASK" ); + if ( SUCCESS == reg->Read() ) + { + reg->SetBit( 1 + (dmiPos * 2) ); // 1, 3, 5, 7 + reg->Write(); + } - SCAN_COMM_REGISTER_CLASS * iomcMask = - procChip->getRegister( iomcFirMask); - if ( pos >= 4 ) pos -= 4; + // Mask off all attentions from the DMI target in the IOMCFIR. + reg = mcChip->getRegister( "IOMCFIR_MASK_OR" ); + reg->SetBitFieldJustified( 8 + (dmiPos * 8), 8, 0xff ); // 8, 16, 24, 32 + reg->Write(); - // 8 bits are reserved for each Centaur in IOMCFIR. - // There are total 4 ( for P system ) centaur supported - // in MCS. Bits for first centaur starts from bit 8. + // Mask off all attentions from the MEMBUF target in the chiplet FIRs. + const char * reg_strs[] { "TP_CHIPLET_FIR_MASK", + "NEST_CHIPLET_FIR_MASK", + "MEM_CHIPLET_FIR_MASK", + "MEM_CHIPLET_SPA_FIR_MASK" }; + for ( auto & reg_str : reg_strs ) + { + reg = i_membChip->getRegister( reg_str ); + reg->setAllBits(); // Blindly mask everything + reg->Write(); + } - iomcMask->SetBitFieldJustified( 8+ ( pos*8 ), 8, 0xff); + // For all attached MBAs: + // During runtime, send a dynamic memory deallocation message. + // During Memory Diagnostics, tell MDIA to stop pattern tests. + for ( auto & mbaChip : getConnected(i_membChip, TYPE_MBA) ) + { + #ifdef __HOSTBOOT_RUNTIME + MemDealloc::port<TYPE_MBA>( mbaChip ); + #else + if ( isInMdiaMode() ) + mdiaSendEventMsg( mbaChip->getTrgt(), MDIA::STOP_TESTING ); + #endif + } - o_rc |= iomcMask->Write(); + #endif // Hostboot only - SCAN_COMM_REGISTER_CLASS * l_tpfirmask = NULL; - SCAN_COMM_REGISTER_CLASS * l_nestfirmask = NULL; - SCAN_COMM_REGISTER_CLASS * l_memfirmask = NULL; - SCAN_COMM_REGISTER_CLASS * l_memspamask = NULL; + #undef PRDF_FUNC +} - l_tpfirmask = i_mbChip->getRegister("TP_CHIPLET_FIR_MASK"); - l_nestfirmask = i_mbChip->getRegister("NEST_CHIPLET_FIR_MASK"); - l_memfirmask = i_mbChip->getRegister("MEM_CHIPLET_FIR_MASK"); - l_memspamask = i_mbChip->getRegister("MEM_CHIPLET_SPA_FIR_MASK"); +template<> +void cleanupChnlFail<TYPE_MEMBUF>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_MEMBUF == i_chip->getType() ); - l_tpfirmask->setAllBits(); o_rc |= l_tpfirmask->Write(); - l_nestfirmask->setAllBits(); o_rc |= l_nestfirmask->Write(); - l_memfirmask->setAllBits(); o_rc |= l_memfirmask->Write(); - l_memspamask->setAllBits(); o_rc |= l_memspamask->Write(); + ExtensibleChip * dmiChip = getConnectedParent( i_chip, TYPE_DMI ); + __cleanupChnlFail<TYPE_DMI,TYPE_MEMBUF>( dmiChip, i_chip, io_sc ); +} - for ( uint32_t i = 0; i < MAX_MBA_PER_MEMBUF; i++ ) - { - ExtensibleChip * mbaChip = mbdb->getMbaChip( i ); - if( NULL != mbaChip ) - { - TargetHandle_t mba = mbaChip->GetChipHandle(); - if ( NULL != mba ) - { - #if defined(__HOSTBOOT_MODULE) && \ - !defined(__HOSTBOOT_RUNTIME) - // This is very small platform specific code. So not - // creating a separate file for this. - int32_t l_rc = mdiaSendEventMsg( mba, MDIA::SKIP_MBA ); - if ( SUCCESS != l_rc ) - { - PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(0x%08x, SKIP_MBA)" - " failed", getHuid( mba ) ); - o_rc |= l_rc; - } - #else - int32_t l_rc = DEALLOC::mbaGard( mbaChip ); - if ( SUCCESS != l_rc ) - { - PRDF_ERR( PRDF_FUNC "mbaGard failed. HUID: 0x%08x", - getHuid( mba ) ); - o_rc |= l_rc; - } - #endif // __HOSTBOOT_MODULE - } - } - } +template<> +void cleanupChnlFail<TYPE_DMI>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_DMI == i_chip->getType() ); - // Clean up complete an is no longer required. - mbdb->iv_doChnlFailCleanup = false; + ExtensibleChip * membChip = getConnectedChild( i_chip, TYPE_MEMBUF, 0 ); + PRDF_ASSERT( nullptr != membChip ); // shouldn't be possible - } while(0); + __cleanupChnlFail<TYPE_DMI,TYPE_MEMBUF>( i_chip, membChip, io_sc ); +} - return o_rc; +template<> +void cleanupChnlFail<TYPE_MC>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_MC == i_chip->getType() ); - #undef PRDF_FUNC + for ( auto & dmiChip : getConnected(i_chip, TYPE_DMI) ) + { + cleanupChnlFail<TYPE_DMI>( dmiChip, io_sc ); + } } + //------------------------------------------------------------------------------ -*/ + } // end namespace MemUtils } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H index 716a2c6f0..64e04baac 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H @@ -119,15 +119,6 @@ int32_t checkMcsChannelFail( ExtensibleChip * i_mcsChip, STEP_CODE_DATA_STRUCT & io_sc ); /** - * @brief Cleanup for channel CS. - * @param i_mbChip Membuf chip. - * @param i_sc Service Data Collector. - * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. - */ -int32_t chnlCsCleanup( ExtensibleChip *i_mbChip, - STEP_CODE_DATA_STRUCT & i_sc ); - -/** * @brief determines the type of Centaur based raw card associated with MBA. * @param i_mba mba target * @param o_type raw card type. @@ -149,6 +140,18 @@ int32_t getRawCardType( TARGETING::TargetHandle_t i_mba, template<TARGETING::TYPE T> void cleanupChnlAttns( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ); +/** + * @brief After analyzing a memory channel failure, we want to mask off all + * possible attentions on that channel to ensure we don't get any errant + * attentions. + * @note Intended to be called in the memory buffer PostAnalysis after the + * rule code has cleared the analyzed attention. + * @param i_chip MEMBUF, DMI, or MC chip. + * @param io_sc The step code data struct. + */ +template<TARGETING::TYPE T> +void cleanupChnlFail( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ); + } // end namespace MemUtils } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/p9/p9_mc_regs.rule b/src/usr/diag/prdf/common/plat/p9/p9_mc_regs.rule new file mode 100644 index 000000000..6f796bd73 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/p9_mc_regs.rule @@ -0,0 +1,41 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/common/plat/p9/p9_mc_regs.rule $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2018 +# [+] 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 + +################################################################################ +# Additional registers for MC target, not defined in XML +################################################################################ + + ############################################################################ + # P9 MC target IOMCFIR + ############################################################################ + + register IOMCFIR_MASK_OR + { + name "P9 MC target IOMCFIR MASK atomic OR"; + scomaddr 0x07011005; + capture group never; + access write_only; + }; + diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Dmi_common.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Dmi_common.C new file mode 100644 index 000000000..801b25f89 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Dmi_common.C @@ -0,0 +1,76 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Dmi_common.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 <iipServiceDataCollector.h> +#include <prdfExtensibleChip.H> +#include <prdfPluginDef.H> +#include <prdfPluginMap.H> + +// Platform includes +#include <prdfMemUtils.H> +#include <prdfPlatServices.H> + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; + +namespace p9_dmi +{ + +//############################################################################## +// +// Special plugins +// +//############################################################################## + +/** + * @brief Plugin function called after analysis is complete but before PRD + * exits. + * @param i_chip A DMI chip. + * @param io_sc The step code data struct. + * @note This is especially useful for any analysis that still needs to be + * done after the framework clears the FIR bits that were at attention. + * @return SUCCESS. + */ +int32_t PostAnalysis( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ) +{ + // If there was a channel failure some cleanup is required to ensure + // there are no more attentions from this channel. + MemUtils::cleanupChnlFail<TYPE_DMI>( i_chip, io_sc ); + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( p9_dmi, PostAnalysis ); + +//------------------------------------------------------------------------------ + +} // end namespace p9_dmi + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9Mc_common.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Mc_common.C new file mode 100644 index 000000000..50ad49f53 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Mc_common.C @@ -0,0 +1,78 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Mc_common.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 <iipServiceDataCollector.h> +#include <prdfExtensibleChip.H> +#include <prdfPluginDef.H> +#include <prdfPluginMap.H> + +// Platform includes +#include <prdfMemUtils.H> +#include <prdfPlatServices.H> + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace PlatServices; + +namespace p9_mc +{ + +//############################################################################## +// +// Special plugins +// +//############################################################################## + +/** + * @brief Plugin function called after analysis is complete but before PRD + * exits. + * @param i_chip An MC chip. + * @param io_sc The step code data struct. + * @note This is especially useful for any analysis that still needs to be + * done after the framework clears the FIR bits that were at attention. + * @return SUCCESS. + */ +int32_t PostAnalysis( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ) +{ + // If there was a channel failure some cleanup is required to ensure there + // are no more attentions from the failed channel. This is required to do + // for the MC target just in case isolation was to the IOMCFIR, which + // contains FIR bits for each of the four attached channels. + MemUtils::cleanupChnlFail<TYPE_MC>( i_chip, io_sc ); + + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( p9_mc, PostAnalysis ); + +//------------------------------------------------------------------------------ + +} // end namespace p9_mc + +} // 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 6b6cf11e1..cb69cad14 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 @@ -54,3 +54,6 @@ prd_rule_plugin += prdfP9Ex.o prd_rule_plugin += prdfP9Ec.o prd_rule_plugin += prdfP9Eq.o prd_rule_plugin += prdfP9TodPlugins.o +prd_rule_plugin += prdfP9Dmi_common.o +prd_rule_plugin += prdfP9Mc_common.o + diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C index f4cdba115..95dcc0c22 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C @@ -183,34 +183,6 @@ int32_t PreAnalysis( ExtensibleChip * i_mbChip, STEP_CODE_DATA_STRUCT & i_sc, } PRDF_PLUGIN_DEFINE( Membuf, PreAnalysis ); -//------------------------------------------------------------------------------ - -/** - * @brief Plugin function called after analysis is complete but before PRD - * exits. - * @param i_mbChip A Centaur chip. - * @param i_sc The step code data struct. - * @note This is especially useful for any analysis that still needs to be - * done after the framework clears the FIR bits that were at attention. - * @return SUCCESS. - */ -int32_t PostAnalysis( ExtensibleChip * i_mbChip, STEP_CODE_DATA_STRUCT & i_sc ) -{ - #define PRDF_FUNC "[Membuf::PostAnalysis] " - int32_t l_rc; - - l_rc = MemUtils::chnlCsCleanup( i_mbChip, i_sc ); - if( SUCCESS != l_rc ) - { - PRDF_ERR( PRDF_FUNC "ChnlCsCleanup() failed"); - } - - return SUCCESS; - - #undef PRDF_FUNC -} -PRDF_PLUGIN_DEFINE( Membuf, PostAnalysis ); - //############################################################################## // // DMIFIR diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembufDataBundle.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembufDataBundle.H deleted file mode 100644 index 96f6c99c8..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembufDataBundle.H +++ /dev/null @@ -1,148 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMembufDataBundle.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* 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 __prdfCenMembufDataBundle_H -#define __prdfCenMembufDataBundle_H - -/** @file prdfCenMembufDataBundle.H - * @brief Contains the common data bundle for a PRD Centaur object. - */ - -#include <iipSystem.h> -#include <prdfExtensibleChip.H> -#include <prdfGlobal.H> -#include <prdfPlatServices.H> - -namespace PRDF -{ - -/** - * @brief Data container for the Centaur Membuf chip. - */ -class CenMembufDataBundle : public DataBundle -{ - public: - - /** @brief Constructor */ - CenMembufDataBundle( ExtensibleChip * i_membChip ) : - iv_membChip(i_membChip), iv_mcsChip(NULL), - iv_analyzeMba1Starvation(false), iv_doChnlFailCleanup(false) - { - for ( uint32_t i = 0; i < MAX_MBA_PER_MEMBUF; i++ ) - iv_mbaChips[i] = NULL; - } - - /** @brief Destructor */ - ~CenMembufDataBundle() {} - - /** @return The connected MCS chip. */ - ExtensibleChip * getMcsChip() - { - using namespace TARGETING; - using namespace PlatServices; - - if ( NULL == iv_mcsChip ) - { - TargetHandle_t memb = iv_membChip->GetChipHandle(); - - TargetHandle_t mcs = getConnectedParent( memb, TYPE_MCS ); - if ( NULL != mcs ) - iv_mcsChip = (ExtensibleChip *)systemPtr->GetChip( mcs ); - } - - return iv_mcsChip; - } - - /** @return The connected MBA0 chip. */ - ExtensibleChip * getMbaChip( uint32_t i_pos ) - { - using namespace TARGETING; - using namespace PlatServices; - - ExtensibleChip * mbaChip = NULL; - - if ( MAX_MBA_PER_MEMBUF > i_pos ) - { - if ( NULL == iv_mbaChips[i_pos] ) - { - TargetHandle_t memb = iv_membChip->GetChipHandle(); - - TargetHandle_t mba = getConnectedChild( memb, TYPE_MBA, i_pos ); - if ( NULL != mba ) - { - iv_mbaChips[i_pos] - = (ExtensibleChip *)systemPtr->GetChip(mba); - } - } - - mbaChip = iv_mbaChips[i_pos]; - } - else - { - PRDF_ERR( "[CenMembufDataBundle::getMbaChip] Invalid parameter: " - "i_pos=%d", i_pos ); - } - - return mbaChip; - } - - private: // functions - - CenMembufDataBundle( const CenMembufDataBundle & ); - const CenMembufDataBundle & operator=( const CenMembufDataBundle & ); - - private: // instance variables - - ExtensibleChip * iv_membChip; ///< This MEMBUF chip - ExtensibleChip * iv_mcsChip; ///< The connected MCS chip - ExtensibleChip * iv_mbaChips[MAX_MBA_PER_MEMBUF]; ///< Connected MBA chips - - public: // instance variables - - // Toggles to solve MBA1 starvation issue - bool iv_analyzeMba1Starvation; - - /** The channel fail cleanup function is called in both the MCS and MEMBUF - * PostAnalysis() plugins. It is possible in some cases that both plugins - * are called in the same analysis path. In this case the cleanup will be - * called twice. To circumvent this we will use this bool to determine if - * the cleanup has been done or needs to be done. */ - bool iv_doChnlFailCleanup; -}; - -/** - * @brief Wrapper function for the CenMembufDataBundle. - * @param i_membChip The centaur chip. - * @return This centaur's data bundle. - */ -inline CenMembufDataBundle * getMembufDataBundle( ExtensibleChip * i_membChip ) -{ - return static_cast<CenMembufDataBundle *>(i_membChip->getDataBundle()); -} - -} // end namespace PRDF - -#endif // __prdfCenMembufDataBundle_H - diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C index dd206ba3e..7b1dddc4f 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C @@ -96,38 +96,6 @@ int32_t PreAnalysis( ExtensibleChip * i_mcsChip, STEP_CODE_DATA_STRUCT & i_sc, PRDF_PLUGIN_DEFINE( Mcs, PreAnalysis ); /** - * @brief Plugin function called after analysis is complete but before PRD - * exits. - * @param i_mcsChip MCS chip - * @param i_sc The step code data struct. - * @note This is especially useful for any analysis that still needs to be - * done after the framework clears the FIR bits that were at attention. - * @return SUCCESS. - */ -int32_t PostAnalysis( ExtensibleChip * i_mcsChip, - STEP_CODE_DATA_STRUCT & i_sc ) -{ - #define PRDF_FUNC "[Mcs::PostAnalysis] " - int32_t l_rc = SUCCESS; - - P8McsDataBundle * mcsdb = getMcsDataBundle( i_mcsChip ); - ExtensibleChip * membChip = mcsdb->getMembChip(); - if ( NULL != membChip ) - { - l_rc = MemUtils::chnlCsCleanup( membChip, i_sc ); - if( SUCCESS != l_rc ) - { - PRDF_ERR( PRDF_FUNC "ChnlCsCleanup() failed for Membuf:0x%08X", - membChip->GetId() ); - } - } - - return SUCCESS; - #undef PRDF_FUNC -} -PRDF_PLUGIN_DEFINE( Mcs, PostAnalysis ); - -/** * @fn ClearMbsSecondaryBits * @brief Clears MBS secondary Fir bits which may come up because of MCIFIR * @param i_chip The Mcs chip. diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C index 5db33807c..1a9f5573f 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* Contributors Listed Below - COPYRIGHT 2012,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -465,14 +465,6 @@ int32_t maxSparesExceeded_MCS( ExtensibleChip * i_procChip, l_rc = FAIL; break; } - // Do channel fail cleanup. - l_rc = MemUtils::chnlCsCleanup( membChip, i_sc ); - if ( SUCCESS != l_rc ) - { - PRDF_ERR( PRDF_FUNC "chnlCsCleanup() failed" ); - break; - } - } while (0); if ( SUCCESS != l_rc ) |