summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/diag/prdf/common/plat/p9/p9_mcbist.rule10
-rwxr-xr-xsrc/usr/diag/prdf/makefile1
-rw-r--r--src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C132
-rw-r--r--src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H101
-rw-r--r--src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk58
-rw-r--r--src/usr/diag/prdf/plat/prdfPlatServices_ipl.C57
-rw-r--r--src/usr/diag/prdf/plat/prdfPlatServices_ipl.H6
7 files changed, 325 insertions, 40 deletions
diff --git a/src/usr/diag/prdf/common/plat/p9/p9_mcbist.rule b/src/usr/diag/prdf/common/plat/p9/p9_mcbist.rule
index 3c0c04a1a..ed7d8da1b 100644
--- a/src/usr/diag/prdf/common/plat/p9/p9_mcbist.rule
+++ b/src/usr/diag/prdf/common/plat/p9/p9_mcbist.rule
@@ -186,9 +186,9 @@ group gMCBISTFIR filter singlebit
(rMCBISTFIR, bit(9)) ? TBDDefaultCallout;
/** MCBISTFIR[10]
- *
+ * MCBIST Command Complete
*/
- (rMCBISTFIR, bit(10)) ? TBDDefaultCallout;
+ (rMCBISTFIR, bit(10)) ? analyzeMcbistCmdComplete;
/** MCBISTFIR[11]
*
@@ -471,3 +471,9 @@ group gMCBISTFIR filter singlebit
# Include the common action set.
.include "p9_common_actions.rule";
+/** Analyze MCBIST Command Complete attention */
+actionclass analyzeMcbistCmdComplete
+{
+ funccall("McbistCmdComplete");
+};
+
diff --git a/src/usr/diag/prdf/makefile b/src/usr/diag/prdf/makefile
index 149991f3b..52545693c 100755
--- a/src/usr/diag/prdf/makefile
+++ b/src/usr/diag/prdf/makefile
@@ -40,6 +40,7 @@ include common/prdf_common_fsp_and_hb.mk
include common/framework/prdf_framework.mk
include common/plat/p9/prdf_plat_p9.mk
include common/plat/cen/prdf_plat_cen.mk
+include plat/p9/prdf_plat_p9_hb_only.mk
VPATH += ${prd_vpath}
diff --git a/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C b/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C
new file mode 100644
index 000000000..111497e3a
--- /dev/null
+++ b/src/usr/diag/prdf/plat/p9/prdfP9Mcbist.C
@@ -0,0 +1,132 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/p9/prdfP9Mcbist.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 prdfP9Mcbist.C
+ * @brief Contains plugin code for MCBIST on Hostboot (IPL and runtime).
+ */
+
+// Framework includes
+#include <iipServiceDataCollector.h>
+#include <prdfExtensibleChip.H>
+#include <prdfPluginDef.H>
+#include <prdfPluginMap.H>
+
+// Platform includes
+#include <prdfPlatServices.H>
+#include <prdfP9McbistDataBundle.H>
+
+namespace PRDF
+{
+
+using namespace PlatServices;
+
+namespace p9_mcbist
+{
+
+//##############################################################################
+//
+// Special plugins
+//
+//##############################################################################
+
+#ifndef __HOSTBOOT_RUNTIME
+
+/**
+ * @brief Plugin function called after analysis is complete but before PRD
+ * exits.
+ * @param i_mcbChip An MCBIST chip.
+ * @param i_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_mcbChip,
+ STEP_CODE_DATA_STRUCT & i_sc )
+{
+ #define PRDF_FUNC "[p9_mcbist::PostAnalysis] "
+
+ // Send command complete to MDIA.
+ // This must be done in post analysis after attentions have been cleared.
+
+ McbistDataBundle * mcbdb = getMcbistDataBundle( i_mcbChip );
+
+ if ( mcbdb->iv_sendCmdCompleteMsg )
+ {
+ mcbdb->iv_sendCmdCompleteMsg = false;
+
+ int32_t rc = mdiaSendEventMsg( i_mcbChip->GetChipHandle(),
+ MDIA::COMMAND_COMPLETE );
+ if ( SUCCESS != rc )
+ {
+ PRDF_ERR( PRDF_FUNC "mdiaSendEventMsg(COMMAND_COMPLETE) failed" );
+ }
+ }
+
+ return SUCCESS; // Intentionally return SUCCESS for this plugin
+
+ #undef PRDF_FUNC
+}
+PRDF_PLUGIN_DEFINE( p9_mcbist, PostAnalysis );
+
+#endif // not __HOSTBOOT_RUNTIME
+
+//##############################################################################
+//
+// MCBISTFIR
+//
+//##############################################################################
+
+/**
+ * @brief MCBIST[10] - MCBIST Command Complete.
+ * @param i_mcbChip An MCBIST chip.
+ * @param i_sc The step code data struct.
+ * @return SUCCESS
+ */
+int32_t McbistCmdComplete( ExtensibleChip * i_mcbChip,
+ STEP_CODE_DATA_STRUCT & i_sc )
+{
+ #define PRDF_FUNC "[p9_mcbist::McbistCmdComplete] "
+
+ // TODO: RTC 152592 - This code is only temporary so that we can get MDIA
+ // working in SIMICs. Eventually, we will add a call to the TD
+ // controller which will handle errors, restart commands, communicate
+ // with MDIA, etc.
+ #ifndef __HOSTBOOT_RUNTIME
+
+ McbistDataBundle * mcbdb = getMcbistDataBundle( i_mcbChip );
+ mcbdb->iv_sendCmdCompleteMsg = true;
+
+ #endif
+
+ return SUCCESS;
+
+ #undef PRDF_FUNC
+}
+PRDF_PLUGIN_DEFINE( p9_mcbist, McbistCmdComplete );
+
+} // end namespace p9_mcbist
+
+} // end namespace PRDF
+
diff --git a/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H b/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H
new file mode 100644
index 000000000..f4d12d471
--- /dev/null
+++ b/src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.H
@@ -0,0 +1,101 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/p9/prdfP9McbistDataBundle.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 __prdfP9McbistDataBundle_H
+#define __prdfP9McbistDataBundle_H
+
+/** @file prdfP9McbistDataBundle.H
+ * @brief Contains the data bundle for a P9 MCBIST object.
+ */
+
+// Framework includes
+#include <prdfExtensibleChip.H>
+
+// Platform includes
+#include <prdfPlatServices.H>
+
+namespace PRDF
+{
+
+/** @brief P9 MCBIST data bundle. */
+class McbistDataBundle : public DataBundle
+{
+ public: // functions
+
+ #ifdef __HOSTBOOT_RUNTIME
+
+ /**
+ * @brief Constructor.
+ * @param i_mcbChip The MCBIST chip.
+ */
+ explicit McbistDataBundle( ExtensibleChip * i_mcbChip ) = default;
+
+ #else
+
+ /**
+ * @brief Constructor.
+ * @param i_mcbChip The MCBIST chip.
+ */
+ explicit McbistDataBundle( ExtensibleChip * i_mcbChip ) :
+ iv_sendCmdCompleteMsg(false)
+ {}
+
+ #endif
+
+ /** @brief Destructor. */
+ ~McbistDataBundle() = default;
+
+ // Don't allow copy or assignment.
+ McbistDataBundle( const McbistDataBundle & ) = delete;
+ const McbistDataBundle & operator=( const McbistDataBundle & ) = delete;
+
+ public: // instance variables
+
+ #ifndef __HOSTBOOT_RUNTIME
+
+ /** TRUE if a message needs to be sent to MDIA in the post analysis plugin,
+ * FALSE otherwise. */
+ bool iv_sendCmdCompleteMsg;
+
+ #endif
+
+ private: // instance variables
+
+};
+
+/**
+ * @brief Wrapper function for the McbistDataBundle.
+ * @param i_mcbChip The MCBIST chip.
+ * @return This MBA's data bundle.
+ */
+inline McbistDataBundle * getMcbistDataBundle( ExtensibleChip * i_mcbChip )
+{
+ return static_cast<McbistDataBundle *>(i_mcbChip->getDataBundle());
+}
+
+} // end namespace PRDF
+
+#endif // __prdfP9McbistDataBundle_H
+
diff --git a/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk b/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk
new file mode 100644
index 000000000..256615fb4
--- /dev/null
+++ b/src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk
@@ -0,0 +1,58 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/diag/prdf/plat/p9/prdf_plat_p9_hb_only.mk $
+#
+# 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
+
+# NOTE: PRD_SRC_PATH and PRD_INC_PATH must be defined before including this file
+
+################################################################################
+# Paths common to both IPL and runtime
+################################################################################
+
+prd_vpath += ${PRD_SRC_PATH}/plat/p9
+
+prd_incpath += ${PRD_SRC_PATH}/plat/p9
+
+################################################################################
+# Hostboot only object files common to both IPL and runtime
+################################################################################
+
+# plat/p9/ (rule plugin related)
+prd_rule_plugin += prdfP9Mcbist.o
+
+################################################################################
+# Hostboot only object files (IPL only)
+################################################################################
+
+ifneq (${HOSTBOOT_RUNTIME},1)
+
+endif
+
+################################################################################
+# Hostboot only object files (runtime only)
+################################################################################
+
+ifeq (${HOSTBOOT_RUNTIME},1)
+
+endif
+
diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
index 9de6c2300..dc6bf30ba 100644
--- a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
+++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C
@@ -65,49 +65,36 @@ bool isInMdiaMode()
//------------------------------------------------------------------------------
-int32_t mdiaSendEventMsg( TargetHandle_t i_mbaTarget,
+int32_t mdiaSendEventMsg( TargetHandle_t i_trgt,
MDIA::MaintCommandEventType i_eventType )
{
- #define PRDF_FUNC "[PlatServices::mdiaSendCmdComplete] "
+ #define PRDF_FUNC "[PlatServices::mdiaSendEventMsg] "
int32_t o_rc = SUCCESS;
#ifndef CONFIG_VPO_COMPILE
- do
- {
- if ( !isInMdiaMode() ) break; // no-op
-
- // Verify type.
- TYPE l_type = getTargetType(i_mbaTarget);
- if ( TYPE_MBA != l_type )
- {
- PRDF_ERR( PRDF_FUNC "unsupported target type %d", l_type );
- o_rc = FAIL;
- break;
- }
-
- // Send command complete to MDIA.
- MDIA::MaintCommandEvent l_mdiaEvent;
-
- l_mdiaEvent.target = i_mbaTarget;
- l_mdiaEvent.type = i_eventType;
-
- errlHndl_t errl = MDIA::processEvent( l_mdiaEvent );
- if ( NULL != errl )
- {
- PRDF_ERR( PRDF_FUNC "MDIA::processEvent() failed" );
- PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
- o_rc = FAIL;
- break;
- }
-
- } while (0);
-
- if ( SUCCESS != o_rc )
+ PRDF_ASSERT( nullptr != i_trgt );
+
+ // Only MCBIST and MBA supported.
+ TYPE trgtType = getTargetType( i_trgt );
+ PRDF_ASSERT( TYPE_MCBIST == trgtType || TYPE_MBA == trgtType );
+
+ // MDIA must be running.
+ PRDF_ASSERT( isInMdiaMode() );
+
+ // Send command complete to MDIA.
+ MDIA::MaintCommandEvent mdiaEvent;
+ mdiaEvent.target = i_trgt;
+ mdiaEvent.type = i_eventType;
+
+ errlHndl_t errl = MDIA::processEvent( mdiaEvent );
+ if ( NULL != errl )
{
- PRDF_ERR( PRDF_FUNC "Failed: i_target=0x%08x i_eventType=%d",
- getHuid(i_mbaTarget), i_eventType );
+ PRDF_ERR( PRDF_FUNC "MDIA::processEvent() failed: i_target=0x%08x "
+ "i_eventType=%d", getHuid(i_trgt), i_eventType );
+ PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
+ o_rc = FAIL;
}
#endif
diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
index 177e38c15..6dcdc2e98 100644
--- a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
+++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.H
@@ -55,12 +55,12 @@ namespace PlatServices
bool isInMdiaMode();
/**
- * @brief Sends a maintenance command message to MDIA.
- * @param i_mbaTarget An MBA target.
+ * @brief Sends a MCBIST/maintenance event message to MDIA.
+ * @param i_trgt An MCBIST or MBA target.
* @param i_eventType MDIA event type
* @return Non-SUCCESS in internal function fails, SUCCESS otherwise.
*/
-int32_t mdiaSendEventMsg( TARGETING::TargetHandle_t i_mbaTarget,
+int32_t mdiaSendEventMsg( TARGETING::TargetHandle_t i_trgt,
MDIA::MaintCommandEventType i_eventType );
/**
OpenPOWER on IntegriCloud