summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-01-24 02:40:02 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2018-02-02 22:59:58 -0500
commit7be7840a672ab35234738a6287c95d312a5b3bc9 (patch)
treeaa28205fd8cc6e4f56b7973b25cb445b2cfe8580
parent035b8ccbe617bd2fa82498c185ea83eb62f02404 (diff)
downloadtalos-sbe-7be7840a672ab35234738a6287c95d312a5b3bc9.zip
talos-sbe-7be7840a672ab35234738a6287c95d312a5b3bc9.tar.gz
Store SBE failed rc for async FFDC
Store the SBE rc for failed command in globals Change-Id: I673ee6929fc1941233d5235d18412a747e596508 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52511 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>
-rw-r--r--src/sbefw/app/common/sbecmdgeneric.C15
-rw-r--r--src/sbefw/app/common/sbecmdscomaccess.C13
-rw-r--r--src/sbefw/app/power/sbecmdmemaccess.C34
-rw-r--r--src/sbefw/app/power/sbecmdsram.C10
-rw-r--r--src/sbefw/core/sbeFFDC.C28
-rw-r--r--src/sbefw/core/sbeFFDC.H14
-rw-r--r--src/sbefw/core/sbeFifoMsgUtils.C16
-rw-r--r--src/sbefw/core/sbeHostMsg.C27
-rw-r--r--src/sbefw/core/sbeHostMsg.H27
-rw-r--r--src/sbefw/core/sbeHostUtils.C17
-rw-r--r--src/sbefw/core/sbeSpMsg.C43
-rw-r--r--src/sbefw/core/sbeSpMsg.H35
-rw-r--r--src/sbefw/core/sbecmdprocessor.C2
-rw-r--r--src/sbefw/core/sbeglobals.C9
-rw-r--r--src/sbefw/core/sbeglobals.H7
-rw-r--r--src/sbefw/core/sbescom.C24
-rw-r--r--src/sbefw/core/sbeutil.H9
17 files changed, 190 insertions, 140 deletions
diff --git a/src/sbefw/app/common/sbecmdgeneric.C b/src/sbefw/app/common/sbecmdgeneric.C
index 0601c20..269c513 100644
--- a/src/sbefw/app/common/sbecmdgeneric.C
+++ b/src/sbefw/app/common/sbecmdgeneric.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -130,10 +131,8 @@ uint32_t sbeGetFfdc (uint8_t *i_pArg)
/ 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);
+ l_ffdc.setCmdInfo(0, SBE_GLOBAL->failedCmdClass,
+ SBE_GLOBAL->failedCmd);
// Add HWP specific ffdc data length
l_ffdc.lenInWords += ffdcDataLenInWords;
len = sizeof(sbeResponseFfdc_t)/sizeof(uint32_t);
@@ -152,13 +151,7 @@ uint32_t sbeGetFfdc (uint8_t *i_pArg)
}
//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,
+ rc = sbeFfdcPack.sendOverFIFO(SBE_FFDC_ALL_DUMP,
len,
true);
if (rc)
diff --git a/src/sbefw/app/common/sbecmdscomaccess.C b/src/sbefw/app/common/sbecmdscomaccess.C
index ebb838d..77a3c26 100644
--- a/src/sbefw/app/common/sbecmdscomaccess.C
+++ b/src/sbefw/app/common/sbecmdscomaccess.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -81,7 +82,7 @@ uint32_t sbeGetScom (uint8_t *i_pArg)
l_scomData, &l_hdr,
&l_ffdc);
- if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
+ if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"getscom failed, "
"scomAddr[0x%08X%08X]",
@@ -172,7 +173,7 @@ uint32_t sbePutScom (uint8_t *i_pArg)
checkIndirectAndDoScom(false, l_addr,
l_scomData, &l_hdr, &l_ffdc);
- if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
+ if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"putscom failure data, "
"scomAddr[0x%08X%08X], "
@@ -269,7 +270,7 @@ uint32_t sbeModifyScom (uint8_t *i_pArg)
checkIndirectAndDoScom(true, l_addr,
l_scomData, &l_hdr, &l_ffdc);
- if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
+ if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"getscom failed,"
" ScomAddress[0x%08X %08X]",
@@ -294,7 +295,7 @@ uint32_t sbeModifyScom (uint8_t *i_pArg)
checkIndirectAndDoScom(false, l_addr,
l_modifyingData, &l_hdr, &l_ffdc);
- if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
+ if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"putscom failed,"
" ScomAddress[0x%08X%08X]",
@@ -382,7 +383,7 @@ uint32_t sbePutScomUnderMask (uint8_t *i_pArg)
checkIndirectAndDoScom(true, l_addr,
l_scomData, &l_hdr, &l_ffdc);
- if (l_hdr.secondaryStatus == SBE_SEC_OPERATION_SUCCESSFUL) // scom success
+ if (l_hdr.secondaryStatus() == SBE_SEC_OPERATION_SUCCESSFUL) // scom success
{
l_putScomUmaskMsg.getScomData(l_scomData);
@@ -391,7 +392,7 @@ uint32_t sbePutScomUnderMask (uint8_t *i_pArg)
l_scomData, &l_hdr, &l_ffdc);
}
- if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
+ if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"scom failed, "
"ScomAddress[0x%08X%08X]",
diff --git a/src/sbefw/app/power/sbecmdmemaccess.C b/src/sbefw/app/power/sbecmdmemaccess.C
index 6efa57d..b34637d 100644
--- a/src/sbefw/app/power/sbecmdmemaccess.C
+++ b/src/sbefw/app/power/sbecmdmemaccess.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -191,14 +192,15 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
{
l_addr = i_hdr.getAddr();
// Check if the access to the address is allowed
- l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
+ uint16_t sbeRc = mainStoreSecMemRegionManager.isAccessAllowed(
{l_addr,
i_hdr.len,
(i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
- if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
+ if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
- l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
+ l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
+ sbeRc);
break;
}
}
@@ -274,7 +276,7 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
while (l_granulesCompleted < l_lenCacheAligned)
{
// Breaking out here if invalid size
- if(l_respHdr.primaryStatus != SBE_PRI_OPERATION_SUCCESSFUL)
+ if(l_respHdr.primaryStatus() != SBE_PRI_OPERATION_SUCCESSFUL)
{
break;
}
@@ -331,7 +333,7 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
// need to Flush out upstream FIFO, until EOT arrives
if (!i_isFlagRead)
{
- l_rc = flushUpstreamFifo(l_respHdr.primaryStatus);
+ l_rc = flushUpstreamFifo(l_respHdr.primaryStatus());
CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc);
}
@@ -466,14 +468,15 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
if(false == i_hdr.isTrustedOp())
{
// Check if the access to the address is allowed
- l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
+ uint16_t sbeRc = mainStoreSecMemRegionManager.isAccessAllowed(
{l_addr,
i_hdr.len,
(i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
- if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
+ if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
- l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
+ l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
+ sbeRc);
break;
}
}
@@ -635,7 +638,7 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
// need to Flush out upstream FIFO, until EOT arrives
if (!i_isFlagRead)
{
- l_rc = flushUpstreamFifo(l_respHdr.primaryStatus);
+ l_rc = flushUpstreamFifo(l_respHdr.primaryStatus());
CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc);
}
@@ -759,10 +762,10 @@ uint32_t sbeUpdateMemAccessRegion (uint8_t *i_pArg)
SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags);
uint16_t mode = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & 0x00FF;
+ uint16_t sbeRc = SBE_SEC_OPERATION_SUCCESSFUL;
if(mode == SBE_MEM_REGION_CLOSE)
{
- SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus =
- mainStoreSecMemRegionManager.remove(req.startAddress);
+ sbeRc = mainStoreSecMemRegionManager.remove(req.startAddress);
}
else
{
@@ -776,15 +779,14 @@ uint32_t sbeUpdateMemAccessRegion (uint8_t *i_pArg)
memMode = static_cast<uint8_t>(memRegionMode::READ) |
static_cast<uint8_t>(memRegionMode::WRITE);
}
- SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus =
- mainStoreSecMemRegionManager.add(req.startAddress,
+ sbeRc = mainStoreSecMemRegionManager.add(req.startAddress,
req.size,
memMode);
}
- if(SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus !=
- SBE_SEC_OPERATION_SUCCESSFUL)
+ if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
- SBE_GLOBAL->sbeSbe2PsuRespHdr.primStatus = SBE_PRI_USER_ERROR;
+ SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_USER_ERROR,
+ sbeRc);
}
} while(false);
diff --git a/src/sbefw/app/power/sbecmdsram.C b/src/sbefw/app/power/sbecmdsram.C
index 67bcf7e..1eb49dc 100644
--- a/src/sbefw/app/power/sbecmdsram.C
+++ b/src/sbefw/app/power/sbecmdsram.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -138,14 +139,15 @@ uint32_t sbeOccSramAccess_Wrap(const bool i_isGetFlag)
// For read access no checking is required
if( (l_validAddrForFirstAccess) && !( i_isGetFlag ))
{
- l_respHdr.secondaryStatus = occSramSecRegionManager.isAccessAllowed(
+ uint16_t sbeRc = occSramSecRegionManager.isAccessAllowed(
{static_cast<uint64_t>(l_req.addr)&(0x00000000FFFFFFFFull),
l_req.len,
(i_isGetFlag? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
- if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
+ if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
- l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
+ l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
+ sbeRc);
break;
}
}
@@ -251,7 +253,7 @@ uint32_t sbeOccSramAccess_Wrap(const bool i_isGetFlag)
{
// If there was a HWP failure for put sram occ request,
// need to Flush out upstream FIFO, until EOT arrives
- if ( l_respHdr.primaryStatus != SBE_PRI_OPERATION_SUCCESSFUL)
+ if ( l_respHdr.primaryStatus() != SBE_PRI_OPERATION_SUCCESSFUL)
{
l_rc = sbeUpFifoDeq_mult(l_len2dequeue, NULL,
true, true);
diff --git a/src/sbefw/core/sbeFFDC.C b/src/sbefw/core/sbeFFDC.C
index 9d94af2..6f73eb9 100644
--- a/src/sbefw/core/sbeFFDC.C
+++ b/src/sbefw/core/sbeFFDC.C
@@ -28,12 +28,18 @@
#include "sbeFifoMsgUtils.H"
#include "sberegaccess.H"
#include "sbeFFDC.H"
-#include "sbe_build_info.H"
#include "sbeglobals.H"
#include "sbecmdcntrldmt.H"
void SbeFFDCPackage::updateUserDataHeader(uint32_t i_fieldsConfig)
{
+ // Set failed command information
+ iv_sbeFFDCDataHeader.primaryStatus = SBE_GLOBAL->failedPrimStatus;
+ iv_sbeFFDCDataHeader.secondaryStatus = SBE_GLOBAL->failedSecStatus;
+ iv_sbeFFDCHeader.setCmdInfo(SBE_GLOBAL->failedSeqId,
+ SBE_GLOBAL->failedCmdClass,
+ SBE_GLOBAL->failedCmd);
+
//Update the user data header with dump fields configuration
iv_sbeFFDCDataHeader.dumpFields.set(i_fieldsConfig);
iv_sbeFFDCHeader.lenInWords = (sizeof(sbeResponseFfdc_t) +
@@ -75,8 +81,7 @@ uint32_t SbeFFDCPackage::collectAsyncHwpFfdc (void)
#undef SBE_FUNC
}
-uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
- const uint32_t i_fieldsConfig,
+uint32_t SbeFFDCPackage::sendOverFIFO(const uint32_t i_fieldsConfig,
uint32_t &o_bytesSent,
const bool i_skipffdcBitCheck)
{
@@ -101,14 +106,6 @@ uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
break;
}
- // update the primary and secondary status
- iv_sbeFFDCDataHeader.primaryStatus = i_hdr.primaryStatus;
- iv_sbeFFDCDataHeader.secondaryStatus = i_hdr.secondaryStatus;
- iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
- iv_sbeFFDCDataHeader.ddLevel = SBE_FFDC_DD2;
- // Set failed command information
- // Sequence Id is 0 by default for Fifo interface
- iv_sbeFFDCHeader.setCmdInfo(0, i_hdr.cmdClass, i_hdr.command);
//Update the user data header with dump fields configuration
updateUserDataHeader(i_fieldsConfig);
@@ -167,8 +164,7 @@ uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
#undef SBE_FUNC
}
-uint32_t SbeFFDCPackage::sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
- const uint32_t i_fieldsConfig,
+uint32_t SbeFFDCPackage::sendOverHostIntf(const uint32_t i_fieldsConfig,
sbeMemAccessInterface *i_pMemInterface,
uint32_t i_allocatedSize,
const bool i_skipffdcBitCheck)
@@ -193,12 +189,6 @@ uint32_t SbeFFDCPackage::sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
break;
}
- // update the primary and secondary status
- iv_sbeFFDCDataHeader.primaryStatus = i_hdr.primStatus;
- iv_sbeFFDCDataHeader.secondaryStatus = i_hdr.secStatus;
- iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
- // Set failed command information
- iv_sbeFFDCHeader.setCmdInfo(i_hdr.seqID, i_hdr.cmdClass, i_hdr.command);
//Update the user data header with dump fields configuration
updateUserDataHeader(i_fieldsConfig);
diff --git a/src/sbefw/core/sbeFFDC.H b/src/sbefw/core/sbeFFDC.H
index 2487a1f..71a4485 100644
--- a/src/sbefw/core/sbeFFDC.H
+++ b/src/sbefw/core/sbeFFDC.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -30,6 +31,7 @@
#include "sbeFFDCType.H"
#include "sbeSpMsg.H"
#include "sbeHostUtils.H"
+#include "sbe_build_info.H"
#include "sbeMemAccessInterface.H"
//PIBMEM attribute dump
@@ -90,6 +92,8 @@ public:
iv_sbeFFDCDataHeader.primaryStatus = SBE_PRI_OPERATION_SUCCESSFUL;
iv_sbeFFDCDataHeader.secondaryStatus = SBE_SEC_OPERATION_SUCCESSFUL;
+ iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
+ iv_sbeFFDCDataHeader.ddLevel = SBE_FFDC_DD2;
//length and dumpFields will be filled up depending on the fields
//to be sent in send APIs
@@ -108,7 +112,6 @@ public:
* @brief sendOverFIFO - method to pack and send SBE internal FFDC
* only if isSendInternalFFDCSet() is true
* over FIFO interface
- * @param[in] i_hdr - Fifo response header
* @param[in] i_fieldsConfig - bitmap indicating the field
* to be sent in FFDC
* @param[out] o_bytesSent - number of bytes sent
@@ -118,8 +121,7 @@ public:
*
* @return - SBE secondary RC
*/
- uint32_t sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
- const uint32_t i_fieldsConfig,
+ uint32_t sendOverFIFO(const uint32_t i_fieldsConfig,
uint32_t &o_bytesSent,
const bool i_skipffdcBitCheck = false);
@@ -127,7 +129,6 @@ public:
* only if isSendInternalFFDCSet() is true
* over HOST interface
*
- * @param[in] i_hdr - Host response header
* @param[in] i_fieldsConfig - bitmap indicating the field
* to be sent in FFDC
* @param[in] i_pMemInterface - pointer to memory interface object
@@ -138,8 +139,7 @@ public:
*
* @return - SBE secondary RC
*/
- uint32_t sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
- const uint32_t i_fieldsConfig,
+ uint32_t sendOverHostIntf(const uint32_t i_fieldsConfig,
sbeMemAccessInterface *i_pMemInterface,
uint32_t i_allocatedSize,
const bool i_skipffdcBitCheck = false);
diff --git a/src/sbefw/core/sbeFifoMsgUtils.C b/src/sbefw/core/sbeFifoMsgUtils.C
index 41d2ca2..2deb613 100644
--- a/src/sbefw/core/sbeFifoMsgUtils.C
+++ b/src/sbefw/core/sbeFifoMsgUtils.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -346,7 +347,7 @@ uint32_t sbeDsSendRespHdr(const sbeRespGenHdr_t &i_hdr,
/ sizeof(uint32_t);
// Set failed command information
// Sequence Id is 0 by default for Fifo interface
- i_ffdc->setCmdInfo(0, i_hdr.cmdClass, i_hdr.command);
+ i_ffdc->setCmdInfo(0, i_hdr.cmdClass(), i_hdr.command());
// Add HWP specific ffdc data length
i_ffdc->lenInWords += ffdcDataLenInWords;
len = sizeof(sbeResponseFfdc_t)/sizeof(uint32_t);
@@ -368,18 +369,17 @@ uint32_t sbeDsSendRespHdr(const sbeRespGenHdr_t &i_hdr,
}
// If there is a SBE internal failure
- if((i_hdr.primaryStatus != SBE_PRI_OPERATION_SUCCESSFUL) ||\
- (i_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL))
+ if((i_hdr.primaryStatus() != SBE_PRI_OPERATION_SUCCESSFUL) ||\
+ (i_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL))
{
SBE_ERROR( SBE_FUNC" primaryStatus:0x%08X secondaryStatus:0x%08X",
- (uint32_t)i_hdr.primaryStatus,
- (uint32_t)i_hdr.secondaryStatus);
+ (uint32_t)i_hdr.primaryStatus(),
+ (uint32_t)i_hdr.secondaryStatus());
//Add FFDC data as well.
//Generate all the fields of FFDC package
SbeFFDCPackage sbeFfdc;
- rc = sbeFfdc.sendOverFIFO(i_hdr,
- SBE_FFDC_ALL_DUMP,
+ rc = sbeFfdc.sendOverFIFO(SBE_FFDC_ALL_DUMP,
len);
if (rc)
{
diff --git a/src/sbefw/core/sbeHostMsg.C b/src/sbefw/core/sbeHostMsg.C
index 46ff518..898b953 100644
--- a/src/sbefw/core/sbeHostMsg.C
+++ b/src/sbefw/core/sbeHostMsg.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -27,9 +28,23 @@
void sbeSbe2PsuRespHdr_t::init(void)
{
- primStatus = SBE_PRI_OPERATION_SUCCESSFUL;
- secStatus = SBE_SEC_OPERATION_SUCCESSFUL;
- seqID = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.seqID;
- cmdClass = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.cmdClass;
- command = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.command;
+ _primStatus = SBE_PRI_OPERATION_SUCCESSFUL;
+ _secStatus = SBE_SEC_OPERATION_SUCCESSFUL;
+ _seqID = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.seqID;
+ _cmdClass = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.cmdClass;
+ _command = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.command;
+}
+void sbeSbe2PsuRespHdr_t::setStatus(const uint16_t i_prim, const uint16_t i_sec)
+{
+ _primStatus = i_prim;
+ _secStatus = i_sec;
+
+ if(i_prim != SBE_PRI_OPERATION_SUCCESSFUL)
+ {
+ SBE_GLOBAL->failedPrimStatus = _primStatus;
+ SBE_GLOBAL->failedSecStatus = _secStatus;
+ SBE_GLOBAL->failedSeqId = _seqID;
+ SBE_GLOBAL->failedCmdClass = _cmdClass;
+ SBE_GLOBAL->failedCmd = _command;
+ }
}
diff --git a/src/sbefw/core/sbeHostMsg.H b/src/sbefw/core/sbeHostMsg.H
index d6bd857..280dc69 100644
--- a/src/sbefw/core/sbeHostMsg.H
+++ b/src/sbefw/core/sbeHostMsg.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -154,12 +155,20 @@ typedef struct
*/
typedef struct
{
+ private:
// mbxReg 4
- uint64_t primStatus:16;
- uint64_t secStatus:16;
- uint64_t seqID:16;
- uint64_t cmdClass:8;
- uint64_t command:8;
+ uint64_t _primStatus:16;
+ uint64_t _secStatus:16;
+ uint64_t _seqID:16;
+ uint64_t _cmdClass:8;
+ uint64_t _command:8;
+
+ public:
+ const uint16_t primStatus() const { return _primStatus; }
+ const uint16_t secStatus() const { return _secStatus; }
+ const uint16_t seqID() const { return _seqID; }
+ const uint8_t cmdClass() const { return _cmdClass; }
+ const uint8_t command() const { return _command; }
/**
* @brief set the primary and secondary status
@@ -168,11 +177,7 @@ typedef struct
* @param[in] i_sec Secondary status
*
*/
- void setStatus(const uint16_t i_prim, const uint16_t i_sec)
- {
- primStatus = i_prim;
- secStatus = i_sec;
- }
+ void setStatus(const uint16_t i_prim, const uint16_t i_sec);
/**
* @brief initialize the response fields contained in PSU Mbx3
diff --git a/src/sbefw/core/sbeHostUtils.C b/src/sbefw/core/sbeHostUtils.C
index eb2990f..a8c087e 100644
--- a/src/sbefw/core/sbeHostUtils.C
+++ b/src/sbefw/core/sbeHostUtils.C
@@ -228,9 +228,9 @@ void sbePSUSendResponse(sbeSbe2PsuRespHdr_t &i_sbe2PsuRespHdr,
sbeMemAccessInterface::PBA_GRAN_SIZE_BYTES,
l_ex);
- bool l_internal_ffdc_present = ((i_sbe2PsuRespHdr.primStatus !=
+ bool l_internal_ffdc_present = ((i_sbe2PsuRespHdr.primStatus() !=
SBE_PRI_OPERATION_SUCCESSFUL) ||
- (i_sbe2PsuRespHdr.secStatus !=
+ (i_sbe2PsuRespHdr.secStatus() !=
SBE_SEC_OPERATION_SUCCESSFUL));
// If no ffdc , exit;
@@ -256,9 +256,9 @@ void sbePSUSendResponse(sbeSbe2PsuRespHdr_t &i_sbe2PsuRespHdr,
uint32_t ffdcDataLenInWords = fapi2::g_FfdcData.ffdcLength
/ sizeof(uint32_t);
// Set failed command information
- l_ffdc.setCmdInfo(i_sbe2PsuRespHdr.seqID,
- i_sbe2PsuRespHdr.cmdClass,
- i_sbe2PsuRespHdr.command);
+ l_ffdc.setCmdInfo(i_sbe2PsuRespHdr.seqID(),
+ i_sbe2PsuRespHdr.cmdClass(),
+ i_sbe2PsuRespHdr.command());
// Add HWP specific ffdc data length
l_ffdc.lenInWords += ffdcDataLenInWords;
@@ -294,13 +294,12 @@ void sbePSUSendResponse(sbeSbe2PsuRespHdr_t &i_sbe2PsuRespHdr,
if(l_internal_ffdc_present)
{
SBE_ERROR( SBE_FUNC" primaryStatus:0x%08X secondaryStatus:0x%08X",
- (uint32_t)i_sbe2PsuRespHdr.primStatus,
- (uint32_t)i_sbe2PsuRespHdr.secStatus);
+ (uint32_t)i_sbe2PsuRespHdr.primStatus(),
+ (uint32_t)i_sbe2PsuRespHdr.secStatus());
// SBE internal FFDC package
SbeFFDCPackage sbeFfdc;
//Generate all the fields of FFDC package
- io_rc = sbeFfdc.sendOverHostIntf(i_sbe2PsuRespHdr,
- SBE_FFDC_ALL_DUMP,
+ io_rc = sbeFfdc.sendOverHostIntf(SBE_FFDC_ALL_DUMP,
&l_PBAInterface,
l_allocatedSize);
if (io_rc)
diff --git a/src/sbefw/core/sbeSpMsg.C b/src/sbefw/core/sbeSpMsg.C
index b6afb70..294a967 100644
--- a/src/sbefw/core/sbeSpMsg.C
+++ b/src/sbefw/core/sbeSpMsg.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -28,9 +29,39 @@
void sbeRespGenHdr_t::init(void)
{
- magicCode = 0xC0DE;
- cmdClass = SBE_GLOBAL->sbeFifoCmdHdr.cmdClass;
- command = SBE_GLOBAL->sbeFifoCmdHdr.command;
- primaryStatus = SBE_PRI_OPERATION_SUCCESSFUL;
- secondaryStatus = SBE_SEC_OPERATION_SUCCESSFUL;
+ _magicCode = 0xC0DE;
+ _cmdClass = SBE_GLOBAL->sbeFifoCmdHdr.cmdClass;
+ _command = SBE_GLOBAL->sbeFifoCmdHdr.command;
+ _primaryStatus = SBE_PRI_OPERATION_SUCCESSFUL;
+ _secondaryStatus = SBE_SEC_OPERATION_SUCCESSFUL;
+}
+
+void sbeCmdRespHdr_t::setStatus(const uint16_t i_prim,
+ const uint16_t i_sec)
+{
+ prim_status = i_prim;
+ sec_status = i_sec;
+ if(i_prim != SBE_PRI_OPERATION_SUCCESSFUL)
+ {
+ SBE_GLOBAL->failedPrimStatus = i_prim;
+ SBE_GLOBAL->failedSecStatus = i_sec;
+ SBE_GLOBAL->failedSeqId = 0;
+ SBE_GLOBAL->failedCmdClass = SBE_GLOBAL->sbeFifoCmdHdr.cmdClass;
+ SBE_GLOBAL->failedCmd = SBE_GLOBAL->sbeFifoCmdHdr.command;
+ }
+}
+
+void sbeRespGenHdr_t::setStatus( const uint16_t i_prim, const uint16_t i_sec)
+{
+ _primaryStatus = i_prim;
+ _secondaryStatus = i_sec;
+
+ if(i_prim != SBE_PRI_OPERATION_SUCCESSFUL)
+ {
+ SBE_GLOBAL->failedPrimStatus = _primaryStatus;
+ SBE_GLOBAL->failedSecStatus = _secondaryStatus;
+ SBE_GLOBAL->failedSeqId = 0;
+ SBE_GLOBAL->failedCmdClass = _cmdClass;
+ SBE_GLOBAL->failedCmd = _command;
+ }
}
diff --git a/src/sbefw/core/sbeSpMsg.H b/src/sbefw/core/sbeSpMsg.H
index 56bde0f..c989949 100644
--- a/src/sbefw/core/sbeSpMsg.H
+++ b/src/sbefw/core/sbeSpMsg.H
@@ -66,12 +66,18 @@ typedef struct
*/
typedef struct
{
- uint32_t magicCode:16;
- uint32_t cmdClass:8;
- uint32_t command:8;
- uint32_t primaryStatus:16;
- uint32_t secondaryStatus:16;
-
+ private:
+ uint32_t _magicCode:16;
+ uint32_t _cmdClass:8;
+ uint32_t _command:8;
+ uint32_t _primaryStatus:16;
+ uint32_t _secondaryStatus:16;
+
+ public:
+ const uint8_t cmdClass() const { return _cmdClass; }
+ const uint8_t command() const { return _command; }
+ const uint16_t primaryStatus() const { return _primaryStatus; }
+ const uint16_t secondaryStatus() const { return _secondaryStatus; }
/**
* @brief set the primary and secondary status
*
@@ -80,11 +86,7 @@ typedef struct
*
* @return
*/
- void setStatus( const uint16_t i_prim, const uint16_t i_sec)
- {
- primaryStatus = i_prim;
- secondaryStatus = i_sec;
- }
+ void setStatus( const uint16_t i_prim, const uint16_t i_sec);
/**
* @brief set initial values for response header
@@ -545,15 +547,12 @@ typedef struct
/**
* @brief set the primary and secondary status
*
- * @param[in] i_prim Primary status
- * @param[in] i_sec Secondary status
+ * @param[in] i_prim Primary status
+ * @param[in] i_sec Secondary status
*
**/
- void setStatus(const uint16_t i_prim, const uint16_t i_sec)
- {
- prim_status = i_prim;
- sec_status = i_sec;
- }
+ void setStatus(const uint16_t i_prim,
+ const uint16_t i_sec);
} sbeCmdRespHdr_t;
/**
diff --git a/src/sbefw/core/sbecmdprocessor.C b/src/sbefw/core/sbecmdprocessor.C
index f7cf221..1c1f269 100644
--- a/src/sbefw/core/sbecmdprocessor.C
+++ b/src/sbefw/core/sbecmdprocessor.C
@@ -302,7 +302,7 @@ void sbeSyncCommandProcessor_routine(void *i_pArg)
if ( SBE_GLOBAL->sbeIntrSource.isSet(SBE_RX_ROUTINE,
SBE_INTERFACE_PSU) )
{
- l_rc = SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus;
+ l_rc = SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus();
l_cmdClass = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.cmdClass;
l_cmdOpCode = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.command;
// Set this here, so that during response handling we know which
diff --git a/src/sbefw/core/sbeglobals.C b/src/sbefw/core/sbeglobals.C
index 8d9ef02..90a80b7 100644
--- a/src/sbefw/core/sbeglobals.C
+++ b/src/sbefw/core/sbeglobals.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -46,3 +47,9 @@ secureMemRegion_t SBEGlobalsSingleton::mainMemRegions[MAX_MAIN_STORE_REGIONS] =
secureMemRegion_t SBEGlobalsSingleton::occSramRegions[MAX_OCC_SRAM_REGIONS] = {};
uint64_t SBEGlobalsSingleton::i2cModeRegister = 0x004D000000000000ull;
+
+uint16_t SBEGlobalsSingleton::failedPrimStatus = SBE_PRI_OPERATION_SUCCESSFUL;
+uint16_t SBEGlobalsSingleton::failedSecStatus = SBE_SEC_OPERATION_SUCCESSFUL;
+uint16_t SBEGlobalsSingleton::failedSeqId = 0;
+uint8_t SBEGlobalsSingleton::failedCmdClass = 0;
+uint8_t SBEGlobalsSingleton::failedCmd = 0;
diff --git a/src/sbefw/core/sbeglobals.H b/src/sbefw/core/sbeglobals.H
index 9b970a2..6284a57 100644
--- a/src/sbefw/core/sbeglobals.H
+++ b/src/sbefw/core/sbeglobals.H
@@ -103,6 +103,13 @@ class SBEGlobalsSingleton
// i2c mode register register
static uint64_t i2cModeRegister;
+ // Last failed rc's - for SBE internal ffdc
+ static uint16_t failedPrimStatus;
+ static uint16_t failedSecStatus;
+ static uint16_t failedSeqId;
+ static uint8_t failedCmdClass;
+ static uint8_t failedCmd;
+
////////////////////////////////////////////////////////////////
//// @brief PkThread structure for SBE Command Receiver thread
//////////////////////////////////////////////////////////////////
diff --git a/src/sbefw/core/sbescom.C b/src/sbefw/core/sbescom.C
index 63c62ee..e03f841 100644
--- a/src/sbefw/core/sbescom.C
+++ b/src/sbefw/core/sbescom.C
@@ -91,8 +91,8 @@ void checkIndirectAndDoScom( const bool i_isRead,
if(( i_addr & SCOM_SBE_ADDR_MASK) || ( i_addr & SCOM_MASTER_ID_MASK ))
{
SBE_ERROR(SBE_FUNC "Invalid scom");
- o_hdr->primaryStatus = SBE_PRI_USER_ERROR ;
- o_hdr->secondaryStatus = SBE_SEC_INVALID_ADDRESS_PASSED ;
+ o_hdr->setStatus(SBE_PRI_USER_ERROR,
+ SBE_SEC_INVALID_ADDRESS_PASSED);
break;
}
#endif // __ALLOW_INVALID_SCOMS__
@@ -104,8 +104,7 @@ void checkIndirectAndDoScom( const bool i_isRead,
CHECK_SBE_SECURITY_RC_AND_BREAK_IF_NOT_SUCCESS(
static_cast<uint32_t>(i_addr),
(i_isRead ? SBE_SECURITY::READ : SBE_SECURITY::WRITE),
- o_hdr->primaryStatus,
- o_hdr->secondaryStatus)
+ o_hdr)
if( i_isRead )
{
fapiRc = getscom_abs_wrap (&l_hndl, (uint32_t)i_addr,
@@ -127,8 +126,8 @@ void checkIndirectAndDoScom( const bool i_isRead,
{
// Not allowed write on new format.
SBE_ERROR(SBE_FUNC "Read not allowed in new form");
- o_hdr->primaryStatus = SBE_PRI_GENERIC_EXECUTION_FAILURE;
- o_hdr->secondaryStatus = SBE_SEC_INVALID_ADDRESS_PASSED;
+ o_hdr->setStatus(SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_INVALID_ADDRESS_PASSED);
break;
}
// Zero out the indirect address location.. leave the 52bits of data
@@ -159,8 +158,7 @@ void checkIndirectAndDoScom( const bool i_isRead,
CHECK_SBE_SECURITY_RC_AND_BREAK_IF_NOT_SUCCESS(
static_cast<uint32_t>(tempAddr),
(i_isRead ? SBE_SECURITY::READ : SBE_SECURITY::WRITE),
- o_hdr->primaryStatus,
- o_hdr->secondaryStatus)
+ o_hdr)
// If we are doing a read. We need to do a write first..
if( i_isRead)
@@ -218,8 +216,8 @@ void checkIndirectAndDoScom( const bool i_isRead,
if( ! scomout.done)
{
SBE_ERROR(SBE_FUNC "Indirect scom timeout.");
- o_hdr->primaryStatus = SBE_PRI_GENERIC_EXECUTION_FAILURE;
- o_hdr->secondaryStatus = SBE_SEC_HW_OP_TIMEOUT;
+ o_hdr->setStatus(SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_HW_OP_TIMEOUT);
break;
}
@@ -227,11 +225,11 @@ void checkIndirectAndDoScom( const bool i_isRead,
if (fapiRc != FAPI2_RC_SUCCESS)
{
- o_hdr->primaryStatus = SBE_PRI_GENERIC_EXECUTION_FAILURE;
- o_hdr->secondaryStatus = SBE_SEC_PCB_PIB_ERR;
+ o_hdr->setStatus(SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_PCB_PIB_ERR);
if(o_ffdc) o_ffdc->setRc(fapiRc);
}
- SBE_DEBUG(SBE_FUNC "fapiRc:%u o_hdr->secondaryStatus:0x%08X", fapiRc, o_hdr->secondaryStatus);
+ SBE_DEBUG(SBE_FUNC "fapiRc:%u o_hdr->secondaryStatus:0x%08X", fapiRc, o_hdr->secondaryStatus());
}
diff --git a/src/sbefw/core/sbeutil.H b/src/sbefw/core/sbeutil.H
index 75ea07b..9528eab 100644
--- a/src/sbefw/core/sbeutil.H
+++ b/src/sbefw/core/sbeutil.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -45,11 +46,11 @@ if ((l_rc) != SBE_SEC_OPERATION_SUCCESSFUL) \
break; \
}
-#define CHECK_SBE_SECURITY_RC_AND_BREAK_IF_NOT_SUCCESS(addr, op, prim, sec) \
+#define CHECK_SBE_SECURITY_RC_AND_BREAK_IF_NOT_SUCCESS(addr, op, resp) \
if (!SBE_SECURITY::isAllowed(addr, op)) \
{ \
- prim = SBE_PRI_UNSECURE_ACCESS_DENIED; \
- sec = SBE_SEC_BLACKLISTED_REG_ACCESS; \
+ resp->setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED, \
+ SBE_SEC_BLACKLISTED_REG_ACCESS); \
/* TODO via RTC 180983:Enable this once the BL/WL registers are settled */ \
/*break;*/ \
}
OpenPOWER on IntegriCloud