diff options
author | Mike Jones <mjjones@us.ibm.com> | 2011-10-06 15:30:27 -0500 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-10-11 16:24:46 -0500 |
commit | 17f630f5c2fabea998708dc2b2cb33120c388079 (patch) | |
tree | 148f26d81d8d33600a25eeda969a8169565978c8 /src/usr/hwpf/hwp | |
parent | 8c062af8b6bd50a59823c7ec430ec5fc019052d2 (diff) | |
download | talos-hostboot-17f630f5c2fabea998708dc2b2cb33120c388079.tar.gz talos-hostboot-17f630f5c2fabea998708dc2b2cb33120c388079.zip |
HWPF: Error Information Updates
Change-Id: I9857638a35f21489e32448af3bf95e0155954b29
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/425
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r-- | src/usr/hwpf/hwp/fapiHwpErrorInfo.xml | 29 | ||||
-rwxr-xr-x | src/usr/hwpf/hwp/fapiTestHwpAttr.C | 4 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpConfig.C | 4 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpError.C | 68 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpFfdc.C | 16 |
5 files changed, 68 insertions, 53 deletions
diff --git a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml index fb7e20439..62cd3badd 100644 --- a/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml +++ b/src/usr/hwpf/hwp/fapiHwpErrorInfo.xml @@ -27,29 +27,30 @@ <!-- *********************************************************************** --> <hwpError> <rc>RC_TEST_ERROR_A</rc> - <description>Test Error A for a HWP operating on a PROC_CHIP</description> + <description>Test Error A</description> + <!-- Call hwpTestFfdc1 to collect FFDC from the master chip --> + <collectFfdc>hwpTestFfdc1, MASTER_CHIP</collectFfdc> + <!-- Collect local FFDC FFDC_DATA_1 --> + <ffdc>FFDC_DATA_1</ffdc> + <!-- Callout MASTER_CHIP HIGH --> <callout> - <!-- The callout is the PROC_CHIP itself --> - <targetType>TARGET_TYPE_PROC_CHIP</targetType> - <targetPos>0</targetPos> + <target>MASTER_CHIP</target> <priority>HIGH</priority> </callout> + <!-- Deconfigure MASTER_CHIP --> + <deconfigure> + <target>MASTER_CHIP</target> + </deconfigure> + <!-- Create GARD record for MASTER_CHIP --> <gard> - <!-- The PROC_CHIP itself should be garded --> - <targetType>TARGET_TYPE_PROC_CHIP</targetType> - <targetPos>0</targetPos> + <target>MASTER_CHIP</target> </gard> - <ffdc> - <!-- FFDC needs to be collected from the PROC_CHIP itself --> - <targetType>TARGET_TYPE_PROC_CHIP</targetType> - <targetPos>0</targetPos> - <ffdcHwp>hwpTestFfdc1</ffdcHwp> - <ffdcHwpData>TestFfdc1</ffdcHwpData> - </ffdc> </hwpError> <!-- *********************************************************************** --> <hwpError> <rc>RC_TEST_ERROR_B</rc> <description>Test Error B</description> + <!-- Call hwpTestAnalyzeError on MASTER_CHIP to analyze the error --> + <callFunc>hwpTestAnalyzeError, MASTER_CHIP</callFunc> </hwpError> </hwpErrors> diff --git a/src/usr/hwpf/hwp/fapiTestHwpAttr.C b/src/usr/hwpf/hwp/fapiTestHwpAttr.C index 6cf43ee6a..d8693d610 100755 --- a/src/usr/hwpf/hwp/fapiTestHwpAttr.C +++ b/src/usr/hwpf/hwp/fapiTestHwpAttr.C @@ -33,6 +33,7 @@ * ------ -------------- ---------- ----------- ---------------------------- * mjjones 06/30/2011 Created. * mjjones 09/07/2011 Update to test scratch attrs + * mjjones 10/06/2011 Updates traces * */ @@ -46,7 +47,7 @@ extern "C" //****************************************************************************** fapi::ReturnCode hwpTestAttributes(const fapi::Target & i_target) { - FAPI_INF("Performing HWP: hwpTestAttributes"); + FAPI_INF("hwpTestAttributes: Start HWP"); // Attempt to call the attribute get/set macros for the scratch attributes fapi::ReturnCode l_rc; @@ -996,6 +997,7 @@ fapi::ReturnCode hwpTestAttributes(const fapi::Target & i_target) } while (0); + FAPI_INF("hwpTestAttributes: End HWP"); return l_rc; } diff --git a/src/usr/hwpf/hwp/fapiTestHwpConfig.C b/src/usr/hwpf/hwp/fapiTestHwpConfig.C index ce47b82df..41f89d01e 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpConfig.C +++ b/src/usr/hwpf/hwp/fapiTestHwpConfig.C @@ -32,6 +32,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 09/12/2011 Created. + * mjjones 10/06/2011 Updated traces. * */ @@ -45,7 +46,7 @@ extern "C" //****************************************************************************** fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip) { - FAPI_INF("Performing HWP: hwpTestConfig"); + FAPI_INF("hwpTestConfig: Start HWP"); // Print the ecmd string of the chip char l_string[fapi::MAX_ECMD_STRING_LEN] = {0}; @@ -110,6 +111,7 @@ fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip) } } + FAPI_INF("hwpTestConfig: End HWP"); return l_rc; } diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C index d1d7e5e5c..e0d2ef6da 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpError.C +++ b/src/usr/hwpf/hwp/fapiTestHwpError.C @@ -33,6 +33,8 @@ * mjjones 08/08/2011 Created. * camvanng 09/06/2011 Added code to test * fapiLogError + * mjjones 10/06/2011 Major updates due to new + * ErrorInfo design * */ @@ -42,54 +44,60 @@ extern "C" { //****************************************************************************** +// hwpTestAnalyzeError function +//****************************************************************************** +fapi::ReturnCode hwpTestAnalyzeError(const fapi::Target & i_target) +{ + FAPI_INF("hwpTestAnalyzeError: Start HWP (analysis HWP)"); + + // This HWP analyses an error condition to decide what the error actually is + // In real life, this HWP may look at chip error registers + fapi::ReturnCode l_rc; + + // Local FFDC that needs to be captured + uint32_t l_ffdc = 0x12345678; + + // Analysis reveals that the error is RC_TEST_ERROR_A + FAPI_ERR("hwpTestAnalyzeError: Generating RC_TEST_ERROR_A"); + + const fapi::Target & MASTER_CHIP = i_target; + uint32_t & FFDC_DATA_1 = l_ffdc; + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A); + + FAPI_INF("hwpTestAnalyzeError: End HWP"); + return l_rc; +} + +//****************************************************************************** // hwpTestError function //****************************************************************************** fapi::ReturnCode hwpTestError(const fapi::Target & i_target) { - FAPI_INF("Performing HWP: hwpTestError"); + FAPI_INF("hwpTestError: Start HWP"); - fapi::ReturnCode l_rc = fapi::RC_TEST_ERROR_A; + fapi::ReturnCode l_rc; - // Add some local FFDC to the ReturnCode - uint32_t l_ffdc = 0x12345678; - l_rc.setHwpFfdc(l_ffdc); + // Error RC_TEST_ERROR_B encountered, the error information requests that + // hwpTestAnalyzeError be called to analyze the error condition + FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_B"); + const fapi::Target & MASTER_CHIP = i_target; + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_B); // Log the error fapiLogError(l_rc); - // Check that the return code is set to success and any data or Error - // Target references are cleared + // Check that the return code is set to success if (!l_rc.ok()) { FAPI_ERR("Performing HWP: hwpTestError: rc is 0x%x, " \ "expected success", static_cast<uint32_t>(l_rc)); } - if (l_rc.getErrTarget() != NULL) - { - FAPI_ERR("Performing HWP: hwpTestError: getErrTarget " \ - "returned non-null pointer"); - } - - if (l_rc.getPlatData() != NULL) - { - FAPI_ERR("Performing HWP: hwpTestError: getPlatData " \ - "returned non-null pointer"); - } - - uint32_t l_size = 0; - if (l_rc.getHwpFfdc(l_size) != NULL) - { - FAPI_ERR("Performing HWP: hwpTestError: getHwpFFDC " \ - "returned non-null pointer"); - } - // Reset the return code - l_rc = fapi::RC_TEST_ERROR_A; - - // Add some local FFDC to the ReturnCode - l_rc.setHwpFfdc(reinterpret_cast<void *>(&l_ffdc), sizeof(uint32_t)); + FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_B"); + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_B); + FAPI_INF("hwpTestError: End HWP"); return l_rc; } diff --git a/src/usr/hwpf/hwp/fapiTestHwpFfdc.C b/src/usr/hwpf/hwp/fapiTestHwpFfdc.C index 69d3fb57a..57cc8fd3c 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpFfdc.C +++ b/src/usr/hwpf/hwp/fapiTestHwpFfdc.C @@ -31,6 +31,8 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/08/2011 Created. + * mjjones 10/06/2011 Updated due to new ErrorInfo + * design. * */ @@ -43,17 +45,17 @@ extern "C" // hwpTestFfdc1 function //****************************************************************************** fapi::ReturnCode hwpTestFfdc1(const fapi::Target & i_target, - fapi::TestFfdc1 & o_ffdc) + fapi::ReturnCode & o_rc) { - FAPI_INF("Performing FFDC HWP: hwpTestFfdc1"); + FAPI_INF("hwpTestFfdc1: Start HWP (FFDC HWP)"); - // Just set data to output structure. A real FFDC HWP would do a hardware - // access to get FFDC - fapi::ReturnCode l_rc; + // Collect a uint64_t worth of FFDC + uint64_t l_ffdc = 0x1122334455667788ULL; - o_ffdc.iv_data = 0x11223344; + fapi::ReturnCodeFfdc::addEIFfdc(o_rc, l_ffdc); - return l_rc; + FAPI_INF("hwpTestFfdc1: End HWP"); + return fapi::FAPI_RC_SUCCESS; } } // extern "C" |