Skip to content

Commit

Permalink
PRD: added PlatServices::isRowRepairEnabled()
Browse files Browse the repository at this point in the history
Change-Id: Ia2ac63ecb1b07af6dab75afa9e00fe966ba11dee
RTC: 196073
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63987
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64559
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Aug 16, 2018
1 parent 890ac53 commit e55c53f
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 9 deletions.
48 changes: 40 additions & 8 deletions src/usr/diag/prdf/plat/mem/prdfMemVcm.C
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,26 @@ uint32_t VcmEvent<TYPE_MCA>::handlePhaseComplete( const uint32_t & i_eccAttns,
//
//##############################################################################

template<>
uint32_t VcmEvent<TYPE_MBA>::rowRepair( STEP_CODE_DATA_STRUCT & io_sc,
bool & o_done )
{
#define PRDF_FUNC "[VcmEvent::rowRepair] "

uint32_t o_rc = SUCCESS;

do
{

} while (0);

return o_rc;

#undef PRDF_FUNC
}

//------------------------------------------------------------------------------

template<>
uint32_t VcmEvent<TYPE_MBA>::startNextPhase( STEP_CODE_DATA_STRUCT & io_sc )
{
Expand Down Expand Up @@ -176,16 +196,28 @@ uint32_t VcmEvent<TYPE_MBA>::handlePhaseComplete( const uint32_t & i_eccAttns,
{
if ( i_eccAttns & MAINT_MCE )
{
// The chip mark has been verified.
o_rc = verified( io_sc );
if ( SUCCESS != o_rc )
if ( iv_rowRepairEnabled )
{
PRDF_ERR( PRDF_FUNC "verified() failed on 0x%08x",
iv_chip->getHuid() );
break;
o_rc = rowRepair( io_sc, o_done );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "rowRepair() failed on 0x%08x",
iv_chip->getHuid() );
break;
}
}
else
{
o_rc = verified( io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "verified() failed on 0x%08x",
iv_chip->getHuid() );
break;
}

o_done = true; // Procedure is complete.
}

o_done = true; // Procedure is complete.
}
else if ( !iv_canResumeScrub )
{
Expand Down
13 changes: 12 additions & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemVcm.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class VcmEvent : public TdEntry
*/
VcmEvent<T>( ExtensibleChip * i_chip, const MemRank & i_rank,
const MemMark & i_mark ) :
TdEntry(VCM_EVENT, i_chip, i_rank), iv_mark(i_mark)
TdEntry(VCM_EVENT, i_chip, i_rank), iv_mark(i_mark),
iv_rowRepairEnabled(PlatServices::isRowRepairEnabled<T>(i_chip,i_rank))
{
PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( T == i_chip->getType() );
Expand Down Expand Up @@ -306,9 +307,19 @@ class VcmEvent : public TdEntry
*/
uint32_t falseAlarm( STEP_CODE_DATA_STRUCT & io_sc );

/**
* @brief Do extra analysis needed for Row Repair.
* @param io_sc The step code data struct.
* @param o_done True if the procedure is complete or has aborted.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
uint32_t rowRepair( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done );

private: // instance variables

const MemMark iv_mark; ///< The chip mark from hardware.

const bool iv_rowRepairEnabled; ///< True if Row Repair is enabled.
};

//------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions src/usr/diag/prdf/plat/mem/prdfMemVcm_ipl.C
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ uint32_t VcmEvent<TYPE_MBA>::startCmd()

uint32_t stopCond = mss_MaintCmd::NO_STOP_CONDITIONS;

// Ensure we stop on each MCE if Row Repair is enabled.
if ( iv_rowRepairEnabled && (TD_PHASE_2 == iv_phase) )
{
stopCond |= mss_MaintCmd::STOP_ON_MCE;
stopCond |= mss_MaintCmd::STOP_IMMEDIATE;
}

switch ( iv_phase )
{
case TD_PHASE_1:
Expand Down
5 changes: 5 additions & 0 deletions src/usr/diag/prdf/plat/mem/prdfMemVcm_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ uint32_t VcmEvent<TYPE_MBA>::startCmd()

if ( TD_PHASE_2 == iv_phase ) stopCond |= mss_MaintCmd::STOP_ON_MCE;

// If Row Repair is enabled, we should stop immediately on error if there is
// an MCE during phase 2. This is already done because of the Centaur
// workarounds. This comment is just pointing out what should be done if for
// some reason the hardware is fixed.

if ( iv_canResumeScrub )
{
// Resume the command from the next address to the end of this master
Expand Down
55 changes: 55 additions & 0 deletions src/usr/diag/prdf/plat/prdfPlatServices.C
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <fapi2_spd_access.H>
#include <p9c_mss_maint_cmds.H>
#include <prdfParserUtils.H>
#include <p9c_mss_rowRepairFuncs.H>

using namespace TARGETING;

Expand Down Expand Up @@ -565,6 +566,60 @@ uint32_t getMemAddrRange<TYPE_MCA>( ExtensibleChip * i_chip,
MemAddr & o_startAddr, MemAddr & o_endAddr,
uint8_t i_dimmSlct );

//------------------------------------------------------------------------------

template<>
bool isRowRepairEnabled<TYPE_MBA>( ExtensibleChip * i_chip,
const MemRank & i_rank )
{
#define PRDF_FUNC "[PlatServices::isRowRepairEnabled<TYPE_MBA>] "

PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( TYPE_MBA == i_chip->getType() );

bool o_isEnabled = false;

do
{
// Don't do row repair if DRAM repairs is disabled.
if ( areDramRepairsDisabled() ) break;

// The HWP will check both DIMMs on rank pair. So we could can use
// either one.
TargetHandleList list = getConnectedDimms( i_chip->getTrgt(), i_rank );
PRDF_ASSERT( !list.empty() );

TargetHandle_t dimm = list.front();

errlHndl_t errl = nullptr;
fapi2::Target<fapi2::TARGET_TYPE_DIMM> fapiDimm(dimm);
FAPI_INVOKE_HWP( errl, is_sPPR_supported, fapiDimm, o_isEnabled );
if ( nullptr != errl )
{
PRDF_ERR( PRDF_FUNC "is_sPPR_supported(0x%08x) failed",
getHuid(dimm) );
PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
o_isEnabled = false; // just in case
break;
}

} while (0);

return o_isEnabled;

#undef PRDF_FUNC
}

template<>
bool isRowRepairEnabled<TYPE_MCA>( ExtensibleChip * i_chip,
const MemRank & i_rank )
{
PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( TYPE_MCA == i_chip->getType() );

return false; // Not supported at this time.
}

//##############################################################################
//## Nimbus Maintenance Command wrappers
//##############################################################################
Expand Down
9 changes: 9 additions & 0 deletions src/usr/diag/prdf/plat/prdfPlatServices.H
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ uint32_t getMemAddrRange( ExtensibleChip * i_chip,
VT & o_startAddr, VT & o_endAddr,
uint8_t i_dimmSlct = MAX_DIMM_PER_PORT );

/**
* @brief Queries if Row Repair is enabled.
* @param i_chip An MCA or MBA.
* @param i_rank Any rank on the target DIMMs.
* @return True if Row Repair is enabled on the DIMMs containing this rank.
* False otherwise.
*/
template<TARGETING::TYPE T>
bool isRowRepairEnabled( ExtensibleChip * i_chip, const MemRank & i_rank );

//##############################################################################
//## Nimbus/Centaur Maintenance Command wrappers
Expand Down
1 change: 1 addition & 0 deletions src/usr/diag/prdf/prdf_hb_only.mk
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ prd_vpath += ${ROOTPATH}/src/import/chips/centaur/procedures/hwp/memory
prd_obj_no_sim += p9c_mss_maint_cmds.o
prd_obj_no_sim += p9c_dimmBadDqBitmapFuncs.o
prd_obj_no_sim += p9c_query_channel_failure.o
prd_obj_no_sim += p9c_mss_rowRepairFuncs.o

################################################################################
# The following are hardware procedure utilities that we are pulling into the
Expand Down

0 comments on commit e55c53f

Please sign in to comment.