diff options
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H | 31 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 131 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiHwpErrorInfo.xml | 12 | ||||
-rwxr-xr-x | src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl | 44 |
4 files changed, 159 insertions, 59 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H b/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H index a3c1c46ef..30329cc75 100644 --- a/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H +++ b/src/include/usr/hwpf/fapi/fapiCollectRegFfdc.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -23,12 +23,13 @@ /** * @file fapiCollectRegFfdc.H * - * @brief Defines the fapiCollectRegFfdc function that collects chip register - * FFDC data. This is called automatically by FAPI_SET_HWP_ERROR (when - * a HWP creates an error) and FAPI_ADD_INFO_TO_HWP_ERROR (when an FFDC - * HWP adds error information to an existing error) if the error XML - * contains a <collectRegisterFfdc> element. This function should not - * be called directly by any user code. The function implementation is + * @brief Defines the fapiCollectRegFfdc function that collects chip or + * chiplet register FFDC data. This is called automatically by + * FAPI_SET_HWP_ERROR (when a HWP creates an error) and + * FAPI_ADD_INFO_TO_HWP_ERROR (when an FFDC HWP adds error information + * to an existing error) if the error XML contains a + * <collectRegisterFfdc> element. This function should not be called + * directly by any user code. The function implementation is * automatically generated from FAPI Error XML files. */ @@ -37,13 +38,15 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 09/19/2012 Created. + * dedahle 09/30/2013 Add i_child parameter for + * chiplet register FFDC */ #ifndef FAPICOLLECTREGFFDC_H_ #define FAPICOLLECTREGFFDC_H_ #include <fapiHwpErrorInfo.H> - +#include <fapiTarget.H> namespace fapi { @@ -51,7 +54,7 @@ class Target; class ReturnCode; /** - * @brief Collects Register FFDC from a chip + * @brief Collects Register FFDC from a chip or chiplet * * This should only be called by FAPI during FAPI_SET_HWP_ERROR or * FAPI_ADD_INFO_TO_HWP_ERROR @@ -59,10 +62,18 @@ class ReturnCode; * @param[in] i_target Reference to Target to collect FFDC from * @param[in] i_ffdcId FFDC Identifier * @param[out] o_rc Reference to ReturnCode that FFDC is added to + * @param[in] i_child Specifies type of i_target's chiplet to collect + * FFDC from. If this parameter is TARGET_TYPE_NONE + * (default value), then register FFDC is collected + * from i_target, else, register FFDC is collected + * from all functional child chiplets i_target of + * the specified type */ void fapiCollectRegFfdc(const fapi::Target & i_target, const fapi::HwpFfdcId i_ffdcId, - fapi::ReturnCode & o_rc); + fapi::ReturnCode & o_rc, + const fapi::TargetType i_child = + fapi::TARGET_TYPE_NONE); } #endif diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index 03689f7af..dc20d3625 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -58,6 +58,7 @@ # mjjones 06/24/13 Support Children CDGs # 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 # # End Change Log ****************************************************** @@ -282,11 +283,13 @@ print CRFILE "#include <fapiReturnCode.H>\n"; print CRFILE "#include <fapiHwAccess.H>\n"; print CRFILE "#include <fapiPlatTrace.H>\n"; print CRFILE "#include <fapiPlatRegAddresses.H>\n\n"; +print CRFILE "#include <fapiPlatAttributeService.H>\n\n"; print CRFILE "namespace fapi\n"; print CRFILE "{\n"; print CRFILE "void fapiCollectRegFfdc(const fapi::Target & i_target,\n"; print CRFILE " const fapi::HwpFfdcId i_ffdcId,\n"; -print CRFILE " fapi::ReturnCode & o_rc)\n"; +print CRFILE " fapi::ReturnCode & o_rc,\n"; +print CRFILE " fapi::TargetType i_child)\n"; print CRFILE "{\n"; print CRFILE " FAPI_INF(\"fapiCollectRegFfdc. FFDC ID: 0x%x\", i_ffdcId);\n"; print CRFILE " fapi::ReturnCode l_rc;\n"; @@ -425,17 +428,26 @@ foreach my $argnum (1 .. $#ARGV) print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. id(s) missing from collectRegisterFfdc\n"); exit(1); } - - if (! exists $collectRegisterFfdc->{target}) - { - print ("fapiParseErrorInfo.pl ERROR in $err->{rc}. target missing from collectRegisterFfdc\n"); - exit(1); - } - foreach my $id (@{$collectRegisterFfdc->{id}}) { - print EIFILE "fapiCollectRegFfdc($collectRegisterFfdc->{target}, "; - print EIFILE "fapi::$id, RC); "; + #------------------------------------------------------------------ + # If collecting chiplet register FFDC, insert childType parameter + #------------------------------------------------------------------ + if (exists $collectRegisterFfdc->{childTargets}) + { + print EIFILE "fapiCollectRegFfdc($collectRegisterFfdc->{childTargets}->{parent}, "; + print EIFILE "fapi::$id, RC, fapi::$collectRegisterFfdc->{childTargets}->{childType}); "; + } + else + { + if (! exists $collectRegisterFfdc->{target}) + { + print ("fapiParseErrorInfo.pl ERROR. target missing from collectRegisterFfdc\n"); + exit(1); + } + print EIFILE "fapiCollectRegFfdc($collectRegisterFfdc->{target}, "; + print EIFILE "fapi::$id, RC); "; + } } } @@ -869,41 +881,96 @@ print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: Invalid FFDC ID 0x%x\ print CRFILE "i_ffdcId);\n"; print CRFILE " return;\n"; print CRFILE " }\n\n"; -print CRFILE " uint8_t * l_pBuf = new uint8_t[l_ffdcSize];\n"; -print CRFILE " uint8_t * l_pData = l_pBuf;\n\n"; -print CRFILE " for (std::vector<uint32_t>::const_iterator cfamIter = l_cfamAddresses.begin();\n"; -print CRFILE " cfamIter != l_cfamAddresses.end(); ++cfamIter)\n"; +print CRFILE " uint8_t * l_pBuf = NULL;\n"; +print CRFILE " uint8_t * l_pData = NULL;\n"; +print CRFILE " std::vector<fapi::Target> l_targets;\n"; +print CRFILE " uint32_t l_chipletPos32 = 0;\n"; +print CRFILE " l_ffdcSize += sizeof(l_chipletPos32);\n"; +print CRFILE " if (fapi::TARGET_TYPE_NONE != i_child)\n"; print CRFILE " {\n"; -print CRFILE " l_rc = fapiGetCfamRegister(i_target, *cfamIter, l_buf);\n"; +print CRFILE " l_rc = fapiGetChildChiplets(i_target, i_child, l_targets, TARGET_STATE_FUNCTIONAL);\n"; print CRFILE " if (l_rc)\n"; print CRFILE " {\n"; -print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: CFAM error for 0x%x\","; -print CRFILE "*cfamIter);\n"; -print CRFILE " l_cfamData = 0xbaddbadd;\n"; +print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: Error: fapiGetChildChiplets: failed to get chiplets.\");\n"; +print CRFILE " return;\n"; print CRFILE " }\n"; -print CRFILE " else\n"; +print CRFILE " if (l_targets.empty())\n"; print CRFILE " {\n"; -print CRFILE " l_cfamData = l_buf.getWord(0);\n"; +print CRFILE " FAPI_INF(\"fapiCollectRegFfdc.C: Error: No functional chiplets found. \");\n"; +print CRFILE " return;\n"; print CRFILE " }\n"; -print CRFILE " *(reinterpret_cast<uint32_t *>(l_pData)) = l_cfamData;\n"; -print CRFILE " l_pData += sizeof(l_cfamData);\n"; +print CRFILE " l_ffdcSize *= l_targets.size();\n"; +print CRFILE " l_pBuf = new uint8_t[l_ffdcSize];\n"; +print CRFILE " l_pData = l_pBuf;\n"; +print CRFILE " }\n"; +print CRFILE " else\n"; +print CRFILE " {\n"; +print CRFILE " l_pBuf = new uint8_t[l_ffdcSize];\n"; +print CRFILE " l_pData = l_pBuf;\n"; +print CRFILE " l_targets.push_back(i_target);\n"; print CRFILE " }\n\n"; -print CRFILE " for (std::vector<uint64_t>::const_iterator scomIter = l_scomAddresses.begin();\n"; -print CRFILE " scomIter != l_scomAddresses.end(); ++scomIter)\n"; +print CRFILE " for (std::vector<fapi::Target>::const_iterator targetIter = l_targets.begin();\n"; +print CRFILE " targetIter != l_targets.end(); ++targetIter)\n"; print CRFILE " {\n"; -print CRFILE " l_rc = fapiGetScom(i_target, *scomIter, l_buf);\n"; -print CRFILE " if (l_rc)\n"; +print CRFILE " if (fapi::TARGET_TYPE_NONE != i_child)\n"; print CRFILE " {\n"; -print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: SCOM error for 0x%llx\","; -print CRFILE "*scomIter);\n"; -print CRFILE " l_scomData = 0xbaddbaddbaddbaddULL;\n"; +print CRFILE " uint8_t l_chipletPos = 0;\n"; +print CRFILE " l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &(*targetIter), l_chipletPos);\n"; +print CRFILE " if (l_rc)\n"; +print CRFILE " {\n"; +print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: Error getting chiplet position\");\n"; +print CRFILE " l_chipletPos = 0xFF;\n"; +print CRFILE " }\n"; +print CRFILE " // We print the target's position in the error log whether the target is a\n"; +print CRFILE " // chip or chiplet, so we need to store the chiplet position in a uint32_t\n"; +print CRFILE " // to have consitency in the buffer as ATTR_POS below returns a uint32_t\n"; +print CRFILE " l_chipletPos32 = l_chipletPos;\n"; print CRFILE " }\n"; print CRFILE " else\n"; print CRFILE " {\n"; -print CRFILE " l_scomData = l_buf.getDoubleWord(0);\n"; +print CRFILE " l_rc = FAPI_ATTR_GET(ATTR_POS, &(*targetIter), l_chipletPos32);\n"; +print CRFILE " if (l_rc)\n"; +print CRFILE " {\n"; +print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: Error getting chip position\");\n"; +print CRFILE " l_chipletPos32 = 0xFFFFFFFF;\n"; +print CRFILE " }\n"; +print CRFILE " }\n"; +print CRFILE " *(reinterpret_cast<uint32_t *>(l_pData)) = l_chipletPos32;\n"; +print CRFILE " l_pData += sizeof(l_chipletPos32);\n"; +print CRFILE " for (std::vector<uint32_t>::const_iterator cfamIter = l_cfamAddresses.begin();\n"; +print CRFILE " cfamIter != l_cfamAddresses.end(); ++cfamIter)\n"; +print CRFILE " {\n"; +print CRFILE " l_rc = fapiGetCfamRegister(*targetIter, *cfamIter, l_buf);\n"; +print CRFILE " if (l_rc)\n"; +print CRFILE " {\n"; +print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: CFAM error for 0x%x\","; +print CRFILE "*cfamIter);\n"; +print CRFILE " l_cfamData = 0xbaddbadd;\n"; +print CRFILE " }\n"; +print CRFILE " else\n"; +print CRFILE " {\n"; +print CRFILE " l_cfamData = l_buf.getWord(0);\n"; +print CRFILE " }\n"; +print CRFILE " *(reinterpret_cast<uint32_t *>(l_pData)) = l_cfamData;\n"; +print CRFILE " l_pData += sizeof(l_cfamData);\n"; +print CRFILE " }\n\n"; +print CRFILE " for (std::vector<uint64_t>::const_iterator scomIter = l_scomAddresses.begin();\n"; +print CRFILE " scomIter != l_scomAddresses.end(); ++scomIter)\n"; +print CRFILE " {\n"; +print CRFILE " l_rc = fapiGetScom(*targetIter, *scomIter, l_buf);\n"; +print CRFILE " if (l_rc)\n"; +print CRFILE " {\n"; +print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: SCOM error for 0x%llx\","; +print CRFILE "*scomIter);\n"; +print CRFILE " l_scomData = 0xbaddbaddbaddbaddULL;\n"; +print CRFILE " }\n"; +print CRFILE " else\n"; +print CRFILE " {\n"; +print CRFILE " l_scomData = l_buf.getDoubleWord(0);\n"; +print CRFILE " }\n"; +print CRFILE " *(reinterpret_cast<uint64_t *>(l_pData)) = l_scomData;\n"; +print CRFILE " l_pData += sizeof(l_scomData);\n"; print CRFILE " }\n"; -print CRFILE " *(reinterpret_cast<uint64_t *>(l_pData)) = l_scomData;\n"; -print CRFILE " l_pData += sizeof(l_scomData);\n"; print CRFILE " }\n\n"; print CRFILE " o_rc.addEIFfdc(i_ffdcId, l_pBuf, l_ffdcSize);\n"; print CRFILE " delete [] l_pBuf;\n"; diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml index e64415dd0..aaca27edf 100644 --- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml +++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml @@ -39,6 +39,18 @@ <id>REG_FFDC_TEST_X_PROC_REGISTERS</id> <target>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</target> </collectRegisterFfdc> + +<!-- Collect child chiplet register FFDC --> +<!-- + <collectRegisterFfdc> + <id>REG_FFDC_TEST_X_PROC_REGISTERS</id> + <childTargets> + <parent>UNIT_TEST_FFDC_MASTER_CHIP_TARGET</parent> + <childType>TARGET_TYPE_EX_CHIPLET</childType> + </childTargets> + </collectRegisterFfdc> +--> + <!-- Call hwpTestFfdc1 to collect additional FFDC from the master chip --> <collectFfdc>hwpTestFfdc1, UNIT_TEST_FFDC_MASTER_CHIP_TARGET</collectFfdc> <!-- Add some integer data as FFDC --> diff --git a/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl b/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl index c5de43ae9..6a57389c5 100755 --- a/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl +++ b/src/usr/hwpf/plat/fapiPlatCreateHwpErrParser.pl @@ -142,6 +142,7 @@ print TGFILE " const uint32_t i_buflen)\n"; print TGFILE "{\n"; print TGFILE " const uint32_t CFAM_DATA_LEN = 4;\n"; print TGFILE " const uint32_t SCOM_DATA_LEN = 8;\n"; +print TGFILE " const uint32_t POS_LEN = 4;\n"; print TGFILE " uint8_t * l_pBuffer = static_cast<uint8_t *>(i_pBuffer);\n"; print TGFILE " int32_t l_buflen = i_buflen;\n\n"; print TGFILE " // The first uint32_t is the FFDC ID\n"; @@ -208,29 +209,38 @@ foreach my $argnum (1 .. $#ARGV) my $ffdcHash32Bit = substr($ffdcHash128Bit, 0, 8); print TGFILE " case 0x$ffdcHash32Bit:\n"; print TGFILE " i_parser.PrintString(\"Register FFDC:\", \"$ffdcName\");\n"; - + print TGFILE " while (l_buflen > 0)\n"; + print TGFILE " {\n"; + print TGFILE " if (l_buflen >= POS_LEN)\n"; + print TGFILE " {\n"; + print TGFILE " uint32_t * l_pBufferTemp = reinterpret_cast<uint32_t *>(l_pBuffer);\n"; + print TGFILE " i_parser.PrintNumber(\"Chip Position:\",\"%X\",ntohl(*l_pBufferTemp));\n"; + print TGFILE " l_pBufferTemp = NULL;\n"; + print TGFILE " l_pBuffer+= POS_LEN;\n"; + print TGFILE " l_buflen -= POS_LEN;\n"; + print TGFILE " }\n"; foreach my $cfamRegister (@{$registerFfdc->{cfamRegister}}) { - print TGFILE " if (l_buflen >= CFAM_DATA_LEN)\n"; - print TGFILE " {\n"; - print TGFILE " i_parser.PrintString(NULL, \"$cfamRegister\");\n"; - print TGFILE " i_parser.PrintHexDump(l_pBuffer, CFAM_DATA_LEN);\n"; - print TGFILE " }\n"; - print TGFILE " l_pBuffer+= CFAM_DATA_LEN;\n"; - print TGFILE " l_buflen -= CFAM_DATA_LEN;\n"; + print TGFILE " if (l_buflen >= CFAM_DATA_LEN)\n"; + print TGFILE " {\n"; + print TGFILE " i_parser.PrintString(\"CFAM Register:\", \"$cfamRegister\");\n"; + print TGFILE " i_parser.PrintHexDump(l_pBuffer, CFAM_DATA_LEN);\n"; + print TGFILE " l_pBuffer+= CFAM_DATA_LEN;\n"; + print TGFILE " l_buflen -= CFAM_DATA_LEN;\n"; + print TGFILE " }\n"; } - foreach my $scomRegister (@{$registerFfdc->{scomRegister}}) { - print TGFILE " if (l_buflen >= SCOM_DATA_LEN)\n"; - print TGFILE " {\n"; - print TGFILE " i_parser.PrintString(NULL, \"$scomRegister\");\n"; - print TGFILE " i_parser.PrintHexDump(l_pBuffer, SCOM_DATA_LEN);\n"; - print TGFILE " }\n"; - print TGFILE " l_pBuffer+= SCOM_DATA_LEN;\n"; - print TGFILE " l_buflen -= SCOM_DATA_LEN;\n"; - } + print TGFILE " if (l_buflen >= SCOM_DATA_LEN)\n"; + print TGFILE " {\n"; + print TGFILE " i_parser.PrintString(\"SCOM Register:\", \"$scomRegister\");\n"; + print TGFILE " i_parser.PrintHexDump(l_pBuffer, SCOM_DATA_LEN);\n"; + print TGFILE " l_pBuffer+= SCOM_DATA_LEN;\n"; + print TGFILE " l_buflen -= SCOM_DATA_LEN;\n"; + print TGFILE " }\n"; + } + print TGFILE " }\n"; print TGFILE " break;\n"; } } |