From ae6df59506b64974d5fb330d2800370a3e93c0b0 Mon Sep 17 00:00:00 2001 From: "Sunil.Kumar" Date: Tue, 26 Jul 2016 08:36:33 -0500 Subject: 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 Tested-by: FSP CI Jenkins Reviewed-by: RAJA DAS Reviewed-by: Sachin Gupta Reviewed-by: AMIT J. TENDOLKAR --- src/sbefw/sbecmdgeneric.C | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src/sbefw/sbecmdgeneric.C') 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 +} -- cgit v1.2.1