From 41c9a48acc1bd50d2fe3f0185cf8cf805d299af0 Mon Sep 17 00:00:00 2001 From: Caleb Palmer Date: Fri, 26 Aug 2016 13:50:04 -0500 Subject: PRD: Enable background scrubbing Change-Id: I3a92fbb75bc8642f79e8aca571078baee8d4f532 RTC: 147390 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28186 Tested-by: Jenkins Server Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29179 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../diag/prdf/common/plat/p9/prdfP9McbistDomain.H | 61 ---- src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H | 108 +++++++ src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C | 312 +++++++++++++++++++++ src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H | 66 +++++ src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C | 76 +++++ src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H | 71 +++++ .../diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk | 2 + src/usr/diag/prdf/plat/pegasus/prdfMbaDomain.C | 9 +- src/usr/diag/prdf/prdfMain_ipl.C | 40 ++- src/usr/diag/prdf/prdf_hb_only.mk | 5 +- 10 files changed, 671 insertions(+), 79 deletions(-) delete mode 100644 src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H create mode 100644 src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H create mode 100644 src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.C create mode 100644 src/usr/diag/prdf/plat/mem/prdfMemScrubUtils.H create mode 100644 src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.C create mode 100755 src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H b/src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H deleted file mode 100644 index 01f4f5519..000000000 --- a/src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.H +++ /dev/null @@ -1,61 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9McbistDomain.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 */ - -#ifndef __prdfP9McbistDomain_H -#define __prdfP9McbistDomain_H - -#include - -namespace PRDF -{ - -class McbistDomain : public RuleChipDomain -{ - public: - - /** - * @brief Constructor - * @param i_did The domain ID - * @param i_size The projected size of the domain - */ - McbistDomain( DOMAIN_ID i_did, uint32_t i_size = MCBIST_DOMAIN_SIZE ) : - RuleChipDomain( i_did, i_size ) - {} - - /** - * @brief Query for an attention of a specific type in this domain - * @param i_attnType [MACHINE_CHECK | RECOVERABLE | SPECIAL] - * @return false - * @note This function will always return false. That way PRD will look - * for the attention via the processor chip. - */ - virtual bool Query( ATTENTION_TYPE i_attnType ) - { return false; } - -}; - -} // end namespace PRDF - -#endif /* __prdfP9McbistDomain_H */ 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 +#include +#include +#include + +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 +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(chip); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "clearCmdCompleteAttn failed" ); + break; + } + + o_rc = clearEccCounters(chip); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "clearEccCounters failed" ); + break; + } + + o_rc = clearEccFirs(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(trgt, rank, 0); + + } while (0); + + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "chip:0x%08x", chip->GetId() ); + + int32_t l_rc = clearCmdCompleteAttn(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 +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace TARGETING; + +namespace PRDF +{ +using namespace PlatServices; + +template<> +int32_t clearCmdCompleteAttn(ExtensibleChip* i_mcbChip) +{ + #define PRDF_FUNC "[PRDF::clearCmdCompleteAttn] " + + 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(ExtensibleChip* i_mbaChip) +{ + #define PRDF_FUNC "[PRDF::clearCmdCompleteAttn] " + + 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(ExtensibleChip* i_mcbChip) +{ + #define PRDF_FUNC "[PRDF::clearEccCounters] " + 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(ExtensibleChip* i_mbaChip) +{ + #define PRDF_FUNC "[PRDF::clearEccCounters] " + 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(ExtensibleChip* i_mcbChip) +{ + #define PRDF_FUNC "[PRDF::clearEccFirs] " + + 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(ExtensibleChip* i_mbaChip) +{ + #define PRDF_FUNC "[PRDF::clearEccFirs] " + + 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 +#include +#include + +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 +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 +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 +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 + +// Framework includes +#include +#include +#include +#include + +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(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/plat/mem/prdfP9McbistDomain.H b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H new file mode 100755 index 000000000..702c97af9 --- /dev/null +++ b/src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.H @@ -0,0 +1,71 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/mem/prdfP9McbistDomain.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 */ + +#ifndef __prdfP9McbistDomain_H +#define __prdfP9McbistDomain_H + +#include + +namespace PRDF +{ + +class McbistDomain : public RuleChipDomain +{ + public: + + /** + * @brief Constructor + * @param i_did The domain ID + * @param i_size The projected size of the domain + */ + McbistDomain( DOMAIN_ID i_did, uint32_t i_size = MCBIST_DOMAIN_SIZE ) : + RuleChipDomain( i_did, i_size ) + {} + + /** + * @brief Query for an attention of a specific type in this domain + * @param i_attnType [MACHINE_CHECK | RECOVERABLE | SPECIAL] + * @return false + * @note This function will always return false. That way PRD will look + * for the attention via the processor chip. + */ + 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 + +#endif /* __prdfP9McbistDomain_H */ 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 #include #include - -// Pegasus includes -//#include TODO RTC 136126 +#include 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(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 #include //#include TODO RTC 136128 +#include +#include // Custom compile configs #include @@ -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 -- cgit v1.2.1