Skip to content

Commit

Permalink
PRD: Fix inputted DRAM pos for row repair
Browse files Browse the repository at this point in the history
Change-Id: I54e23b3f9f9cc6bc3ed6de8577ab79467acbaa99
CQ: SW445966
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66319
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/66640
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 Sep 26, 2018
1 parent 46663cd commit 1612a30
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/usr/diag/prdf/common/plat/mem/prdfMemRowRepair.H
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ uint32_t setRowRepairData( TARGETING::TargetHandle_t i_dimm,
* @param i_dimm A dimm target.
* @param i_rank Target rank.
* @param i_addr Address for the row repair.
* @param i_dram Dram position for the row repair.
* @param i_dram Dram position for the row repair. NOTE: this is the dram
* position relative to the Centaur DQs (x8: 0-9, x4: 0-19)
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
template<TARGETING::TYPE T>
Expand Down
41 changes: 41 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,47 @@ uint8_t MemSymbol::getDram() const

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

uint8_t MemSymbol::getDramRelCenDqs() const
{
// This function will return the DRAM position for this symbol relative
// to the Centaur DQs. Mainly this is needed for the DRAM position input
// of Row Repair.

const uint8_t X4_ECC_SPARE = 17;
const uint8_t X8_ECC_SPARE = 8;

const uint8_t X4_DRAM_SPARE_LOWER = 18;
const uint8_t X4_DRAM_SPARE_UPPER = 19;
const uint8_t X8_DRAM_SPARE = 9;


uint8_t l_dramWidth = ( isDramWidthX4(iv_trgt) ) ? 4 : 8;
uint8_t l_dram = getDq() / l_dramWidth; // (x8: 0-9, x4: 0-19)

// Adjust for spares
if ( isDramSpared() )
{
if ( isDramWidthX4(iv_trgt) )
{
uint8_t l_bit = getDq() % DQS_PER_BYTE;
l_dram = ( l_bit < 4 ) ? X4_DRAM_SPARE_LOWER : X4_DRAM_SPARE_UPPER;
}
else
{
l_dram = X8_DRAM_SPARE;
}
}
else if ( isEccSpared() )
{
l_dram = ( isDramWidthX4(iv_trgt) ) ? X4_ECC_SPARE : X8_ECC_SPARE;
}

return l_dram;

}

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

uint8_t MemSymbol::getDramPins() const
{
bool isMba = TYPE_MBA == getTargetType(iv_trgt);
Expand Down
3 changes: 3 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class MemSymbol
/** @return The DRAM index for this symbol. */
uint8_t getDram() const;

/** @return The DRAM relative to the Centaur DQs */
uint8_t getDramRelCenDqs() const;

/** @return The bad pins associated with this symbol in relation to the DRAM
* (x4 mode is 4-bits, x8 mode is 8-bits). */
uint8_t getDramPins() const;
Expand Down
3 changes: 2 additions & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemVcm.C
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ uint32_t VcmEvent<TYPE_MBA>::rowRepairEndRank( STEP_CODE_DATA_STRUCT & io_sc )

// If scrub gets to the end of the master rank with an MCE
// Update VPD with row repair
// Note: inputted DRAM position needs to be relative to the Centaur DQs
o_rc = setRowRepairData<TYPE_MBA>( l_dimm, iv_rank,
iv_rowRepairFailAddr, iv_mark.getSymbol().getDram() );
iv_rowRepairFailAddr, iv_mark.getSymbol().getDramRelCenDqs() );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "setRowRepairData(0x%08x, 0x%02x) "
Expand Down

0 comments on commit 1612a30

Please sign in to comment.