Skip to content

Commit

Permalink
PRD: Row Repair VCM Updates
Browse files Browse the repository at this point in the history
Change-Id: I809cdc7fc2a010c5cb421bf5410d43f9bb690fee
RTC: 196073
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63375
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@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/64982
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: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Aug 23, 2018
1 parent 0a6c8e4 commit 4dee8a0
Show file tree
Hide file tree
Showing 5 changed files with 334 additions and 44 deletions.
126 changes: 99 additions & 27 deletions src/usr/diag/prdf/common/plat/mem/prdfMemDqBitmap.C
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,45 @@ int32_t MemDqBitmap<T>::setDram( const MemSymbol & i_symbol, uint8_t i_pins )

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

template <DIMMS_PER_RANK T>
uint32_t MemDqBitmap<T>::clearDram( const MemSymbol & i_symbol, uint8_t i_pins )
{
#define PRDF_FUNC "[MemDqBitmap::clearDram] "

int32_t o_rc = SUCCESS;

do
{
uint8_t portSlct, byteIdx, bitIdx;
o_rc = getPortByteBitIdx( i_symbol, portSlct, byteIdx, bitIdx );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getPortByteBitIdx() failed" );
break;
}

if ( iv_x4Dram )
{
i_pins &= 0xf; // limit to 4 bits
uint32_t shift = (DQS_PER_BYTE-1) - bitIdx;
shift = (shift / DQS_PER_NIBBLE) * DQS_PER_NIBBLE; // 0,4
iv_data[portSlct][byteIdx] &= ~(i_pins << shift);
}
else
{
i_pins &= 0xff; // limit to 8 bits
iv_data[portSlct][byteIdx] &= ~(i_pins);
}

} while (0);

return o_rc;

#undef PRDF_FUNC
}

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

template <DIMMS_PER_RANK T>
void MemDqBitmap<T>::getCaptureData( CaptureData & o_cd ) const
{
Expand Down Expand Up @@ -654,26 +693,24 @@ template class MemDqBitmap<DIMMS_PER_RANK::MBA>;
// Utility Functions
//##############################################################################

template<>
uint32_t setDramInVpd<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
const MemRank & i_rank,
MemSymbol i_symbol )
template<TARGETING::TYPE T, DIMMS_PER_RANK D>
uint32_t __setDramInVpd( ExtensibleChip * i_chip, const MemRank & i_rank,
MemSymbol i_symbol )
{
#define PRDF_FUNC "[MemDqBitmap::setDramInVpd] "
#define PRDF_FUNC "[MemDqBitmap::__setDramInVpd] "

uint32_t o_rc = SUCCESS;

do
{
TARGETING::TargetHandle_t trgt = i_chip->getTrgt();

TARGETING::TargetHandle_t mcaTrgt = i_chip->getTrgt();

MemDqBitmap<DIMMS_PER_RANK::MCA> dqBitmap;
o_rc = getBadDqBitmap<DIMMS_PER_RANK::MCA>( mcaTrgt, i_rank, dqBitmap );
MemDqBitmap<D> dqBitmap;
o_rc = getBadDqBitmap<D>( trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getBadDqBitmap<DIMMS_PER_RANK::MCA>(0x%08x, "
"0x%02x) failed.", getHuid(mcaTrgt), i_rank.getKey() );
PRDF_ERR( PRDF_FUNC "getBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(trgt), i_rank.getKey() );
break;
}

Expand All @@ -684,11 +721,11 @@ uint32_t setDramInVpd<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
break;
}

o_rc = setBadDqBitmap<DIMMS_PER_RANK::MCA>( mcaTrgt, i_rank, dqBitmap );
o_rc = setBadDqBitmap<D>( trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setBadDqBitmap<DIMMS_PER_RANK::MCA>(0x%08x, "
"0x%02x) failed.", getHuid(mcaTrgt), i_rank.getKey() );
PRDF_ERR( PRDF_FUNC "setBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(trgt), i_rank.getKey() );
break;
}
}while(0);
Expand All @@ -698,43 +735,60 @@ uint32_t setDramInVpd<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
#undef PRDF_FUNC
}

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

template<>
uint32_t setDramInVpd<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip,
const MemRank & i_rank,
MemSymbol i_symbol )
{
#define PRDF_FUNC "[MemDqBitmap::setDramInVpd] "
return __setDramInVpd<TARGETING::TYPE_MBA, DIMMS_PER_RANK::MBA>(i_chip,
i_rank, i_symbol);
}

template<>
uint32_t setDramInVpd<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
const MemRank & i_rank,
MemSymbol i_symbol )
{
return __setDramInVpd<TARGETING::TYPE_MCA, DIMMS_PER_RANK::MCA>(i_chip,
i_rank, i_symbol);
}

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

template<TARGETING::TYPE T, DIMMS_PER_RANK D>
uint32_t __clearDramInVpd( ExtensibleChip * i_chip, const MemRank & i_rank,
MemSymbol i_symbol )
{
#define PRDF_FUNC "[MemDqBitmap::__clearDramInVpd] "

uint32_t o_rc = SUCCESS;

do
{
TARGETING::TargetHandle_t trgt = i_chip->getTrgt();

TARGETING::TargetHandle_t mbaTrgt = i_chip->getTrgt();

MemDqBitmap<DIMMS_PER_RANK::MBA> dqBitmap;
o_rc = getBadDqBitmap<DIMMS_PER_RANK::MBA>( mbaTrgt, i_rank, dqBitmap );
MemDqBitmap<D> dqBitmap;
o_rc = getBadDqBitmap<D>( trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getBadDqBitmap<DIMMS_PER_RANK::MBA>(0x%08x, "
"0x%02x) failed.", getHuid(mbaTrgt), i_rank.getKey() );
PRDF_ERR( PRDF_FUNC "getBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(trgt), i_rank.getKey() );
break;
}

o_rc = dqBitmap.setDram( i_symbol );
o_rc = dqBitmap.clearDram( i_symbol );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setDram() failed." );
PRDF_ERR( PRDF_FUNC "clearDram() failed." );
break;
}

o_rc = setBadDqBitmap<DIMMS_PER_RANK::MBA>( mbaTrgt, i_rank, dqBitmap );
o_rc = setBadDqBitmap<D>( trgt, i_rank, dqBitmap );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setBadDqBitmap<DIMMS_PER_RANK::MBA>(0x%08x, "
"0x%02x) failed.", getHuid(mbaTrgt), i_rank.getKey() );
PRDF_ERR( PRDF_FUNC "setBadDqBitmap(0x%08x, 0x%02x) failed.",
getHuid(trgt), i_rank.getKey() );
break;
}
}while(0);
Expand All @@ -744,6 +798,24 @@ uint32_t setDramInVpd<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip,
#undef PRDF_FUNC
}

template<>
uint32_t clearDramInVpd<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
const MemRank & i_rank,
MemSymbol i_symbol )
{
return __clearDramInVpd<TARGETING::TYPE_MCA, DIMMS_PER_RANK::MCA>(i_chip,
i_rank, i_symbol);
}

template<>
uint32_t clearDramInVpd<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip,
const MemRank & i_rank,
MemSymbol i_symbol )
{
return __clearDramInVpd<TARGETING::TYPE_MBA, DIMMS_PER_RANK::MBA>(i_chip,
i_rank, i_symbol);
}

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

} // end namespace PRDF
Expand Down
20 changes: 20 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemDqBitmap.H
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ class MemDqBitmap
*/
int32_t setDram( const MemSymbol & i_symbol, uint8_t i_pins = 0xff );

/**
* @brief Clears the specified DRAM.
* @note Will adjust for DRAM or ECC spares, if applicable.
* @param i_symbol A symbol on the target DRAM.
* @param i_pins Optional 8-bit (x8 mode) or 4-bit (x4 mode) value of the
* DRAM's pins. The default is to clear all pins.
* @return Non-SUCCESS if an internal function failed, SUCCESS otherwise.
*/
uint32_t clearDram( const MemSymbol & i_symbol, uint8_t i_pins = 0xff );

/**
* @brief Adds the bitmaps for both ports to the capture data.
* @param o_cd Capture data struct.
Expand Down Expand Up @@ -220,6 +230,16 @@ template<TARGETING::TYPE T>
uint32_t setDramInVpd( ExtensibleChip * i_chip, const MemRank & i_rank,
MemSymbol i_symbol );

/**
* @brief Clears the inputted dram in DRAM repairs VPD.
* @param i_chip MBA or MCA chip.
* @param i_rank Target rank.
* @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
*/
template<TARGETING::TYPE T>
uint32_t clearDramInVpd( ExtensibleChip * i_chip, const MemRank & i_rank,
MemSymbol i_symbol );

} // end namespace PRDF

#endif // __prdfMemDqBitmap_H
Expand Down
5 changes: 5 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemExtraSig.H
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ PRDR_ERROR_SIGNATURE(MaintRETRY_CTE, 0xffff0016, "", "Maintenance RETRY CTE");
PRDR_ERROR_SIGNATURE(VcmVerified, 0xffff0020, "", "VCM: verified");
PRDR_ERROR_SIGNATURE(VcmFalseAlarm, 0xffff0021, "", "VCM: false alarm");
PRDR_ERROR_SIGNATURE(VcmFalseAlarmTH, 0xffff0022, "", "VCM: false alarm threshold");
PRDR_ERROR_SIGNATURE(VcmVerSameDram, 0xffff0023, "", "VCM: verified: previous PPR on same DRAM");
PRDR_ERROR_SIGNATURE(VcmVerDiffDram, 0xffff0024, "", "VCM: verified: previous PPR on different DRAM");
PRDR_ERROR_SIGNATURE(VcmVerFirstMce, 0xffff0025, "", "VCM: verified: first MCE");
PRDR_ERROR_SIGNATURE(VcmVerSecMce, 0xffff0026, "", "VCM: verified: second MCE");
PRDR_ERROR_SIGNATURE(VcmVerRowFail, 0xffff0027, "", "VCM: verified: common row fail");
PRDR_ERROR_SIGNATURE(AllDramRepairs, 0xffff002F, "", "all DRAM repairs used");

PRDR_ERROR_SIGNATURE(RdrInternalFail, 0xffff0040, "", "RDR: Internal failure");
Expand Down

0 comments on commit 4dee8a0

Please sign in to comment.