diff options
author | Sunil.Kumar <skumar8j@in.ibm.com> | 2016-07-26 08:36:33 -0500 |
---|---|---|
committer | AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> | 2016-09-13 06:45:28 -0400 |
commit | ae6df59506b64974d5fb330d2800370a3e93c0b0 (patch) | |
tree | fbdd477663a94491cfc59be19e5e29eae6ca0413 /src/sbefw | |
parent | 618c1dd87d43f3e516dfb0dd50583febec8b95c8 (diff) | |
download | talos-sbe-ae6df59506b64974d5fb330d2800370a3e93c0b0.tar.gz talos-sbe-ae6df59506b64974d5fb330d2800370a3e93c0b0.zip |
RTC 128326 SBE : SBE ChipOps : Generic Messages : Get SBE FFDC
Change-Id: I034a43f67244a6f5e50c54b10f8bd4e013c6076a
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27610
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r-- | src/sbefw/sbeFFDC.C | 14 | ||||
-rw-r--r-- | src/sbefw/sbeFFDC.H | 8 | ||||
-rw-r--r-- | src/sbefw/sbeFifoMsgUtils.C | 2 | ||||
-rw-r--r-- | src/sbefw/sbecmdgeneric.C | 54 | ||||
-rw-r--r-- | src/sbefw/sbecmdgeneric.H | 9 | ||||
-rw-r--r-- | src/sbefw/sbecmdparser.C | 6 |
6 files changed, 87 insertions, 6 deletions
diff --git a/src/sbefw/sbeFFDC.C b/src/sbefw/sbeFFDC.C index 88bee00d..3a8e24e7 100644 --- a/src/sbefw/sbeFFDC.C +++ b/src/sbefw/sbeFFDC.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -36,17 +37,20 @@ * @param[in] i_secStatus - Secondary status of Chip op * @param[in] i_fieldsConfig - bitmap indicating the field * to be sent in FFDC - * * @param[out] o_bytesSent -number of bytes sent * + * @param[in] i_skipffdcBitCheck - Boolean to indicate whether + * ffdc bit should be checked or not. + * By default it is false. * @return - SBE secondary RC */ uint32_t SbeFFDCPackage::sendOverFIFO(uint32_t i_primStatus, uint32_t i_secStatus, uint32_t i_fieldsConfig, - uint32_t &o_bytesSent) + uint32_t &o_bytesSent, + bool i_skipffdcBitCheck) { - #define SBE_FUNC "sbeSendFFDCPackageFIFO " + #define SBE_FUNC "sendOverFIFO" SBE_ENTER(SBE_FUNC); uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL; uint32_t length = 0; @@ -57,7 +61,9 @@ uint32_t SbeFFDCPackage::sendOverFIFO(uint32_t i_primStatus, o_bytesSent = 0; //check if SBE internal FFDC should be generated - if(SbeRegAccess::theSbeRegAccess().isSendInternalFFDCSet() == false) + if(!i_skipffdcBitCheck && + (SbeRegAccess::theSbeRegAccess().isSendInternalFFDCSet() + == false)) { SBE_INFO(SBE_FUNC" isSendInternalFFDCSet()=false, " "not generating SBE InternalFFDC"); diff --git a/src/sbefw/sbeFFDC.H b/src/sbefw/sbeFFDC.H index 514b9caf..995840a8 100644 --- a/src/sbefw/sbeFFDC.H +++ b/src/sbefw/sbeFFDC.H @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -95,12 +96,17 @@ public: * * @param[out] o_bytesSent -number of bytes sent * + * @param[in] i_skipffdciBitCheck + * - boolean to indicate whether + * ffdc bit should be checked or not. + * By Default it is false. * @return - SBE secondary RC */ uint32_t sendOverFIFO(uint32_t i_primStatus, uint32_t i_secStatus, uint32_t i_fieldsConfig, - uint32_t &o_bytesSent); + uint32_t &o_bytesSent, + bool i_skipffdcBitCheck = false); /* TODO via RTC:150786 * @brief sendOverHOST - method to pack and send SBE internal FFDC diff --git a/src/sbefw/sbeFifoMsgUtils.C b/src/sbefw/sbeFifoMsgUtils.C index 6edc341e..4525d20f 100644 --- a/src/sbefw/sbeFifoMsgUtils.C +++ b/src/sbefw/sbeFifoMsgUtils.C @@ -338,7 +338,7 @@ uint32_t sbeDsSendRespHdr(const sbeRespGenHdr_t &i_hdr, distance += len; // If no ffdc , exit; - if( (i_ffdc != NULL) && i_ffdc->getRc() ) + if( (i_ffdc != NULL) && (i_ffdc->getRc() != FAPI2_RC_SUCCESS)) { // making sure ffdc length is multiples of uint32_t assert((g_FfdcData.ffdcLength % sizeof(uint32_t)) == 0); diff --git a/src/sbefw/sbecmdgeneric.C b/src/sbefw/sbecmdgeneric.C index 88e79d01..31165e50 100644 --- a/src/sbefw/sbecmdgeneric.C +++ b/src/sbefw/sbecmdgeneric.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -34,6 +35,7 @@ #include "sbe_sp_intf.H" #include "sbe_build_info.H" #include "sbeFifoMsgUtils.H" +#include "sbeFFDC.H" // Forward declaration sbeCapabilityRespMsg::sbeCapabilityRespMsg() @@ -47,6 +49,8 @@ sbeCapabilityRespMsg::sbeCapabilityRespMsg() { capability[idx] = 0; } + // @TODO via RTC : 160602 + // Update Capability flags based on lastes spec. capability[IPL_CAPABILITY_START_IDX] = EXECUTE_ISTEP_SUPPPORTED; @@ -57,6 +61,7 @@ sbeCapabilityRespMsg::sbeCapabilityRespMsg() PUT_SCOM_UNDER_MASK_SUPPPORTED ; capability[GENERIC_CHIPOP_CAPABILITY_START_IDX] = + GET_SBE_FFDC_SUPPPORTED | GET_SBE_CAPABILITIES_SUPPPORTED; capability[MEMORY_CAPABILITY_START_IDX] = @@ -115,3 +120,52 @@ uint32_t sbeGetCapabilities (uint8_t *i_pArg) return rc; #undef SBE_FUNC } + + +// Functions +//---------------------------------------------------------------------------- +uint32_t sbeGetFfdc (uint8_t *i_pArg) +{ + #define SBE_FUNC "sbeGetFfdc " + SBE_DEBUG(SBE_FUNC); + uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL; + uint32_t len = 0; + sbeRespGenHdr_t respHdr; + respHdr.init(); + + do + { + // Dequeue the EOT entry as no more data is expected. + rc = sbeUpFifoDeq_mult (len, NULL); + + if ( rc != SBE_SEC_OPERATION_SUCCESSFUL ) + { + // Let command processor routine to handle the RC + break; + } + + SbeFFDCPackage sbeFfdcPack; + len = 0; + //Send the FFDC data over FIFO. + // @TODO via RTC : 149074 + // primary and secondary status should be picked + // from the globals. + rc = sbeFfdcPack.sendOverFIFO(respHdr.primaryStatus, + respHdr.secondaryStatus, + SBE_FFDC_ALL_DUMP,len, + true); + if (rc) + { + break; + } + rc = sbeDsSendRespHdr(respHdr); + + }while(0); + + if( rc ) + { + SBE_ERROR( SBE_FUNC"Failed. rc[0x%X]", rc); + } + return rc; + #undef SBE_FUNC +} diff --git a/src/sbefw/sbecmdgeneric.H b/src/sbefw/sbecmdgeneric.H index 3fa174ad..451731ab 100644 --- a/src/sbefw/sbecmdgeneric.H +++ b/src/sbefw/sbecmdgeneric.H @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -33,6 +34,14 @@ #include <stdint.h> +/** + * @brief retrieve SBE FFDC on request from FSP. (0xA801) + * + * @param[in] i_pArg Buffer to be passed to the function (not used as of now) + * + * @return Rc from the FIFO access utility + */ +uint32_t sbeGetFfdc(uint8_t *i_pArg); /** * @brief SBE Generic capabilities (0xA802) diff --git a/src/sbefw/sbecmdparser.C b/src/sbefw/sbecmdparser.C index c22e67c7..b3398f40 100644 --- a/src/sbefw/sbecmdparser.C +++ b/src/sbefw/sbecmdparser.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -114,6 +115,11 @@ static sbeCmdStruct_t g_sbeGenericCmdArray [] = SBE_STATE_FFDC_COLLECT, // Fence in FFDC Collect State, since it might over-write traces }, + + {sbeGetFfdc, + SBE_CMD_GET_SBE_FFDC, + SBE_NO_FENCE, + }, }; ////////////////////////////////////////////////////////////// |