summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-08-19 16:44:31 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-13 12:56:29 -0500
commit0b823dd9ef5579112cbbaae770028c75f7d19119 (patch)
treed15afcbcc31171c42b1915f45094f4101a0fb328 /src/usr
parent97e007ba1b3c283bb7dcbd35e692385bb91fb5e6 (diff)
downloadtalos-hostboot-0b823dd9ef5579112cbbaae770028c75f7d19119.tar.gz
talos-hostboot-0b823dd9ef5579112cbbaae770028c75f7d19119.zip
add clock callout functionality
Change-Id: Id864e2baa0b69d0dfdbe9c9cfe56f7b4246269ab RTC: 73480 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5842 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@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.C35
-rw-r--r--src/usr/errl/errludcallout.C28
-rw-r--r--src/usr/errl/plugins/errludcallout.H24
-rw-r--r--src/usr/errl/test/errltest.H5
-rw-r--r--src/usr/errl/test/errluserdetailtest.H6
-rw-r--r--src/usr/hwas/common/hwasCallout.C34
-rw-r--r--src/usr/hwas/hwasPlatCallout.C20
-rw-r--r--src/usr/xscom/piberror.C23
8 files changed, 165 insertions, 10 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C
index a10ab6fc4..ee23e4097 100644
--- a/src/usr/errl/errlentry.C
+++ b/src/usr/errl/errlentry.C
@@ -299,6 +299,41 @@ void ErrlEntry::removeBackTrace()
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
+void ErrlEntry::addClockCallout(const TARGETING::Target *i_target,
+ const HWAS::clockTypeEnum i_clockType,
+ const HWAS::callOutPriority i_priority)
+{
+ TRACFCOMP(g_trac_errl, ENTER_MRK"addClockCallout(%p, %d, 0x%x)",
+ i_target, i_clockType, i_priority);
+
+ TARGETING::EntityPath ep;
+ const void *pData;
+ uint32_t size;
+
+ if (i_target == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL)
+ {
+ size = sizeof(HWAS::TARGET_IS_SENTINEL);
+ pData = &HWAS::TARGET_IS_SENTINEL;
+ }
+ else
+ { // we got a non MASTER_SENTINEL target, therefore the targeting
+ // module is loaded, therefore we can make this call.
+ ep = i_target->getAttr<TARGETING::ATTR_PHYS_PATH>();
+ // size is total EntityPath size minus unused path elements
+ size = sizeof(ep) -
+ (TARGETING::EntityPath::MAX_PATH_ELEMENTS - ep.size()) *
+ sizeof(TARGETING::EntityPath::PathElement);
+ pData = &ep;
+ }
+
+ ErrlUserDetailsCallout( pData, size, i_clockType,
+ i_priority).addToLog(this);
+
+} // addClockCallout
+
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
void ErrlEntry::addBusCallout(const TARGETING::Target *i_target_endp1,
const TARGETING::Target *i_target_endp2,
const HWAS::busTypeEnum i_busType,
diff --git a/src/usr/errl/errludcallout.C b/src/usr/errl/errludcallout.C
index c206a628a..2e9b42cf7 100644
--- a/src/usr/errl/errludcallout.C
+++ b/src/usr/errl/errludcallout.C
@@ -38,6 +38,34 @@ namespace ERRORLOG
extern TARGETING::TARG_TD_t g_trac_errl;
//------------------------------------------------------------------------------
+// Clock callout
+ErrlUserDetailsCallout::ErrlUserDetailsCallout(
+ const void *i_pTargetData,
+ uint32_t i_targetDataLength,
+ const HWAS::clockTypeEnum i_clockType,
+ const HWAS::callOutPriority i_priority)
+{
+ TRACDCOMP(g_trac_errl, "ClockCallout entry");
+
+ // Set up ErrlUserDetails instance variables
+ iv_CompId = ERRL_COMP_ID;
+ iv_Version = 1;
+ iv_SubSection = ERRL_UDT_CALLOUT;
+
+ uint32_t pDataLength = sizeof(HWAS::callout_ud_t) + i_targetDataLength;
+ HWAS::callout_ud_t *pData;
+ pData = reinterpret_cast<HWAS::callout_ud_t *>
+ (reallocUsrBuf(pDataLength));
+ pData->type = HWAS::CLOCK_CALLOUT;
+ pData->clockType = i_clockType;
+ pData->priority = i_priority;
+ memcpy(pData + 1, i_pTargetData, i_targetDataLength);
+
+ TRACDCOMP(g_trac_errl, "ClockCallout exit; pDataLength %d", pDataLength);
+
+} // Clock callout
+
+//------------------------------------------------------------------------------
// Bus callout
ErrlUserDetailsCallout::ErrlUserDetailsCallout(
const void *i_pTarget1Data,
diff --git a/src/usr/errl/plugins/errludcallout.H b/src/usr/errl/plugins/errludcallout.H
index 8ea213d72..01d9000fd 100644
--- a/src/usr/errl/plugins/errludcallout.H
+++ b/src/usr/errl/plugins/errludcallout.H
@@ -73,6 +73,28 @@ public:
switch (pData->type)
{
+ case HWAS::CLOCK_CALLOUT:
+ {
+ switch (ntohl(pData->clockType))
+ {
+#define case_CLOCK_TYPE(_type) \
+case HWAS::_type: i_parser.PrintString( "Clock Type", #_type); break;
+ case_CLOCK_TYPE(TODCLK_TYPE)
+ case_CLOCK_TYPE(MEMCLK_TYPE)
+ case_CLOCK_TYPE(OSCREFCLK_TYPE)
+ case_CLOCK_TYPE(OSCPCICLK_TYPE)
+ default:
+ i_parser.PrintNumber( "Clock Type", "UNKNOWN: 0x%X",
+ ntohl(pData->clockType) );
+ } // switch clockType
+
+ // what follows the pData structure is one entity path
+ // print it out
+ uint8_t *l_ptr = reinterpret_cast<uint8_t *>(pData+1);
+ printEntityPath(l_ptr, i_parser, "Target");
+
+ break; // CLOCK_CALLOUT
+ }
case HWAS::BUS_CALLOUT:
{
switch (ntohl(pData->busType))
@@ -144,6 +166,7 @@ case HWAS::_type: i_parser.PrintString( "GARD Error Type", #_type); break;
break; // HW_CALLOUT
}
case HWAS::PROCEDURE_CALLOUT:
+ {
i_parser.PrintString( "Callout type", "Procedure Callout");
switch (ntohl(pData->procedure))
{
@@ -174,6 +197,7 @@ case HWAS::_type: i_parser.PrintString( "Procedure", #_type); break;
break;
} // switch procedure
break; // PROCEDURE_CALLOUT
+ }
default:
i_parser.PrintNumber( "Callout type", "UNKNOWN: 0x%X",
ntohl(pData->type) );
diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H
index 708c46084..3d8a247db 100644
--- a/src/usr/errl/test/errltest.H
+++ b/src/usr/errl/test/errltest.H
@@ -441,6 +441,11 @@ public:
HWAS::EPUB_PRC_MEMORY_PLUGGING_ERROR,
HWAS::SRCI_PRIORITY_HIGH);
+ errl->addClockCallout(
+ pExList[0],
+ HWAS::TODCLK_TYPE,
+ HWAS::SRCI_PRIORITY_MED);
+
if (pExList.size() > 1)
{
errl->addBusCallout(
diff --git a/src/usr/errl/test/errluserdetailtest.H b/src/usr/errl/test/errluserdetailtest.H
index 92b65578e..e3417861d 100644
--- a/src/usr/errl/test/errluserdetailtest.H
+++ b/src/usr/errl/test/errluserdetailtest.H
@@ -580,6 +580,12 @@ public:
HWAS::EPUB_PRC_FSI_PATH,
HWAS::SRCI_PRIORITY_HIGH).addToLog(errl);
+ ErrlUserDetailsCallout(
+ &ep,
+ ep_size,
+ HWAS::TODCLK_TYPE,
+ HWAS::SRCI_PRIORITY_LOW).addToLog(errl);
+
if (pExList.size() > 1)
{
TARGETING::EntityPath ep2;
diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C
index 1d226f20f..dcac818e8 100644
--- a/src/usr/hwas/common/hwasCallout.C
+++ b/src/usr/hwas/common/hwasCallout.C
@@ -100,10 +100,9 @@ void processCallout(errlHndl_t &io_errl,
uint64_t i_Size,
bool i_DeferredOnly)
{
- HWAS_INF("processCallout entry. data %p size %lld",
- i_pData, i_Size);
-
callout_ud_t *pCalloutUD = (callout_ud_t *)i_pData;
+ HWAS_INF("processCallout entry. data %p size %lld type 0x%x",
+ i_pData, i_Size, pCalloutUD->type);
if (i_DeferredOnly)
{
@@ -141,7 +140,7 @@ void processCallout(errlHndl_t &io_errl,
pCalloutUD->gardErrorType);
if (errl)
{
- HWAS_ERR("HW callout: error from platHandlHWCallout");
+ HWAS_ERR("processCallout: error from platHandlHWCallout");
errlCommit(errl, HWAS_COMP_ID);
}
}
@@ -156,11 +155,11 @@ void processCallout(errlHndl_t &io_errl,
pCalloutUD->procedure, pCalloutUD->priority);
if (errl)
{
- HWAS_ERR("HW callout: error from platHandlProcedureCallout");
+ HWAS_ERR("processCallout: error from platHandlProcedureCallout");
errlCommit(errl, HWAS_COMP_ID);
}
break;
- }
+ } // PROCEDURE_CALLOUT
case (BUS_CALLOUT):
{
TARGETING::Target *pTarget1 = NULL;
@@ -179,12 +178,33 @@ void processCallout(errlHndl_t &io_errl,
io_errl);
if (errl)
{
- HWAS_ERR("HW callout: error from platHandlBusCallout");
+ HWAS_ERR("processCallout: error from platHandlBusCallout");
errlCommit(errl, HWAS_COMP_ID);
}
}
break;
} // BUS_CALLOUT
+ case (CLOCK_CALLOUT):
+ {
+ TARGETING::Target *pTarget = NULL;
+ uint8_t * l_uData = (uint8_t *)(pCalloutUD + 1);
+ bool l_err = retrieveTarget(l_uData, pTarget, io_errl);
+
+ if (!l_err)
+ {
+ errlHndl_t errl = platHandleClockCallout(
+ pTarget,
+ pCalloutUD->clockType,
+ pCalloutUD->priority,
+ io_errl);
+ if (errl)
+ {
+ HWAS_ERR("processCallout: error from platHandleClockCallout");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
+ }
+ break;
+ } // CLOCK_CALLOUT
default:
{
HWAS_ERR("bad data in Callout UD %x", pCalloutUD->type);
diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C
index 52a5d2b5e..95f2b4a47 100644
--- a/src/usr/hwas/hwasPlatCallout.C
+++ b/src/usr/hwas/hwasPlatCallout.C
@@ -159,4 +159,24 @@ errlHndl_t platHandleBusCallout(
return errl;
}
+//******************************************************************************
+// platHandleClockCallout
+//******************************************************************************
+errlHndl_t platHandleClockCallout(
+ TARGETING::Target *i_pTarget,
+ clockTypeEnum i_clockType,
+ callOutPriority i_priority,
+ errlHndl_t &io_errl)
+{
+ // WARNING:
+ // this hostboot code should not change io_errl, unless the caller of the
+ // processCallouts() function also changes, as today it (errlentry.C) calls
+ // from the errlEntry object
+
+ errlHndl_t errl = NULL;
+
+ // hostboot does not handle or do any action for clock callouts
+ return errl;
+}
+
} // namespace HWAS
diff --git a/src/usr/xscom/piberror.C b/src/usr/xscom/piberror.C
index fe6093396..e36a37f78 100644
--- a/src/usr/xscom/piberror.C
+++ b/src/usr/xscom/piberror.C
@@ -67,9 +67,26 @@ void addFruCallouts(TARGETING::Target* i_target,
HWAS::GARD_NULL );
break;
case PIB::PIB_CLOCK_ERROR:
- // @todo: RTC: 73480 Add Clock callout support
- // (likely will need a procedure callout and have HWserver add the fru
- // add a procedure callout type to hwascallout.H)
+ if (i_target->getAttr<TARGETING::ATTR_TYPE>() ==
+ TARGETING::TYPE_PROC)
+ {
+ io_errl->addClockCallout(i_target,
+ HWAS::OSCREFCLK_TYPE,
+ HWAS::SRCI_PRIORITY_LOW);
+ }
+ else if (i_target->getAttr<TARGETING::ATTR_TYPE>() ==
+ TARGETING::TYPE_MEMBUF)
+ {
+ io_errl->addClockCallout(i_target,
+ HWAS::MEMCLK_TYPE,
+ HWAS::SRCI_PRIORITY_LOW);
+ }
+ else // for anything else, just blame the refclock
+ {
+ io_errl->addClockCallout(i_target,
+ HWAS::OSCREFCLK_TYPE,
+ HWAS::SRCI_PRIORITY_LOW);
+ }
break;
default:
OpenPOWER on IntegriCloud