Skip to content

Commit

Permalink
PRD: added support functions in MemSymbol class
Browse files Browse the repository at this point in the history
Change-Id: I5a13013902dd612a332fe141d41c5bf59c450ed2
RTC: 165381
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34741
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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/35413
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Jan 25, 2017
1 parent d1e5423 commit bf0eecf
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
46 changes: 43 additions & 3 deletions src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -103,9 +103,49 @@ MemSymbol MemSymbol::fromGalois( TargetHandle_t i_trgt, const MemRank & i_rank,

uint8_t MemSymbol::getDq() const
{
return TYPE_MBA == getTargetType(iv_trgt) ? symbol2Dq<TYPE_MBA>(iv_symbol)
: symbol2Dq<TYPE_MCA>(iv_symbol);
bool isMba = TYPE_MBA == getTargetType(iv_trgt);

return isMba ? symbol2Dq<TYPE_MBA>(iv_symbol)
: symbol2Dq<TYPE_MCA>(iv_symbol);
}

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

uint8_t MemSymbol::getPortSlct() const
{
bool isMba = TYPE_MBA == getTargetType(iv_trgt);

return isMba ? symbol2PortSlct<TYPE_MBA>(iv_symbol)
: symbol2PortSlct<TYPE_MCA>(iv_symbol);
}

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

uint8_t MemSymbol::getDram() const
{
bool isMba = TYPE_MBA == getTargetType(iv_trgt);
bool isX4 = isDramWidthX4( iv_trgt );

return isMba ? isX4 ? symbol2Nibble<TYPE_MBA>( iv_symbol )
: symbol2Byte <TYPE_MBA>( iv_symbol )
: isX4 ? symbol2Nibble<TYPE_MCA>( iv_symbol )
: symbol2Byte <TYPE_MCA>( iv_symbol );
}

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

uint8_t MemSymbol::getDramPins() const
{
bool isMba = TYPE_MBA == getTargetType(iv_trgt);
bool isX4 = isDramWidthX4( iv_trgt );

uint32_t dps = isMba ? MBA_DQS_PER_SYMBOL : MCA_DQS_PER_SYMBOL;
uint32_t spd = isMba ? isX4 ? MBA_SYMBOLS_PER_NIBBLE : MBA_SYMBOLS_PER_BYTE
: isX4 ? MCA_SYMBOLS_PER_NIBBLE : MCA_SYMBOLS_PER_BYTE;

return iv_pins << (((spd - 1) - (iv_symbol % spd)) * dps);
}

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

} // end namespace PRDF
13 changes: 12 additions & 1 deletion src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -105,6 +105,17 @@ class MemSymbol
/** @return rank associated with this symbol. */
MemRank getRank() const { return iv_rank; };

/** @return The port select for this symbol. Only relevant on MBA. Will
* always return 0 for MCA. */
uint8_t getPortSlct() const;

/** @return The DRAM index for this symbol. */
uint8_t getDram() 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;

/** @return Marks this symbol as steered to a DRAM spare. */
void setDramSpared() { iv_isDramSpared = true; }

Expand Down
12 changes: 11 additions & 1 deletion src/usr/diag/prdf/common/plugins/prdfParserUtils.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2016 */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -103,6 +103,16 @@ uint8_t symbol2PortSlct<TARGETING::TYPE_MBA>( uint8_t i_symbol )

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

template<>
uint8_t symbol2PortSlct<TARGETING::TYPE_MCA>( uint8_t i_symbol )
{
// Port select does not exist on MCA. Always return 0 so that code will
// continue to work.
return 0;
}

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

template<>
uint8_t nibble2Symbol<TARGETING::TYPE_MBA>( uint8_t i_x4Dram )
{
Expand Down

0 comments on commit bf0eecf

Please sign in to comment.