summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2014-11-10 17:12:56 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-01 15:43:28 -0600
commit21fcb80bae184cc5a219fbcdec1c2b3ce4c6be3f (patch)
tree9d5ea960cc28614e57b646b823a1d823d4d15161 /src/usr/diag/prdf
parentae5a0adb5f8350e95d274947233f57e79cc0385c (diff)
downloadtalos-hostboot-21fcb80bae184cc5a219fbcdec1c2b3ce4c6be3f.tar.gz
talos-hostboot-21fcb80bae184cc5a219fbcdec1c2b3ce4c6be3f.zip
PRD: split Hostboot IPL code in prdfMain
Change-Id: Ia18bb1d7d332cfad13a3cab143b7f92d4fc22173 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14474 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14574
Diffstat (limited to 'src/usr/diag/prdf')
-rwxr-xr-xsrc/usr/diag/prdf/makefile4
-rwxr-xr-xsrc/usr/diag/prdf/prdfMain.C156
-rw-r--r--src/usr/diag/prdf/prdfMain_ipl.C189
-rw-r--r--src/usr/diag/prdf/prdf_hb_only.mk (renamed from src/usr/diag/prdf/prdf_common_hb_only.mk)27
4 files changed, 215 insertions, 161 deletions
diff --git a/src/usr/diag/prdf/makefile b/src/usr/diag/prdf/makefile
index 41c91e1b0..d1eea5634 100755
--- a/src/usr/diag/prdf/makefile
+++ b/src/usr/diag/prdf/makefile
@@ -32,9 +32,9 @@ SUBDIRS += test.d
################################################################################
# ROOTPATH must be defined before including this file.
-include prdf_common_hb_only.mk # Will define PRD_SRC_PATH
+include prdf_hb_only.mk # Will define PRD_SRC_PATH and PRD_INC_PATH
-# PRD_SRC_PATH must be defined before including this file.
+# PRD_SRC_PATH and PRD_INC_PATH must be defined before including this file.
include common/prdf_common_fsp_and_hb.mk
VPATH += ${prd_vpath}
diff --git a/src/usr/diag/prdf/prdfMain.C b/src/usr/diag/prdf/prdfMain.C
index 96d81e793..fd2a31987 100755
--- a/src/usr/diag/prdf/prdfMain.C
+++ b/src/usr/diag/prdf/prdfMain.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2002,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* [+] 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. */
@@ -23,21 +25,14 @@
/**
* @file prdfMain.C
- * @brief PRD code used by external components.
+ * @brief PRD code used by external components (IPL and runtime).
*
* This file contains code that is strictly specific to Hostboot. All code that
* is common between FSP and Hostboot should be in the respective common file.
*/
#include <prdfMain.H>
-#include <prdfCenMbaDataBundle.H>
-#include <prdfExtensibleChip.H>
-#include <prdfErrlUtil.H>
-#include <prdfPlatServices.H>
-#include <prdfMbaDomain.H>
-
-using namespace TARGETING;
-using namespace HWAS;
+#include <prdfGlobal.H>
//------------------------------------------------------------------------------
// Global variable
@@ -52,14 +47,6 @@ prdfMutex g_prdMutex;
namespace PRDF
{
-using namespace PlatServices;
-
-//------------------------------------------------------------------------------
-// Forward references
-//------------------------------------------------------------------------------
-
-extern errlHndl_t noLock_refresh();
-
//------------------------------------------------------------------------------
// Platform specific helper function for PRDF::initialize()
//------------------------------------------------------------------------------
@@ -69,137 +56,4 @@ void initPlatSpecific()
// Currently no-op in Hostboot.
}
-//------------------------------------------------------------------------------
-// External functions - declared in prdfMain.H
-//------------------------------------------------------------------------------
-
-int32_t analyzeIplCEStats( TargetHandle_t i_mba, bool &o_calloutMade )
-{
- #define PRDF_FUNC "PRDF::analyzeIplCEStats"
-
- PRDF_ENTER( PRDF_FUNC"(0x%08x)", getHuid(i_mba) );
-
- // will unlock when going out of scope
- PRDF_SYSTEM_SCOPELOCK;
-
- int32_t o_rc = SUCCESS;
- o_calloutMade = false;
-
- ExtensibleChip * mbaChip = (ExtensibleChip *)systemPtr->GetChip( i_mba );
- CenMbaDataBundle * mbadb = getMbaDataBundle( mbaChip );
-
- o_rc = mbadb->getIplCeStats()->analyzeStats( o_calloutMade );
-
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( "["PRDF_FUNC"] analyzeStats() failed");
-
- // Get user data
- uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( getHuid(i_mba), 0 );
- uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( PRDFSIG_MnfgIplFail, 0 );
-
- // Create error log
- errlHndl_t errl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_PREDICTIVE, // severity
- PRDF_MNFG_IPL_CE_ANALYSIS, // module ID
- PRDF_DETECTED_FAIL_SOFTWARE, // reason code
- ud12, ud34 ); // user data 1-4
-
- // Add 2nd level support
- errl->addProcedureCallout( EPUB_PRC_LVL_SUPP, SRCI_PRIORITY_HIGH );
-
- // Add traces
- errl->collectTrace( PRDF_COMP_NAME, 512 );
-
- // Commit the error log
- ERRORLOG::errlCommit( errl, PRDF_COMP_ID );
- }
-
- PRDF_EXIT( PRDF_FUNC"(0x%08x), o_calloutMade:%u",
- getHuid(i_mba), o_calloutMade );
-
- return o_rc;
-
- #undef PRDF_FUNC
-}
-
-//------------------------------------------------------------------------------
-
-errlHndl_t startScrub()
-{
- #define PRDF_FUNC "[PRDF::startScrub] "
- PRDF_ENTER( PRDF_FUNC );
-
- errlHndl_t o_errl = NULL;
-
- int32_t l_rc = SUCCESS;
- HUID nodeId = INVALID_HUID;
-
- // will unlock when going out of scope
- PRDF_SYSTEM_SCOPELOCK;
-
- do
- {
- // Since the last refresh is in istep10 host_prd_hwreconfig,
- // it may be good to call it again here at istep16 mss_scrub
- // 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)
- {
- PRDF_ERR( PRDF_FUNC"noLock_refresh() failed" );
- break;
- }
-
- // This is run in Hostboot so there should only be one node.
- TargetHandleList list = getFunctionalTargetList( TYPE_NODE );
- if ( 1 != list.size() )
- {
- PRDF_ERR( PRDF_FUNC"getFunctionalTargetList(TYPE_NODE) failed" );
- l_rc = FAIL; break;
- }
- nodeId = getHuid(list[0]);
-
- PRDF_ENTER( PRDF_FUNC"HUID=0x%08x", nodeId );
-
- // Start scrubbing on all MBAs.
- MbaDomain * domain = (MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
- if ( NULL == domain )
- {
- PRDF_ERR( PRDF_FUNC"MBA_DOMAIN not found. nodeId=0x%08x", nodeId );
- l_rc = FAIL; break;
- }
- l_rc = domain->startScrub();
-
- PRDF_EXIT( PRDF_FUNC"HUID=0x%08x", nodeId );
-
- } while (0);
-
- if (( SUCCESS != l_rc ) && (NULL == o_errl))
- {
- // Get user data
- uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( nodeId, __LINE__ );
- uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( 0, 0 );
-
- // Create error log
- o_errl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_UNRECOVERABLE, // severity
- PRDF_START_SCRUB, // module ID
- PRDF_DETECTED_FAIL_SOFTWARE, // reason code
- ud12, ud34 ); // user data 1-4
-
- // Add 2nd level support
- o_errl->addProcedureCallout( EPUB_PRC_LVL_SUPP, SRCI_PRIORITY_HIGH );
-
- // Add traces
- o_errl->collectTrace( PRDF_COMP_NAME, 512 );
- }
-
- PRDF_EXIT( PRDF_FUNC );
-
- return o_errl;
-
- #undef PRDF_FUNC
-}
-
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/prdfMain_ipl.C b/src/usr/diag/prdf/prdfMain_ipl.C
new file mode 100644
index 000000000..599bef145
--- /dev/null
+++ b/src/usr/diag/prdf/prdfMain_ipl.C
@@ -0,0 +1,189 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/prdfMain_ipl.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] 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 prdfMain_ipl.C
+ * @brief PRD code used by external components (IPL only).
+ *
+ * This file contains code that is strictly specific to Hostboot. All code that
+ * is common between FSP and Hostboot should be in the respective common file.
+ */
+
+#include <prdfMain.H>
+
+#include <prdfCenMbaDataBundle.H>
+#include <prdfExtensibleChip.H>
+#include <prdfErrlUtil.H>
+#include <prdfPlatServices.H>
+#include <prdfMbaDomain.H>
+
+using namespace TARGETING;
+using namespace HWAS;
+
+namespace PRDF
+{
+
+using namespace PlatServices;
+
+//------------------------------------------------------------------------------
+// Forward references
+//------------------------------------------------------------------------------
+
+extern errlHndl_t noLock_refresh();
+
+//------------------------------------------------------------------------------
+// External functions - declared in prdfMain.H
+//------------------------------------------------------------------------------
+
+int32_t analyzeIplCEStats( TargetHandle_t i_mba, bool &o_calloutMade )
+{
+ #define PRDF_FUNC "PRDF::analyzeIplCEStats"
+
+ PRDF_ENTER( PRDF_FUNC"(0x%08x)", getHuid(i_mba) );
+
+ // will unlock when going out of scope
+ PRDF_SYSTEM_SCOPELOCK;
+
+ int32_t o_rc = SUCCESS;
+ o_calloutMade = false;
+
+ ExtensibleChip * mbaChip = (ExtensibleChip *)systemPtr->GetChip( i_mba );
+ CenMbaDataBundle * mbadb = getMbaDataBundle( mbaChip );
+
+ o_rc = mbadb->getIplCeStats()->analyzeStats( o_calloutMade );
+
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( "["PRDF_FUNC"] analyzeStats() failed");
+
+ // Get user data
+ uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( getHuid(i_mba), 0 );
+ uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( PRDFSIG_MnfgIplFail, 0 );
+
+ // Create error log
+ errlHndl_t errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_PREDICTIVE, // severity
+ PRDF_MNFG_IPL_CE_ANALYSIS, // module ID
+ PRDF_DETECTED_FAIL_SOFTWARE, // reason code
+ ud12, ud34 ); // user data 1-4
+
+ // Add 2nd level support
+ errl->addProcedureCallout( EPUB_PRC_LVL_SUPP, SRCI_PRIORITY_HIGH );
+
+ // Add traces
+ errl->collectTrace( PRDF_COMP_NAME, 512 );
+
+ // Commit the error log
+ ERRORLOG::errlCommit( errl, PRDF_COMP_ID );
+ }
+
+ PRDF_EXIT( PRDF_FUNC"(0x%08x), o_calloutMade:%u",
+ getHuid(i_mba), o_calloutMade );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+errlHndl_t startScrub()
+{
+ #define PRDF_FUNC "[PRDF::startScrub] "
+ PRDF_ENTER( PRDF_FUNC );
+
+ errlHndl_t o_errl = NULL;
+
+ int32_t l_rc = SUCCESS;
+ HUID nodeId = INVALID_HUID;
+
+ // will unlock when going out of scope
+ PRDF_SYSTEM_SCOPELOCK;
+
+ do
+ {
+ // Since the last refresh is in istep10 host_prd_hwreconfig,
+ // it may be good to call it again here at istep16 mss_scrub
+ // 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)
+ {
+ PRDF_ERR( PRDF_FUNC"noLock_refresh() failed" );
+ break;
+ }
+
+ // This is run in Hostboot so there should only be one node.
+ TargetHandleList list = getFunctionalTargetList( TYPE_NODE );
+ if ( 1 != list.size() )
+ {
+ PRDF_ERR( PRDF_FUNC"getFunctionalTargetList(TYPE_NODE) failed" );
+ l_rc = FAIL; break;
+ }
+ nodeId = getHuid(list[0]);
+
+ PRDF_ENTER( PRDF_FUNC"HUID=0x%08x", nodeId );
+
+ // Start scrubbing on all MBAs.
+ MbaDomain * domain = (MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
+ if ( NULL == domain )
+ {
+ PRDF_ERR( PRDF_FUNC"MBA_DOMAIN not found. nodeId=0x%08x", nodeId );
+ l_rc = FAIL; break;
+ }
+ l_rc = domain->startScrub();
+
+ PRDF_EXIT( PRDF_FUNC"HUID=0x%08x", nodeId );
+
+ } while (0);
+
+ if (( SUCCESS != l_rc ) && (NULL == o_errl))
+ {
+ // Get user data
+ uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( nodeId, __LINE__ );
+ uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( 0, 0 );
+
+ // Create error log
+ o_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE, // severity
+ PRDF_START_SCRUB, // module ID
+ PRDF_DETECTED_FAIL_SOFTWARE, // reason code
+ ud12, ud34 ); // user data 1-4
+
+ // Add 2nd level support
+ o_errl->addProcedureCallout( EPUB_PRC_LVL_SUPP, SRCI_PRIORITY_HIGH );
+
+ // Add traces
+ o_errl->collectTrace( PRDF_COMP_NAME, 512 );
+ }
+
+ PRDF_EXIT( PRDF_FUNC );
+
+ return o_errl;
+
+ #undef PRDF_FUNC
+}
+
+} // end namespace PRDF
diff --git a/src/usr/diag/prdf/prdf_common_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk
index 3f9630703..328611822 100644
--- a/src/usr/diag/prdf/prdf_common_hb_only.mk
+++ b/src/usr/diag/prdf/prdf_hb_only.mk
@@ -1,11 +1,11 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/usr/diag/prdf/prdf_common_hb_only.mk $
+# $Source: src/usr/diag/prdf/prdf_hb_only.mk $
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2014
+# Contributors Listed Below - COPYRIGHT 2013,2014
# [+] International Business Machines Corp.
#
#
@@ -23,8 +23,8 @@
#
# IBM_PROLOG_END_TAG
-# NOTE: ROOTPATH must be defined before including this file and PRD_SRC_PATH
-# must be defined in this file.
+# NOTE: ROOTPATH must be defined before including this file and both
+# PRD_SRC_PATH and PRD_INC_PATH must be defined in this file.
PRD_SRC_PATH = ${ROOTPATH}/src/usr/diag/prdf
PRD_INC_PATH = ${ROOTPATH}/src/include/usr/diag/prdf
@@ -100,6 +100,17 @@ prd_rule_plugin += prdfPlatP8Ex.o
prd_rule_plugin += prdfPlatP8Proc.o
################################################################################
+# Hostboot only object files (IPL only)
+################################################################################
+
+ifneq (${HOSTBOOT_RUNTIME},1)
+
+# ./
+prd_obj += prdfMain_ipl.o
+
+endif
+
+################################################################################
# Conditional compile flag to enable profiling of flyweight register and
# resolution object
################################################################################
@@ -112,11 +123,11 @@ endif
# Rule for generated MNFG threshold header file
################################################################################
-MFG_THRES = prdfMfgThresholds
-MFG_THRES_H = ${MFG_THRES}.H
+MFG_THRES = prdfMfgThresholds
+MFG_THRES_H = ${MFG_THRES}.H
MFG_THRES_PL = ${PRD_SRC_PATH}/common/mnfgtools/${MFG_THRES}.pl
-MFG_THRES_LIST = ${PRD_SRC_PATH}/common/mnfgtools/${MFG_THRES}.lst
-MFG_THRES_PATH = ${ROOTPATH}/obj/genfiles/${MFG_THRES_H}
+MFG_THRES_LIST = ${PRD_SRC_PATH}/common/mnfgtools/${MFG_THRES}.lst
+MFG_THRES_PATH = ${ROOTPATH}/obj/genfiles/${MFG_THRES_H}
GENFILES += ${MFG_THRES_H}
OpenPOWER on IntegriCloud