summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-04-25 16:53:55 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-05-08 11:34:22 -0500
commit3541d56fbffa428a51ae0eb7bc963e45ce48d836 (patch)
tree6371aeea73b89987bf9ff2aceb9e2a57fd64160f /src/usr
parent750329e0758039e2692b3c26c28a4debb8feea1c (diff)
downloadtalos-hostboot-3541d56fbffa428a51ae0eb7bc963e45ce48d836.tar.gz
talos-hostboot-3541d56fbffa428a51ae0eb7bc963e45ce48d836.zip
add platform specific callout functions for FSP integration.
Make the HWAS function processCallout() be common instead of hostboot specific, and create new platform specific functions for the processing of procedure and hardware callouts. Intention is that hostboot and fsp will use these to read the hwas hostboot-created callout_ud_t structure out of an errlog. Change-Id: Ie5679b0a833f802744bfd8f5285901b73f022d52 RTC: 49965 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4275 Tested-by: Jenkins Server Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/errl/errlentry.C11
-rw-r--r--src/usr/hwas/common/hwasCallout.C132
-rw-r--r--src/usr/hwas/hwasPlatCallout.C119
-rw-r--r--src/usr/hwas/makefile4
4 files changed, 163 insertions, 103 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index f7ecefc4e..ec2fa96c5 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -337,9 +337,16 @@ uint32_t ErrlEntry::callout()
(ERRL_UDT_CALLOUT == (*it)->iv_header.iv_sst))
{
// call HWAS to have this processed
- if ((*pFn)(plid(),(*it)->iv_pData, (*it)->iv_Size))
+ (*pFn)(this,(*it)->iv_pData, (*it)->iv_Size);
+
+ // check to see if the master processor got deconfigured
+ TARGETING::Target *l_masterProc;
+ TARGETING::targetService().masterProcChipTargetHandle(
+ l_masterProc);
+ if (!l_masterProc->getAttr<TARGETING::ATTR_HWAS_STATE>().
+ functional)
{
- // if it returned true, we need to return the plid
+ // if it got deconfigured, we need to return the plid
// to indicate that we need to shutdown
l_rc = plid();
}
diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C
index 3eb884270..a536b62c4 100644
--- a/src/usr/hwas/common/hwasCallout.C
+++ b/src/usr/hwas/common/hwasCallout.C
@@ -33,6 +33,7 @@
/******************************************************************************/
#include <stdint.h>
+#include <hwas/common/hwasError.H>
#include <hwas/common/hwasCommon.H>
#include <hwas/common/deconfigGard.H>
#include <hwas/common/hwasCallout.H>
@@ -42,16 +43,17 @@
namespace HWAS
{
-bool processCallout(const uint32_t i_errlPlid,
+using namespace HWAS::COMMON;
+
+void processCallout(errlHndl_t i_errl,
uint8_t *i_pData,
uint64_t i_Size)
{
- HWAS_INF("processCallout entry. plid 0x%x data %p size %lld",
- i_errlPlid, i_pData, i_Size);
+ HWAS_INF("processCallout entry. data %p size %lld",
+ i_pData, i_Size);
- bool l_rc = false; // default is no shutdown required
callout_ud_t *pCalloutUD = (callout_ud_t *)i_pData;
- errlHndl_t errl = NULL;
+
switch (pCalloutUD->type)
{
case (HW_CALLOUT):
@@ -71,18 +73,20 @@ bool processCallout(const uint32_t i_errlPlid,
if (unlikely(pTarget == NULL))
{ // only happen if we have a corrupt errlog or targeting.
HWAS_ERR("HW callout; pTarget was NULL!!!");
-
+
/*@
* @errortype
* @moduleid HWAS::MOD_PROCESS_CALLOUT
* @reasoncode HWAS::RC_INVALID_TARGET
* @devdesc Invalid Target encountered in
- * processCallout
+ * processing of HW callout
+ * @userdata1 callout errlog PLID
*/
- errl = hwasError(
- ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ errlHndl_t errl = hwasError(
+ ERRL_SEV_INFORMATIONAL,
HWAS::MOD_PROCESS_CALLOUT,
- HWAS::RC_INVALID_TARGET);
+ HWAS::RC_INVALID_TARGET,
+ i_errl->plid());
errlCommit(errl, HWAS_COMP_ID);
break;
}
@@ -92,100 +96,31 @@ bool processCallout(const uint32_t i_errlPlid,
TARGETING::targetService().masterProcChipTargetHandle(pTarget);
}
- const DeconfigEnum deconfigState = pCalloutUD->deconfigState;
- const GARD_ErrorType gardErrorType = pCalloutUD->gardErrorType;
- //const callOutPriority priority = pCalloutUD->priority;
-
- HWAS_INF("HW callout; pTarget %p gardErrorType %x deconfigState %x",
- pTarget, gardErrorType, deconfigState);
- switch (gardErrorType)
- {
- case (GARD_NULL):
- { // means no GARD operations
- break;
- }
- default:
- {
- // move these to platform specific functions?
- // RTC: 45781
- // hostboot:
- // call HWAS common function
- errl = HWAS::theDeconfigGard().createGardRecord(*pTarget,
- i_errlPlid,
- GARD_Fatal);
- errlCommit(errl, HWAS_COMP_ID);
- // fsp:
- // RTC: 45781
- // nothing? gard record is already in PNOR
- break;
- }
- } // switch gardErrorType
-
- switch (deconfigState)
+ errlHndl_t errl = platHandleHWCallout(
+ pTarget,
+ pCalloutUD->priority,
+ pCalloutUD->deconfigState,
+ i_errl,
+ pCalloutUD->gardErrorType);
+ if (errl)
{
- case (NO_DECONFIG):
- {
- break;
- }
- case (DECONFIG):
- {
- // check to see if this target is the master processor
- TARGETING::Target *l_masterProc;
- TARGETING::targetService().masterProcChipTargetHandle(
- l_masterProc);
- if (pTarget == l_masterProc)
- {
- // if so, we can't run anymore, so we will
- // return TRUE so the caller calls doShutdown
- HWAS_ERR("callout - DECONFIG on MasterProc");
- l_rc = true;
- break;
- }
-
- // else, call HWAS common function
- errl = HWAS::theDeconfigGard().deconfigureTarget(*pTarget,
- i_errlPlid);
- errlCommit(errl, HWAS_COMP_ID);
- break;
- }
- case (DELAYED_DECONFIG):
- {
- // check to see if this target is the master processor
- TARGETING::Target *l_masterProc;
- TARGETING::targetService().masterProcChipTargetHandle(
- l_masterProc);
- if (pTarget == l_masterProc)
- {
- // if so, we can't run anymore, so we will
- // return TRUE so the caller calls doShutdown
- l_rc = true;
- HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc");
- break;
- }
- // else
- // do nothing -- the deconfig information was already
- // put on a queue and will be processed separately,
- // when the time is right.
- break;
- }
- } // switch deconfigState
+ HWAS_ERR("HW callout: error from platHandlHWCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
break;
- }
+ } // HW_CALLOUT
case (PROCEDURE_CALLOUT):
{
HWAS_INF("Procedure callout; proc 0x%x priority 0x%x",
pCalloutUD->type, pCalloutUD->type);
- //const HWAS::epubProcedureID procedure = pCalloutUD->procedure;
- //const callOutPriority priority = pCalloutUD->priority;
- // move these to platform specific functions?
- // RTC: 45781
- // hostboot:
- // nothing
-
- // fsp:
- // RTC: 45781
- // ? not sure what fsp does for procedure callouts?
+ errlHndl_t errl = platHandleProcedureCallout(i_errl,
+ pCalloutUD->procedure, pCalloutUD->priority);
+ if (errl)
+ {
+ HWAS_ERR("HW callout: error from platHandlProcedureCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
break;
}
default:
@@ -195,8 +130,7 @@ bool processCallout(const uint32_t i_errlPlid,
}
} // switch
- HWAS_INF("processCallout exit l_rc %d", l_rc);
- return l_rc;
+ HWAS_INF("processCallout exit");
} // processCallout
}; // end namespace
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
new file mode 100644
index 000000000..10d84e877
--- /dev/null
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -0,0 +1,119 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwas/hwasPlatCallout.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file hwasPlatCallout.C
+ *
+ * @brief Platform Callout specific functions
+ */
+
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasCallout.H>
+#include <hwas/common/deconfigGard.H>
+
+namespace HWAS
+{
+
+//******************************************************************************
+// platHandleProcedureCallout
+//******************************************************************************
+errlHndl_t platHandleProcedureCallout(
+ errlHndl_t i_errl,
+ epubProcedureID i_procedure,
+ callOutPriority i_priority)
+{
+ errlHndl_t errl = NULL;
+
+ // hostboot does not handle or do any action for procedure callouts
+ return errl;
+}
+
+//******************************************************************************
+// platHandleHWCallout
+//******************************************************************************
+errlHndl_t platHandleHWCallout(
+ TARGETING::Target *i_pTarget,
+ callOutPriority i_priority,
+ DeconfigEnum i_deconfigState,
+ errlHndl_t i_errl,
+ GARD_ErrorType i_gardErrorType)
+{
+ errlHndl_t errl = NULL;
+
+ HWAS_INF("HW callout; pTarget %p gardErrorType %x deconfigState %x",
+ i_pTarget, i_gardErrorType, i_deconfigState);
+ switch (i_gardErrorType)
+ {
+ case (GARD_NULL):
+ { // means no GARD operations
+ break;
+ }
+ default:
+ {
+ errl = HWAS::theDeconfigGard().createGardRecord(*i_pTarget,
+ i_errl->plid(),
+ i_gardErrorType);
+ break;
+ }
+ } // switch i_gardErrorType
+
+ switch (i_deconfigState)
+ {
+ case (NO_DECONFIG):
+ {
+ break;
+ }
+ case (DECONFIG):
+ {
+ // call HWAS common function
+ errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
+ i_errl->plid());
+ break;
+ }
+ case (DELAYED_DECONFIG):
+ {
+ // check to see if this target is the master processor
+ TARGETING::Target *l_masterProc;
+ TARGETING::targetService().masterProcChipTargetHandle(
+ l_masterProc);
+ if (i_pTarget == l_masterProc)
+ {
+ // if so, we can't run anymore, so we will
+ // call HWAS to deconfigure, forcing the issue now.
+ // TODO: RTC: 45781
+ HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc");
+ errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
+ i_errl->plid());
+ break;
+ }
+ // else
+ // do nothing -- the deconfig information was already
+ // put on a queue and will be processed separately,
+ // when the time is right.
+ break;
+ }
+ } // switch i_deconfigState
+ return errl;
+}
+
+} // namespace HWAS
diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile
index bcddfb822..047c0bd38 100644
--- a/src/usr/hwas/makefile
+++ b/src/usr/hwas/makefile
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011,2012
+# COPYRIGHT International Business Machines Corp. 2011,2013
#
# p1
#
@@ -34,7 +34,7 @@ MODULE = hwas
OBJS = hwas.o hwasCallout.o deconfigGard.o
# files in this directory
-OBJS += hwasPlat.o hostbootIstep.o hwasPlatError.o
+OBJS += hwasPlat.o hostbootIstep.o hwasPlatError.o hwasPlatCallout.o
SUBDIRS = test.d
OpenPOWER on IntegriCloud