diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2016-07-20 19:52:11 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-08-31 18:00:47 -0400 |
commit | 57e84c7a1e4cc3127213f6fb48052361bb167dee (patch) | |
tree | 62d3f54449ac25d11aca58be35ae18d68e7fd126 /src/usr/diag | |
parent | 06b0dd98b87dcf48f5a0207f9e28d458dba31c3c (diff) | |
download | talos-hostboot-57e84c7a1e4cc3127213f6fb48052361bb167dee.tar.gz talos-hostboot-57e84c7a1e4cc3127213f6fb48052361bb167dee.zip |
PRD: Add support to stop background scrubbing
Change-Id: I20acb278cb3c6c9dc2213f804554a31351ed004f
RTC: 157894
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27915
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28815
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/diag')
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C | 36 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C | 8 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices.H | 1 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices_rt.C | 78 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices_rt.H (renamed from src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H) | 14 | ||||
-rw-r--r-- | src/usr/diag/prdf/prdf_hb_only.mk | 14 | ||||
-rwxr-xr-x | src/usr/diag/prdf/test/prdf_hb_common_test.mk | 5 |
7 files changed, 111 insertions, 45 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C index 51aba3c98..ea292c33a 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C @@ -200,39 +200,11 @@ int32_t CenMbaTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, // Stop background scrubbing. Whether to start a new TD procedure or to // temporarily mask TPS triggers while TPS is banned to prevent // flooding. - if ( NULL == iv_mssCmd ) - { - // This scenario will only exist if there was a resest/reload or - // failover. It should be safe to just make a dummy command so that - // we can stop the current command. - iv_mssCmd = createMssCmd( mss_MaintCmdWrapper::TIMEBASE_SCRUB, - iv_mbaTrgt, CenRank(0), 0 ); - if ( NULL == iv_mssCmd ) - { - PRDF_ERR( PRDF_FUNC "createMssCmd() failed" ); - break; - } - - o_rc = iv_mssCmd->stopCmd(); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "stopCmd() failed" ); - break; - } - - // We don't want to chance calling cleanupCmd() on this command - // since we created a temporary command object just to stop - // background scrubbing. Therefore, delete the object. - delete iv_mssCmd; iv_mssCmd = NULL; - } - else + o_rc = stopBgScrub<TYPE_MBA>( iv_mbaTrgt ); + if ( SUCCESS != o_rc ) { - o_rc = iv_mssCmd->stopCmd(); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "stopCmd() failed" ); - break; - } + PRDF_ERR( PRDF_FUNC "stopBgScrub<TYPE_MBA>() failed" ); + break; } // If the queue is empty, there were no pending requests and the new diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C index c1ea99144..d4da567dc 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C @@ -132,7 +132,13 @@ uint32_t MemTdCtlr<T,D>::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, if ( nullptr != iv_curProcedure ) break; // Stop background scrubbing. - // TODO: RTC 136126 + o_rc = stopBgScrub<T>( iv_chip->getTrgt() ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "stopBgScrub<T>(0x%08x) failed", + iv_chip->getHuid() ); + break; + } // Move onto the next step in the state machine. o_rc = nextStep( io_sc ); diff --git a/src/usr/diag/prdf/plat/prdfPlatServices.H b/src/usr/diag/prdf/plat/prdfPlatServices.H index 6fc4c8cf7..66a8556e0 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices.H +++ b/src/usr/diag/prdf/plat/prdfPlatServices.H @@ -34,6 +34,7 @@ * is common between FSP and Hostboot should be in the respective common file. */ +#include <lib/mcbist/memdiags.H> ///< MCBIST command interfaces //#include <utility_procedures/mss_maint_cmds.H> TODO: RTC 136126 // This must be included after all Hostboot specific includes. This will take diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C index 7828c095c..423acb3ad 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C @@ -31,12 +31,20 @@ * is common between FSP and Hostboot should be in the respective common file. */ -#include <prdfPlatServices.H> +// Framework includes +#include <prdfErrlUtil.H> #include <prdfTrace.H> + +// Platform includes +#include <prdfPlatServices.H> + +// Other includes #include <runtime/interface.h> //------------------------------------------------------------------------------ +using namespace TARGETING; + namespace PRDF { @@ -105,6 +113,74 @@ void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ) #undef PRDF_FUNC } +//############################################################################## +//## MCBIST Command wrappers +//############################################################################## + +template<> +uint32_t stopBgScrub<TYPE_MCBIST>( TargetHandle_t i_trgt ) +{ + #define PRDF_FUNC "[PlatServices::stopBgScrub<TYPE_MCBIST>] " + + PRDF_ASSERT( TYPE_MCBIST == getTargetType(i_trgt) ); + + uint32_t rc = SUCCESS; + + fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiTrgt ( i_trgt ); + + fapi2::ReturnCode fapi_rc = memdiags::stop( fapiTrgt ); + + errlHndl_t errl = fapi2::rcToErrl( fapi_rc ); + if ( nullptr != errl ) + { + PRDF_ERR( PRDF_FUNC "memdiags::stop(0x%08x) failed", getHuid(i_trgt) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + rc = FAIL; + } + + return rc; + + #undef PRDF_FUNC +} + +//############################################################################## +//## MBA Command wrappers +//############################################################################## + +template<> +uint32_t stopBgScrub<TYPE_MBA>( TargetHandle_t i_trgt ) +{ + #define PRDF_FUNC "[PlatServices::stopBgScrub<TYPE_MBA>] " + + PRDF_ASSERT( TYPE_MBA == getTargetType(i_trgt) ); + + uint32_t rc = SUCCESS; + + PRDF_ERR( PRDF_FUNC "function not implemented yet" ); +/* TODO RTC 136126 + // It is safe to create a dummy command object because runtime commands do + // not store anything for cleanupCmd() and the stopCmd() function is generic + // for all command types. Also, since we are only stopping the command, all + // of the parameters for the command object are junk except for the target. + ecmdDataBufferBase i_startAddr, i_endAddr; + mss_TimeBaseScrub cmd { getFapiTarget(i_trgt), i_startAddr, i_endAddr, + mss_MaintCmd::FAST_MAX_BW_IMPACT, 0, false }; + + errlHndl_t errl = fapi::fapiRcToErrl( cmd.stopCmd() ); + if ( nullptr != errl ) + { + PRDF_ERR( PRDF_FUNC "mss_TimeBaseScrub::stop(0x%08x) failed", + getHuid(i_trgt) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + rc = FAIL; + } +*/ + + return rc; + + #undef PRDF_FUNC +} + //------------------------------------------------------------------------------ } // end namespace PlatServices diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H index 7f5956c24..cf9312770 100644 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H $ */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices_rt.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ @@ -58,6 +58,18 @@ void sendLmbGardRequest( uint64_t i_systemAddress, bool i_isFetchUE ); */ void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ); +//############################################################################## +//## MCBIST/Maintenance Command wrappers +//############################################################################## + +/** + * @brief Stops Background Scrubbing. + * @param i_trgt MCBIST or MBA target. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +template<TARGETING::TYPE T> +uint32_t stopBgScrub( TARGETING::TargetHandle_t i_trgt ); + } // end namespace PlatServices } // end namespace PRDF diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index b0b9ddacb..0d972059e 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -51,13 +51,14 @@ prd_incpath += ${PRD_SRC_PATH}/plat # External header paths prd_incpath += ${ROOTPATH}/src/include/usr/ecmddatabuffer prd_incpath += ${ROOTPATH}/src/include/usr/errl -prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include prd_incpath += ${ROOTPATH}/src/include/usr/fapi2 prd_incpath += ${ROOTPATH}/src/include/usr/ibscom prd_incpath += ${ROOTPATH}/src/include/usr/util -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/bus_training -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/include -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete +prd_incpath += ${ROOTPATH}/src/import/chips/p9/common/include/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ +prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include ################################################################################ # Hostboot only object files common to both IPL and runtime @@ -152,11 +153,6 @@ prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/eff_confi prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/ prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/utils/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/common/include/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ - prd_obj_no_sim += mcbist.o prd_obj_no_sim += sim.o prd_obj_no_sim += rank.o diff --git a/src/usr/diag/prdf/test/prdf_hb_common_test.mk b/src/usr/diag/prdf/test/prdf_hb_common_test.mk index 2bd0f5823..dd574a2c6 100755 --- a/src/usr/diag/prdf/test/prdf_hb_common_test.mk +++ b/src/usr/diag/prdf/test/prdf_hb_common_test.mk @@ -52,10 +52,13 @@ EXTRAINCDIR += ${PRD_USR_PATH}/test EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer EXTRAINCDIR += ${ROOTPATH}/src/include/usr/errl +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 EXTRAINCDIR += ${ROOTPATH}/src/include/usr/util +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 #------------------------------------------------------------------------------ # objects |