diff options
author | Bill Schwartz <whs@us.ibm.com> | 2014-03-10 20:05:03 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-03-20 15:29:01 -0500 |
commit | 7d87c86e14ad803bb295bc4e3e97e42cce20fd08 (patch) | |
tree | fc8be61bdf6d445b16f3991c5b67a54ef9dbb97c /src | |
parent | 6c6ededed27870f024c4e46fecfcdd2b477d30ee (diff) | |
download | talos-hostboot-7d87c86e14ad803bb295bc4e3e97e42cce20fd08.tar.gz talos-hostboot-7d87c86e14ad803bb295bc4e3e97e42cce20fd08.zip |
Ability for FAPI to request FW traces added to error log
Trace buffer IDs are requested through <collectTrace>TRACE_ID</collectTrace>
on the FAPI RC.
Trace buffer IDs are 'generic' to provide flexibility for the platform to map
to specific traces.
The colllected trace is limited to a maximum size via a constant.
FSP common FAPI files and platform specific code will be updated after initial
host boot review.
Change-Id: Iabb2ce584cfd76225f84a0617562dbd6d504c70f
RTC: 98649
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9464
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiErrorInfo.H | 63 | ||||
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCode.H | 18 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 12 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 16 | ||||
-rw-r--r-- | src/usr/hwpf/fapi/fapiReturnCode.C | 22 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiHwpErrorInfo.xml | 12 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpError.C | 10 |
7 files changed, 144 insertions, 9 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H index b7818058b..cded70629 100644 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: fapiErrorInfo.H,v 1.12 2014/02/26 14:50:39 mjjones Exp $ +// $Id: fapiErrorInfo.H,v 1.13 2014/03/12 00:47:58 whs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiErrorInfo.H,v $ /** @@ -48,6 +48,7 @@ * rjknight 09/19/2013 Allow callout/deconfigure * /gard of DIMM(s) related * to MBA + * whs 03/11/2014 Add FW traces to error logs */ #ifndef FAPIERRORINFO_H_ @@ -124,6 +125,23 @@ enum CalloutPriority } /** + * @enum Enumeration of firmware traces + * + * This enumeration defines the possible firmware traces to collect + */ +namespace CollectTraces +{ +const uint32_t TRACE_SIZE = 256; // limit collected trace size +enum CollectTrace +{ + FSI = 1, + SCOM = 2, + SCAN = 3, + MBOX = 4, +}; +} + +/** * @class ErrorInfoFfdc * * This class contains a copy of some FFDC data @@ -473,6 +491,42 @@ struct ErrorInfoChildrenCDG }; /** + * @struct ErrorInfoCollectTrace + * + * This struct contains trace ID to add to the error log + */ +struct ErrorInfoCollectTrace +{ + /** + * @brief Constructor. + * + * @param[in] i_trace + */ + ErrorInfoCollectTrace(CollectTraces::CollectTrace i_traceId); + +#ifdef FAPI_CUSTOM_MALLOC + /** + * @brief Overload new operator to use platform-specific allocator + * + * @param[in] i_sz Size of memory to allocate in bytes + * + * @return Pointer to allocated memory + */ + static void * operator new(size_t i_sz); + + /** + * @brief Overload delete operator to use platform-specific deallocator + * + * @param[in] i_ptr Pointer to memory previously allocated with new + */ + static void operator delete(void * i_ptr); +#endif + + // trace + CollectTraces::CollectTrace iv_eiTraceId; +}; + +/** * @struct ErrorInfo * * This struct defines the error information associated with a fapi::ReturnCode @@ -540,6 +594,13 @@ struct ErrorInfo ErrorInfoChildrenCDGItr_t; typedef std::vector<ErrorInfoChildrenCDG *>::const_iterator ErrorInfoChildrenCDGCItr_t; + + // Vector of traces to collect + std::vector<ErrorInfoCollectTrace *> iv_traces; + typedef std::vector<ErrorInfoCollectTrace *>::iterator + ErrorInfoCollectTraceItr_t; + typedef std::vector<ErrorInfoCollectTrace *>::const_iterator + ErrorInfoCollectTraceCItr_t; }; } diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H index 37fe73465..dcb396dc9 100644 --- a/src/include/usr/hwpf/fapi/fapiReturnCode.H +++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: fapiReturnCode.H,v 1.19 2013/11/11 19:33:31 mjjones Exp $ +// $Id: fapiReturnCode.H,v 1.20 2014/03/12 00:48:25 whs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiReturnCode.H,v $ /** @@ -57,6 +57,7 @@ * rjknight 09/10/2013 Support DIMM callout from * MBA port and dimm number * mjjones 11/08/2013 Do not define struct in union + * whs 03/11/2014 Add FW traces to error logs */ #ifndef FAPIRETURNCODE_H_ @@ -280,6 +281,7 @@ public: EI_TYPE_BUS_CALLOUT = 4, EI_TYPE_CDG = 5, // Target Callout/Deconfig/GARD EI_TYPE_CHILDREN_CDG = 6, // Children Callout/Deconfig/GARD + EI_TYPE_COLLECT_TRACE = 7, }; /** @@ -336,6 +338,11 @@ public: uint8_t iv_calloutPriority; }; + struct ErrorInfoEntryCollectTrace + { + uint32_t iv_eieTraceId; + }; + struct ErrorInfoEntry { uint8_t iv_type; // Value from ErrorInfoType @@ -347,6 +354,7 @@ public: ErrorInfoEntryBusCallout bus_callout; ErrorInfoEntryTargetCDG target_cdg; ErrorInfoEntryChildrenCDG children_cdg; + ErrorInfoEntryCollectTrace collect_trace; }; }; @@ -510,6 +518,14 @@ private: const CalloutPriorities::CalloutPriority i_priority, const uint8_t i_childPort, const uint8_t i_childNum); + /** + * @brief Add traces to collect to the ErrorInfo + * + * @param[in] i_trace + */ + void addEICollectTrace( + const CollectTraces::CollectTrace i_traceId); + // The rcValue uint32_t iv_rcValue; diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index b72534012..30dd3f066 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: fapiErrorInfo.C,v 1.11 2013/11/11 19:33:45 mjjones Exp $ +// $Id: fapiErrorInfo.C,v 1.12 2014/03/12 00:48:05 whs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiErrorInfo.C,v $ /** @@ -47,6 +47,7 @@ * mjjones 08/26/2013 Support HW Callouts * rjknight 09/24/2013 Support dimm callouts * based on mba parent target + * whs 03/11/2014 Add FW traces to error logs */ #include <fapiErrorInfo.H> @@ -262,6 +263,15 @@ ErrorInfoChildrenCDG::ErrorInfoChildrenCDG( } //****************************************************************************** +// ErrorInfoCollectTrace Constructor +//****************************************************************************** +ErrorInfoCollectTrace::ErrorInfoCollectTrace( + const CollectTraces::CollectTrace i_traceId) +: iv_eiTraceId(i_traceId) +{ +} + +//****************************************************************************** // ErrorInfoChildrenCDG new Operator Overload //****************************************************************************** #ifdef FAPI_CUSTOM_MALLOC diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index 294c2f708..b544251b2 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -6,7 +6,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011,2013 +# COPYRIGHT International Business Machines Corp. 2011,2014 # # p1 # @@ -21,7 +21,7 @@ # Origin: 30 # # IBM_PROLOG_END_TAG -# $Id: fapiParseErrorInfo.pl,v 1.25 2013/10/31 21:34:01 dedahle Exp $ +# $Id: fapiParseErrorInfo.pl,v 1.26 2014/03/12 00:48:41 whs Exp $ # Purpose: This perl script will parse HWP Error XML files and create required # FAPI code. # @@ -63,6 +63,7 @@ # DIMM(s) related to MBA # dedahle 10/15/13 Support register FFDC collection based on # present children +# whs 03/11/14 Add FW traces to error logs # # End Change Log ***************************************************** # @@ -356,7 +357,7 @@ foreach my $argnum (1 .. $#ARGV) my $errors = $xml->XMLin($infile, ForceArray => ['hwpError', 'collectFfdc', 'ffdc', 'callout', 'deconfigure', 'gard', 'registerFfdc', 'collectRegisterFfdc', 'cfamRegister', 'scomRegister', - 'id']); + 'id','collectTrace']); # Uncomment to get debug output of all errors #print "\nFile: ", $infile, "\n", Dumper($errors), "\n"; @@ -505,6 +506,15 @@ foreach my $argnum (1 .. $#ARGV) my %cdgTargetHash; # Records the callout/deconfigure/gards for Targets my %cdgChildHash; # Records the callout/deconfigure/gards for Children + # collect firmware trace + foreach my $collectTrace (@{$err->{collectTrace}}) + { + # Add an EI entry to eiEntryStr + $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_COLLECT_TRACE; \\\n"; + $eiEntryStr .= " l_entries[$eiEntryCount].collect_trace.iv_eieTraceId = fapi::CollectTraces::$collectTrace; \\\n"; + $eiEntryCount++; + } + # Local FFDC foreach my $ffdc (@{$err->{ffdc}}) { diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C index a40f02b9f..3165af44b 100644 --- a/src/usr/hwpf/fapi/fapiReturnCode.C +++ b/src/usr/hwpf/fapi/fapiReturnCode.C @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: fapiReturnCode.C,v 1.18 2013/11/11 19:33:34 mjjones Exp $ +// $Id: fapiReturnCode.C,v 1.19 2014/03/12 00:48:21 whs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/hwpf/working/fapi/fapiReturnCode.C,v $ /** @@ -56,6 +56,7 @@ * mjjones 05/20/2013 Support Bus Callouts * mjjones 06/24/2013 Support Children CDGs * mjjones 08/26/2013 Support HW Callouts + * whs 03/11/2014 Add FW traces to error logs */ #include <fapiReturnCode.H> @@ -385,6 +386,13 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, addEIChildrenCdg(*l_pParent, l_childType, l_callout, l_deconf, l_gard, l_pri, l_childPort, l_childNumber ); } + else if (l_type == EI_TYPE_COLLECT_TRACE) + { + CollectTraces::CollectTrace l_traceId = + static_cast<CollectTraces::CollectTrace> + (i_pEntries[i].collect_trace.iv_eieTraceId); + addEICollectTrace(l_traceId); + } else { FAPI_ERR("addErrorInfo: Unrecognized EI type: %d", l_type); @@ -556,4 +564,16 @@ void ReturnCode::addEIChildrenCdg( iv_childrenCDGs.push_back(l_pCdg); } +//****************************************************************************** +// addEICollectTrace function +//****************************************************************************** +void ReturnCode::addEICollectTrace( + const CollectTraces::CollectTrace i_traceId) +{ + // Create an ErrorInfoCollectTrace object and add it to Error Information + ErrorInfoCollectTrace * l_pCT = new ErrorInfoCollectTrace(i_traceId); + getCreateReturnCodeDataRef().getCreateErrorInfo(). + iv_traces.push_back(l_pCT); +} + } diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml index 4de66539f..79b367fac 100644 --- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml +++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml @@ -20,7 +20,7 @@ <!-- Origin: 30 --> <!-- --> <!-- IBM_PROLOG_END_TAG --> -<!-- $Id: fapiHwpErrorInfo.xml,v 1.14 2013/10/31 19:49:04 dedahle Exp $ --> +<!-- $Id: fapiHwpErrorInfo.xml,v 1.15 2014/03/12 00:49:03 whs Exp $ --> <!-- XML file specifying Test HW Procedure generated errors. --> <hwpErrors> @@ -345,4 +345,14 @@ <ffdc>FFDC_ROW</ffdc> </hwpError> <!-- ************************************************************ --> + <hwpError> + <rc>RC_TEST_COLLECT_TRACE</rc> + <description>Test adding firmware traces</description> + <ffdc>FFDC_VALUE</ffdc> + <collectTrace>FSI</collectTrace> + <collectTrace>SCOM</collectTrace> + <collectTrace>SCAN</collectTrace> + <collectTrace>MBOX</collectTrace> + </hwpError> + <!-- ************************************************************ --> </hwpErrors> diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C index e5df32461..93cf17851 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpError.C +++ b/src/usr/hwpf/hwp/fapiTestHwpError.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ /* */ /* p1 */ /* */ @@ -38,6 +38,7 @@ * mjjones 10/17/2011 Moved AnalyzeError to new file * rjknight 09/28/2013 Added callout test for MBA * dimm callout support + * whs 03/11/2014 Add FW traces to error logs * * * HWP_IGNORE_VERSION_CHECK @@ -58,6 +59,13 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_procTarget, fapi::ReturnCode l_rc; + // Test ability for FAPI to request FW traces added to error log + FAPI_ERR("hwpTestError: Generating RC_TEST_COLLECT_TRACE"); + uint32_t FFDC_VALUE = 0xBEF2; + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_COLLECT_TRACE); + // Log the error + fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE, true); + // Local data that needs to be captured as FFDC uint32_t l_ffdc = 0x12345678; ecmdDataBufferBase l_buf(65); |