summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2014-03-05 14:51:24 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-03-21 10:27:10 -0500
commite2b7aeb5ef7a79f9969420a5f21fc7b6e473ca61 (patch)
tree71023aaecc5097efab4975d7ac111d66b3f4af82 /src/usr/diag/prdf/common
parent9789508b0d23b4c253588c6f5f88c6ebab2c7ade (diff)
downloadtalos-hostboot-e2b7aeb5ef7a79f9969420a5f21fc7b6e473ca61.tar.gz
talos-hostboot-e2b7aeb5ef7a79f9969420a5f21fc7b6e473ca61.zip
PRD: Redesigned placing marks during TPS
Change-Id: I1d24edc6b956270cd7d633780740354d51be1695 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9322 Tested-by: Jenkins Server Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com> Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com> Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: BENJAMIN J. WEISENBECK <bweisenb@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9474
Diffstat (limited to 'src/usr/diag/prdf/common')
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H10
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C6
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C66
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H18
4 files changed, 68 insertions, 32 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
index ffd220e60..d90f01c37 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaExtraSig.H
@@ -48,9 +48,11 @@ PRDR_ERROR_SIGNATURE(MaintNCE_CTE, 0xffff0016, "", "Maint SOFT/INTER CTE");
PRDR_ERROR_SIGNATURE(VcmVerified, 0xffff0020, "", "VCM: verified");
PRDR_ERROR_SIGNATURE(VcmFalseAlarm, 0xffff0021, "", "VCM: false alarm");
PRDR_ERROR_SIGNATURE(VcmBadSpare, 0xffff0022, "", "VCM: bad DRAM spare");
-PRDR_ERROR_SIGNATURE(VcmMarksUnavail, 0xffff0023, "",
- "VCM: No more marks available");
-PRDR_ERROR_SIGNATURE(VcmFalseAlarmExceeded, 0xffff0024, "",
+PRDR_ERROR_SIGNATURE(VcmCmAndSpare, 0xffff0023, "",
+ "VCM: Both spare and chip mark used");
+PRDR_ERROR_SIGNATURE(VcmCmAndSm, 0xffff0024, "",
+ "VCM: Both symbol and chip mark used");
+PRDR_ERROR_SIGNATURE(VcmFalseAlarmExceeded, 0xffff0025, "",
"VCM: false alarm threshold exceeded");
PRDR_ERROR_SIGNATURE(DsdDramSpared, 0xffff0030, "", "DSD: DRAM spared");
@@ -79,5 +81,7 @@ PRDR_ERROR_SIGNATURE(TpsSymbolMark, 0xffff0063, "", "TPS: symbol mark placed");
PRDR_ERROR_SIGNATURE(TpsChipMark, 0xffff0064, "", "TPS: chip mark placed");
PRDR_ERROR_SIGNATURE(TpsMarksUnavail, 0xffff0065, "",
"TPS: No more marks available");
+PRDR_ERROR_SIGNATURE(TpsCmAndSpare, 0xffff0066, "",
+ "TPS: Both spare and chip mark used");
#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 3601a6a8b..1116eda1f 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
@@ -517,14 +517,14 @@ int32_t CenMbaTdCtlrCommon::handleMCE_VCM2( STEP_CODE_DATA_STRUCT & io_sc )
else
{
// Chip mark and DRAM spare are both used.
- io_sc.service_data->SetErrorSig( PRDFSIG_VcmMarksUnavail );
+ io_sc.service_data->SetErrorSig( PRDFSIG_VcmCmAndSpare );
io_sc.service_data->SetServiceCall();
}
}
else
{
// Chip mark is in place and sparing is not possible.
- setTdSignature( io_sc, PRDFSIG_VcmMarksUnavail );
+ setTdSignature( io_sc, PRDFSIG_VcmCmAndSpare );
io_sc.service_data->SetServiceCall();
}
}
@@ -535,7 +535,7 @@ int32_t CenMbaTdCtlrCommon::handleMCE_VCM2( STEP_CODE_DATA_STRUCT & io_sc )
// predictive.
if ( iv_mark.getSM().isValid() )
{
- setTdSignature( io_sc, PRDFSIG_VcmMarksUnavail );
+ setTdSignature( io_sc, PRDFSIG_VcmCmAndSm );
io_sc.service_data->SetServiceCall();
}
}
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C
index 3b09433e8..7d2f1a638 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C
@@ -55,14 +55,26 @@ static const char *mbsCeStatReg[][ CE_REGS_PER_MBA ] = {
//------------------------------------------------------------------------------
+// Helper structs for collectCeStats()
+struct DramCount_t
+{
+ uint8_t totalCount; uint8_t symbolCount;
+ DramCount_t() : totalCount(0), symbolCount(0) {}
+};
+typedef std::map<uint32_t, DramCount_t> DramCountMap;
+
+//------------------------------------------------------------------------------
+
int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
- MaintSymbols & o_maintStats, CenSymbol & o_highestDram,
+ MaintSymbols & o_maintStats, CenSymbol & o_chipMark,
uint8_t i_thr )
{
#define PRDF_FUNC "[MemUtils::collectCeStats] "
int32_t o_rc = SUCCESS;
+ o_chipMark = CenSymbol(); // Initially invalid.
+
do
{
if ( 0 == i_thr ) // Must be non-zero
@@ -87,7 +99,7 @@ int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
o_rc = FAIL; break;
}
- bool isX4 = isDramWidthX4(mbaTrgt);
+ const bool isX4 = isDramWidthX4(mbaTrgt);
// Get the current spares on this rank.
CenSymbol sp0, sp1, ecc;
@@ -99,8 +111,7 @@ int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
}
// Use this map to keep track of the total counts per DRAM.
- typedef std::map<uint32_t, uint32_t> DramCount;
- DramCount dramCounts;
+ DramCountMap dramCounts;
const char * reg_str = NULL;
SCAN_COMM_REGISTER_CLASS * reg = NULL;
@@ -129,11 +140,15 @@ int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
uint8_t dram = CenSymbol::symbol2Dram( sym, isX4 );
// Keep track of the total DRAM counts.
- dramCounts[dram] += count;
+ dramCounts[dram].totalCount += count;
// Add any symbols that have exceeded threshold to the list.
if ( i_thr <= count )
{
+ // Keep track of the total number of symbols per DRAM that
+ // have exceeded threshold.
+ dramCounts[dram].symbolCount++;
+
SymbolData symData;
symData.symbol = CenSymbol::fromSymbol( mbaTrgt, i_rank,
sym, CenSymbol::BOTH_SYMBOL_DQS );
@@ -176,26 +191,35 @@ int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
std::sort( o_maintStats.begin(), o_maintStats.end(), sortSymDataCount );
// Get the DRAM with the highest count.
- DramCount::iterator highestEntry = dramCounts.begin();
- DramCount::iterator it = highestEntry; ++it; // sets it to next entry
- for ( ; it != dramCounts.end(); ++it )
+ uint32_t highestDram = 0;
+ uint32_t highestCount = 0;
+ const uint32_t symbolTH = isX4 ? 1 : 2;
+ for ( DramCountMap::iterator it = dramCounts.begin();
+ it != dramCounts.end(); ++it )
{
- if ( highestEntry->second < it->second )
- highestEntry = it;
+ if ( (symbolTH <= it->second.symbolCount) &&
+ (highestCount < it->second.totalCount ) )
+ {
+ highestDram = it->first;
+ highestCount = it->second.totalCount;
+ }
}
- uint8_t sym = CenSymbol::dram2Symbol( highestEntry->first, isX4 );
- o_highestDram = CenSymbol::fromSymbol( mbaTrgt, i_rank, sym );
-
- // Check if this symbol is on any of the spares.
- if ( ( sp0.isValid() && (sp0.getDram() == o_highestDram.getDram()) ) ||
- ( sp1.isValid() && (sp1.getDram() == o_highestDram.getDram()) ) )
- {
- o_highestDram.setDramSpared();
- }
- if ( ecc.isValid() && (ecc.getDram() == o_highestDram.getDram()) )
+ if ( 0 != highestCount )
{
- o_highestDram.setEccSpared();
+ uint8_t sym = CenSymbol::dram2Symbol( highestDram, isX4 );
+ o_chipMark = CenSymbol::fromSymbol( mbaTrgt, i_rank, sym );
+
+ // Check if this symbol is on any of the spares.
+ if ( ( sp0.isValid() && (sp0.getDram() == o_chipMark.getDram()) ) ||
+ ( sp1.isValid() && (sp1.getDram() == o_chipMark.getDram()) ) )
+ {
+ o_chipMark.setDramSpared();
+ }
+ if ( ecc.isValid() && (ecc.getDram() == o_chipMark.getDram()) )
+ {
+ o_chipMark.setEccSpared();
+ }
}
} while(0);
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H
index b2a8292f2..cb4f6792c 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H
@@ -116,10 +116,18 @@ class MatchSymDataSymbol
* @param i_mbaChip Target MBA chip.
* @param i_rank Target rank.
* @param o_maintStats Returns the list of symbols and counts.
- * @param o_highestDram Returns a symbol representing the DRAM with the highest
- * total count. This includes counts from DRAM that are
- * under the given threshold. This value is undefined if
- * o_maintStats is empty.
+ * @param o_chipMark This represents the DRAM in which a chip mark should be
+ * placed, if necessary, based on the following:
+ * - In x4 mode, this represents the DRAM with the
+ * highest total per symbol count with at least 1
+ * symbol that has exceeded threshold.
+ * - In x8 mode, this represents the DRAM with the
+ * highest total per symbol count with at least 2
+ * symbols that have exceeded threshold.
+ * It is possible that there will be symbols returned in
+ * o_maintStats that do not meet the criteria stated
+ * above. Therefore, the user must check if o_chipMark is
+ * valid before using it.
* @param i_thr The count threshold. Each symbol count must be greater
* than or equal to this value to be added to the list.
* The default is 1, which means all non-zero counts will
@@ -128,7 +136,7 @@ class MatchSymDataSymbol
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
int32_t collectCeStats( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
- MaintSymbols & o_maintStats, CenSymbol & o_highestDram,
+ MaintSymbols & o_maintStats, CenSymbol & o_chipMark,
uint8_t i_thr = 1 );
/**
OpenPOWER on IntegriCloud