From 3eac7d61c5a1f78006c1c4b0e9621d91e2dbf47f Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Wed, 29 Mar 2017 15:44:23 -0500 Subject: PRD: add support to resume background scrubbing after pause on error Change-Id: I3059a243c343c3508a4fb89bea5aa70cb27afd5c RTC: 164704 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38595 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38700 Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins --- src/usr/diag/prdf/plat/prdfPlatServices_rt.C | 64 ++++++++++++++++++++++++++++ src/usr/diag/prdf/plat/prdfPlatServices_rt.H | 21 ++++++++- 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C index 5a99e7ed5..241344e0a 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C @@ -155,6 +155,47 @@ uint32_t stopBgScrub( ExtensibleChip * i_chip ) return stopBgScrub( getConnectedParent(i_chip, TYPE_MCBIST) ); } +//------------------------------------------------------------------------------ + +template<> +uint32_t resumeBgScrub( ExtensibleChip * i_chip ) +{ + #define PRDF_FUNC "[PlatServices::resumeBgScrub] " + + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_MCBIST == i_chip->getType() ); + + uint32_t rc = SUCCESS; + + fapi2::Target fapiTrgt ( i_chip->getTrgt() ); + + errlHndl_t errl; + FAPI_INVOKE_HWP( errl, memdiags::continue_cmd, fapiTrgt ); + + if ( nullptr != errl ) + { + PRDF_ERR( PRDF_FUNC "memdiags::continue_cmd(0x%08x) failed", + i_chip->getHuid() ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + rc = FAIL; + } + + return rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +template<> +uint32_t resumeBgScrub( ExtensibleChip * i_chip ) +{ + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_MCA == i_chip->getType() ); + + return resumeBgScrub(getConnectedParent(i_chip, TYPE_MCBIST)); +} + //############################################################################## //## Centaur Maintenance Command wrappers //############################################################################## @@ -196,6 +237,29 @@ uint32_t stopBgScrub( ExtensibleChip * i_chip ) //------------------------------------------------------------------------------ +template<> +uint32_t resumeBgScrub( ExtensibleChip * i_chip ) +{ + #define PRDF_FUNC "[PlatServices::resumeBgScrub] " + + PRDF_ASSERT( nullptr != i_chip ); + PRDF_ASSERT( TYPE_MBA == i_chip->getType() ); + + uint32_t rc = SUCCESS; + + PRDF_ERR( PRDF_FUNC "function not implemented yet" ); + + /* TODO: RTC 157888 - Not entirely sure how to do this. Will require a inc + * command followed by a start command. May need the stop conditions + * for the start command. */ + + return rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + } // end namespace PlatServices } // end namespace PRDF diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.H b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H index b591b06ee..66da25424 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices_rt.H +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -70,6 +70,25 @@ void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ); template uint32_t stopBgScrub( ExtensibleChip * i_chip ); +/** + * @brief Resumes background scrubbing after it has paused on error. + * + * There are use cases where we want background scrubbing to pause on error in + * order to collect FFDC (specifically address information), in which case we + * will not start a Targeted Diagnostics procedure. Instead, this command will + * resume the background scrubbing procedure already set up in hardware, + * starting on the next configured address. + * + * @note This function should only be called after pausing background scrubbing + * due to an error. It should not be called after executing a Targeted + * Diagnotics procedure. + * + * @param i_chip MCBIST, MCA, or MBA chip. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +template +uint32_t resumeBgScrub( ExtensibleChip * i_chip ); + } // end namespace PlatServices } // end namespace PRDF -- cgit v1.2.1