Skip to content

Commit

Permalink
PRD: Simplify templates in memory CE functions
Browse files Browse the repository at this point in the history
Change-Id: I8182ce256b247009b198220f937aef58343a61bf
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58879
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@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/59227
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 May 23, 2018
1 parent 0535232 commit 5064efd
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ int32_t AnalyzeFetchNce##POS( ExtensibleChip * i_chip, \
{ \
ExtensibleChip * mbaChip = getConnectedChild( i_chip, TYPE_MBA, POS ); \
PRDF_ASSERT( nullptr != mbaChip ); \
MemEcc::analyzeFetchNceTce<TYPE_MBA, MbaDataBundle *>( mbaChip, io_sc ); \
MemEcc::analyzeFetchNceTce<TYPE_MBA>( mbaChip, io_sc ); \
return SUCCESS; \
} \
PRDF_PLUGIN_DEFINE( cen_centaur, AnalyzeFetchNce##POS );
Expand Down
32 changes: 32 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@ namespace MemDbUtils
// Generic wrappers
//##############################################################################

/**
* @brief Generic wrapper to add an entry to the CE table.
* @param i_chip MCA or MBA.
* @param i_addr CE address.
* @param i_symbol CE symbol.
* @param i_isHard True if this was a hard CE. False otherwise.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
template<TARGETING::TYPE T>
uint32_t addCeTableEntry( ExtensibleChip * i_chip, const MemAddr & i_addr,
const MemSymbol & i_symbol, bool i_isHard );

template<> inline
uint32_t addCeTableEntry<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
const MemAddr & i_addr,
const MemSymbol & i_symbol,
bool i_isHard )
{
return getMcaDataBundle(i_chip)->iv_ceTable.addEntry( i_addr, i_symbol,
i_isHard );
}

template<> inline
uint32_t addCeTableEntry<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip,
const MemAddr & i_addr,
const MemSymbol & i_symbol,
bool i_isHard )
{
return getMbaDataBundle(i_chip)->iv_ceTable.addEntry( i_addr, i_symbol,
i_isHard );
}

/**
* @brief Generic wrapper to add an entry to the UE table.
* @param i_chip MCA or MBA.
Expand Down
20 changes: 10 additions & 10 deletions src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ uint32_t analyzeFetchMpe<TYPE_MBA>( ExtensibleChip * i_chip,

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

template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t handleMemCe( ExtensibleChip * i_chip, const MemAddr & i_addr,
const MemSymbol & i_symbol, bool & o_doTps,
STEP_CODE_DATA_STRUCT & io_sc, bool i_isHard )
Expand All @@ -604,8 +604,8 @@ uint32_t handleMemCe( ExtensibleChip * i_chip, const MemAddr & i_addr,
io_sc.service_data->SetCallout( memmru, MRU_MEDA );

// Add data to the CE table.
D db = static_cast<D>(i_chip->getDataBundle());
uint32_t ceTableRc = db->iv_ceTable.addEntry( i_addr, i_symbol, i_isHard );
uint32_t ceTableRc = MemDbUtils::addCeTableEntry<T>( i_chip, i_addr,
i_symbol, i_isHard );

// Check MNFG thresholds, if needed.
// NOTE: We will only check the MNFG thresholds if DRAM repairs is disabled.
Expand Down Expand Up @@ -688,7 +688,7 @@ uint32_t handleMemCe( ExtensibleChip * i_chip, const MemAddr & i_addr,

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

template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
Expand Down Expand Up @@ -726,7 +726,7 @@ uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip,
bool doTps = false;
if ( sym1.isValid() )
{
o_rc = handleMemCe<T,D>( i_chip, addr, sym1, doTps, io_sc );
o_rc = handleMemCe<T>( i_chip, addr, sym1, doTps, io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMemCe(0x%08x,0x%02x,%d) failed",
Expand All @@ -747,7 +747,7 @@ uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip,
if ( sym2.isValid() )
{
bool tmp;
o_rc = handleMemCe<T,D>( i_chip, addr, sym2, tmp, io_sc );
o_rc = handleMemCe<T>( i_chip, addr, sym2, tmp, io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMemCe(0x%08x,0x%02x,%d) failed",
Expand Down Expand Up @@ -790,11 +790,11 @@ uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip,

// To resolve template linker errors.
template
uint32_t analyzeFetchNceTce<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );
uint32_t analyzeFetchNceTce<TYPE_MCA>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );
template
uint32_t analyzeFetchNceTce<TYPE_MBA, MbaDataBundle *>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );
uint32_t analyzeFetchNceTce<TYPE_MBA>( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );

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

Expand Down
4 changes: 2 additions & 2 deletions src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace MemEcc
* @param i_isHard True if this is a hard CE. Default is false.
* @return Non-SUCCESS if an interal function fails, SUCCESS otherwise.
*/
template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t handleMemCe( ExtensibleChip * i_chip, const MemAddr & i_addr,
const MemSymbol & i_symbol, bool & o_doTps,
STEP_CODE_DATA_STRUCT & io_sc, bool i_isHard = false );
Expand Down Expand Up @@ -150,7 +150,7 @@ uint32_t analyzeFetchMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
* @param io_sc The step code data struct.
* @return Non-SUCCESS if an interal function fails, SUCCESS otherwise.
*/
template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc );

Expand Down
2 changes: 1 addition & 1 deletion src/usr/diag/prdf/common/plat/mem/prdfP9Mca_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ PLUGIN_FETCH_MPE_ERROR( 7 )
int32_t AnalyzeFetchNceTce( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & io_sc )
{
MemEcc::analyzeFetchNceTce<TYPE_MCA, McaDataBundle *>( i_chip, io_sc );
MemEcc::analyzeFetchNceTce<TYPE_MCA>( i_chip, io_sc );
return SUCCESS; // nothing to return to rule code
}
PRDF_PLUGIN_DEFINE( p9_mca, AnalyzeFetchNceTce );
Expand Down
12 changes: 4 additions & 8 deletions src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ uint32_t MemTdCtlr<T>::handleCmdComplete( STEP_CODE_DATA_STRUCT & io_sc )
// some way to change the template to use the MCA. It is also a local function
// because this is only for MemTdCtlr internal use and it didn't make much sense
// to create a public function.
template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
Expand Down Expand Up @@ -272,11 +272,8 @@ uint32_t __analyzeCmdComplete<TYPE_MCBIST>( ExtensibleChip * i_chip,
for ( auto & mcaChip : portList )
{
bool errorsFound;
uint32_t l_rc = __checkEcc<TYPE_MCA, McaDataBundle *>( mcaChip,
io_queue,
i_addr,
errorsFound,
io_sc );
uint32_t l_rc = __checkEcc<TYPE_MCA>( mcaChip, io_queue, i_addr,
errorsFound, io_sc );
if ( SUCCESS != l_rc )
{
PRDF_ERR( PRDF_FUNC "__checkEcc<TYPE_MCA>(0x%08x) failed",
Expand Down Expand Up @@ -307,8 +304,7 @@ uint32_t __analyzeCmdComplete<TYPE_MBA>( ExtensibleChip * i_chip,
o_stoppedRank = __getStopRank<TYPE_MBA>( i_chip, i_addr );

// Check the MBA for ECC errors.
return __checkEcc<TYPE_MBA, MbaDataBundle *>( i_chip, io_queue, i_addr,
o_errorsFound, io_sc );
return __checkEcc<TYPE_MBA>(i_chip, io_queue, i_addr, o_errorsFound, io_sc);
}

//------------------------------------------------------------------------------
Expand Down
18 changes: 7 additions & 11 deletions src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool __mnfgCeCheck<TYPE_MBA>( uint32_t i_eccAttns )
return ( 0 != (i_eccAttns & MAINT_HARD_NCE_ETE) );
}

template <TARGETING::TYPE T, typename D>
template <TARGETING::TYPE T>
uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc )
Expand Down Expand Up @@ -244,17 +244,13 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
}

template
uint32_t __checkEcc<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip,
TdQueue & io_queue,
const MemAddr & i_addr,
bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
uint32_t __checkEcc<TYPE_MCA>( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
template
uint32_t __checkEcc<TYPE_MBA, MbaDataBundle *>( ExtensibleChip * i_chip,
TdQueue & io_queue,
const MemAddr & i_addr,
bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
uint32_t __checkEcc<TYPE_MBA>( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );

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

Expand Down
36 changes: 16 additions & 20 deletions src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ uint32_t MemTdCtlr<T>::defaultStep( STEP_CODE_DATA_STRUCT & io_sc )

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

template<TARGETING::TYPE T, typename D>
template<TARGETING::TYPE T>
uint32_t __handleNceEte( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, STEP_CODE_DATA_STRUCT & io_sc,
bool i_isHard = false )
Expand Down Expand Up @@ -496,8 +496,8 @@ uint32_t __handleNceEte( ExtensibleChip * i_chip, TdQueue & io_queue,
{
// Add the symbol(s) to the callout list and CE table.
bool doTps;
o_rc = MemEcc::handleMemCe<T,D>( i_chip, i_addr, d.symbol, doTps,
io_sc, i_isHard );
o_rc = MemEcc::handleMemCe<T>( i_chip, i_addr, d.symbol, doTps,
io_sc, i_isHard );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMemCe(0x%08x) failed",
Expand Down Expand Up @@ -595,7 +595,7 @@ uint32_t __handleRceEte<TYPE_MBA>( ExtensibleChip * i_chip,

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

template <TARGETING::TYPE T, typename D>
template <TARGETING::TYPE T>
uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc )
Expand Down Expand Up @@ -630,10 +630,10 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
o_errorsFound = true;
io_sc.service_data->AddSignatureList( trgt, PRDFSIG_MaintINTER_CTE);

o_rc = __handleNceEte<T,D>( i_chip, io_queue, i_addr, io_sc );
o_rc = __handleNceEte<T>( i_chip, io_queue, i_addr, io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__handleNceEte<T,D>(0x%08x) failed",
PRDF_ERR( PRDF_FUNC "__handleNceEte<T>(0x%08x) failed",
huid );
break;
}
Expand All @@ -644,10 +644,10 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
o_errorsFound = true;
io_sc.service_data->AddSignatureList( trgt, PRDFSIG_MaintSOFT_CTE );

o_rc = __handleNceEte<T,D>( i_chip, io_queue, i_addr, io_sc );
o_rc = __handleNceEte<T>( i_chip, io_queue, i_addr, io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__handleNceEte<T,D>(0x%08x) failed",
PRDF_ERR( PRDF_FUNC "__handleNceEte<T>(0x%08x) failed",
huid );
break;
}
Expand All @@ -658,10 +658,10 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
o_errorsFound = true;
io_sc.service_data->AddSignatureList( trgt, PRDFSIG_MaintHARD_CTE );

o_rc = __handleNceEte<T,D>( i_chip, io_queue, i_addr, io_sc, true );
o_rc = __handleNceEte<T>( i_chip, io_queue, i_addr, io_sc, true );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "__handleNceEte<T,D>(0x%08x) failed",
PRDF_ERR( PRDF_FUNC "__handleNceEte<T>(0x%08x) failed",
huid );
break;
}
Expand Down Expand Up @@ -734,17 +734,13 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
}

template
uint32_t __checkEcc<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip,
TdQueue & io_queue,
const MemAddr & i_addr,
bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
uint32_t __checkEcc<TYPE_MCA>( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc );
template<>
uint32_t __checkEcc<TYPE_MBA, MbaDataBundle *>( ExtensibleChip * i_chip,
TdQueue & io_queue,
const MemAddr & i_addr,
bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc )
uint32_t __checkEcc<TYPE_MBA>( ExtensibleChip * i_chip, TdQueue & io_queue,
const MemAddr & i_addr, bool & o_errorsFound,
STEP_CODE_DATA_STRUCT & io_sc )
{
// TODO: remove this once runtime support is abled for MBA.
return SUCCESS;
Expand Down

0 comments on commit 5064efd

Please sign in to comment.