diff options
Diffstat (limited to 'src/usr/diag/prdf/common/plat/pegasus')
5 files changed, 155 insertions, 54 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMarkstore.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMarkstore.H new file mode 100644 index 000000000..38bf32245 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMarkstore.H @@ -0,0 +1,99 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMarkstore.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef prdfCenMarkstore_H +#define prdfCenMarkstore_H + +/** @file prdfCenMarkstore.H */ + +#include <prdfCenAddress.H> +#include <prdfCenConst.H> +#include <prdfCenSymbol.H> +#include <prdfTargetFwdRef.H> + +//############################################################################## +// class CenMark +//############################################################################## + +namespace PRDF +{ + +/** + * @brief Container for a memory symbol and chip mark. + * @note When reading and writing markstore the symbol and chip marks are set + * or returned as a pair. This is a simple container to keep the two + * marks bundled. + */ +class CenMark +{ + public: // constructors + + /** @brief Default constructor */ + CenMark() : + iv_symbolMark(), iv_chipMark() + {} + + /** @brief Constructor from components */ + CenMark( CenSymbol i_symbolMark, CenSymbol i_chipMark ) : + iv_symbolMark(i_symbolMark), iv_chipMark(i_chipMark) + {} + + /** @brief Constructor from components */ + CenMark( TARGETING::TargetHandle_t i_mba, CenRank i_rank, + uint8_t i_symbolMark, uint8_t i_chipMark ) + { + iv_symbolMark = CenSymbol::fromSymbol( i_mba, i_rank, i_symbolMark ); + iv_chipMark = CenSymbol::fromSymbol( i_mba, i_rank, i_chipMark ); + } + + public: // functions + + /** @return A symbol representing the symbol mark. */ + CenSymbol getSM() const { return iv_symbolMark; } + + /** @return A symbol representing the chip mark. */ + CenSymbol getCM() const { return iv_chipMark; } + + /** @brief Sets the symbol mark to the given symbol. */ + void setSM( CenSymbol i_symbolMark ) { iv_symbolMark = i_symbolMark; } + + /** @brief Sets the chip mark to the given symbol. */ + void setCM( CenSymbol i_chipMark ) { iv_chipMark = i_chipMark; } + + /** @brief Sets the symbol mark to an invalid symbol. */ + void clearSM() { iv_symbolMark = CenSymbol(); } + + /** @brief Sets the chip mark to an invalid symbol. */ + void clearCM() { iv_chipMark = CenSymbol(); } + + private: // instance variables + + CenSymbol iv_symbolMark; ///< A symbol representing the symbol mark. + CenSymbol iv_chipMark; ///< A symbol representing the chip mark. + +}; + +} // end namespace PRDF + +#endif // prdfCenMarkstore_H + diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaCaptureData.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaCaptureData.C index 0e55bd69f..8fdcfd3d3 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaCaptureData.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaCaptureData.C @@ -33,6 +33,8 @@ #include <iipServiceDataCollector.h> #include <prdf_ras_services.H> +#include <prdfCenMarkstore.H> + namespace PRDF { @@ -67,35 +69,36 @@ void captureDramRepairsData( TARGETING::TargetHandle_t i_mbaTarget, DramRepairMbaData mbaData; // Iterate all ranks to get DRAM repair data - for(int rank = 0; rank < MAX_RANKS_PER_MBA ; rank++) + for ( uint32_t r = 0; r < MAX_RANKS_PER_MBA; r++ ) { - DramRepairRankData rankData; - rankData.rank = rank; - - // Get DRAM Repair data + CenRank rank ( r ); - rc = PlatServices::mssGetMarkStore( i_mbaTarget, rankData.rank, - rankData.chipMark, rankData.symbolMark ); - - if (SUCCESS != rc) + // Get chip/symbol marks + CenMark mark; + rc = PlatServices::mssGetMarkStore( i_mbaTarget, rank, mark ); + if ( SUCCESS != rc ) { PRDF_ERR("Failed to get markstore data"); continue; } - rc = PlatServices::mssGetSteerMux( i_mbaTarget, rankData.rank, - rankData.port0Spare, - rankData.port1Spare, - rankData.eccSpare ); - - if (SUCCESS != rc) + // Get DRAM spares + CenSymbol sp0, sp1, ecc; + rc = PlatServices::mssGetSteerMux( i_mbaTarget, rank, sp0, sp1, ecc ); + if ( SUCCESS != rc ) { PRDF_ERR("Failed to get DRAM steer data"); continue; } - // Check id rank had some DRAM repair data - if( rankData.valid() ) + // Add data + DramRepairRankData rankData = { rank.flatten(), + mark.getCM().getSymbol(), + mark.getSM().getSymbol(), + sp0.getSymbol(), + sp1.getSymbol(), + ecc.getSymbol() }; + if ( rankData.valid() ) { mbaData.rankDataList.push_back(rankData); } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C index fe28589ba..38edaea21 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C @@ -37,25 +37,24 @@ using namespace PlatServices; // class CenSymbol //############################################################################## -int32_t CenSymbol::fromSymbol( TargetHandle_t i_mba, const CenRank & i_rank, - uint8_t i_symbol, uint8_t i_pins, - CenSymbol & o_symbol ) +CenSymbol CenSymbol::fromSymbol( TargetHandle_t i_mba, const CenRank & i_rank, + uint8_t i_symbol, uint8_t i_pins ) { #define PRDF_FUNC "[CenSymbol::fromSymbol] " - int32_t o_rc = SUCCESS; + CenSymbol o_symbol; // default contructor is invalid. do { if ( TYPE_MBA != getTargetType(i_mba) ) { PRDF_ERR( PRDF_FUNC"i_mba is invalid" ); - o_rc = FAIL; break; + break; } WiringType wiringType = WIRING_INVALID; - o_rc = getWiringType( i_mba, i_rank, wiringType ); - if ( SUCCESS != o_rc ) + int32_t l_rc = getWiringType( i_mba, i_rank, wiringType ); + if ( SUCCESS != l_rc ) { PRDF_ERR( PRDF_FUNC"getWiringType() failed" ); break; @@ -64,14 +63,12 @@ int32_t CenSymbol::fromSymbol( TargetHandle_t i_mba, const CenRank & i_rank, if ( SYMBOLS_PER_RANK <= i_symbol ) { PRDF_ERR( PRDF_FUNC"i_symbol is invalid" ); - o_rc = FAIL; break; } if ( BOTH_SYMBOL_DQS < i_pins ) { PRDF_ERR( PRDF_FUNC"i_pins is invalid" ); - o_rc = FAIL; break; } @@ -79,47 +76,46 @@ int32_t CenSymbol::fromSymbol( TargetHandle_t i_mba, const CenRank & i_rank, } while (0); - if ( SUCCESS != o_rc ) + if ( !o_symbol.isValid() ) { PRDF_ERR( PRDF_FUNC"Failed: i_mba=0x%08x i_rank=%d i_symbol=%d " "i_pins=%d", getHuid(i_mba), i_rank.flatten(), i_symbol, i_pins ); } - return o_rc; + return o_symbol; #undef PRDF_FUNC } //------------------------------------------------------------------------------ -int32_t CenSymbol::fromDimmDq( TargetHandle_t i_mba, const CenRank & i_rank, - uint8_t i_dimmDq, uint8_t i_portSlct, - CenSymbol & o_symbol ) +CenSymbol CenSymbol::fromDimmDq( TargetHandle_t i_mba, const CenRank & i_rank, + uint8_t i_dimmDq, uint8_t i_portSlct ) { #define PRDF_FUNC "[CenSymbol::fromDimmDq] " - int32_t o_rc = SUCCESS; + CenSymbol o_symbol; // default contructor is invalid. do { if ( TYPE_MBA != getTargetType(i_mba) ) { PRDF_ERR( PRDF_FUNC"i_mba is invalid" ); - o_rc = FAIL; break; + break; } WiringType wiringType = WIRING_INVALID; - o_rc = getWiringType( i_mba, i_rank, wiringType ); - if ( SUCCESS != o_rc ) + int32_t l_rc = getWiringType( i_mba, i_rank, wiringType ); + if ( SUCCESS != l_rc ) { PRDF_ERR( PRDF_FUNC"getWiringType() failed" ); break; } uint8_t symbol; - o_rc = getSymbol( i_rank, wiringType, i_dimmDq, i_portSlct, symbol ); - if ( SUCCESS != o_rc ) + l_rc = getSymbol( i_rank, wiringType, i_dimmDq, i_portSlct, symbol ); + if ( SUCCESS != l_rc ) { PRDF_ERR( PRDF_FUNC"getSymbol() failed" ); break; @@ -132,14 +128,14 @@ int32_t CenSymbol::fromDimmDq( TargetHandle_t i_mba, const CenRank & i_rank, } while (0); - if ( SUCCESS != o_rc ) + if ( !o_symbol.isValid() ) { PRDF_ERR( PRDF_FUNC"Failed: i_mba=0x%08x i_rank=%d i_dimmDq=%d " "i_portSlct=%d", getHuid(i_mba), i_rank.flatten(), i_dimmDq, i_portSlct ); } - return o_rc; + return o_symbol; #undef PRDF_FUNC } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H index ccd1f8ec4..0bfc86dfd 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H @@ -72,7 +72,7 @@ class CenSymbol */ CenSymbol() : iv_mbaTarget(NULL), iv_rank(), iv_wiringType(WIRING_INVALID), - iv_symbol(0), iv_pins(NO_SYMBOL_DQS) + iv_symbol(SYMBOLS_PER_RANK), iv_pins(NO_SYMBOL_DQS) {} private: // constructor @@ -94,12 +94,12 @@ class CenSymbol * @param i_rank The rank this symbol is on. * @param i_symbol The input symbol. * @param i_pins See enum DqMask. - * @param o_symbol The returned symbol object. - * @return Non-SUCCESS if an internal function failed, SUCCESS otherwise. + * @return A CenSymbol. Must call isValid() to determine if the function was + * successful in creating a valid object. */ - static int32_t fromSymbol( TARGETING::TargetHandle_t i_mba, - const CenRank & i_rank, uint8_t i_symbol, - uint8_t i_pins, CenSymbol & o_symbol ); + static CenSymbol fromSymbol( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, uint8_t i_symbol, + uint8_t i_pins = NO_SYMBOL_DQS ); /** * @brief Creates a CenSymbol from a DIMM DQ. @@ -112,11 +112,12 @@ class CenSymbol * For IS DIMMs, the mapping between DIMM DQ and Centaur DQ is * determined by card that the DIMM is plugged into. See enum * WiringType for more details. - * @return Non-SUCCESS if an internal function failed, SUCCESS otherwise. + * @return A CenSymbol. Must call isValid() to determine if the function was + * successful in creating a valid object. */ - static int32_t fromDimmDq( TARGETING::TargetHandle_t i_mba, - const CenRank & i_rank, uint8_t i_dimmDq, - uint8_t i_portSlct, CenSymbol & o_symbol ); + static CenSymbol fromDimmDq( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, uint8_t i_dimmDq, + uint8_t i_portSlct ); /** * @brief Returns the dimm's wiring type. @@ -129,6 +130,9 @@ class CenSymbol const CenRank & i_rank, WiringType & o_wiringType ); + /** @return true if symbol is within the valid range, false otherwise. */ + bool isValid() const { return iv_symbol < SYMBOLS_PER_RANK; } + /** @return This symbol's wiring type. */ WiringType getWiringType() const { return iv_wiringType; } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfMemoryMru.C b/src/usr/diag/prdf/common/plat/pegasus/prdfMemoryMru.C index bba6248f5..177a64d91 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfMemoryMru.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfMemoryMru.C @@ -122,12 +122,11 @@ MemoryMru::MemoryMru( uint32_t i_memMru ) : break; } - int32_t rc = CenSymbol::fromSymbol( iv_mbaTarget, iv_rank, - iv_memMruMeld.s.symbol, - iv_memMruMeld.s.pins, - iv_symbol ); + iv_symbol = CenSymbol::fromSymbol( iv_mbaTarget, iv_rank, + iv_memMruMeld.s.symbol, + iv_memMruMeld.s.pins ); - if ( SUCCESS != rc) + if ( !iv_symbol.isValid() ) { PRDF_ERR( PRDF_FUNC"Can not create symbol from symbol value" " :%u, pins:%u, rank:%u", |