From 2bb80fdb4caabf48b2652be42cbf5a9bfb08405c Mon Sep 17 00:00:00 2001 From: Caleb Palmer Date: Mon, 15 Apr 2019 15:00:00 -0500 Subject: PRD: Axone Dram Spare Deploy (DSD) updates Change-Id: I5ae1900276a52c258a31cf54162ab159e56aee23 RTC: 208698 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76005 Tested-by: Jenkins Server Reviewed-by: Brian J. Stegmiller Reviewed-by: Benjamen G. Tyner Reviewed-by: Zane C. Shelley Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78327 Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW --- src/usr/diag/prdf/plat/mem/prdfMemDsd.H | 4 +- src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C | 98 +++++++++++++++++++------- src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C | 73 ++++++++++++------- src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C | 25 ++++--- 4 files changed, 141 insertions(+), 59 deletions(-) (limited to 'src/usr/diag/prdf/plat/mem') diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd.H b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H index 5990a902e..063e92775 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemDsd.H +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -47,7 +47,7 @@ class DsdEvent : public TdEntry /** * @brief Constructor - * @param i_chip MCA or MBA. + * @param i_chip MCA, MBA, or OCMB. * @param i_rank Rank reporting chip mark. */ DsdEvent( ExtensibleChip * i_chip, const MemRank & i_rank, diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C index 70a6be7f2..0e6069315 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd_ipl.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,18 +37,12 @@ namespace PRDF using namespace PlatServices; -//############################################################################## -// -// Specializations for MBA -// -//############################################################################## - -template<> -uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, - STEP_CODE_DATA_STRUCT & io_sc, - bool & o_done ) +template +uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) { - #define PRDF_FUNC "[DsdEvent::checkEcc] " + #define PRDF_FUNC "[DsdEvent::checkEcc] " uint32_t o_rc = SUCCESS; @@ -71,7 +65,7 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, // At this point we don't actually have an address for the UE. The // best we can do is get the address in which the command stopped. MemAddr addr; - o_rc = getMemMaintAddr( iv_chip, addr ); + o_rc = getMemMaintAddr( iv_chip, addr ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "getMemMaintAddr(0x%08x) failed", @@ -79,8 +73,8 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, break; } - o_rc = MemEcc::handleMemUe( iv_chip, addr, - UE_TABLE::SCRUB_UE, io_sc ); + o_rc = MemEcc::handleMemUe( iv_chip, addr, + UE_TABLE::SCRUB_UE, io_sc ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "handleMemUe(0x%08x,0x%02x) failed", @@ -101,12 +95,12 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, //------------------------------------------------------------------------------ -template<> -uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, - STEP_CODE_DATA_STRUCT & io_sc, - bool & o_done ) +template +uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) { - #define PRDF_FUNC "[DsdEvent::verifySpare] " + #define PRDF_FUNC "[DsdEvent::verifySpare] " uint32_t o_rc = SUCCESS; @@ -128,8 +122,15 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, // Set the bad spare in the VPD. At this point, the chip mark // should have already been set in the VPD because it was recently // verified. + TargetHandle_t bitmapTrgt = iv_chip->getTrgt(); + if ( TYPE_OCMB_CHIP == T ) + { + ExtensibleChip * bitmapChip = getConnectedChild( iv_chip, + TYPE_MEM_PORT, iv_mark.getSymbol().getPortSlct() ); + bitmapTrgt = bitmapChip->getTrgt(); + } MemDqBitmap bitmap; - o_rc = getBadDqBitmap( iv_chip->getTrgt(), iv_rank, bitmap ); + o_rc = getBadDqBitmap( bitmapTrgt, iv_rank, bitmap ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "getBadDqBitmap() failed" ); @@ -149,7 +150,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, } } - o_rc = setBadDqBitmap( iv_chip->getTrgt(), iv_rank, bitmap ); + o_rc = setBadDqBitmap( bitmapTrgt, iv_rank, bitmap ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "setBadDqBitmap() failed" ); @@ -166,7 +167,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, PRDFSIG_DsdDramSpared ); // Remove the chip mark. - o_rc = MarkStore::clearChipMark( iv_chip, iv_rank ); + o_rc = MarkStore::clearChipMark( iv_chip, iv_rank ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "clearChipMark(0x%08x,0x%02x) failed", @@ -190,7 +191,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, template<> uint32_t DsdEvent::startCmd() { - #define PRDF_FUNC "[DsdEvent::startCmd] " + #define PRDF_FUNC "[DsdEvent::startCmd] " uint32_t o_rc = SUCCESS; @@ -231,7 +232,50 @@ uint32_t DsdEvent::startCmd() //------------------------------------------------------------------------------ template<> -uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) +uint32_t DsdEvent::startCmd() +{ + #define PRDF_FUNC "[DsdEvent::startCmd] " + + uint32_t o_rc = SUCCESS; + + mss::mcbist::stop_conditions<> stopCond; + + switch ( iv_phase ) + { + case TD_PHASE_1: + // Start the steer cleanup procedure on this master rank. + o_rc = startTdSteerCleanup( iv_chip, iv_rank, + MASTER_RANK, stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdSteerCleanup(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + break; + + case TD_PHASE_2: + // Start the superfast read procedure on this master rank. + o_rc = startTdSfRead( iv_chip, iv_rank, MASTER_RANK, + stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdSfRead(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + break; + + default: PRDF_ASSERT( false ); // invalid phase + } + + return o_rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +template +uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) { uint32_t signature = 0; @@ -260,5 +304,9 @@ uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) //------------------------------------------------------------------------------ +// Avoid linker errors with the template. +template class DsdEvent; +template class DsdEvent; + } // end namespace PRDF diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C index 42b7eb9fc..c7023662d 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemDsd_rt.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2018 */ +/* Contributors Listed Below - COPYRIGHT 2018,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,16 +36,10 @@ namespace PRDF using namespace PlatServices; -//############################################################################## -// -// Specializations for MBA -// -//############################################################################## - -template<> -uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, - STEP_CODE_DATA_STRUCT & io_sc, - bool & o_done ) +template +uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) { #define PRDF_FUNC "[DsdEvent::checkEcc] " @@ -64,7 +58,7 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, // At this point we don't actually have an address for the UE. The // best we can do is get the address in which the command stopped. MemAddr addr; - o_rc = getMemMaintAddr( iv_chip, addr ); + o_rc = getMemMaintAddr( iv_chip, addr ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "getMemMaintAddr(0x%08x) failed", @@ -72,8 +66,8 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, break; } - o_rc = MemEcc::handleMemUe( iv_chip, addr, - UE_TABLE::SCRUB_UE, io_sc ); + o_rc = MemEcc::handleMemUe( iv_chip, addr, + UE_TABLE::SCRUB_UE, io_sc ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "handleMemUe(0x%08x,0x%02x) failed", @@ -83,7 +77,7 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, // Because of the UE, any further TPS requests will likely have no // effect. So ban all subsequent requests. - MemDbUtils::banTps( iv_chip, addr.getRank() ); + MemDbUtils::banTps( iv_chip, addr.getRank() ); // Leave the mark in place and abort this procedure. o_done = true; break; @@ -114,12 +108,12 @@ uint32_t DsdEvent::checkEcc( const uint32_t & i_eccAttns, //------------------------------------------------------------------------------ -template<> -uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, - STEP_CODE_DATA_STRUCT & io_sc, - bool & o_done ) +template +uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, + STEP_CODE_DATA_STRUCT & io_sc, + bool & o_done ) { - #define PRDF_FUNC "[DsdEvent::verifySpare] " + #define PRDF_FUNC "[DsdEvent::verifySpare] " uint32_t o_rc = SUCCESS; @@ -134,7 +128,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, // error (i.e. a UE). bool lastAddr = false; - o_rc = didCmdStopOnLastAddr( iv_chip, MASTER_RANK, lastAddr ); + o_rc = didCmdStopOnLastAddr( iv_chip, MASTER_RANK, lastAddr ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "didCmdStopOnLastAddr(0x%08x) failed", @@ -155,7 +149,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, io_sc.service_data->setSignature( iv_chip->getHuid(), PRDFSIG_DsdDramSpared ); // Remove the chip mark. - o_rc = MarkStore::clearChipMark( iv_chip, iv_rank ); + o_rc = MarkStore::clearChipMark( iv_chip, iv_rank ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "clearChipMark(0x%08x,0x%02x) failed", @@ -179,7 +173,7 @@ uint32_t DsdEvent::verifySpare( const uint32_t & i_eccAttns, template<> uint32_t DsdEvent::startCmd() { - #define PRDF_FUNC "[DsdEvent::startCmd] " + #define PRDF_FUNC "[DsdEvent::startCmd] " uint32_t o_rc = SUCCESS; @@ -224,7 +218,34 @@ uint32_t DsdEvent::startCmd() //------------------------------------------------------------------------------ template<> -uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) +uint32_t DsdEvent::startCmd() +{ + #define PRDF_FUNC "[DsdEvent::startCmd] " + + uint32_t o_rc = SUCCESS; + + mss::mcbist::stop_conditions<> stopCond; + + stopCond.set_pause_on_ue(mss::ON); + + // Start the time based scrub procedure on this master rank. + o_rc = startTdScrub( iv_chip, iv_rank, MASTER_RANK, + stopCond ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "startTdScrub(0x%08x,0x%2x) failed", + iv_chip->getHuid(), getKey() ); + } + + return o_rc; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +template +uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) { uint32_t signature = 0; @@ -258,5 +279,9 @@ uint32_t DsdEvent::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc ) //------------------------------------------------------------------------------ +// Avoid linker errors with the template. +template class DsdEvent; +template class DsdEvent; + } // end namespace PRDF diff --git a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C index 24dfc3813..a84f6b706 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C @@ -731,11 +731,11 @@ uint32_t setBgScrubThresholds( ExtensibleChip * i_chip, //------------------------------------------------------------------------------ -template<> -uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, - AddrRangeType i_rangeType, - bool & o_stoppedOnLastAddr, - bool i_rowRepair ) +template +uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, + AddrRangeType i_rangeType, + bool & o_stoppedOnLastAddr, + bool i_rowRepair ) { #define PRDF_FUNC "[didCmdStopOnLastAddr] " @@ -747,7 +747,7 @@ uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, { // Get the current address. MemAddr curAddr; - o_rc = getMemMaintAddr( i_chip, curAddr ); + o_rc = getMemMaintAddr( i_chip, curAddr ); if ( SUCCESS != o_rc ) { PRDF_ERR( PRDF_FUNC "getMemMaintAddr(0x%08x) failed", @@ -757,7 +757,7 @@ uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, // Get the end address of the current rank. MemAddr junk, endAddr; - o_rc = getMemAddrRange( i_chip, curAddr.getRank(), junk, + o_rc = getMemAddrRange( i_chip, curAddr.getRank(), junk, endAddr, i_rangeType ); if ( SUCCESS != o_rc ) { @@ -782,7 +782,16 @@ uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, #undef PRDF_FUNC } - +template +uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, + AddrRangeType i_rangeType, + bool & o_stoppedOnLastAddr, + bool i_rowRepair ); +template +uint32_t didCmdStopOnLastAddr( ExtensibleChip * i_chip, + AddrRangeType i_rangeType, + bool & o_stoppedOnLastAddr, + bool i_rowRepair ); //------------------------------------------------------------------------------ } // end namespace PRDF -- cgit v1.2.1