summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sbefw/app/common/sbecmdgeneric.C21
-rw-r--r--src/sbefw/app/common/sbecmdgeneric.H9
-rw-r--r--src/sbefw/app/power/sbecmdgeneric.C20
-rw-r--r--src/sbefw/core/sbeSpMsg.H4
-rw-r--r--src/sbefw/core/sbe_sp_intf.H3
-rwxr-xr-xsrc/test/testcases/testGetCapabilities.py4
6 files changed, 39 insertions, 22 deletions
diff --git a/src/sbefw/app/common/sbecmdgeneric.C b/src/sbefw/app/common/sbecmdgeneric.C
index 1d78705c..813df873 100644
--- a/src/sbefw/app/common/sbecmdgeneric.C
+++ b/src/sbefw/app/common/sbecmdgeneric.C
@@ -49,6 +49,24 @@
using namespace fapi2;
#ifdef __SBEFW_SEEPROM__
+
+static const uint32_t SBE_CAPABILITES_LEN_FIFO =
+ sizeof(sbeCapabilityRespMsg_t) -
+ (sizeof(uint32_t) *
+ (SBE_MAX_CAPABILITIES - CAPABILITIES_LAST_INDEX_FIFO - 1));
+
+sbeCapabilityRespMsg::sbeCapabilityRespMsg() : capability{}
+{
+ verMajor= SBE_FW_MAJOR_VERSION;
+ verMinor = SBE_FW_MINOR_VERSION;
+ fwCommitId = SBE_COMMIT_ID;
+ // Get xip header
+ P9XipHeader *hdr = getXipHdr();
+ for(uint32_t idx=0; idx<sizeof(hdr->iv_buildTag); idx++)
+ {
+ buildTag[idx] = hdr->iv_buildTag[idx];
+ }
+}
// Functions
//----------------------------------------------------------------------------
uint32_t sbeGetCapabilities (uint8_t *i_pArg)
@@ -59,6 +77,7 @@ uint32_t sbeGetCapabilities (uint8_t *i_pArg)
sbeRespGenHdr_t respHdr;
respHdr.init();
sbeCapabilityRespMsg_t capMsg;
+ updateFifoCapabilities(capMsg.capability);
do
{
@@ -73,7 +92,7 @@ uint32_t sbeGetCapabilities (uint8_t *i_pArg)
break;
}
- len = sizeof(capMsg)/sizeof(uint32_t);
+ len = SBE_CAPABILITES_LEN_FIFO / sizeof(uint32_t);
rc = sbeDownFifoEnq_mult ( len, ( uint32_t *) &capMsg);
if (rc)
{
diff --git a/src/sbefw/app/common/sbecmdgeneric.H b/src/sbefw/app/common/sbecmdgeneric.H
index c387d654..471304c9 100644
--- a/src/sbefw/app/common/sbecmdgeneric.H
+++ b/src/sbefw/app/common/sbecmdgeneric.H
@@ -92,6 +92,15 @@ typedef struct stashMsg
}stashMsg_t;
/**
+ * @brief Update Fifo capabilities
+ *
+ * @param[in] capability Pointer to capcbility array
+ *
+ * @return void
+ */
+void updateFifoCapabilities(uint32_t * capability);
+
+/**
* @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)
diff --git a/src/sbefw/app/power/sbecmdgeneric.C b/src/sbefw/app/power/sbecmdgeneric.C
index 3f4294d0..6f6afa91 100644
--- a/src/sbefw/app/power/sbecmdgeneric.C
+++ b/src/sbefw/app/power/sbecmdgeneric.C
@@ -49,25 +49,9 @@
using namespace fapi2;
#ifdef __SBEFW_SEEPROM__
-// Forward declaration
-sbeCapabilityRespMsg::sbeCapabilityRespMsg()
-{
- verMajor= SBE_FW_MAJOR_VERSION;
- verMinor = SBE_FW_MINOR_VERSION;
- fwCommitId = SBE_COMMIT_ID;
- // Get hbbl section
- P9XipHeader *hdr = getXipHdr();
- for(uint32_t idx=0; idx<sizeof(hdr->iv_buildTag); idx++)
- {
- buildTag[idx] = hdr->iv_buildTag[idx];
- }
- // We can remove this for llop once all capabilities
- // are supported
- for(uint32_t idx = 0; idx < SBE_MAX_CAPABILITIES; idx++ )
- {
- capability[idx] = 0;
- }
+void updateFifoCapabilities(uint32_t * capability)
+{
// @TODO via RTC : 160602
// Update Capability flags based on lastes spec.
capability[IPL_CAPABILITY_START_IDX] =
diff --git a/src/sbefw/core/sbeSpMsg.H b/src/sbefw/core/sbeSpMsg.H
index c989949a..e2499234 100644
--- a/src/sbefw/core/sbeSpMsg.H
+++ b/src/sbefw/core/sbeSpMsg.H
@@ -503,8 +503,8 @@ typedef struct
uint32_t len; // Length of Data in Bytes
}sbeOccSramAccessReqMsgHdr_t;
-// Maximum number of capabilities
-static const uint32_t SBE_MAX_CAPABILITIES = 18;
+// Maximum number of capabilities - max of FIFO and PSU capabilities
+static const uint32_t SBE_MAX_CAPABILITIES = 20;
/**
* @brief structure for SBE Get Capabilities chipop (0xA802) contents.
diff --git a/src/sbefw/core/sbe_sp_intf.H b/src/sbefw/core/sbe_sp_intf.H
index 76895ae3..ae4876e9 100644
--- a/src/sbefw/core/sbe_sp_intf.H
+++ b/src/sbefw/core/sbe_sp_intf.H
@@ -251,6 +251,9 @@ enum
ARRAY_CAPABILITY_START_IDX = GENERIC_CAPABILTITY_START_IDX + 12,
INSTRUCTION_CTRL_CAPABILITY_START_IDX = GENERIC_CAPABILTITY_START_IDX + 14,
GENERIC_CHIPOP_CAPABILITY_START_IDX = GENERIC_CAPABILTITY_START_IDX + 16,
+
+ // Keep in sync with the spec
+ CAPABILITIES_LAST_INDEX_FIFO = 19,
};
/**
* @brief capabilities enum values.
diff --git a/src/test/testcases/testGetCapabilities.py b/src/test/testcases/testGetCapabilities.py
index 3cc21027..cffff709 100755
--- a/src/test/testcases/testGetCapabilities.py
+++ b/src/test/testcases/testGetCapabilities.py
@@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
@@ -50,6 +50,8 @@ EXPDATA2 = [0xa4,0x0,0x0,0x0f, #GetMemPba/PutMemPba/GetSramOcc/PutSramOcc
EXPDATA3 = [0xa8,0x0,0x0,0x13, #getcapability/getSbeFFDC/quiesce
0x0,0x0,0x0,0x0,
+ 0, 0, 0, 0, #MPIPL related
+ 0, 0, 0, 0,
0xc0,0xde,0xa8,0x02,
0x0,0x0,0x0,0x0,
0x00,0x0,0x0,0x3];
OpenPOWER on IntegriCloud