summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plat/pegasus
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/diag/prdf/common/plat/pegasus')
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/Membuf_regs_NEST.rule18
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle_common.H4
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H10
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C7
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.H55
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C111
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H57
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C167
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H99
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C24
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H22
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfLaneRepair.H1
12 files changed, 568 insertions, 7 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/Membuf_regs_NEST.rule b/src/usr/diag/prdf/common/plat/pegasus/Membuf_regs_NEST.rule
index 6bf4bd177..134282142 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/Membuf_regs_NEST.rule
+++ b/src/usr/diag/prdf/common/plat/pegasus/Membuf_regs_NEST.rule
@@ -821,3 +821,21 @@
capture group default;
};
+ ############################################################################
+ # MBA Address Translate Control Register
+ ############################################################################
+
+ register MBA0_MBAXCR
+ {
+ name "MBU.MBS.ARB.RXLT.MBAXCR01Q";
+ scomaddr 0x0201140B;
+ capture group never;
+ };
+
+ register MBA1_MBAXCR
+ {
+ name "MBU.MBS.ARB.RXLT.MBAXCR23Q";
+ scomaddr 0x0201140C;
+ capture group never;
+ };
+
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle_common.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle_common.H
index fe2eb5c4c..ecda1af5b 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle_common.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle_common.H
@@ -83,9 +83,11 @@ class CenMbaDataBundleCommon : public DataBundle
CenMbaDataBundleCommon( const CenMbaDataBundleCommon & );
const CenMbaDataBundleCommon & operator=( const CenMbaDataBundleCommon & );
- private: // instance variables
+ protected: // instance variables
ExtensibleChip * iv_mbaChip; ///< This MBA chip
+
+ private: // instance variables
ExtensibleChip * iv_membChip; ///< The connected MEMBUF chip
public: // instance variables
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
index 26cc84bdd..91ff82c90 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
@@ -33,6 +33,9 @@ PRDR_ERROR_SIGNATURE(StartVcmPhase1, 0xffff0000, "", "Starting VCM phase 1");
PRDR_ERROR_SIGNATURE(StartVcmPhase2, 0xffff0001, "", "Starting VCM phase 2");
PRDR_ERROR_SIGNATURE(StartDsdPhase1, 0xffff0002, "", "Starting DSD phase 1");
PRDR_ERROR_SIGNATURE(StartDsdPhase2, 0xffff0003, "", "Starting DSD phase 2");
+PRDR_ERROR_SIGNATURE(StartTpsPhase1, 0xffff0004, "", "Starting TPS phase 1");
+PRDR_ERROR_SIGNATURE(StartTpsPhase2, 0xffff0005, "", "Starting TPS phase 2");
+PRDR_ERROR_SIGNATURE(EndTpsPhase2, 0xffff0006, "", "TPS Phase 2 completed");
PRDR_ERROR_SIGNATURE(MaintUE, 0xffff0010, "", "Maintenance UE");
@@ -54,6 +57,11 @@ PRDR_ERROR_SIGNATURE(RdrRepairsUsed, 0xffff0043, "",
PRDR_ERROR_SIGNATURE(RdrRepairUnavail, 0xffff0044, "",
"RDR: Repairs needed but unavailable");
-
+PRDR_ERROR_SIGNATURE(MnfgIplFail, 0xffff0050, "",
+ "MNFG IPL Internal failure");
+PRDR_ERROR_SIGNATURE(MnfgIplHardCE, 0xffff0051, "", "MNFG IPL hard CE");
+PRDR_ERROR_SIGNATURE(MnfgIplDramCTE, 0xffff0052, "", "MNFG IPL DRAM CTE");
+PRDR_ERROR_SIGNATURE(MnfgIplRankCTE, 0xffff0053, "", "MNFG IPL half-rank CTE");
+PRDR_ERROR_SIGNATURE(MnfgIplDsCTE, 0xffff0054, "", "MNFG IPL DIMM CTE");
#endif // __prdfCenMbaExtraSig_H
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
index 1e7a0ed7c..65628e581 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
@@ -100,5 +100,12 @@ int32_t CenMbaTdCtlrCommon::chipMarkCleanup()
#undef PRDF_FUNC
}
+//------------------------------------------------------------------------------
+
+bool CenMbaTdCtlrCommon::isInTdMode()
+{
+ return ( (NO_OP != iv_tdState) && (MAX_TD_STATE > iv_tdState) );
+}
+
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.H
index 5107dc7f5..097928fc3 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.H
@@ -49,6 +49,26 @@ class ExtensibleChip;
*/
class CenMbaTdCtlrCommon
{
+ protected: // constants, enums
+
+ /**
+ * @brief Lists all possible states of TD controller
+ * @note These enums are used as array indexes to cv_cmdCompleteFuncs and
+ * the last entry will be used to get the size of the array.
+ */
+ enum TdState
+ {
+ NO_OP = 0, ///< No TD procedures in place.
+ VCM_PHASE_1, ///< Verify Chip Mark phase 1.
+ VCM_PHASE_2, ///< Verify Chip Mark phase 2.
+ DSD_PHASE_1, ///< DRAM Spare Deploy phase 1.
+ DSD_PHASE_2, ///< DRAM Spare Deploy phase 2.
+ TPS_PHASE_1, ///< Two-Phase Scrub phase 1.
+ TPS_PHASE_2, ///< Two-Phase Scrub phase 2.
+ RANK_SCRUB, ///< Targetted fast scrub on a rank.
+ MAX_TD_STATE ///< The maximum number of TD states.
+ };
+
public: // functions
/**
@@ -62,8 +82,8 @@ class CenMbaTdCtlrCommon
* @param i_mbaChip An MBA chip.
*/
explicit CenMbaTdCtlrCommon( ExtensibleChip * i_mbaChip ) :
- iv_mbaChip(i_mbaChip), iv_initialized(false), iv_rank(), iv_mark(),
- iv_mssCmd(NULL)
+ iv_mbaChip(i_mbaChip), iv_initialized(false), iv_tdState(NO_OP),
+ iv_rank(), iv_mark(), iv_mssCmd(NULL)
{}
/** @brief Destructor */
@@ -140,6 +160,20 @@ class CenMbaTdCtlrCommon
virtual int32_t analyzeDsdPhase2( STEP_CODE_DATA_STRUCT & io_sc ) = 0;
/**
+ * @brief Analyzes Tps Phase 1 results and moves state machine.
+ * @param io_sc The step code data struct.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+ virtual int32_t analyzeTpsPhase1( STEP_CODE_DATA_STRUCT & io_sc ) = 0;
+
+ /**
+ * @brief Analyzes Tps Phase 2 results and moves state machine.
+ * @param io_sc The step code data struct.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+ virtual int32_t analyzeTpsPhase2( STEP_CODE_DATA_STRUCT & io_sc ) = 0;
+
+ /**
* @brief Starts VCM Phase 1.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
@@ -164,10 +198,22 @@ class CenMbaTdCtlrCommon
virtual int32_t startDsdPhase2() = 0;
/**
+ * @brief Starts Tps Phase 1.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+ virtual int32_t startTpsPhase1() = 0;
+
+ /**
+ * @brief Starts Tps Phase 2.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+ virtual int32_t startTpsPhase2() = 0;
+
+ /**
* @return TRUE if currently running a targeted diagnositics procedure,
* FALSE otherwise.
*/
- virtual bool isInTdMode() = 0;
+ virtual bool isInTdMode();
/**
* @brief Calls the cleanupCmd() function of the command that had just
@@ -195,6 +241,9 @@ class CenMbaTdCtlrCommon
/** Indicates if TD controller is initialized. */
bool iv_initialized;
+ /** The targeted diagnostics state variable (see enum TdState). */
+ TdState iv_tdState;
+
/** The current rank that is being targeted for diagnostics. */
CenRank iv_rank;
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C
new file mode 100755
index 000000000..58b664863
--- /dev/null
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C
@@ -0,0 +1,111 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.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 */
+
+/** @file prdfCenMbaThresholds_common.C
+ * @brief Utility functions used to get specific Centaur thresholds.
+ */
+
+// Framework includes
+#include <prdfExtensibleChip.H>
+#include <prdfMfgThresholds.H>
+#include <prdfMfgThresholdMgr.H>
+#include <prdfPlatServices.H>
+
+// Pegasus includes
+#include <prdfCenMbaThresholds.H>
+#include <prdfCenMemUtils.H>
+
+using namespace TARGETING;
+
+namespace PRDF
+{
+
+using namespace PlatServices;
+
+int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+ uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
+ uint16_t & o_cePerDimm )
+{
+ #define PRDF_FUNC "[getMnfgMemCeTh] "
+
+ int32_t o_rc = SUCCESS;
+
+ do
+ {
+ // Get base threshold ( 2GB ).
+ uint8_t baseTh = getMnfgCeTh();
+
+ // A base threhold of 0 indicates there should be no thresholding.
+ if ( 0 == baseTh )
+ {
+ o_cePerDram = o_cePerHalfRank = o_cePerDimm =
+ MfgThresholdMgr::INFINITE_LIMIT_THR;
+ break;
+ }
+
+ // Get DRAM size
+ uint8_t size = 0;
+ o_rc = MemUtils::getDramSize( i_mbaChip, size );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "MemUtils::getDramSize() failed" );
+ break;
+ }
+
+ // Get number of ranks DIMM select.
+ uint8_t rankCount = getRanksPerDimm( i_mbaChip->GetChipHandle(),
+ i_rank.getDimmSlct() );
+ if ( 0 == rankCount )
+ {
+ PRDF_ERR( PRDF_FUNC "PlatServices::getRanksPerDimm() failed" );
+ break;
+ }
+
+ // Get number of allowed CEs.
+ uint8_t baseAllowed = baseTh - 1;
+
+ // Calculate CEs per DRAM.
+ // The DRAM size is in MBAXCR[6:7], where 0 = 2Gb, 1 = 4Gb, 2 = 8Gb,
+ // and 3 = 16 Gb. So the allowed CEs per DRAM can be calculated with
+ // the following:
+ // perDram = base * 2^(MBAXCR[6:7]+1) * (9/16)
+ // or, perDram = (base << MBAXCR[6:7]+1) * (9/16)
+ uint32_t computeBase = (baseAllowed << (size+1)) * 9;
+ o_cePerDram = (computeBase + 8) / 16;
+
+ // Calculate CEs per DIMM.
+ o_cePerDimm = ((computeBase * (2 + rankCount)) + 8) / 16;
+
+ // Calculate CEs per half-rank.
+ // Same as perDimm where rankCount is 1;
+ o_cePerHalfRank = ((computeBase * (2 + 1)) + 8) / 16;
+
+ } while (0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+} // end namespace PRDF
+
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H
new file mode 100755
index 000000000..4084ec614
--- /dev/null
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H
@@ -0,0 +1,57 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.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 __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
+#define __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
+
+/** @file prdfCenMbaThresholds_common.H
+ * @brief Utility functions used to get specific Centaur thresholds.
+ */
+
+#include <prdfThresholdResolutions.H>
+#include <prdfCenAddress.H>
+
+namespace PRDF
+{
+
+class ExtensibleChip;
+
+/**
+ * @brief Returns number of allowed CEs for MNFG IPLs.
+ * @pre Must check if in manufacturing mode before calling this function.
+ * @post Must callout if the count is greater than the returned values.
+ * @param i_mbaChip MBA chip.
+ * @param i_rank The rank for which the threshold is needed.
+ * @param o_cePerDram CEs allowed per DRAM.
+ * @param o_cePerHalfRank CEs allowed per logical DIMM rank.
+ * @param o_cePerDimm CEs allowed per logical DIMM.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+ uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
+ uint16_t & o_cePerDimm );
+
+} // end namespace PRDF
+
+#endif /* __PRDF_CEN_MBA_COMMON_THRESHOLDS_H */
+
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C
new file mode 100755
index 000000000..0701670cb
--- /dev/null
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C
@@ -0,0 +1,167 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.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 */
+
+/** @file prdfCenMemUtils.C
+ * @brief Utility functions related to Centaur
+ */
+
+#include <prdfCenMemUtils.H>
+#include <prdfExtensibleChip.H>
+#include <prdfCenMbaDataBundle.H>
+#include <prdfPlatServices.H>
+
+using namespace TARGETING;
+
+namespace PRDF
+{
+
+namespace MemUtils
+{
+
+using namespace PlatServices;
+
+const uint8_t CE_REGS_PER_MBA = 9;
+const uint8_t SYMBOLS_PER_CE_REG = 8;
+
+static const char *mbsCeStatReg[][ CE_REGS_PER_MBA ] = {
+ { "MBA0_MBSSYMEC0", "MBA0_MBSSYMEC1","MBA0_MBSSYMEC2",
+ "MBA0_MBSSYMEC3", "MBA0_MBSSYMEC4", "MBA0_MBSSYMEC5",
+ "MBA0_MBSSYMEC6", "MBA0_MBSSYMEC7", "MBA0_MBSSYMEC8" },
+ { "MBA1_MBSSYMEC0", "MBA1_MBSSYMEC1","MBA1_MBSSYMEC2",
+ "MBA1_MBSSYMEC3", "MBA1_MBSSYMEC4", "MBA1_MBSSYMEC5",
+ "MBA1_MBSSYMEC6", "MBA1_MBSSYMEC7", "MBA1_MBSSYMEC8" }
+ };
+
+int32_t collectCeStats( ExtensibleChip *i_mbaChip, MaintSymbols &o_maintStats,
+ const CenRank & i_rank )
+{
+ #define PRDF_FUNC "[MemUtils::collectCeStats] "
+ int32_t o_rc = SUCCESS;
+ do
+ {
+ TargetHandle_t mbaTrgt = i_mbaChip->GetChipHandle();
+ CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
+ ExtensibleChip * membufChip = mbadb->getMembChip();
+ if ( NULL == membufChip )
+ {
+ PRDF_ERR( PRDF_FUNC"getMembChip() failed: MBA=0x%08x",
+ getHuid(mbaTrgt) );
+ o_rc = FAIL; break;
+ }
+ uint8_t mbaPos = getTargetPosition( mbaTrgt );
+
+ for( uint8_t regIdx = 0 ; regIdx < CE_REGS_PER_MBA; regIdx++)
+ {
+ SCAN_COMM_REGISTER_CLASS * ceReg = membufChip->getRegister(
+ mbsCeStatReg[mbaPos][regIdx] );
+
+ if( NULL == ceReg )
+ {
+ PRDF_ERR( PRDF_FUNC"getRegister() Failed for register:%s",
+ mbsCeStatReg[mbaPos][regIdx]);
+ break;
+ }
+ o_rc = ceReg->Read();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"%s Read() failed. Target=0x%08x",
+ mbsCeStatReg[mbaPos][regIdx], getHuid(mbaTrgt) );
+ break;
+ }
+ uint8_t baseSymbol = SYMBOLS_PER_CE_REG*regIdx;
+ for(uint8_t i = 0 ; i < SYMBOLS_PER_CE_REG; i++)
+ {
+ uint8_t synCount = ceReg->GetBitFieldJustified( (i*8), 8 );
+
+ if ( 0 == synCount)
+ {
+ continue;
+ }
+ else
+ {
+ SymbolData symData;
+ symData.symbol = CenSymbol::fromSymbol( mbaTrgt, i_rank,
+ baseSymbol+i, CenSymbol::BOTH_SYMBOL_DQS );
+ if ( !symData.symbol.isValid() )
+ {
+ PRDF_ERR( PRDF_FUNC"CenSymbol() failed" );
+ o_rc = FAIL;
+ break;
+ }
+ else
+ {
+ symData.count = synCount;
+ o_maintStats.push_back( symData );
+ }
+ }
+ }
+ if( FAIL == o_rc) break;
+ }
+ if( FAIL == o_rc) break;
+ }while(0);
+ return o_rc;
+ #undef PRDF_FUNC
+}
+
+int32_t getDramSize( ExtensibleChip *i_mbaChip, uint8_t & o_size )
+{
+ #define PRDF_FUNC "[MemUtils::getDramSize] "
+
+ int32_t o_rc = SUCCESS;
+ o_size = SIZE_2GB;
+
+ do
+ {
+ TargetHandle_t mbaTrgt = i_mbaChip->GetChipHandle();
+ CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
+ ExtensibleChip * membufChip = mbadb->getMembChip();
+ if ( NULL == membufChip )
+ {
+ PRDF_ERR( PRDF_FUNC"getMembChip() failed: MBA=0x%08x",
+ getHuid(mbaTrgt) );
+ o_rc = FAIL; break;
+ }
+
+ uint32_t pos = getTargetPosition(mbaTrgt);
+ const char * reg_str = (0 == pos) ? "MBA0_MBAXCR" : "MBA1_MBAXCR";
+
+ SCAN_COMM_REGISTER_CLASS * reg = membufChip->getRegister( reg_str );
+ o_rc = reg->Read();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"Read() failed on %s. Target=0x%08x",
+ reg_str, getHuid(mbaTrgt) );
+ break;
+ }
+ o_size = reg->GetBitFieldJustified( 6, 2 );
+
+ } while(0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+} // end namespace MemUtils
+
+} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H
new file mode 100755
index 000000000..1b77c607a
--- /dev/null
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H
@@ -0,0 +1,99 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.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 prdfCenMemUtils_H
+#define prdfCenMemUtils_H
+
+/** @file prdfCenMemUtils.H
+ * @brief General utility functions for Centaur
+ */
+
+//------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------
+
+#include <vector>
+#include <prdfCenSymbol.H>
+
+
+
+namespace PRDF
+{
+
+class ExtensibleChip;
+
+namespace MemUtils
+{
+
+//==============================================================================
+// Constants and Enums
+//==============================================================================
+
+/**
+ * @brief Lists all possible sizes for a DRAM.
+ * @note These values must match the defintion of MBAXCR[6:7]. They are
+ * important for calculations.
+ */
+enum DramSize
+{
+ SIZE_2GB = 0,
+ SIZE_4GB = 1,
+ SIZE_8GB = 2,
+ SIZE_16GB = 3,
+};
+
+//==============================================================================
+// Maintenance statistics
+//==============================================================================
+
+/**
+ * @brief Collects CE symbol data.
+ */
+struct SymbolData
+{
+ CenSymbol symbol;
+ uint8_t count;
+ SymbolData() : count(0) {}
+};
+
+typedef std::vector<SymbolData> MaintSymbols;
+/**
+ * @brief Checks CE stats on a MBA.
+ * @param i_mbaChip MBA chip.
+ * @param o_maintStats Output vector. Contains symbols with CE count.
+ * @param i_rank Rank for which stat collection will be done.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+int32_t collectCeStats( ExtensibleChip *i_mbaChip, MaintSymbols &o_maintStats,
+ const CenRank & i_rank );
+/**
+ * @brief Gets DRAM size for an MBA.
+ * @param i_mbaChip MBA chip.
+ * @param o_size size for a DRAM.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+int32_t getDramSize( ExtensibleChip *i_mbaChip, uint8_t & o_size );
+
+} // namespace MemUtils
+} // end namespace PRDF
+#endif
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C
index 57eaf1322..5b1e0444b 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C
@@ -245,4 +245,28 @@ int32_t CenSymbol::getSymbol( const CenRank & i_rank, WiringType i_wiringType,
#undef PRDF_FUNC
}
+//------------------------------------------------------------------------------
+
+int32_t CenSymbol::setPins( uint8_t i_pins )
+{
+ #define PRDF_FUNC "[CenSymbol::setPins] "
+ int32_t o_rc = SUCCESS;
+
+ do
+ {
+ if ( BOTH_SYMBOL_DQS < i_pins )
+ {
+ PRDF_ERR( PRDF_FUNC"i_pins %u is invalid", i_pins );
+ o_rc = FAIL;
+ break;
+ }
+
+ iv_pins = i_pins;
+
+ } while (0);
+
+ 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
index a43700e87..681bff7ee 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.H
@@ -34,6 +34,7 @@
#include <prdfCenAddress.H>
#include <prdfCenConst.H>
+#include <prdfPlatServices.H>
#include <prdfTargetFwdRef.H>
//##############################################################################
@@ -152,6 +153,16 @@ class CenSymbol
/** @return The DRAM index for this symbol. */
uint8_t getDram() const { return symbol2Dram( iv_symbol, iv_x4Dram ); }
+ /** @return rank associated with this symbol. */
+ CenRank getRank() const { return iv_rank; };
+
+ /**
+ * @brief Sets this symbol's pin to a new set of bad pins.
+ * @param The new pins.
+ * @return Non-SUCCESS if an internal function failed, SUCCESS otherwise.
+ */
+ int32_t setPins( uint8_t i_pins );
+
/** @return TRUE this symbol is on a x4 DRAM, FALSE otherwise. */
bool isX4Dram() const { return iv_x4Dram; }
@@ -171,20 +182,27 @@ class CenSymbol
* @brief Overrides the '<' operator.
* @param i_symbol The symbol to compare with.
* @return TRUE if this symbol is less than i_symbol, FALSE otherwise.
+ * @note Compares against iv_symbol and iv_rank. There is currently no
+ * need to compare against iv_mbaTarget.
*/
bool operator < ( const CenSymbol & i_symbol ) const
{
- return ( this->getSymbol() < i_symbol.getSymbol() );
+ return ( (iv_symbol < i_symbol.iv_symbol) ||
+ ( (iv_symbol == i_symbol.iv_symbol) &&
+ (iv_rank < i_symbol.iv_rank ) ) );
}
/**
* @brief Overrides the '==' operator.
* @param i_symbol The symbol to compare with.
* @return TRUE if the two symbols are equivalent, FALSE otherwise.
+ * @note Compares against iv_symbol and iv_rank. There is currently no
+ * need to compare against iv_mbaTarget.
*/
bool operator == ( const CenSymbol & i_symbol ) const
{
- return ( this->getSymbol() == i_symbol.getSymbol() );
+ return ( (iv_symbol == i_symbol.iv_symbol) &&
+ (iv_rank == i_symbol.iv_rank ) );
}
private: // functions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfLaneRepair.H b/src/usr/diag/prdf/common/plat/pegasus/prdfLaneRepair.H
index 1bf1d256c..77482bcc3 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfLaneRepair.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfLaneRepair.H
@@ -20,6 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
+
#ifndef _PRDFLANEREPAIR_H
#define _PRDFLANEREPAIR_H
OpenPOWER on IntegriCloud