summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2018-05-07 20:51:59 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2018-05-15 21:58:16 -0400
commit09035bf134603f1b966708fe7ada97dff6eadd9b (patch)
tree9197825baab531965e46dc878f76b4234e53079f
parent3f14f5032bfee52840e5c58848f1e7bd4deb47ed (diff)
downloadtalos-hostboot-09035bf134603f1b966708fe7ada97dff6eadd9b.tar.gz
talos-hostboot-09035bf134603f1b966708fe7ada97dff6eadd9b.zip
PRD: refined cleanupChnlAttns() for Centaur
Change-Id: I4772ad5ba66efefa87bd442f0f40c7a9046bc80f RTC: 136123 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58466 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: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58725 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
-rw-r--r--src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C17
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/mem/prdfMemUtils.C45
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/mem/prdfMemUtils.H11
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C7
-rwxr-xr-xsrc/usr/diag/prdf/plat/pegasus/prdfPlatCenMemUtils.C91
-rw-r--r--src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C58
6 files changed, 59 insertions, 170 deletions
diff --git a/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C b/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C
index 2e0707f22..00c3bf656 100644
--- a/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C
+++ b/src/usr/diag/prdf/common/plat/cen/prdfCenMembuf_common.C
@@ -53,25 +53,18 @@ namespace cen_centaur
/**
* @brief Plugin function called after analysis is complete but before PRD
* exits.
- * @param i_mbChip A Centaur chip.
- * @param io_sc The step code data struct.
+ * @param i_chip A MEMBUF chip.
+ * @param io_sc The step code data struct.
* @note This is especially useful for any analysis that still needs to be
* done after the framework clears the FIR bits that were at attention.
* @return SUCCESS.
*/
-int32_t PostAnalysis( ExtensibleChip * i_mbChip, STEP_CODE_DATA_STRUCT & io_sc )
+int32_t PostAnalysis( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc )
{
#define PRDF_FUNC "[cen_centaur::PostAnalysis] "
- if ( CHECK_STOP != io_sc.service_data->getPrimaryAttnType() )
- {
- // Cleanup processor FIR bits on the other side of the channel.
- if ( SUCCESS != MemUtils::chnlFirCleanup(i_mbChip) )
- {
- PRDF_ERR( PRDF_FUNC "chnlFirCleanup(0x%08x) failed",
- i_mbChip->getHuid() );
- }
- }
+ // Cleanup processor FIR bits on the other side of the channel.
+ MemUtils::cleanupChnlAttns<TYPE_MEMBUF>( i_chip, io_sc );
return SUCCESS;
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C
index d0e158503..cc6d18143 100755
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C
@@ -28,15 +28,19 @@
*/
#include <prdfMemUtils.H>
+
+// Framework includes
+#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
-#include <prdfPlatServices.H>
-#include <prdfParserUtils.H>
-#include <prdfMemSymbol.H>
+
+// Platform includes
#include <prdfCenMbaDataBundle.H>
-#include <prdfPlatServices_common.H>
+#include <prdfMemSymbol.H>
+#include <prdfParserUtils.H>
+#include <prdfPlatServices.H>
-#if defined(__HOSTBOOT_RUNTIME) || !defined(__HOSTBOOT_MODULE)
-// #include <prdfCenMbaDynMemDealloc_rt.H>
+#if __HOSTBOOT_RUNTIME
+ #include <prdfMemDynDealloc.H>
#endif
using namespace TARGETING;
@@ -463,17 +467,26 @@ uint8_t getDramSize<TYPE_MBA>(ExtensibleChip *i_chip, uint8_t i_dimmSlct)
//------------------------------------------------------------------------------
-uint32_t chnlFirCleanup( ExtensibleChip * i_mbChip )
+template<>
+void cleanupChnlAttns<TYPE_MEMBUF>( ExtensibleChip * i_chip,
+ STEP_CODE_DATA_STRUCT & io_sc )
{
- #define PRDF_FUNC "[MemUtils::chnlFirCleanup] "
+ #define PRDF_FUNC "[MemUtils::cleanupChnlAttns] "
+
+ PRDF_ASSERT( nullptr != i_chip );
+ PRDF_ASSERT( TYPE_MEMBUF == i_chip->getType() );
- uint32_t o_rc = SUCCESS;
+ // No cleanup if this is a checkstop attention.
+ if ( CHECK_STOP == io_sc.service_data->getPrimaryAttnType() ) return;
- ExtensibleChip * dmiChip = getConnectedParent( i_mbChip, TYPE_DMI );
+ #ifdef __HOSTBOOT_MODULE // only do cleanup in Hostboot, no-op in FSP
+
+ ExtensibleChip * dmiChip = getConnectedParent( i_chip, TYPE_DMI );
// Clear the associated FIR bits for all attention types.
// NOTE: If there are any active attentions left in the Centaur the
- // associated FIR bit will be redriven with the next packet on the bus
+ // associated FIR bits in the CHIFIR will be redriven with the
+ // next packet on the bus.
SCAN_COMM_REGISTER_CLASS * reg = dmiChip->getRegister("CHIFIR_AND");
@@ -483,17 +496,11 @@ uint32_t chnlFirCleanup( ExtensibleChip * i_mbChip )
reg->ClearBit(20); // SPA
reg->ClearBit(21); // maintenance command complete
- o_rc = reg->Write();
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "CHIFIR_AND write failed on 0x%08x",
- dmiChip->getHuid() );
- }
+ reg->Write();
- return o_rc;
+ #endif // Hostboot only
#undef PRDF_FUNC
-
}
//------------------------------------------------------------------------------
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H
index 58100edc3..716a2c6f0 100755
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemUtils.H
@@ -139,12 +139,15 @@ int32_t getRawCardType( TARGETING::TargetHandle_t i_mba,
/**
* @brief When handling attentions on a memory buffer, there will be FIR bits
- * on the processor side of the bus that must be manually cleaned up in
+ * on the processor side of the bus that must be manually cleared in
* order to completely clear the attention.
- * @param i_mbChip MEMBUF chip.
- * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ * @note Intended to be called in the memory buffer PostAnalysis after the
+ * rule code has cleared the analyzed attention.
+ * @param i_chip MEMBUF chip.
+ * @param io_sc The step code data struct.
*/
-uint32_t chnlFirCleanup( ExtensibleChip * i_mbChip );
+template<TARGETING::TYPE T>
+void cleanupChnlAttns( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc );
} // end namespace MemUtils
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
index 70ede507b..f4cdba115 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
@@ -199,13 +199,6 @@ int32_t PostAnalysis( ExtensibleChip * i_mbChip, STEP_CODE_DATA_STRUCT & i_sc )
#define PRDF_FUNC "[Membuf::PostAnalysis] "
int32_t l_rc;
- // In hostboot, we need to clear associated bits in the MCIFIR bits.
- l_rc = MemUtils::mcifirCleanup( i_mbChip, i_sc );
- if( SUCCESS != l_rc )
- {
- PRDF_ERR( PRDF_FUNC "mcifirCleanup() failed");
- }
-
l_rc = MemUtils::chnlCsCleanup( i_mbChip, i_sc );
if( SUCCESS != l_rc )
{
diff --git a/src/usr/diag/prdf/plat/pegasus/prdfPlatCenMemUtils.C b/src/usr/diag/prdf/plat/pegasus/prdfPlatCenMemUtils.C
deleted file mode 100755
index 30ef1e07d..000000000
--- a/src/usr/diag/prdf/plat/pegasus/prdfPlatCenMemUtils.C
+++ /dev/null
@@ -1,91 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/diag/prdf/plat/pegasus/prdfPlatCenMemUtils.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
-/* [+] 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 prdfPlatCenMemUtils.C
- * @brief Hostboot Utility functions related to Centaur
- */
-
-#include <prdfCenMemUtils.H>
-#include <prdfExtensibleChip.H>
-#include <prdfCenMembufDataBundle.H>
-
-using namespace TARGETING;
-
-namespace PRDF
-{
-
-namespace MemUtils
-{
-
-//------------------------------------------------------------------------------
-
-int32_t mcifirCleanup( ExtensibleChip *i_mbChip,
- STEP_CODE_DATA_STRUCT & i_sc )
-{
- #define PRDF_FUNC "[MemUtils::mcifirCleanup] "
-
- int32_t l_rc = SUCCESS;
-
- // In hostboot, we need to clear associated bits in the MCIFIR bits.
- do
- {
- CenMembufDataBundle * mbdb = getMembufDataBundle(i_mbChip);
- ExtensibleChip * mcsChip = mbdb->getMcsChip();
- if ( NULL == mcsChip )
- {
- PRDF_ERR( PRDF_FUNC "CenMembufDataBundle::getMcsChip() failed" );
- l_rc = FAIL;
- break;
- }
-
- // Clear the associated MCIFIR bits for all attention types.
- // NOTE: If there are any active attentions left in the Centaur the
- // associated MCIFIR bit will be redriven with the next packet on
- // the bus.
- SCAN_COMM_REGISTER_CLASS * firand = mcsChip->getRegister("MCIFIR_AND");
-
- firand->setAllBits();
- firand->ClearBit(12); // CS
- firand->ClearBit(15); // RE
- firand->ClearBit(16); // SPA
- firand->ClearBit(17); // maintenance command complete
-
- l_rc = firand->Write();
- if ( SUCCESS != l_rc )
- {
- PRDF_ERR( PRDF_FUNC "MCIFIR_AND write failed" );
- break;
- }
-
- } while (0);
-
- return l_rc;
-
- #undef PRDF_FUNC
-}
-
-} // end namespace MemUtils
-
-} // end namespace PRDF
diff --git a/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C b/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C
index 05ac09839..6e0139169 100644
--- a/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C
+++ b/src/usr/diag/prdf/plat/pegasus/prdfPlatCenPll.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -47,14 +47,14 @@ namespace Membuf
/**
* @brief Optional plugin function called after analysis is complete but
* before PRD exits.
- * @param i_cenChip A Centaur MBA chip.
- * @param i_sc The step code data struct.
+ * @param i_chip A MEMBUF chip.
+ * @param io_sc The step code data struct.
* @note This is especially useful for any analysis that still needs to be
* done after the framework clears the FIR bits that were at attention.
* @return SUCCESS.
*/
-int32_t PllPostAnalysis( ExtensibleChip * i_cenChip,
- STEP_CODE_DATA_STRUCT & i_sc )
+int32_t PllPostAnalysis( ExtensibleChip * i_chip,
+ STEP_CODE_DATA_STRUCT & io_sc )
{
#define PRDF_FUNC "[Membuf::PllPostAnalysis] "
@@ -63,43 +63,27 @@ int32_t PllPostAnalysis( ExtensibleChip * i_cenChip,
do
{
- // need to clear associated bits in the MCIFIR bits.
- o_rc = MemUtils::mcifirCleanup( i_cenChip, i_sc );
- if( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "mcifirCleanup() failed");
- break;
- }
-
- // Check to make sure we are at threshold and have something garded.
- if ( !i_sc.service_data->IsAtThreshold() ||
- ( !i_sc.service_data->isGardRequested() ) )
- {
- break; // nothing to do
- }
+ // The PLL FIR bits have been cleared on the MEMBUF, but there are some
+ // bits on the processor side of the bus that need to be cleared in
+ // order to complete clear the attentions.
+ MemUtils::cleanupChnlAttns<TYPE_MEMBUF>( i_chip, io_sc );
#ifndef __HOSTBOOT_RUNTIME
- TargetHandle_t cenTrgt = i_cenChip->GetChipHandle();
- TargetHandleList list = getConnected( cenTrgt, TYPE_MBA );
- if ( 0 == list.size() )
- {
- PRDF_ERR( PRDF_FUNC "getConnected(0x%08x, TYPE_MBA) failed",
- getHuid(cenTrgt) );
- o_rc = FAIL; break;
- }
-
- // Send SKIP_MBA message for each MBA.
- for ( TargetHandleList::iterator mbaIt = list.begin();
- mbaIt != list.end(); ++mbaIt )
+ if ( isInMdiaMode() &&
+ io_sc.service_data->IsAtThreshold() &&
+ io_sc.service_data->isGardRequested() )
{
- int32_t l_rc = mdiaSendEventMsg( *mbaIt, MDIA::SKIP_MBA );
- if ( SUCCESS != l_rc )
+ // Tell MDIA to stop testing on all attached MBAs.
+ for ( auto & trgt : getConnected(i_chip->getTrgt(), TYPE_MBA) )
{
- PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(0x%08x, SKIP_MBA) failed",
- getHuid(*mbaIt) );
- o_rc |= FAIL;
- continue; // keep going
+ if ( SUCCESS != mdiaSendEventMsg(trgt, MDIA::STOP_TESTING) )
+ {
+ PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(0x%08x,STOP_TESTING) "
+ "failed", getHuid(trgt) );
+ o_rc |= FAIL;
+ continue; // keep going
+ }
}
}
OpenPOWER on IntegriCloud