diff options
| author | Richard J. Knight <rjknight@us.ibm.com> | 2013-09-13 14:59:14 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-10 12:02:04 -0500 |
| commit | ae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb (patch) | |
| tree | 01d6128e1c9f8c8aa3b412160d08af827093a7d2 /src | |
| parent | 95bf47c534737019f956fbcca2c622c98dacc266 (diff) | |
| download | blackbird-hostboot-ae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb.tar.gz blackbird-hostboot-ae5f2aa9194b6f26893bfb21b1fc115d3cae0dcb.zip | |
HWPF Error XML: Allow callout/deconfigure/gard of DIMM(s) related to MBA
Change-Id: Ibd067f73cf381b18eab5e48cf1f72f961450a1f2
RTC:81669
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6208
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: Brian H. Horton <brianh@linux.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 | 32 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiReturnCode.H | 19 | ||||
| -rw-r--r-- | src/include/usr/hwpf/fapi/fapiUtil.H | 10 | ||||
| -rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwpError.H | 54 | ||||
| -rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfo.C | 12 | ||||
| -rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 71 | ||||
| -rw-r--r-- | src/usr/hwpf/fapi/fapiReturnCode.C | 32 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/fapiHwpErrorInfo.xml | 79 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpError.C | 67 | ||||
| -rw-r--r-- | src/usr/hwpf/plat/fapiPlatHwpInvoker.C | 101 | ||||
| -rw-r--r-- | src/usr/hwpf/plat/fapiPlatUtil.C | 11 | ||||
| -rw-r--r-- | src/usr/hwpf/test/fapiRcTest.C | 10 | ||||
| -rw-r--r-- | src/usr/hwpf/test/hwpftest.H | 16 |
13 files changed, 426 insertions, 88 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H index 8467e22f1..fe6db4544 100644 --- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H +++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H @@ -42,6 +42,9 @@ * mjjones 05/20/2013 Support Bus Callouts * mjjones 06/24/2013 Support Children CDGs * mjjones 08/26/2013 Support HW Callouts + * rjknight 09/19/2013 Allow callout/deconfigure + * /gard of DIMM(s) related + * to MBA */ #ifndef FAPIERRORINFO_H_ @@ -150,7 +153,7 @@ public: * @return void *. Pointer to the FFDC */ const void * getData(uint32_t & o_size) const; - + /** * @brief Get the FFDC Identifier * @@ -180,7 +183,7 @@ private: // FFDC Identifier uint32_t iv_ffdcId; - + // Pointer to the FFDC uint8_t * iv_pFfdc; @@ -326,7 +329,9 @@ struct ErrorInfoBusCallout // The callout priority CalloutPriorities::CalloutPriority iv_calloutPriority; }; - +// defines used with MBA dimm callouts +#define FAPI_ALL_MBA_PORTS 0xFF +#define FAPI_ALL_MBA_DIMMS 0xFF /** * @struct ErrorInfoCDG * @@ -391,19 +396,26 @@ struct ErrorInfoChildrenCDG /** * @brief Constructor. * - * @param[in] i_parentChip Reference to the parent chip - * @oaram[in] i_childType Child target types to c/d/g + * @param[in] i_parent Reference to the parent target + * @oaram[in] i_childType Child target type to c/d/g * @param[in] i_callout True if Target should be called out * @param[in] i_deconfigure True if Target should be deconfigured * @param[in] i_gard True if Target should be GARDed * @param[in] i_priority The priority of any callout + * @param[in] i_childPort Parent port number where child is + * connected + * @param[in] i_childNum Chip number of child target + * + * @note i_childPort and i_childNum are valid only for MBA/DIMM + * parent/child combination */ ErrorInfoChildrenCDG(const Target & i_parentChip, const TargetType i_childType, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority); + const CalloutPriorities::CalloutPriority i_priority, + const uint8_t i_childPort, const uint8_t i_childNum); #ifdef FAPI_CUSTOM_MALLOC /** @@ -424,7 +436,7 @@ struct ErrorInfoChildrenCDG #endif // The parent chip - Target iv_parentChip; + Target iv_parent; // The child target types to c/d/g TargetType iv_childType; @@ -438,6 +450,12 @@ struct ErrorInfoChildrenCDG // GARD Information bool iv_gard; + + // For MBA/DIMM parent/child, the MBA port + uint8_t iv_childPort; + + // For MBA/DIMM parent/child, the MBA dimm number + uint8_t iv_childNumber; }; /** diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H index edd86397b..31d1b0ebc 100644 --- a/src/include/usr/hwpf/fapi/fapiReturnCode.H +++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H @@ -50,6 +50,8 @@ * mjjones 06/06/2013 Check FFDC size at compile time * mjjones 06/24/2013 Support Children CDGs * mjjones 08/26/2013 Support Hw Callout + * rjknight 09/10/2013 Support DIMM callout from + * MBA port and dimm number */ #ifndef FAPIRETURNCODE_H_ @@ -339,10 +341,12 @@ public: struct { - uint8_t iv_parentChipObjIndex; + uint8_t iv_parentObjIndex; uint8_t iv_callout; uint8_t iv_deconfigure; uint32_t iv_childType; + uint8_t iv_childPort; + uint8_t iv_childNumber; uint8_t iv_gard; uint8_t iv_calloutPriority; } children_cdg; @@ -487,22 +491,27 @@ private: * @brief Add children target callout/deconfigure/GARDs to the ErrorInfo * * This is called by addErrorInfo to c/d/g all child Targets of a specified - * type. + * type. The function can take a chip/unit pair or an MBA/DIMM pair. For + * the MBA/DIMM pair two additional parameters are used to identify which + * dimms should be called out. * - * @param[in] i_parentChip Reference to the parent chip + * @param[in] i_parent Reference to the parent chip * @param[in] i_childType Child target types to c/d/g * @param[in] i_callout True if Target should be called out * @param[in] i_deconfigure True if Target should be deconfigured * @param[in] i_gard True if Target should be GARDed * @param[in] i_priority The priority of any callout + * @param[in] i_childPort MBA port where error was detected + * @param[in] i_childNum MBA dimm number of failing chip */ void addEIChildrenCdg( - const Target & i_parentChip, + const Target & i_parent, const TargetType i_childType, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority); + const CalloutPriorities::CalloutPriority i_priority, + const uint8_t i_childPort, const uint8_t i_childNum); // The rcValue uint32_t iv_rcValue; diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H index 9d149de63..a90871a7e 100644 --- a/src/include/usr/hwpf/fapi/fapiUtil.H +++ b/src/include/usr/hwpf/fapi/fapiUtil.H @@ -44,6 +44,8 @@ * and doxygen changes; * needed by cronus * mjjones 08/13/2012 Add fapiSpecialWakeup + * mjjones 09/24/2013 Update fapiLogError to + * accept another parameter */ #ifndef FAPIUTIL_H_ @@ -141,13 +143,16 @@ enum fapiErrlSeverity_t * target are removed and rc value is set to success after * function ends.) * @param[in] i_sev Fapi error log severity defaulted to unrecoverable + * @param[in] i_unitTestError - flag to log error which does not cause a unit + * test to fail. * * Example usage: <br> * fapi::ReturnCode l_rc; <br> + * fapi::fapiErrlSeverity_t l_sev = fapi::FAPI_ERRL_SEV_UNRECOVERABLE;<br> * FAPI_EXEC_HWP(l_rc, function1, i_target); <br> * if (!l_rc) <br> * { <br> - * fapiLogError(l_rc); <br> + * fapiLogError(l_rc, l_sev); <br> * } <br> * * FAPI_EXEC_HWP(l_rc, function2, i_target) <br> @@ -155,7 +160,8 @@ enum fapiErrlSeverity_t */ void fapiLogError(fapi::ReturnCode & io_rc, fapi::fapiErrlSeverity_t i_sev = - fapi::FAPI_ERRL_SEV_UNRECOVERABLE); + fapi::FAPI_ERRL_SEV_UNRECOVERABLE, + bool i_unitTestError=false); /** @brief This function answers the question, is scand tracing turned on? * The implementation of this function is specific to the platform. diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpError.H b/src/include/usr/hwpf/hwp/fapiTestHwpError.H index 2c18ba0ec..8a4f2d0ea 100644 --- a/src/include/usr/hwpf/hwp/fapiTestHwpError.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwpError.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/hwpf/hwp/fapiTestHwpError.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// 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 other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/fapiTestHwpError.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,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 fapiTestHwpError.H * @@ -32,6 +32,7 @@ * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/08/2011 Created. * mjjones 10/17/2011 Added func pointer + * rjknight 09/30/2013 Add 2nd target to fctn ptr */ #ifndef FAPITESTHWPERROR_H_ @@ -39,7 +40,8 @@ #include <fapi.H> -typedef fapi::ReturnCode (*hwpTestError_FP_t)(const fapi::Target &); +typedef fapi::ReturnCode (*hwpTestError_FP_t)(const fapi::Target &T1, + const fapi::Target &T2); extern "C" { @@ -47,11 +49,13 @@ extern "C" /** * @brief Simple HWP that returns an error (RC_TEST_ERROR_A) * - * @param[in] i_target Reference to target (unused by HWP) + * @param[in] i_procTarget Reference to a processor target type + * @param[in] i_mbaTarget Reference to an mba target type * * @return ReturnCode */ -fapi::ReturnCode hwpTestError(const fapi::Target & i_target); + fapi::ReturnCode hwpTestError(const fapi::Target& i_procTarget, + const fapi::Target& i_mbaTarget); } diff --git a/src/usr/hwpf/fapi/fapiErrorInfo.C b/src/usr/hwpf/fapi/fapiErrorInfo.C index 27f505383..ecac27b76 100644 --- a/src/usr/hwpf/fapi/fapiErrorInfo.C +++ b/src/usr/hwpf/fapi/fapiErrorInfo.C @@ -42,6 +42,8 @@ * mjjones 05/20/2013 Support Bus Callouts * mjjones 06/24/2013 Support Children CDGs * mjjones 08/26/2013 Support HW Callouts + * rjknight 09/24/2013 Support dimm callouts + * based on mba parent target */ #include <fapiErrorInfo.H> @@ -242,14 +244,16 @@ void ErrorInfoCDG::operator delete(void * i_ptr) // ErrorInfoChildrenCDG Constructor //****************************************************************************** ErrorInfoChildrenCDG::ErrorInfoChildrenCDG( - const Target & i_parentChip, + const Target & i_parent, const TargetType i_childType, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority) -: iv_parentChip(i_parentChip), iv_childType(i_childType), iv_callout(i_callout), - iv_calloutPriority(i_priority), iv_deconfigure(i_deconfigure), iv_gard(i_gard) + const CalloutPriorities::CalloutPriority i_priority, + const uint8_t i_childPort, const uint8_t i_childNum ) +: iv_parent(i_parent), iv_childType(i_childType), iv_callout(i_callout), + iv_calloutPriority(i_priority), iv_deconfigure(i_deconfigure), + iv_gard(i_gard), iv_childPort(i_childPort), iv_childNumber(i_childNum) { } diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index dc20d3625..9ff2e1d73 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -59,9 +59,10 @@ # mjjones 08/20/13 Use constants for Reg FFDC collection # mjjones 08/26/13 Support HW Callouts # dedahle 09/30/13 Support chiplet register FFDC collection +# rjknight 09/24/13 Allow callout/deconfigure/gard of +# DIMM(s) related to MBA # -# End Change Log ****************************************************** - +# End Change Log ***************************************************** # # Usage: # fapiParseErrorInfo.pl <output dir> <filename1> <filename2> ... @@ -580,6 +581,7 @@ foreach my $argnum (1 .. $#ARGV) $cdgTargetHash{$callout->{target}}{callout} = 1; $cdgTargetHash{$callout->{target}}{priority} = $callout->{priority}; + $elementsFound++; } if (exists $callout->{childTargets}) @@ -590,6 +592,7 @@ foreach my $argnum (1 .. $#ARGV) print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. Child Callout parent missing\n"); exit(1); } + if (! exists $callout->{childTargets}->{childType}) { print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. Child Callout childType missing\n"); @@ -603,7 +606,22 @@ foreach my $argnum (1 .. $#ARGV) $cdgChildHash{$parent}{$childType}{callout} = 1; $cdgChildHash{$parent}{$childType}{priority} = $callout->{priority}; + $elementsFound++; + + if (exists $callout->{childTargets}->{childPort}) + { + my $childPort = $callout->{childTargets}->{childPort}; + + $cdgChildHash{$parent}{$childType}{childPort} = $childPort; + } + + if (exists $callout->{childTargets}->{childNumber}) + { + my $childNum = $callout->{childTargets}->{childNumber}; + $cdgChildHash{$parent}{$childType}{childNumber} = $childNum; + } + } if ($elementsFound == 0) { @@ -647,7 +665,22 @@ foreach my $argnum (1 .. $#ARGV) my $parent = $deconfigure->{childTargets}->{parent}; my $childType = $deconfigure->{childTargets}->{childType}; $cdgChildHash{$parent}{$childType}{deconf} = 1; + $elementsFound++; + + if ( exists $deconfigure->{childTargets}->{childPort}) + { + my $childPort = $deconfigure->{childTargets}->{childPort}; + + $cdgChildHash{$parent}{$childType}{childPort} = $childPort; + } + + if ( exists $deconfigure->{childTargets}->{childNumber}) + { + my $childNum = $deconfigure->{childTargets}->{childNumber}; + $cdgChildHash{$parent}{$childType}{childNumber} = $childNum; + + } } if ($elementsFound == 0) { @@ -691,7 +724,22 @@ foreach my $argnum (1 .. $#ARGV) my $parent = $gard->{childTargets}->{parent}; my $childType = $gard->{childTargets}->{childType}; $cdgChildHash{$parent}{$childType}{gard} = 1; + $elementsFound++; + + if ( exists $gard->{childTargets}->{childPort}) + { + my $childPort = $gard->{childTargets}->{childPort}; + + $cdgChildHash{$parent}{$childType}{childPort} = $childPort; + + } + + if ( exists $gard->{childTargets}->{childNumber}) + { + my $childNum = $gard->{childTargets}->{childNumber}; + $cdgChildHash{$parent}{$childType}{childNumber} = $childNum; + } } if ($elementsFound == 0) { @@ -758,6 +806,8 @@ foreach my $argnum (1 .. $#ARGV) my $priority = 'LOW'; my $deconf = 0; my $gard = 0; + my $childPort = 0xFF; + my $childNumber = 0xFF; if (exists $cdgChildHash{$parent}{$childType}->{callout}) { @@ -772,11 +822,22 @@ foreach my $argnum (1 .. $#ARGV) { $deconf = 1; } + if (exists $cdgChildHash{$parent}->{$childType}->{childPort}) + { + $childPort = + $cdgChildHash{$parent}->{$childType}->{childPort} ; + } + if (exists $cdgChildHash{$parent}->{$childType}->{childNumber}) + { + $childNumber = + $cdgChildHash{$parent}->{$childType}->{childNumber} ; + } if (exists $cdgChildHash{$parent}->{$childType}->{gard}) { $gard = 1; } + # Add the Target to the objectlist if it doesn't already exist my $objNum = addEntryToArray(\@eiObjects, $parent); @@ -784,7 +845,7 @@ foreach my $argnum (1 .. $#ARGV) $eiEntryStr .= " l_entries[$eiEntryCount].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; \\\n"; $eiEntryStr .= - " l_entries[$eiEntryCount].children_cdg.iv_parentChipObjIndex = $objNum; \\\n"; + " l_entries[$eiEntryCount].children_cdg.iv_parentObjIndex = $objNum; \\\n"; $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_callout = $callout; \\\n"; $eiEntryStr .= @@ -792,6 +853,10 @@ foreach my $argnum (1 .. $#ARGV) $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_childType = fapi::$childType; \\\n"; $eiEntryStr .= + " l_entries[$eiEntryCount].children_cdg.iv_childPort = $childPort; \\\n"; + $eiEntryStr .= + " l_entries[$eiEntryCount].children_cdg.iv_childNumber = $childNumber; \\\n"; + $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_gard = $gard; \\\n"; $eiEntryStr .= " l_entries[$eiEntryCount].children_cdg.iv_calloutPriority = fapi::CalloutPriorities::$priority; \\\n"; diff --git a/src/usr/hwpf/fapi/fapiReturnCode.C b/src/usr/hwpf/fapi/fapiReturnCode.C index 587020bee..6feb1d4e6 100644 --- a/src/usr/hwpf/fapi/fapiReturnCode.C +++ b/src/usr/hwpf/fapi/fapiReturnCode.C @@ -252,7 +252,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, // The FFDC is a ecmdDataBufferBase const ecmdDataBufferBase * l_pDb = static_cast<const ecmdDataBufferBase *>(l_pObject); - + size_t byteLength = l_pDb->getWordLength() * sizeof(uint32_t); uint32_t * l_pData = reinterpret_cast<uint32_t*>(fapiMalloc(byteLength)); @@ -264,7 +264,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, // Deliberately not checking return code from extract l_pDb->extract(l_pData, 0, l_pDb->getBitLength()); addEIFfdc(l_ffdcId, l_pData, (l_pDb->getWordLength() * 4)); - + fapiFree(l_pData); } else if (l_size == ReturnCodeFfdc::EI_FFDC_SIZE_TARGET) @@ -272,7 +272,7 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, // The FFDC is a fapi::Target const fapi::Target * l_pTarget = static_cast<const fapi::Target *>(l_pObject); - + const char * l_ecmdString = l_pTarget->toEcmdString(); addEIFfdc(l_ffdcId, l_ecmdString, (strlen(l_ecmdString) + 1)); } @@ -363,26 +363,29 @@ void ReturnCode::addErrorInfo(const void * const * i_pObjects, } else if (l_type == EI_TYPE_CHILDREN_CDG) { - uint8_t l_parentChipIndex = - i_pEntries[i].children_cdg.iv_parentChipObjIndex; + uint8_t l_parentIndex = + i_pEntries[i].children_cdg.iv_parentObjIndex; TargetType l_childType = static_cast<TargetType>( i_pEntries[i].children_cdg.iv_childType); uint8_t l_callout = i_pEntries[i].children_cdg.iv_callout; uint8_t l_deconf = i_pEntries[i].children_cdg.iv_deconfigure; uint8_t l_gard = i_pEntries[i].children_cdg.iv_gard; + uint8_t l_childPort = i_pEntries[i].children_cdg.iv_childPort; + uint8_t l_childNumber = + i_pEntries[i].children_cdg.iv_childNumber; CalloutPriorities::CalloutPriority l_pri = static_cast<CalloutPriorities::CalloutPriority>( i_pEntries[i].children_cdg.iv_calloutPriority); // Get the Parent Target of the children to cdg - const Target * l_pParentChip = static_cast<const Target *>( - i_pObjects[l_parentChipIndex]); + const Target * l_pParent = static_cast<const Target *>( + i_pObjects[l_parentIndex]); // Add the ErrorInfo FAPI_ERR("addErrorInfo: Adding children cdg (%d:%d:%d), type: 0x%08x, pri: %d", l_callout, l_deconf, l_gard, l_childType, l_pri); - addEIChildrenCdg(*l_pParentChip, l_childType, l_callout, l_deconf, - l_gard, l_pri); + addEIChildrenCdg(*l_pParent, l_childType, l_callout, l_deconf, + l_gard, l_pri, l_childPort, l_childNumber ); } else { @@ -538,16 +541,19 @@ void ReturnCode::addEICdg( // addEIChildrenCdg function //****************************************************************************** void ReturnCode::addEIChildrenCdg( - const Target & i_parentChip, + const Target & i_parent, const TargetType i_childType, const bool i_callout, const bool i_deconfigure, const bool i_gard, - const CalloutPriorities::CalloutPriority i_priority) + const CalloutPriorities::CalloutPriority i_priority, + const uint8_t i_childPort, + const uint8_t i_childNum) { // Create an ErrorInfoChildrenCDG object and add it to the Error Information - ErrorInfoChildrenCDG * l_pCdg = new ErrorInfoChildrenCDG(i_parentChip, - i_childType, i_callout, i_deconfigure, i_gard, i_priority); + ErrorInfoChildrenCDG * l_pCdg = new ErrorInfoChildrenCDG(i_parent, + i_childType, i_callout, i_deconfigure, i_gard, i_priority, + i_childPort, i_childNum); getCreateReturnCodeDataRef().getCreateErrorInfo(). iv_childrenCDGs.push_back(l_pCdg); } diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml index aaca27edf..33d09bafd 100644 --- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml +++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml @@ -118,8 +118,85 @@ </hw> <priority>MEDIUM</priority> </callout> + --> + </hwpError> + + <hwpError> + <rc>RC_TEST_DIMM_CALLOUT_MBA_A</rc> + <description>DIMM Callout generated by Unit Test, passing in + MBA target and port number.</description> + <!-- Callout ALL dimms on specified MBA port with MEDIUM priority--> + <callout> + <childTargets> + <parent>UNIT_TEST_MBA_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort> + </childTargets> + <priority>MEDIUM</priority> + </callout> + </hwpError> + <!-- Callout a specific DIMM on a specified PORT of MBA --> + <hwpError> + <rc>RC_TEST_DIMM_CALLOUT_MBA_B</rc> + <description>DIMM Callout generated by Unit Test, passing in + MBA target,port number and specific DIMM number.</description> + <callout> + <childTargets> + <parent>UNIT_TEST_MBA_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort> + <childNumber>UNIT_TEST_DIMM_NUMBER</childNumber> + </childTargets> + <priority>LOW</priority> + </callout> + </hwpError> + <!-- Callout all dimms on all ports of a specfied MBA --> + <hwpError> + <rc>RC_TEST_DIMM_CALLOUT_MBA_C</rc> + <description>DIMM Callout generated by Unit Test, passing in + only MBA target to callout all dimms under it.</description> + <callout> + <childTargets> + <parent>UNIT_TEST_MBA_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + </childTargets> + <priority>HIGH</priority> + </callout> + </hwpError> + <!-- Deconfigure ALL dimms on specified MBA port with MEDIUM priority--> + <hwpError> + <rc>RC_TEST_DIMM_DECONFIGURE_MBA_A</rc> + <description>DIMM DECONFIGURE generated by Unit Test, passing in + MBA target and port number.</description> + <!-- Commented out to avoid actually calling out chiplets in UT + <deconfigure> + <childTargets> + <parent>UNIT_TEST_MBA_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort> + </childTargets> + <priority>MEDIUM</priority> + </deconfigure> + --> + </hwpError> + <!-- Gard a specific DIMM on a specified PORT of MBA --> + <hwpError> + <rc>RC_TEST_DIMM_GARD_MBA_B</rc> + <description>DIMM Callout generated by Unit Test, passing in + MBA target,port number and specific DIMM number.</description> + <!-- + <gard> + <childTargets> + <parent>UNIT_TEST_MBA_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + <childPort>UNIT_TEST_MBA_PORT_NUMBER</childPort> + <childNumber>UNIT_TEST_DIMM_NUMBER</childNumber> + </childTargets> + <priority>LOW</priority> + </gard> + --> + </hwpError> --> - </hwpError> <!-- *********************************************************************** --> <hwpError> <rc>RC_TEST_ERROR_B</rc> diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C index b7e1119c1..e5df32461 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpError.C +++ b/src/usr/hwpf/hwp/fapiTestHwpError.C @@ -36,6 +36,8 @@ * mjjones 10/06/2011 Major updates due to new * ErrorInfo design * mjjones 10/17/2011 Moved AnalyzeError to new file + * rjknight 09/28/2013 Added callout test for MBA + * dimm callout support * * * HWP_IGNORE_VERSION_CHECK @@ -49,7 +51,8 @@ extern "C" //****************************************************************************** // hwpTestError function //****************************************************************************** -fapi::ReturnCode hwpTestError(const fapi::Target & i_target) +fapi::ReturnCode hwpTestError(const fapi::Target & i_procTarget, + const fapi::Target & i_mbaTarget ) { FAPI_INF("hwpTestError: Start HWP"); @@ -62,13 +65,13 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target) l_buf.setBit(64); FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A"); - const fapi::Target & UNIT_TEST_FFDC_MASTER_CHIP_TARGET = i_target; + const fapi::Target & UNIT_TEST_FFDC_MASTER_CHIP_TARGET = i_procTarget; uint32_t & UNIT_TEST_FFDC_DATA_INTEGER = l_ffdc; ecmdDataBufferBase & UNIT_TEST_FFDC_DATA_BUF = l_buf; FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A); // Log the error - fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE); + fapiLogError(l_rc, fapi::FAPI_ERRL_SEV_PREDICTIVE, true); // Check that the return code is set to success if (!l_rc.ok()) @@ -77,7 +80,63 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target) "expected success", static_cast<uint32_t>(l_rc)); } - // Generate the same error again + + FAPI_INF("Test calling out all DIMMs based on mba port 0"); + + // all dimms on a specific port + FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_A"); + + const fapi::Target & UNIT_TEST_MBA_TARGET = i_mbaTarget; + uint8_t UNIT_TEST_MBA_PORT_NUMBER = 0x0; + + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_A); + + fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true ); + + // specific dimm on a specific port + FAPI_INF("Test calling out DIMM3 based on port and dimm number"); + + UNIT_TEST_MBA_PORT_NUMBER = 0x1; + uint8_t UNIT_TEST_DIMM_NUMBER = 0x01; + + FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_B"); + + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_B); + + fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true ); + + + FAPI_INF("Test calling out all dimms of an mba"); + // all dimms on an mba target + FAPI_ERR("Generating RC_TEST_DIMM_CALLOUT_MBA_C"); + + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_CALLOUT_MBA_C); + + fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true ); + + // commented out due to ci test failing on deconfigured parts + FAPI_INF("Test deconfigure all dimms of mba with port 0 specified"); + UNIT_TEST_MBA_PORT_NUMBER = 0x0; + // deconfigure all dimms on port 0 + FAPI_ERR("Generating RC_TEST_DIMM_DECONFIGURE_MBA_A "); + + FAPI_SET_HWP_ERROR(l_rc,RC_TEST_DIMM_DECONFIGURE_MBA_A); + + fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true ); + + FAPI_INF("Test gard of DIMM2"); + // gard dimm 0 onn port 1 + UNIT_TEST_DIMM_NUMBER = 0x00; + UNIT_TEST_MBA_PORT_NUMBER = 0x01; + + FAPI_ERR("Generating RC_TEST_DIMM_GARD_MBA_B "); + + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_DIMM_GARD_MBA_B); + + fapiLogError( l_rc,fapi::FAPI_ERRL_SEV_PREDICTIVE, true ); + + // Generate the same error again need to return an error + // to make the test code happy FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_A again"); FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A); diff --git a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C index 6739be5b2..a4ff9b3a3 100644 --- a/src/usr/hwpf/plat/fapiPlatHwpInvoker.C +++ b/src/usr/hwpf/plat/fapiPlatHwpInvoker.C @@ -28,6 +28,7 @@ #include <fapiTarget.H> #include <fapiReturnCode.H> +#include <fapiSystemConfig.H> #include <fapiPlatTrace.H> #include <fapiErrorInfo.H> #include <hwpf/hwpf_reasoncodes.H> @@ -132,6 +133,10 @@ HWAS::epubProcedureID xlateProcedureCallout( return l_proc; } +void getChildTargetsForCDG( + TARGETING::Target * i_pParent, TARGETING::TYPE i_childType, + TARGETING::TargetHandleList & o_childTargets, uint8_t i_childPort, + uint8_t i_childNumber); /** * @brief Translates a FAPI target type to a Targeting target type @@ -404,6 +409,10 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo, i_errInfo.iv_childrenCDGs.begin(); l_itr != i_errInfo.iv_childrenCDGs.end(); ++l_itr) { + + uint8_t l_childNumber = (*l_itr)->iv_childNumber; + uint8_t l_childPort = (*l_itr)->iv_childPort; + TARGETING::TYPE l_childType = xlateTargetType((*l_itr)->iv_childType); @@ -414,9 +423,9 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo, } else { - TARGETING::Target * l_pParentChip = - reinterpret_cast<TARGETING::Target*>( - (*l_itr)->iv_parentChip.get()); + TARGETING::Target * l_pParent = + reinterpret_cast<TARGETING::Target *> + ((*l_itr)->iv_parent.get()); HWAS::callOutPriority l_priority = xlateCalloutPriority((*l_itr)->iv_calloutPriority); @@ -435,14 +444,18 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo, // Get a list of functional children TARGETING::TargetHandleList l_children; - TARGETING::getChildChiplets(l_children, l_pParentChip, l_childType); + + getChildTargetsForCDG( l_pParent, l_childType, l_children, + l_childPort, l_childNumber ); // Callout/Deconfigure/GARD each child as appropriate for (TARGETING::TargetHandleList::const_iterator l_itr = l_children.begin(); - l_itr != l_children.end(); ++l_itr) + l_itr != l_children.end(); ++l_itr) { - FAPI_ERR("processEIChildrenCDGs: Calling out target (type: 0x%02x, pri:%d, deconf:%d, gard:%d)", + + FAPI_ERR("processEIChildrenCDGs: Calling out target" + " (type: 0x%02x, pri:%d, deconf:%d, gard:%d)", l_childType, l_priority, l_deconfig, l_gard); io_pError->addHwCallout(*l_itr, l_priority, l_deconfig, l_gard); } @@ -450,6 +463,78 @@ void processEIChildrenCDGs(const ErrorInfo & i_errInfo, } } +void getChildTargetsForCDG( + TARGETING::Target * i_pParent, TARGETING::TYPE i_childType, + TARGETING::TargetHandleList & o_childTargets, uint8_t i_childPort, + uint8_t i_childNumber ) +{ + o_childTargets.clear(); + bool l_functional = true; + + // dimms are not considered as a chiplet but + // a logical card so we need special processing here + if( i_childType == TARGETING::TYPE_DIMM ) + { + TARGETING::TargetHandleList l_dimmList; + + TARGETING:: getChildAffinityTargets( l_dimmList, i_pParent, + TARGETING::CLASS_LOGICAL_CARD, + TARGETING::TYPE_DIMM, l_functional); + + for (TARGETING::TargetHandleList::const_iterator + l_itr = l_dimmList.begin(); + l_itr != l_dimmList.end(); + ++l_itr) + { + + uint8_t l_mbaPort = + (*l_itr)->getAttr<TARGETING::ATTR_MBA_PORT>(); + + uint8_t l_mbaDimm = + (*l_itr)->getAttr<TARGETING::ATTR_MBA_DIMM>(); + + // if childPort was not set in the callout + // the caller is trying to callout either all dimms + // connected to this MBA or a specific dimm number on both + // ports + if( i_childPort == FAPI_ALL_MBA_PORTS ) + { + // if the caller reqested all children on all ports + // or if this dimm matches the requested dimm on + // either port then add it + if( ( i_childNumber == FAPI_ALL_MBA_DIMMS ) || + ( i_childNumber == l_mbaDimm )) + { + FAPI_DBG("adding callout for i_childNumber=%d " + "and i_childPort %d ", + i_childNumber, i_childPort ); + + o_childTargets.push_back( *l_itr ); + } + } + else + { + // if caller requested all dimms on a specific port or if this + // child is the one requested then add it + if((( i_childNumber == FAPI_ALL_MBA_DIMMS ) || + ( i_childNumber == l_mbaDimm )) && + ( i_childPort == l_mbaPort )) + { + FAPI_DBG("adding callout for i_childNumber=%d " + " and i_childPort %d", + i_childNumber, i_childPort ); + + o_childTargets.push_back( *l_itr ); + } + } + } + } + else + { + TARGETING::getChildChiplets(o_childTargets, i_pParent, i_childType); + } +} + //****************************************************************************** // fapiRcToErrl function. Converts a fapi::ReturnCode to an error log //****************************************************************************** @@ -468,7 +553,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc, { // PLAT error. Release the errlHndl_t FAPI_ERR("fapiRcToErrl: PLAT error: 0x%08x", - static_cast<uint32_t>(io_rc)); + static_cast<uint32_t>(io_rc)); l_pError = reinterpret_cast<errlHndl_t> (io_rc.releasePlatData()); } else if (l_creator == ReturnCode::CREATOR_HWP) @@ -492,7 +577,7 @@ errlHndl_t fapiRcToErrl(ReturnCode & io_rc, // Add the rcValue as FFDC. This will explain what the error was l_pError->addFFDC(HWPF_COMP_ID, &l_rcValue, sizeof(l_rcValue), 1, - HWPF_UDT_HWP_RCVALUE); + HWPF_UDT_HWP_RCVALUE); // Get the Error Information Pointer const ErrorInfo * l_pErrorInfo = io_rc.getErrorInfo(); diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C index 939f695cf..0aad15fbf 100644 --- a/src/usr/hwpf/plat/fapiPlatUtil.C +++ b/src/usr/hwpf/plat/fapiPlatUtil.C @@ -92,20 +92,15 @@ fapi::ReturnCode fapiDelay(uint64_t i_nanoSeconds, uint64_t i_simCycles) // fapiLogError //****************************************************************************** void fapiLogError(fapi::ReturnCode & io_rc, - fapi::fapiErrlSeverity_t i_sev) + fapi::fapiErrlSeverity_t i_sev, + bool i_unitTestError) { // ENUM CONVERSION FAPI to PLATFORM errlHndl_t l_pError = NULL; - bool l_unitTestError = false; FAPI_ERR("fapiLogError: logging error"); - if (fapi::RC_TEST_ERROR_A == static_cast<uint32_t>(io_rc)) - { - l_unitTestError = true; - } - // Convert a FAPI severity to a ERRORLOG severity ERRORLOG::errlSeverity_t l_sev = ERRORLOG::ERRL_SEV_UNRECOVERABLE; switch (i_sev) @@ -130,7 +125,7 @@ void fapiLogError(fapi::ReturnCode & io_rc, // Commit the error log. This will delete the error log and set the handle // to NULL. - if (l_unitTestError) + if (i_unitTestError) { errlCommit(l_pError, CXXTEST_COMP_ID); } diff --git a/src/usr/hwpf/test/fapiRcTest.C b/src/usr/hwpf/test/fapiRcTest.C index 1de3728a1..0e9949924 100644 --- a/src/usr/hwpf/test/fapiRcTest.C +++ b/src/usr/hwpf/test/fapiRcTest.C @@ -640,7 +640,7 @@ uint32_t rcTest12() l_entries[3].target_cdg.iv_gard = 0; l_entries[3].target_cdg.iv_calloutPriority = fapi::CalloutPriorities::HIGH; l_entries[4].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; - l_entries[4].children_cdg.iv_parentChipObjIndex = 1; + l_entries[4].children_cdg.iv_parentObjIndex = 1; l_entries[4].children_cdg.iv_callout = 0; l_entries[4].children_cdg.iv_deconfigure = 1; l_entries[4].children_cdg.iv_childType = fapi::TARGET_TYPE_ABUS_ENDPOINT; @@ -804,7 +804,7 @@ uint32_t rcTest12() break; } - if (l_pErrInfo->iv_childrenCDGs[0]->iv_parentChip != l_target) + if (l_pErrInfo->iv_childrenCDGs[0]->iv_parent != l_target) { FAPI_ERR("rcTest12. parent chip mismatch"); l_result = 19; @@ -1174,7 +1174,7 @@ uint32_t rcTest16() l_entries[7].bus_callout.iv_endpoint2ObjIndex = 3; l_entries[7].bus_callout.iv_calloutPriority = fapi::CalloutPriorities::HIGH; l_entries[8].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; - l_entries[8].children_cdg.iv_parentChipObjIndex = 2; + l_entries[8].children_cdg.iv_parentObjIndex = 2; l_entries[8].children_cdg.iv_callout = 1; l_entries[8].children_cdg.iv_deconfigure = 1; l_entries[8].children_cdg.iv_childType = fapi::TARGET_TYPE_ABUS_ENDPOINT; @@ -1182,7 +1182,7 @@ uint32_t rcTest16() l_entries[8].children_cdg.iv_calloutPriority = fapi::CalloutPriorities::HIGH; l_entries[9].iv_type = fapi::ReturnCode::EI_TYPE_CHILDREN_CDG; - l_entries[9].children_cdg.iv_parentChipObjIndex = 3; + l_entries[9].children_cdg.iv_parentObjIndex = 3; l_entries[9].children_cdg.iv_callout = 1; l_entries[9].children_cdg.iv_deconfigure = 0; l_entries[9].children_cdg.iv_childType = fapi::TARGET_TYPE_MBA_CHIPLET; @@ -1436,7 +1436,7 @@ uint32_t rcTest16() break; } - if (l_pErrInfo->iv_childrenCDGs[0]->iv_parentChip != l_target) + if (l_pErrInfo->iv_childrenCDGs[0]->iv_parent != l_target) { FAPI_ERR("rcTest16. parent chip mismatch 1"); l_result = 31; diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H index fc2f9e584..c1f2a8157 100644 --- a/src/usr/hwpf/test/hwpftest.H +++ b/src/usr/hwpf/test/hwpftest.H @@ -198,16 +198,25 @@ public: // Create a FAPI Target and invoke the hwpTestError HWP. The HWP // returns an error to test out error handling fapi::Target l_fapiTarget(TARGET_TYPE_PROC_CHIP, - reinterpret_cast<void *> (l_pTarget)); + reinterpret_cast<void *> (l_pTarget)); + + TARGETING::TargetHandleList l_mbaTargetList; + TARGETING::getAllChiplets(l_mbaTargetList, TARGETING::TYPE_MBA); - FAPI_INVOKE_HWP(l_err, hwpTestError, l_fapiTarget); + // just grab the first one in the list. + TARGETING::Target * l_mbaTarget = l_mbaTargetList[0]; + // Cast to a FAPI type of target. + fapi::Target l_fapiMbaTarget( fapi::TARGET_TYPE_MBA_CHIPLET, + (reinterpret_cast<void *>( l_mbaTarget)) ); + + FAPI_INVOKE_HWP(l_err, hwpTestError, l_fapiTarget, l_fapiMbaTarget); if (l_err) { // Delete the error rather than committing it to avoid it getting // interpreted as a real problem TS_TRACE("testHwpf2: Unit Test passed. " - "hwpTestError failed. Error deleted"); + "hwpTestError failed. Error deleted"); delete l_err; l_err = NULL; } @@ -895,6 +904,7 @@ public: } while(0); } + }; #endif |

