From 36b343d78a73b9d923329c41a8863ebe4f285b7e Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Tue, 12 Jun 2018 16:17:27 -0500 Subject: PRD: use correct symbol when writing MBA markstore Change-Id: I94db83c4ff438a02df04d8c8e7f17cd491c6c720 CQ: SW433063 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60437 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Caleb N. Palmer Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Zane C. Shelley --- src/usr/diag/prdf/common/plat/mem/prdfMemMark.C | 4 ++-- src/usr/diag/prdf/common/plat/mem/prdfMemMark.H | 17 ++++++----------- src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C | 14 ++++++++++++++ src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H | 3 +++ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemMark.C b/src/usr/diag/prdf/common/plat/mem/prdfMemMark.C index 567c01c33..0e99d8a49 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemMark.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemMark.C @@ -131,7 +131,7 @@ uint32_t writeChipMark( ExtensibleChip * i_chip, SCAN_COMM_REGISTER_CLASS * hwms = i_chip->getRegister( msName ); // HWMSx[0:7] set this to the Galois field. - hwms->SetBitFieldJustified( 0, 8, i_mark.getChipGalois() ); + hwms->SetBitFieldJustified( 0, 8, i_mark.getDramGalois() ); // HWMSx[8] confirmed with the hardware team that this will not trigger // another MPE attention and that they want this set to 1. @@ -518,7 +518,7 @@ uint32_t writeChipMark( ExtensibleChip * i_chip, uint8_t l_sm = l_symMark.isValid() ? l_symMark.getSymbol().getSymbol() : MSS_INVALID_SYMBOL; - uint8_t l_cm = i_mark.isValid() ? i_mark.getSymbol().getSymbol() + uint8_t l_cm = i_mark.isValid() ? i_mark.getSymbol().getDramSymbol() : MSS_INVALID_SYMBOL; errlHndl_t l_errl = nullptr; diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemMark.H b/src/usr/diag/prdf/common/plat/mem/prdfMemMark.H index d0f8c57ef..2cd28b8dd 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemMark.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemMark.H @@ -63,48 +63,43 @@ class MemMark */ MemMark( TARGETING::TargetHandle_t i_trgt, const MemRank & i_rank, uint8_t i_galois ) : - iv_galois( i_galois ), iv_symbol( MemSymbol::fromGalois(i_trgt, i_rank, i_galois) ) {} /** - * @brief Cosntructor from components. + * @brief Constructor from components. * @param i_trgt MBA or MCA target. * @param i_rank The rank this mark is on. * @param i_symbol The symbol representing this mark. */ MemMark( TARGETING::TargetHandle_t i_trgt, const MemRank & i_rank, const MemSymbol & i_symbol ) : - iv_galois( i_symbol.getGalois() ), iv_symbol( i_symbol ) {} public: // functions /** @return The Galois field representing this mark. */ - uint8_t getGalois() const { return iv_galois; } + uint8_t getGalois() const { return iv_symbol.getGalois(); } /** @return The Galois field associated with the chip this mark is in. * Will correspond to the rightmost/least index symbol in the chip. You * must check for a valid symbol before calling this function. */ - uint8_t getChipGalois() const + uint8_t getDramGalois() const { PRDF_ASSERT( iv_symbol.isValid() ); - return symbol2Galois[(iv_symbol.getSymbol()/4)*4]; + return symbol2Galois[iv_symbol.getDramSymbol()]; } /** @return The symbol representing this mark. */ MemSymbol getSymbol() const { return iv_symbol; } - /** @return The symbol representing this mark. */ + /** @return True if the symbol representing this mark is valid. */ bool isValid() const { return iv_symbol.isValid(); } private: // instance variables - /** Galois field representing any symbol on this mark. */ - uint8_t iv_galois = 0; - - /** Any symbol on this mark (must match iv_galois). */ + /** Any symbol on this mark. */ MemSymbol iv_symbol = MemSymbol(); }; diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C index 51d81d780..79a7c7a18 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C @@ -139,6 +139,20 @@ uint8_t MemSymbol::getDramPins() const //------------------------------------------------------------------------------ +uint8_t MemSymbol::getDramSymbol() const +{ + bool isMba = TYPE_MBA == getTargetType(iv_trgt); + bool isX4 = isDramWidthX4( iv_trgt ); + uint8_t dram = getDram(); + + return isMba ? isX4 ? nibble2Symbol( dram ) + : byte2Symbol ( dram ) + : isX4 ? nibble2Symbol( dram ) + : byte2Symbol ( dram ); +} + +//------------------------------------------------------------------------------ + uint8_t MemSymbol::getGalois() const { return symbol2Galois[iv_symbol]; diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H index d52bf7c8c..9958e6761 100755 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.H @@ -132,6 +132,9 @@ class MemSymbol * (x4 mode is 4-bits, x8 mode is 8-bits). */ uint8_t getDramPins() const; + /** @return The first symbol (smallest index) on the associated DRAM. */ + uint8_t getDramSymbol() const; + /** @return The Galois field associated with this symbol. */ uint8_t getGalois() const; -- cgit v1.2.1