summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2018-05-14 21:57:26 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2018-05-18 10:39:37 -0400
commit1b04e458595a9e9c5c04dd322f90d4c44129e111 (patch)
treec70c6c2c35632c604d7d3c359118964c9fbcc948 /src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
parentc1c584f04be0bb7b1340d013b9b9d6147ffa2960 (diff)
downloadtalos-hostboot-1b04e458595a9e9c5c04dd322f90d4c44129e111.tar.gz
talos-hostboot-1b04e458595a9e9c5c04dd322f90d4c44129e111.zip
PRD: support to determine if BG scrub can resume after stop-on-error
Change-Id: Ie2179b66bbe77ef1b982a6dfb1750734d6a9cc23 RTC: 192638 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58811 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59012 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C')
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C136
1 files changed, 46 insertions, 90 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
index 38cbcc8bd..5b7e72c03 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
@@ -386,96 +386,6 @@ uint32_t checkEccFirs<TYPE_MBA>( ExtensibleChip * i_chip,
//------------------------------------------------------------------------------
template<>
-uint32_t isBgScrubConfig<TYPE_MCBIST>( ExtensibleChip * i_chip,
- bool & o_isBgScrub )
-{
- #define PRDF_FUNC "[isBgScrubConfig] "
-
- PRDF_ASSERT( nullptr != i_chip );
- PRDF_ASSERT( TYPE_MCBIST == i_chip->getType() );
-
- uint32_t o_rc = SUCCESS;
-
- o_isBgScrub = false;
-
- do
- {
- // There really is not a good way of doing this. A scrub command is a
- // scrub command the only difference is the speed. Unfortunately, that
- // speed can change depending on how the hardware team tunes it. For
- // now, we can use the stop conditions, which should be unique for
- // background scrub, to determine if it has been configured.
-
- SCAN_COMM_REGISTER_CLASS * reg = i_chip->getRegister( "MBSTR" );
- o_rc = reg->Read();
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "Read() failed on MBSTR: i_chip=0x%08x",
- i_chip->getHuid() );
- break;
- }
-
- if ( 0xf != reg->GetBitFieldJustified(0,4) && // NCE int TH
- 0xf != reg->GetBitFieldJustified(4,4) && // NCE soft TH
- 0xf != reg->GetBitFieldJustified(8,4) && // NCE hard TH
- reg->IsBitSet(34) && // pause on MPE
- reg->IsBitSet(35) ) // pause on UE
- {
- o_isBgScrub = true;
- }
-
- } while(0);
-
- return o_rc;
-
- #undef PRDF_FUNC
-}
-
-template<>
-uint32_t isBgScrubConfig<TYPE_MCA>( ExtensibleChip * i_chip,
- bool & o_isBgScrub )
-{
- PRDF_ASSERT( nullptr != i_chip );
- PRDF_ASSERT( TYPE_MCA == i_chip->getType() );
-
- ExtensibleChip * mcbChip = getConnectedParent( i_chip, TYPE_MCBIST );
-
- return isBgScrubConfig<TYPE_MCBIST>( mcbChip, o_isBgScrub );
-}
-
-template<>
-uint32_t isBgScrubConfig<TYPE_MBA>( ExtensibleChip * i_chip,
- bool & o_isBgScrub )
-{
- #define PRDF_FUNC "[isBgScrubConfig] "
-
- PRDF_ASSERT( nullptr != i_chip );
- PRDF_ASSERT( TYPE_MBA == i_chip->getType() );
-
- uint32_t o_rc = SUCCESS;
-
- o_isBgScrub = false;
-
- do
- {
- // There really is not a good way of doing this. A scrub command is a
- // scrub command the only difference is the speed. Unfortunately, that
- // speed can change depending on how the hardware team tunes it. For
- // now, we can use the stop conditions, which should be unique for
- // background scrub, to determine if it has been configured.
-
- // TODO RTC 157888
-
- } while(0);
-
- return o_rc;
-
- #undef PRDF_FUNC
-}
-
-//------------------------------------------------------------------------------
-
-template<>
uint32_t setBgScrubThresholds<TYPE_MBA>( ExtensibleChip * i_chip,
const MemRank & i_rank )
{
@@ -534,5 +444,51 @@ uint32_t setBgScrubThresholds<TYPE_MBA>( ExtensibleChip * i_chip,
//------------------------------------------------------------------------------
+template<>
+uint32_t didCmdStopOnLastAddr<TYPE_MBA>( ExtensibleChip * i_chip,
+ AddrRangeType i_rangeType,
+ bool & o_stoppedOnLastAddr )
+{
+ #define PRDF_FUNC "[didCmdStopOnLastAddr] "
+
+ uint32_t o_rc = SUCCESS;
+
+ o_stoppedOnLastAddr = false;
+
+ do
+ {
+ // Get the current address.
+ MemAddr curAddr;
+ o_rc = getMemMaintAddr<TYPE_MBA>( i_chip, curAddr );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "getMemMaintAddr(0x%08x) failed",
+ i_chip->getHuid() );
+ break;
+ }
+
+ // Get the end address of the current rank.
+ MemAddr junk, endAddr;
+ o_rc = getMemAddrRange<TYPE_MBA>( i_chip, curAddr.getRank(), junk,
+ endAddr, i_rangeType );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "getMemAddrRange(0x%08x,0x%02x) failed",
+ i_chip->getHuid(), curAddr.getRank().getKey() );
+ break;
+ }
+
+ // Compare the addresses.
+ o_stoppedOnLastAddr = ( curAddr == endAddr );
+
+ } while (0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
} // end namespace PRDF
OpenPOWER on IntegriCloud