summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunil.Kumar <skumar8j@in.ibm.com>2016-11-28 03:45:22 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-01-19 01:14:16 -0500
commit76b294bed6cd3aff8f8f74df8e0d2a09ca153e75 (patch)
tree2948ff38b7c12e169fef7cb19f178c2cd89e93dd /src
parentf7622cfdaafd77c57b93ade0d144c623eaec043f (diff)
downloadtalos-sbe-76b294bed6cd3aff8f8f74df8e0d2a09ca153e75.tar.gz
talos-sbe-76b294bed6cd3aff8f8f74df8e0d2a09ca153e75.zip
RTC 149074 Async Response of PSU operation from SBE
Change-Id: Ifb6be2cb5edd2e1abeb5766a54bc44439c67e8dd Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33045 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/sbefw/plugins/sbeUserDataParser.C5
-rw-r--r--src/sbefw/sbeFFDC.C5
-rw-r--r--src/sbefw/sbeFFDCType.H3
-rw-r--r--src/sbefw/sbeSpMsg.H2
-rw-r--r--src/sbefw/sbecmdgeneric.C40
-rw-r--r--src/test/testcases/testSbeDump.py12
-rw-r--r--src/test/testcases/testUtil.py2
7 files changed, 57 insertions, 12 deletions
diff --git a/src/sbefw/plugins/sbeUserDataParser.C b/src/sbefw/plugins/sbeUserDataParser.C
index 1e87ad53..b1f010a5 100644
--- a/src/sbefw/plugins/sbeUserDataParser.C
+++ b/src/sbefw/plugins/sbeUserDataParser.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -174,7 +174,8 @@ int parseSbeFFDC(ErrlUsrParser & i_parser, const void * i_pBuffer,
(uint16_t)l_pData.primaryStatus);
i_parser.PrintNumber("Secondary Status ", "0x%04X",
(uint16_t)l_pData.secondaryStatus);
-
+ i_parser.PrintNumber("FW Commit ID ", "0x%08X",
+ (uint32_t)l_pData.fwCommitID);
//loop through the number of fields configured
uint32_t l_dumpFields = l_pData.dumpFields.get();
while(l_dumpFields && !l_rc)
diff --git a/src/sbefw/sbeFFDC.C b/src/sbefw/sbeFFDC.C
index de8bd43f..826579f1 100644
--- a/src/sbefw/sbeFFDC.C
+++ b/src/sbefw/sbeFFDC.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -28,7 +28,7 @@
#include "sbeFifoMsgUtils.H"
#include "sberegaccess.H"
#include "sbeFFDC.H"
-
+#include "sbe_build_info.H"
/*
* @brief sendOverFIFO - method to pack and send SBE internal FFDC
* only if isSendInternalFFDCSet() is true
@@ -72,6 +72,7 @@ uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
// update the primary and secondary status
iv_sbeFFDCDataHeader.primaryStatus = i_hdr.primaryStatus;
iv_sbeFFDCDataHeader.secondaryStatus = i_hdr.secondaryStatus;
+ iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
// Set failed command information
// Sequence Id is 0 by default for Fifo interface
iv_sbeFFDCHeader.setCmdInfo(0, i_hdr.cmdClass, i_hdr.command);
diff --git a/src/sbefw/sbeFFDCType.H b/src/sbefw/sbeFFDCType.H
index 9d5a8477..8870d17f 100644
--- a/src/sbefw/sbeFFDCType.H
+++ b/src/sbefw/sbeFFDCType.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -95,6 +95,7 @@ typedef struct
{
uint32_t primaryStatus:16;//Chip Op Primary status
uint32_t secondaryStatus:16;//Chip Op Secondary status
+ uint32_t fwCommitID;// FW commit ID
sbeFFDCDumpFields_t dumpFields;//bitmapped dumpFields
} sbeFFDCDataHeader_t;
diff --git a/src/sbefw/sbeSpMsg.H b/src/sbefw/sbeSpMsg.H
index ace397ce..433f7132 100644
--- a/src/sbefw/sbeSpMsg.H
+++ b/src/sbefw/sbeSpMsg.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
diff --git a/src/sbefw/sbecmdgeneric.C b/src/sbefw/sbecmdgeneric.C
index cf8579c5..444548ee 100644
--- a/src/sbefw/sbecmdgeneric.C
+++ b/src/sbefw/sbecmdgeneric.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -138,7 +138,7 @@ uint32_t sbeGetCapabilities (uint8_t *i_pArg)
uint32_t sbeGetFfdc (uint8_t *i_pArg)
{
#define SBE_FUNC "sbeGetFfdc "
- SBE_DEBUG(SBE_FUNC);
+ SBE_ENTER(SBE_FUNC);
uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
uint32_t len = 0;
sbeRespGenHdr_t respHdr;
@@ -156,11 +156,45 @@ uint32_t sbeGetFfdc (uint8_t *i_pArg)
}
SbeFFDCPackage sbeFfdcPack;
- len = 0;
+ sbeResponseFfdc_t l_ffdc ;
+ l_ffdc.setRc(g_FfdcData.fapiRc);
+ SBE_INFO(SBE_FUNC"FAPI RC is %x", g_FfdcData.fapiRc);
+ // If no ffdc , exit;
+ if( (l_ffdc.getRc() != FAPI2_RC_SUCCESS))
+ {
+ // making sure ffdc length is multiples of uint32_t
+ assert((g_FfdcData.ffdcLength % sizeof(uint32_t)) == 0);
+ uint32_t ffdcDataLenInWords = g_FfdcData.ffdcLength
+ / sizeof(uint32_t);
+ // Set failed command information
+ // Sequence Id is 0 by default for Fifo interface
+ // @TODO via RTC : 149074
+ // primary and secondary status should be picked
+ // from the globals.
+ l_ffdc.setCmdInfo(0, respHdr.cmdClass, respHdr.command);
+ // Add HWP specific ffdc data length
+ l_ffdc.lenInWords += ffdcDataLenInWords;
+ len = sizeof(sbeResponseFfdc_t)/sizeof(uint32_t);
+ rc = sbeDownFifoEnq_mult ( len, ( uint32_t *) &l_ffdc);
+ if (rc)
+ {
+ break;
+ }
+ //Send HWP internal Data
+ rc = sbeDownFifoEnq_mult ( ffdcDataLenInWords,
+ ( uint32_t *) &g_FfdcData.ffdcData);
+ if (rc)
+ {
+ break;
+ }
+
+ }
//Send the FFDC data over FIFO.
// @TODO via RTC : 149074
// primary and secondary status should be picked
// from the globals.
+ // Check for Primary and Secondary Status from Globals and then send
+ // internal FFDC.
rc = sbeFfdcPack.sendOverFIFO(respHdr,
SBE_FFDC_ALL_DUMP,
len,
diff --git a/src/test/testcases/testSbeDump.py b/src/test/testcases/testSbeDump.py
index 3b273cdf..180795f6 100644
--- a/src/test/testcases/testSbeDump.py
+++ b/src/test/testcases/testSbeDump.py
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016
+# Contributors Listed Below - COPYRIGHT 2016,2017
# [+] International Business Machines Corp.
#
#
@@ -42,6 +42,10 @@ def main():
testUtil.writeUsFifo(TESTDATA)
testUtil.writeEot()
+ print ("\n HWP internal ffdc")
+ testUtil.extractHWPFFDC( True )
+
+ print ("\n SBE internal ffdc")
data = testUtil.readDsEntryReturnVal()
magicBytes = ((data[0] << 8) | data[1])
if (magicBytes == 0xFFDC) :
@@ -68,6 +72,10 @@ def main():
+ str(hex(secondaryStatus)))
data = testUtil.readDsEntryReturnVal()
+ commitID = ((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3])
+ print ("\ncommitID = " + str(hex(commitID)))
+
+ data = testUtil.readDsEntryReturnVal()
header = ((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3])
print ("\nHeader = " + str(hex(header)))
@@ -95,9 +103,9 @@ def main():
print("write to a file Done")
myBin.close()
- #Read the Exp data
print ("Read the Expected data")
testUtil.readDsFifo( EXPDATA )
+ print ("Read Eot")
testUtil.readEot( )
#-------------------------------------------------
diff --git a/src/test/testcases/testUtil.py b/src/test/testcases/testUtil.py
index 7620ebc5..5fd46307 100644
--- a/src/test/testcases/testUtil.py
+++ b/src/test/testcases/testUtil.py
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2016
+# Contributors Listed Below - COPYRIGHT 2015,2017
# [+] International Business Machines Corp.
#
#
OpenPOWER on IntegriCloud