summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Palmer <cnpalmer@us.ibm.com>2016-08-26 13:50:04 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-09-20 16:47:29 -0400
commit41c9a48acc1bd50d2fe3f0185cf8cf805d299af0 (patch)
tree8967dc668d36cacb74699403a961a5d7db4c3a11
parentd5de7972297a818670c0987b59a4f4cb398f1cd7 (diff)
downloadtalos-hostboot-41c9a48acc1bd50d2fe3f0185cf8cf805d299af0.tar.gz
talos-hostboot-41c9a48acc1bd50d2fe3f0185cf8cf805d299af0.zip
PRD: Enable background scrubbing
Change-Id: I3a92fbb75bc8642f79e8aca571078baee8d4f532 RTC: 147390 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28186 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29179 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H108
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C312
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H66
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C76
-rwxr-xr-x[-rw-r--r--]src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H (renamed from src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H)12
-rw-r--r--src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk2
-rw-r--r--src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C9
-rw-r--r--src/usr/diag/prdf/prdfMain_ipl.C40
-rw-r--r--src/usr/diag/prdf/prdf_hb_only.mk5
9 files changed, 611 insertions, 19 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H b/src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H
new file mode 100644
index 000000000..19e3c6e3f
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H
@@ -0,0 +1,108 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/** @file prdfMemBgScrub.H
+ * @brief Define the functionality necessary to start initial background scrub
+ */
+
+#ifndef __prdfMemBgScrub_H
+#define __prdfMemBgScrub_H
+
+// Framework includes
+#include <prdfExtensibleChip.H>
+#include <prdfPlatServices.H>
+#include <prdfTrace.H>
+#include <prdfMemScrubUtils.H>
+
+namespace PRDF
+{
+
+/**
+ * @brief Performs all actions necessary to start the background scrub
+ * @param mcbChip The mcbist chip
+ * @return SUCCESS when background scrub is started correctly, else Non-SUCCESS
+ */
+template<TARGETING::TYPE T>
+int32_t startInitialBgScrub(ExtensibleChip* chip)
+{
+ #define PRDF_FUNC "[PRDF::startInitialBgScrub] "
+
+ int32_t o_rc = SUCCESS;
+
+ // NOTE: It is possible for a chip mark to have been placed between MDIA
+ // and the initial start scrub. Those unverified chip marks will be
+ // found in the runtime TD controller's initialize() function. The
+ // chip marks will then be verified after the initial fast scrub is
+ // complete.
+
+ do
+ {
+ // Cleanup hardware before starting the maintenance command.
+ o_rc = clearCmdCompleteAttn<T>(chip);
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "clearCmdCompleteAttn failed" );
+ break;
+ }
+
+ o_rc = clearEccCounters<T>(chip);
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "clearEccCounters failed" );
+ break;
+ }
+
+ o_rc = clearEccFirs<T>(chip);
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "clearEccFirs failed" );
+ break;
+ }
+
+ TARGETING::TargetHandle_t trgt = chip->GetChipHandle();
+
+ // We can use the default constructor for MemRank to start rank 0
+ MemRank rank;
+
+ o_rc = PlatServices::startBgScrub<T>(trgt, rank, 0);
+
+ } while (0);
+
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "chip:0x%08x", chip->GetId() );
+
+ int32_t l_rc = clearCmdCompleteAttn<T>(chip); // Just in case.
+ if ( SUCCESS != l_rc )
+ PRDF_ERR( PRDF_FUNC "clearCmdCompleteAttn() failed" );
+ }
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+} //end namespace PRDF
+
+#endif // __prdfMemBgScrub_H
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
new file mode 100644
index 000000000..c64e668d9
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C
@@ -0,0 +1,312 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/** @file prdfMemScrubUtils.C
+ * @brief Define the functionality necessary to start initial background scrub
+ */
+
+// Framework includes
+#include <prdfMemScrubUtils.H>
+#include <prdfExtensibleChip.H>
+#include <prdfGlobal.H>
+#include <prdfPlatServices.H>
+#include <prdfTrace.H>
+#include <fapi2.H>
+#include <prdfTargetServices.H>
+#include <prdfRegisterCache.H>
+#include <lib/mcbist/memdiags.H>
+
+using namespace TARGETING;
+
+namespace PRDF
+{
+using namespace PlatServices;
+
+template<>
+int32_t clearCmdCompleteAttn<TYPE_MCBIST>(ExtensibleChip* i_mcbChip)
+{
+ #define PRDF_FUNC "[PRDF::clearCmdCompleteAttn<TYPE_MCBIST>] "
+
+ int32_t o_rc = SUCCESS;
+
+ SCAN_COMM_REGISTER_CLASS * mcbFirAnd =
+ i_mcbChip->getRegister("MCBISTFIR_AND");
+ mcbFirAnd->setAllBits();
+
+ mcbFirAnd->ClearBit(10); // Maint cmd complete
+ mcbFirAnd->ClearBit(12); // Maint cmd WAT workaround for sf commands
+
+ if ( SUCCESS != mcbFirAnd->Write() )
+ {
+ PRDF_ERR ( PRDF_FUNC "Write() failed on MCBISTFIR_AND" );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+template<>
+int32_t clearCmdCompleteAttn<TYPE_MBA>(ExtensibleChip* i_mbaChip)
+{
+ #define PRDF_FUNC "[PRDF::clearCmdCompleteAttn<TYPE_MBA>] "
+
+ int32_t o_rc = SUCCESS;
+
+ SCAN_COMM_REGISTER_CLASS * mbaSpaAnd = i_mbaChip->getRegister("MBASPA_AND");
+ mbaSpaAnd->setAllBits();
+
+ mbaSpaAnd->ClearBit(0); // Maint cmd complete
+ mbaSpaAnd->ClearBit(8); // Maint cmd complete (DD1.0 workaround)
+
+ if ( SUCCESS != mbaSpaAnd->Write() )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on MBASPA_AND" );
+ o_rc = FAIL;
+ }
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+template<>
+int32_t clearEccCounters<TYPE_MCBIST>(ExtensibleChip* i_mcbChip)
+{
+ #define PRDF_FUNC "[PRDF::clearEccCounters<TYPE_MCBIST>] "
+ int32_t o_rc = SUCCESS;
+
+ do
+ {
+ SCAN_COMM_REGISTER_CLASS * mcbcntl =
+ i_mcbChip->getRegister( "MCB_CNTL" );
+
+ o_rc = mcbcntl->ForceRead();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "ForceRead() failed on MCB_CNTL" );
+ break;
+ }
+
+ mcbcntl->SetBit(7); // Setting this bit clears all counters.
+
+ o_rc = mcbcntl->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on MCB_CNTL" );
+ break;
+ }
+
+ // Hardware automatically clears bit 7, so flush this register out
+ // of the register cache to avoid clearing the counters again with
+ // a write from the out-of-date cached copy.
+ RegDataCache & cache = RegDataCache::getCachedRegisters();
+ cache.flush( i_mcbChip, mcbcntl );
+
+ } while(0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+template<>
+int32_t clearEccCounters<TYPE_MBA>(ExtensibleChip* i_mbaChip)
+{
+ #define PRDF_FUNC "[PRDF::clearEccCounters<TYPE_MBA>] "
+ int32_t o_rc = SUCCESS;
+ const char* reg_str = nullptr;
+
+ TARGETING::TargetHandle_t mbaTrgt = i_mbaChip->GetChipHandle();
+
+ do
+ {
+
+ uint32_t mbaPos = getTargetPosition(mbaTrgt);
+ reg_str = (0 == mbaPos) ? "MBA0_MBSTR" : "MBA1_MBSTR";
+ SCAN_COMM_REGISTER_CLASS * mbstr = i_mbaChip->getRegister( reg_str );
+
+ // MBSTR's content could be modified from cleanupCmd()
+ // so we need to refresh
+ o_rc = mbstr->ForceRead();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "ForceRead() failed on %s", reg_str );
+ break;
+ }
+
+ mbstr->SetBit(53); // Setting this bit clears all counters.
+
+ o_rc = mbstr->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on %s", reg_str );
+ break;
+ }
+
+ // Hardware automatically clears bit 53, so flush this register out
+ // of the register cache to avoid clearing the counters again with
+ // a write from the out-of-date cached copy.
+ RegDataCache & cache = RegDataCache::getCachedRegisters();
+ cache.flush( i_mbaChip, mbstr );
+
+ } while(0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+template<>
+int32_t clearEccFirs<TYPE_MCBIST>(ExtensibleChip* i_mcbChip)
+{
+ #define PRDF_FUNC "[PRDF::clearEccFirs<TYPE_MCBIST>] "
+
+ int32_t o_rc = SUCCESS;
+
+ TARGETING::TargetHandle_t mcbTrgt = i_mcbChip->GetChipHandle();
+
+ do
+ {
+ //clear MCBISTFIR - bits 5-9
+ SCAN_COMM_REGISTER_CLASS * mcbFirAnd =
+ i_mcbChip->getRegister("MCBISTFIR_AND");
+ mcbFirAnd->setAllBits();
+
+ mcbFirAnd->SetBitFieldJustified( 5, 5, 0 );
+
+ o_rc = mcbFirAnd->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on MCBISTFIR_AND" );
+ break;
+ }
+
+ //clear MCAECCFIR - bits 20-34, 36-37, and 39
+ //iterate through all MCAs
+ for ( uint32_t mcaPos = 0; mcaPos < MAX_PORT_PER_MCBIST ; mcaPos++ )
+ {
+ TargetHandle_t mcaTrgt =
+ getConnectedChild( mcbTrgt, TYPE_MCA, mcaPos );
+ if ( nullptr == mcaTrgt )
+ {
+ PRDF_ERR ( PRDF_FUNC "Failed to get mcaTrgt" );
+ continue;
+ }
+ ExtensibleChip * mcaChip =
+ (ExtensibleChip*)systemPtr->GetChip(mcaTrgt);
+
+ SCAN_COMM_REGISTER_CLASS * mcaEccFirAnd =
+ mcaChip->getRegister("MCAECCFIR_AND");
+ mcaEccFirAnd->setAllBits();
+
+ mcaEccFirAnd->SetBitFieldJustified( 20, 15, 0 );
+ mcaEccFirAnd->SetBitFieldJustified( 36, 2, 0 );
+ mcaEccFirAnd->ClearBit(39);
+
+ o_rc = mcaEccFirAnd->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on MCAECCFIR_AND" );
+ break;
+ }
+ }
+
+ } while(0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+template<>
+int32_t clearEccFirs<TYPE_MBA>(ExtensibleChip* i_mbaChip)
+{
+ #define PRDF_FUNC "[PRDF::clearEccFirs<TYPE_MBA>] "
+
+ int32_t o_rc = SUCCESS;
+ const char* reg_str = nullptr;
+
+ TARGETING::TargetHandle_t mbaTrgt = i_mbaChip->GetChipHandle();
+
+ do
+ {
+ uint32_t mbaPos = getTargetPosition(mbaTrgt);
+ reg_str = (0 == mbaPos) ? "MBA0_MBSECCFIR_AND"
+ : "MBA1_MBSECCFIR_AND";
+
+ TargetHandle_t membTrgt = getConnectedParent(mbaTrgt, TYPE_MEMBUF);
+ if (nullptr == membTrgt)
+ {
+ PRDF_ERR ( PRDF_FUNC "Failed to get membTrgt" );
+ o_rc = FAIL;
+ break;
+ }
+ ExtensibleChip * membChip =
+ (ExtensibleChip*)systemPtr->GetChip(membTrgt);
+ SCAN_COMM_REGISTER_CLASS * firand = membChip->getRegister(reg_str);
+ firand->setAllBits();
+
+ // Clear all scrub MPE bits.
+ // This will need to be done when starting a TD procedure or bg
+ // scrubbing. rank may not be set when starting background scrubbing
+ // and technically there should only be one of the MPE bits on at a
+ // time so we should not have to worry about losing an attention by
+ // clearing them all.
+ firand->SetBitFieldJustified( 20, 8, 0 );
+
+ // Clear scrub NCE, SCE, MCE, RCE, SUE, UE bits (36-41)
+ firand->SetBitFieldJustified( 36, 6, 0 );
+
+ o_rc = firand->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on %s", reg_str );
+ break;
+ }
+
+ SCAN_COMM_REGISTER_CLASS * spaAnd =
+ i_mbaChip->getRegister("MBASPA_AND");
+ spaAnd->setAllBits();
+
+ // Clear threshold exceeded attentions
+ spaAnd->SetBitFieldJustified( 1, 4, 0 );
+
+ o_rc = spaAnd->Write();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "Write() failed on MBASPA_AND" );
+ break;
+ }
+
+ } while(0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+} //end namespace PRDF
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H
new file mode 100644
index 000000000..7caa08e27
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H
@@ -0,0 +1,66 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/** @file prdfMemScrubUtils.H
+ * @brief Define the functionality necessary to start initial background scrub
+ */
+
+#ifndef __prdfMemScrubUtils_H
+#define __prdfMemScrubUtils_H
+
+#include <iipconst.h>
+#include <iipServiceDataCollector.h>
+#include <iipSystem.h>
+
+namespace PRDF
+{
+
+/**
+ * @brief Clears the cmd complete attention from the inputted chip
+ * @param chip The chip, either mba or mcbist
+ * @return SUCCESS if the cmd complete attention is cleared, else Non-SUCCESS
+ */
+template<TARGETING::TYPE T>
+int32_t clearCmdCompleteAttn (ExtensibleChip* chip);
+
+/**
+ * @brief Clears the ecc counters from the inputted chip
+ * @param chip The chip, either mba or mcbist
+ * @return SUCCESS if the ecc counters are cleared, else Non-SUCCESS
+ */
+template<TARGETING::TYPE T>
+int32_t clearEccCounters (ExtensibleChip* chip);
+
+/**
+ * @brief Clears the ecc firs from the inputted chip
+ * @param chip The chip, either mba or mcbist
+ * @return SUCCESS if the ecc firs are cleared, else Non-SUCCESS
+ */
+template<TARGETING::TYPE T>
+int32_t clearEccFirs (ExtensibleChip* chip);
+
+} //end namespace PRDF
+
+#endif // __prdfMemScrubUtils_H
diff --git a/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C
new file mode 100644
index 000000000..241d835f2
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C
@@ -0,0 +1,76 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/**
+ * @file prdfP9McbistDomain.C
+ * @brief chip Plug-in code for mcbist domain
+ */
+
+#include <prdfP9McbistDomain.H>
+
+// Framework includes
+#include <prdfExtensibleChip.H>
+#include <prdfPlatServices.H>
+#include <prdfTrace.H>
+#include <prdfMemBgScrub.H>
+
+using namespace TARGETING;
+
+namespace PRDF
+{
+
+using namespace PlatServices;
+
+int32_t McbistDomain::startScrub()
+{
+ #define PRDF_FUNC "[McbistDomain::startScrub] "
+
+ PRDF_ENTER( PRDF_FUNC );
+
+ int32_t o_rc = SUCCESS;
+
+ // Iterate all MCBISTs in the domain.
+ for ( uint32_t i = 0; i < GetSize(); ++i )
+ {
+ RuleChip * mcbistChip = LookUp(i);
+
+ // Start background scrub
+ int32_t l_rc = PRDF::startInitialBgScrub<TYPE_MCBIST>(mcbistChip);
+ if ( SUCCESS != l_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "startInitialBgScrub() failed: "
+ "MCBIST=0x%08x", mcbistChip->GetId() );
+ o_rc = FAIL; continue; // Keep going.
+ }
+ }
+
+ PRDF_EXIT( PRDF_FUNC "prdf: McbistDomain::startScrub exit" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H
index 01f4f5519..702c97af9 100644..100755
--- a/src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H
+++ b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H
@@ -1,7 +1,7 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H $ */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
@@ -54,6 +54,16 @@ class McbistDomain : public RuleChipDomain
virtual bool Query( ATTENTION_TYPE i_attnType )
{ return false; }
+ #ifndef __HOSTBOOT_RUNTIME
+
+ /**
+ * @brief Starts memory background scrubbing for all memory.
+ * @param Non-SUCCESS if an internal function failed, SUCCESS otherwise.
+ */
+ int32_t startScrub();
+
+ #endif
+
};
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
index 188b3b14f..250ab0286 100644
--- a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
+++ b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
@@ -47,8 +47,10 @@ prd_rule_plugin += prdfP9Mcbist.o
ifneq (${HOSTBOOT_RUNTIME},1)
# plat/mem/ (non-rule plugin related)
+prd_obj += prdfMemScrubUtils.o
prd_obj += prdfMemTdCtlr_ipl.o
prd_obj += prdfMemVcm_ipl.o
+prd_obj += prdfP9McbistDomain.o
endif
diff --git a/src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C b/src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C
index 122b3b9ab..669d2906f 100644
--- a/src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C
+++ b/src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C
@@ -29,9 +29,7 @@
#include <prdfExtensibleChip.H>
#include <prdfPlatServices.H>
#include <prdfTrace.H>
-
-// Pegasus includes
-//#include <prdfCenMbaDataBundle.H> TODO RTC 136126
+#include <prdfMemBgScrub.H>
using namespace TARGETING;
@@ -48,15 +46,13 @@ int32_t MbaDomain::startScrub()
do
{
-/* TODO RTC 136126
// Iterate all MBAs in the domain.
for ( uint32_t i = 0; i < GetSize(); ++i )
{
RuleChip * mbaChip = LookUp(i);
// Start background scrub
- CenMbaDataBundle * mbadb = getMbaDataBundle( mbaChip );
- int32_t l_rc = mbadb->iv_tdCtlr.startInitialBgScrub();
+ int32_t l_rc = PRDF::startInitialBgScrub<TYPE_MBA>(mbaChip);
if ( SUCCESS != l_rc )
{
PRDF_ERR( PRDF_FUNC "startInitialBgScrub() failed: MBA=0x%08x",
@@ -64,7 +60,6 @@ int32_t MbaDomain::startScrub()
o_rc = FAIL; continue; // Keep going.
}
}
-*/
} while (0);
diff --git a/src/usr/diag/prdf/prdfMain_ipl.C b/src/usr/diag/prdf/prdfMain_ipl.C
index 61f14db6e..7af6352ca 100644
--- a/src/usr/diag/prdf/prdfMain_ipl.C
+++ b/src/usr/diag/prdf/prdfMain_ipl.C
@@ -38,6 +38,8 @@
#include <prdfErrlUtil.H>
#include <prdfPlatServices.H>
//#include <prdfMbaDomain.H> TODO RTC 136128
+#include <prdfP9McbistDomain.H>
+#include <iipSystem.h>
// Custom compile configs
#include <config.h>
@@ -124,12 +126,11 @@ errlHndl_t startScrub()
#define PRDF_FUNC "[PRDF::startScrub] "
PRDF_ENTER( PRDF_FUNC );
- errlHndl_t o_errl = NULL;
+ errlHndl_t o_errl = nullptr;
int32_t l_rc = SUCCESS;
HUID nodeId = INVALID_HUID;
-/* TODO RTC 136126
// will unlock when going out of scope
PRDF_SYSTEM_SCOPELOCK;
@@ -140,7 +141,7 @@ errlHndl_t startScrub()
// to remove any non-functional MBAs from PRD system model.
o_errl = noLock_refresh();
// This shouldn't return any error but if it does, break out
- if(NULL != o_errl)
+ if( nullptr != o_errl )
{
PRDF_ERR( PRDF_FUNC "noLock_refresh() failed" );
break;
@@ -157,19 +158,38 @@ errlHndl_t startScrub()
PRDF_ENTER( PRDF_FUNC "HUID=0x%08x", nodeId );
- // Start scrubbing on all MBAs.
- MbaDomain * domain = (MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
- if ( NULL == domain )
+ //master proc is CUMULUS, use MBA
+ if ( MODEL_CUMULUS == getChipModel( getMasterProc() ) )
{
- PRDF_ERR( PRDF_FUNC "MBA_DOMAIN not found. nodeId=0x%08x", nodeId );
- l_rc = FAIL; break;
+ //TODO RTC 155857
+ // Start scrubbing on all MBAs.
+ //MbaDomain * domain = (MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
+ //if ( nullptr == domain )
+ //{
+ // PRDF_ERR( PRDF_FUNC "MBA_DOMAIN not found. nodeId=0x%08x",
+ // nodeId );
+ // l_rc = FAIL; break;
+ //}
+ //l_rc = domain->startScrub();
+ }
+ //else use MCBIST
+ else
+ {
+ //Start scrubbing on all MCBISTs
+ McbistDomain * domain =
+ (McbistDomain *)systemPtr->GetDomain(MCBIST_DOMAIN);
+ if ( nullptr == domain )
+ {
+ PRDF_ERR( PRDF_FUNC "MCBIST_DOMAIN not found. nodeId=0x%08x",
+ nodeId );
+ l_rc = FAIL; break;
+ }
+ l_rc = domain->startScrub();
}
- l_rc = domain->startScrub();
PRDF_EXIT( PRDF_FUNC "HUID=0x%08x", nodeId );
} while (0);
-*/
if (( SUCCESS != l_rc ) && (NULL == o_errl))
{
diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk
index 0d972059e..884845e25 100644
--- a/src/usr/diag/prdf/prdf_hb_only.mk
+++ b/src/usr/diag/prdf/prdf_hb_only.mk
@@ -47,6 +47,7 @@ prd_incpath += ${PRD_SRC_PATH}/framework
prd_incpath += ${PRD_SRC_PATH}/mnfgtools
prd_incpath += ${PRD_SRC_PATH}/occ_firdata
prd_incpath += ${PRD_SRC_PATH}/plat
+prd_incpath += ${PRD_SRC_PATH}/plat/mem
# External header paths
prd_incpath += ${ROOTPATH}/src/include/usr/ecmddatabuffer
@@ -55,8 +56,10 @@ prd_incpath += ${ROOTPATH}/src/include/usr/fapi2
prd_incpath += ${ROOTPATH}/src/include/usr/ibscom
prd_incpath += ${ROOTPATH}/src/include/usr/util
prd_incpath += ${ROOTPATH}/src/import/chips/p9/common/include/
-prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
+prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/
+prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/
+prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/utils/
prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include
OpenPOWER on IntegriCloud