diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2017-01-10 09:20:30 -0600 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-01-25 17:33:12 -0500 |
commit | bf0eecf3d45af318152bb791d1a333c703233098 (patch) | |
tree | 5a246f2814f0def5969c7d54c5525b47201eee2c /src/usr | |
parent | d1e5423ee58028a96c7e49bd012f12bcf498c9f4 (diff) | |
download | talos-hostboot-bf0eecf3d45af318152bb791d1a333c703233098.tar.gz talos-hostboot-bf0eecf3d45af318152bb791d1a333c703233098.zip |
PRD: added support functions in MemSymbol class
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>
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C | 46 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H | 13 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfParserUtils.C | 12 |
3 files changed, 66 insertions, 5 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C index 86316ca02..6c8226af3 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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 diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H index 9ff7a8f54..97ef1e80a 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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; } diff --git a/src/usr/diag/prdf/common/plugins/prdfParserUtils.C b/src/usr/diag/prdf/common/plugins/prdfParserUtils.C index 28d049365..42b39cdc1 100644 --- a/src/usr/diag/prdf/common/plugins/prdfParserUtils.C +++ b/src/usr/diag/prdf/common/plugins/prdfParserUtils.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2016 */ +/* Contributors Listed Below - COPYRIGHT 2014,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -104,6 +104,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 ) { return (MBA_NIBBLES_PER_RANK >i_x4Dram) ? (i_x4Dram *MBA_SYMBOLS_PER_NIBBLE) |