Skip to content

Commit

Permalink
PRD: VCM/TPS/BG scrub commands support for MBA
Browse files Browse the repository at this point in the history
Change-Id: If68765fc01cfe4d56a24ca41b39e875205a485b0
RTC: 190428
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56772
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56893
CI-Ready: Zane C. Shelley <zshelle@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: Zane C. Shelley <zshelle@us.ibm.com>
  • Loading branch information
zane131 committed Apr 10, 2018
1 parent da885e7 commit 2000b27
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 361 deletions.
51 changes: 4 additions & 47 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -625,56 +625,13 @@ int32_t CenMbaTdCtlrCommon::handleMCE_DSD2( STEP_CODE_DATA_STRUCT & io_sc )

int32_t CenMbaTdCtlrCommon::setRtEteThresholds()
{
#define PRDF_FUNC "[CenMbaTdCtlrCommon::setRtEteThresholds] "

int32_t o_rc = SUCCESS;

do
{
const char * reg_str = (0 == iv_mbaPos) ? "MBA0_MBSTR" : "MBA1_MBSTR";
SCAN_COMM_REGISTER_CLASS * mbstr = iv_membChip->getRegister( reg_str );

// MBSTR's content could be modified from cleanupCmd()
// so we need to refresh
o_rc = mbstr->ForceRead();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "ForceRead() failed on %s", reg_str );
break;
}

uint32_t softIntCe = getScrubCeThreshold( iv_mbaChip, iv_rank );

// Only care about retry CEs if there are a lot of them. So the
// threshold will be high in the field. However, in MNFG the retry CEs
// will be handled differently by putting every occurrence in the RCE
// table and doing targeted diagnostics when needed.
uint16_t retryCe = mfgMode() ? 1 : 2047;

uint16_t hardCe = 1; // Always stop on first occurrence.

mbstr->SetBitFieldJustified( 4, 12, softIntCe );
mbstr->SetBitFieldJustified( 16, 12, softIntCe );
mbstr->SetBitFieldJustified( 28, 12, hardCe );
mbstr->SetBitFieldJustified( 40, 12, retryCe );

// Set the per symbol counters to count hard CEs only. This is so that
// when the scrub stops on the first hard CE, we can use the per symbol
// counters to tell us which symbol reported the hard CE.
mbstr->SetBitFieldJustified( 55, 3, 0x1 );

o_rc = mbstr->Write();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "Write() failed on %s", reg_str );
break;
}

} while(0);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Moved to setBgScrubThresholds() in prdfMemScrubUtils.C
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

return o_rc;

#undef PRDF_FUNC
}

//------------------------------------------------------------------------------
Expand Down
65 changes: 64 additions & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -38,6 +38,9 @@
#include <prdfRegisterCache.H>
#include <lib/mcbist/memdiags.H>

// Platform includes
#include <prdfMemThresholds.H>

using namespace TARGETING;

namespace PRDF
Expand Down Expand Up @@ -473,5 +476,65 @@ uint32_t isBgScrubConfig<TYPE_MBA>( ExtensibleChip * i_chip,

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

template<>
uint32_t setBgScrubThresholds<TYPE_MBA>( ExtensibleChip * i_chip,
const MemRank & i_rank )
{
#define PRDF_FUNC "[setBgScrubThresholds] "

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

uint32_t o_rc = SUCCESS;

do
{
ExtensibleChip * membChip = getConnectedParent( i_chip, TYPE_MEMBUF );
const char * reg_str = (0 == i_chip->getPos()) ? "MBA0_MBSTR"
: "MBA1_MBSTR";
SCAN_COMM_REGISTER_CLASS * mbstr = membChip->getRegister( reg_str );
o_rc = mbstr->Read();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "Read() failed on %s", reg_str );
break;
}

uint32_t softIntCe = getScrubCeThreshold<TYPE_MBA>( i_chip, i_rank );

// Only care about retry CEs if there are a lot of them. So the
// threshold will be high in the field. However, in MNFG the retry CEs
// will be handled differently by putting every occurrence in the RCE
// table and doing targeted diagnostics when needed.
uint16_t retryCe = mfgMode() ? 1 : 2047;

uint16_t hardCe = 1; // Always stop on first occurrence.

mbstr->SetBitFieldJustified( 4, 12, softIntCe );
mbstr->SetBitFieldJustified( 16, 12, softIntCe );
mbstr->SetBitFieldJustified( 28, 12, hardCe );
mbstr->SetBitFieldJustified( 40, 12, retryCe );

// Set the per symbol counters to count hard CEs only. This is so that
// when the scrub stops on the first hard CE, we can use the per symbol
// counters to tell us which symbol reported the hard CE.
mbstr->SetBitFieldJustified( 55, 3, 0x1 );

o_rc = mbstr->Write();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "Write() failed on %s", reg_str );
break;
}

} while(0);

return o_rc;

#undef PRDF_FUNC
}

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

} // end namespace PRDF

12 changes: 11 additions & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -152,6 +152,16 @@ uint32_t checkEccFirs( ExtensibleChip * i_chip, uint32_t & o_eccAttns );
template<TARGETING::TYPE T>
uint32_t isBgScrubConfig( ExtensibleChip * i_chip, bool & o_isBgScrub );

/**
* @brief Sets the ETE thresholds needed for background scrubbing.
* @param i_chip An MBA.
* @param i_rank A rank on the target DIMM.
* @return Non-SUCCESS on SCOM failures, SUCCESS otherwise.
*/
template<TARGETING::TYPE T>
uint32_t setBgScrubThresholds( ExtensibleChip * i_chip,
const MemRank & i_rank );

} //end namespace PRDF

#endif // __prdfMemScrubUtils_H

0 comments on commit 2000b27

Please sign in to comment.