diff options
Diffstat (limited to 'src/usr/diag')
-rwxr-xr-x | src/usr/diag/prdf/common/framework/service/prdfDramRepairUsrData.H | 2 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/pegasus/prdfCenConst.H (renamed from src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaConst.H) | 8 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C | 2 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C | 249 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H | 198 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/prd_pegasus.mk | 1 |
6 files changed, 455 insertions, 5 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfDramRepairUsrData.H b/src/usr/diag/prdf/common/framework/service/prdfDramRepairUsrData.H index 9228bece4..616f8257c 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfDramRepairUsrData.H +++ b/src/usr/diag/prdf/common/framework/service/prdfDramRepairUsrData.H @@ -30,7 +30,7 @@ #include <prdf_types.h> #include <utilstream.H> -#include <prdfCenMbaConst.H> +#include <prdfCenConst.H> #include <vector> #include <iipconst.h> diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaConst.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenConst.H index 91db1c1e7..b4f1806d5 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaConst.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenConst.H @@ -1,7 +1,7 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaConst.H $ */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenConst.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ @@ -25,8 +25,8 @@ #define PRDF_CEN_MBA_CONST_H /** - * @file prdfCenMbaConst.H - * @brief Defines Centaur Mba related constants + * @file prdfCenConst.H + * @brief Defines Centaur related constants */ //------------------------------------------------------------------------------ // Includes @@ -41,7 +41,9 @@ enum MAX_DIMM_SLCT_PER_MBA = 2, MAX_RANKS_PER_DIMM_SLCT = 4, MAX_RANKS_PER_MBA = MAX_DIMM_SLCT_PER_MBA * MAX_RANKS_PER_DIMM_SLCT, + SYMBOLS_PER_RANK = 72, + DQS_PER_DIMM = 72, }; } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C index ef6727f55..f3db8441c 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C @@ -165,7 +165,7 @@ int32_t MaintCmdComplete( ExtensibleChip * i_mbaChip, : MDIA::COMMAND_STOPPED; // Do not commit error log for a successful command complete. if ( MDIA::COMMAND_COMPLETE == mbadb->iv_cmdCompleteMsgData ) - i_sc.service_data->DontCommitErrorLog(); + i_sc.service_data->DontCommitErrorLog(); } #endif // __HOSTBOOT_MODULE diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C new file mode 100755 index 000000000..1c196b16c --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C @@ -0,0 +1,249 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C $ */ +/* */ +/* 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 */ + +#include <prdfCenSymbol.H> + +#include <prdfPlatServices.H> +#include <prdfTrace.H> + +using namespace TARGETING; + +namespace PRDF +{ + +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 ) +{ + #define PRDF_FUNC "[CenSymbol::fromSymbol] " + + int32_t o_rc = SUCCESS; + + do + { + if ( TYPE_MBA != getTargetType(i_mba) ) + { + PRDF_ERR( PRDF_FUNC"i_mba is invalid" ); + o_rc = FAIL; break; + } + + WiringType wiringType = WIRING_INVALID; + o_rc = getWiringType( i_mba, i_rank, wiringType ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC"getWiringType() failed" ); + break; + } + + 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; + } + + o_symbol = CenSymbol ( i_mba, i_rank, wiringType, i_symbol, i_pins ); + + } while (0); + + if ( SUCCESS != o_rc ) + { + 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; + + #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 ) +{ + #define PRDF_FUNC "[CenSymbol::fromDimmDq] " + + int32_t o_rc = SUCCESS; + + do + { + if ( TYPE_MBA != getTargetType(i_mba) ) + { + PRDF_ERR( PRDF_FUNC"i_mba is invalid" ); + o_rc = FAIL; break; + } + + WiringType wiringType = WIRING_INVALID; + o_rc = getWiringType( i_mba, i_rank, wiringType ); + if ( SUCCESS != o_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 ) + { + PRDF_ERR( PRDF_FUNC"getSymbol() failed" ); + break; + } + + uint8_t pins = (0 == (i_dimmDq & ODD_SYMBOL_DQ)) ? EVEN_SYMBOL_DQ : + ODD_SYMBOL_DQ; + + o_symbol = CenSymbol ( i_mba, i_rank, wiringType, symbol, pins ); + + } while (0); + + if ( SUCCESS != o_rc ) + { + 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; + + #undef PRDF_FUNC +} + +//------------------------------------------------------------------------------ + +int32_t CenSymbol::getWiringType( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, + WiringType & o_type ) +{ + int32_t o_rc = SUCCESS; + + // TODO: RTC 67376 Add support for wiring type. + o_type = WIRING_INVALID; + + return o_rc; +} + +//------------------------------------------------------------------------------ + +uint8_t CenSymbol::getPortSlct() const +{ + return ( ((iv_symbol <= 3) || ((8 <= iv_symbol) && (iv_symbol <= 39))) + ? 1 : 0 ); +} + +//------------------------------------------------------------------------------ + +uint8_t CenSymbol::cenDq2Symbol( uint8_t i_cenDq, uint8_t i_ps ) +{ + uint8_t sym = SYMBOLS_PER_RANK; + + if ( DQS_PER_DIMM > i_cenDq && PORT_SLCT_PER_MBA > i_ps ) + { + if ( i_cenDq >= 64 ) + sym = ( (3 - ((i_cenDq - 64) / 2)) + ((0 == i_ps) ? 4 : 0) ); + else + sym = ( ((63 - i_cenDq) / 2) + ((0 == i_ps) ? 32 : 0) + 8 ); + } + + return sym; +} + +//------------------------------------------------------------------------------ + +uint8_t CenSymbol::symbol2CenDq( uint8_t i_symbol ) +{ + uint8_t cenDq = DQS_PER_DIMM; + + if ( SYMBOLS_PER_RANK > i_symbol ) + { + if ( 8 > i_symbol ) + cenDq = ( ((3 - (i_symbol % 4)) * 2) + 64 ); + else + cenDq = ( (31 - (((i_symbol - 8) % 32))) * 2 ); + } + + return cenDq; +} + +//------------------------------------------------------------------------------ + +int32_t CenSymbol::getSymbol( const CenRank & i_rank, WiringType i_wiringType, + uint8_t i_dimmDq, uint8_t i_portSlct, + uint8_t & o_symbol ) +{ + #define PRDF_FUNC "[CenSymbol::fromDq] " + + int32_t o_rc = SUCCESS; + + do + { + if ( DQS_PER_DIMM <= i_dimmDq ) + { + PRDF_ERR( PRDF_FUNC"i_dimmDq is invalid" ); + o_rc = FAIL; break; + } + + if ( PORT_SLCT_PER_MBA <= i_portSlct ) + { + PRDF_ERR( PRDF_FUNC"i_portSlct is invalid" ); + o_rc = FAIL; break; + } + + // Get the Centaur DQ. + uint8_t cenDq = i_dimmDq; + + // TODO: RTC 67376 Add wiring type support for IS DIMMs to convert from + // i_dimmDq to cenDq. + + o_symbol = cenDq2Symbol( cenDq, i_portSlct ); + + } while(0); + + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC"Failed: i_rank=%d i_wiringType=%d i_dimmDq=%d " + "i_portSlct=%d", i_rank.flatten(), i_wiringType, i_dimmDq, + i_portSlct ); + } + + return o_rc; + + #undef PRDF_FUNC +} + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H new file mode 100755 index 000000000..9af918838 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H @@ -0,0 +1,198 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.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 prdfCenSymbol_H +#define prdfCenSymbol_H + +/** @file prdfCenSymbol.H + * @brief Utility functions that help decode memory syndromes. + */ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +#include <prdfCenAddress.H> +#include <prdfCenConst.H> +#include <prdfTargetFwdRef.H> + +//############################################################################## +// class CenSymbol +//############################################################################## + +namespace PRDF +{ +/** + * @brief Container for a memory symbol. + */ +class CenSymbol +{ + public: // constants, enums + + enum WiringType + { + WIRING_INVALID = 0, // An invalid wiring type + }; + + /** Used as a 2-bit mask to display which of the DQs on this symbol are + * failing. */ + enum DqMask + { + NO_SYMBOL_DQS = 0x0, + EVEN_SYMBOL_DQ = 0x2, + ODD_SYMBOL_DQ = 0x1, + BOTH_SYMBOL_DQS = EVEN_SYMBOL_DQ | ODD_SYMBOL_DQ, + }; + + public: // constructor + + /** + * @brief Default constructor + */ + CenSymbol() : + iv_mbaTarget(NULL), iv_rank(), iv_wiringType(WIRING_INVALID), + iv_symbol(0), iv_pins(NO_SYMBOL_DQS) + {} + + private: // constructor + + /** + * @brief Constructor from components + */ + CenSymbol( TARGETING::TargetHandle_t i_mba, CenRank i_rank, + WiringType i_wiringType, uint8_t i_symbol, uint8_t i_pins ) : + iv_mbaTarget(i_mba), iv_rank(i_rank), iv_wiringType(i_wiringType), + iv_symbol(i_symbol), iv_pins(i_pins) + {} + + public: // functions + + /** + * @brief Creates a CenSymbol from a symbol. + * @param i_mba The MBA target. + * @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. + */ + static int32_t fromSymbol( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, uint8_t i_symbol, + uint8_t i_pins, CenSymbol & o_symbol ); + + /** + * @brief Creates a CenSymbol from a DIMM DQ. + * @param i_mba The MBA target. + * @param i_rank The rank this symbol is on. + * @param i_dimmDq The failing DIMM DQ. + * @param i_portSlct The port select. + * @param o_symbol The returned symbol object. + * @note For Centaur DIMMs, a DIMM DQ is the same as a Centaur DQ. + * 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. + */ + static int32_t fromDimmDq( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, uint8_t i_dimmDq, + uint8_t i_portSlct, CenSymbol & o_symbol ); + + /** + * @brief Returns the dimm's wiring type. + * @param i_mba MBA Target handle. + * @param i_rank The rank this symbol is on. + * @param o_wiringType See enum WiringType. + * @return Non-SUCCESS if an internal function failed, SUCCESS otherwise. + */ + static int32_t getWiringType( TARGETING::TargetHandle_t i_mba, + const CenRank & i_rank, + WiringType & o_wiringType ); + + /** @return This symbol's wiring type. */ + WiringType getWiringType() const { return iv_wiringType; } + + /** @return This symbol's numerical value (0-71). */ + uint8_t getSymbol() const { return iv_symbol; } + + /** @return The bad pins associated with this symbol. */ + uint8_t getPins() const { return iv_pins; } + + /** + * @brief Returns this symbol's port select. + * @return Port select. + */ + uint8_t getPortSlct() const; + + /** @return The symbol of this Cen DQ. */ + static uint8_t cenDq2Symbol( uint8_t i_CenDq, uint8_t i_ps ); + + /** @return The first Cen DQ in this symbol. */ + static uint8_t symbol2CenDq( uint8_t i_symbol ); + + /** + * @brief Overrides the '<' operator. + * @param i_symbol The symbol to compare with. + * @return TRUE if this symbol is less than i_symbol, FALSE otherwise. + */ + bool operator < ( const CenSymbol & i_symbol ) const + { + return ( this->getSymbol() < i_symbol.getSymbol() ); + } + + /** + * @brief Overrides the '==' operator. + * @param i_symbol The symbol to compare with. + * @return TRUE if the two symbols are equivalent, FALSE otherwise. + */ + bool operator == ( const CenSymbol & i_symbol ) const + { + return ( this->getSymbol() == i_symbol.getSymbol() ); + } + + private: // functions + + /** + * @brief Returns the symbol associated with the given DIMM DQ. + * @param i_rank The rank this symbol is on. + * @param i_wiringType The DIMM's wiring type. + * @param i_dimmDq The failing DIMM DQ. + * @param i_portSlct The DIMM's port select. + * @param o_symbol The returned symbol. + * @return Non-SUCCESS if an invalid parameter is given, SUCCESS otherwise. + */ + static int32_t getSymbol( const CenRank & i_rank, WiringType i_wiringType, + uint8_t i_dimmDq, uint8_t i_portSlct, + uint8_t & o_symbol ); + + private: // instance variables + + TARGETING::TargetHandle_t iv_mbaTarget; ///< MBA Target handle. + CenRank iv_rank; ///< The rank this symbol is on. + WiringType iv_wiringType; ///< This symbol's wiring type. + uint8_t iv_symbol; ///< This symbol's numerical value. + uint8_t iv_pins; ///< See enum DqMask. +}; + +} // end namespace PRDF + +#endif // prdfCenSymbol_H + diff --git a/src/usr/diag/prdf/common/prd_pegasus.mk b/src/usr/diag/prdf/common/prd_pegasus.mk index 614022a99..6d384b44a 100755 --- a/src/usr/diag/prdf/common/prd_pegasus.mk +++ b/src/usr/diag/prdf/common/prd_pegasus.mk @@ -39,6 +39,7 @@ PRDF_RULE_PLUGINS_PEGASUS_WSIM = \ prd_pegasus_specific = \ prdfCalloutUtil.o \ prdfCenAddress.o \ + prdfCenSymbol.o \ prdfLineDelete.o \ prdfPegasusConfigurator.o \ prdfCenMbaCaptureData.o \ |