summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPrasad Bg Ranganath <prasadbgr@in.ibm.com>2017-03-21 00:44:25 -0500
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2017-05-15 06:46:29 -0400
commit1e66d91947125473e6c3db9a47c480b0fe5290f3 (patch)
treefdb3deb2ffd78d3e60aec797f2419a0ea4ab68e5 /src
parentd770027426ba0c5d6c44fa985e9dfaf28fd6fcce (diff)
downloadtalos-sbe-1e66d91947125473e6c3db9a47c480b0fe5290f3.tar.gz
talos-sbe-1e66d91947125473e6c3db9a47c480b0fe5290f3.zip
SBE:GETRING: Code optimization for getring chiop performance
Change-Id: I1fd32f833f197d94a98e971e23c815775ec628a2 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38189 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/hwpf/include/plat/plat_hw_access.H14
-rw-r--r--src/hwpf/src/plat/plat_hw_access.C36
-rw-r--r--src/sbefw/sbecmdringaccess.C44
3 files changed, 40 insertions, 54 deletions
diff --git a/src/hwpf/include/plat/plat_hw_access.H b/src/hwpf/include/plat/plat_hw_access.H
index 23637c10..55c84f98 100644
--- a/src/hwpf/include/plat/plat_hw_access.H
+++ b/src/hwpf/include/plat/plat_hw_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -116,18 +116,6 @@ namespace fapi2
fapi2::ReturnCode getRing_setup(const uint32_t i_ringAddress,
const fapi2::RingMode i_ringMode);
- // This function read the 64 bit data from the hardware
- // @param[in] i_ringAddress - absolute ring address
- // @param [out]: 64 bit data
- // @param [in] i_bitShiftValue - Bit shift value that needs to rotate
- // @note- If the ring length is divisble by 64, then bitshift will always be
- // 64, else need to store the ring_length mod 64 and send that value in the
- // last iteration.
- // @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- fapi2::ReturnCode getRing_granule_data(const uint32_t i_ringAddress,
- uint64_t *o_data,
- const uint32_t i_bitShiftValue);
-
// This function verify the check word data is matching or not and will
// clean up the scan region data
// @param[in] i_ringAddress - absolute ring address
diff --git a/src/hwpf/src/plat/plat_hw_access.C b/src/hwpf/src/plat/plat_hw_access.C
index ffab1c60..8508eda1 100644
--- a/src/hwpf/src/plat/plat_hw_access.C
+++ b/src/hwpf/src/plat/plat_hw_access.C
@@ -103,42 +103,6 @@ ReturnCode getRing_setup(const uint32_t i_ringAddress,
return l_rc;
}
-ReturnCode getRing_granule_data(const uint32_t i_ringAddress,
- uint64_t *o_data,
- const uint32_t i_bitShiftValue)
-{
- fapi2::ReturnCode l_rc = FAPI2_RC_SUCCESS;
- uint32_t l_chipletId = i_ringAddress & 0xFF000000;
-
- fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_proc;
-
- uint32_t l_scomAddress = 0x00038000;
- l_scomAddress |= l_chipletId;
-
- do
- {
- fapi2::buffer<uint64_t> l_ringData;
- l_rc = fapi2::getScom(l_proc, l_scomAddress, l_ringData);
- if(l_rc != fapi2::FAPI2_RC_SUCCESS)
- {
- break;
- }
- *o_data = l_ringData;
-
- l_scomAddress = 0x00038000 | i_bitShiftValue;
- l_scomAddress |= l_chipletId;
-
- l_rc = fapi2::getScom(l_proc, l_scomAddress, l_ringData);
- if(l_rc != fapi2::FAPI2_RC_SUCCESS)
- {
- break;
- }
- } while(0);
-
- return l_rc;
-}
-
-
ReturnCode getRing_verifyAndcleanup(const uint32_t i_ringAddress,
const RingMode i_ringMode)
{
diff --git a/src/sbefw/sbecmdringaccess.C b/src/sbefw/sbecmdringaccess.C
index 985de100..bd3afb06 100644
--- a/src/sbefw/sbecmdringaccess.C
+++ b/src/sbefw/sbecmdringaccess.C
@@ -125,6 +125,7 @@ uint32_t sbeGetRing(uint8_t *i_pArg)
ReturnCode l_fapiRc;
uint32_t l_len = 0;
uint32_t l_bitSentCnt = 0;
+ const uint32_t LONG_ROTATE_ADDRESS = 0x0003E000;
do
{
@@ -169,7 +170,11 @@ uint32_t sbeGetRing(uint8_t *i_pArg)
// fix for the alignment issue
uint32_t l_buf[NUM_WORDS_PER_GRANULE]__attribute__ ((aligned (8))) ={0};
uint32_t l_bitShift = 0;
+ uint64_t l_tmpbuf = 0;
l_len = NUM_WORDS_PER_GRANULE;
+ plat_target_handle_t l_hndl;
+ uint32_t l_chipletId = (uint32_t)(l_reqMsg.ringAddr) & 0xFF000000;
+ uint32_t l_scomAddress = 0;
// Fetch the ring data in bits, each iteration will give you 64bits
for(uint32_t l_cnt=0; l_cnt < l_loopCnt; l_cnt++)
@@ -180,12 +185,19 @@ uint32_t sbeGetRing(uint8_t *i_pArg)
}
else
{
- l_bitShift = GETRING_GRANULE_SIZE_IN_BITS;
+ //For the very first call sending F's .. because in the lower
+ //level function.. wiil read the first 64bit data and then
+ //shift. Sending F's only for the first will avoid 2 scom
+ //operation for every getring call.
+ //Note-Read operation flow is SHIFT and then READ.
+ l_bitShift = (l_cnt == 0) ? 0x0: GETRING_GRANULE_SIZE_IN_BITS;
}
- // Call getRing_granule_data - read the 64 bit data from the HW
- l_fapiRc = getRing_granule_data((uint32_t)(l_reqMsg.ringAddr),
- (uint64_t*)&l_buf,
- l_bitShift);
+ l_scomAddress = LONG_ROTATE_ADDRESS | l_chipletId;
+ l_scomAddress |= l_bitShift;
+ l_fapiRc = getscom_abs_wrap (&l_hndl,
+ l_scomAddress,
+ (uint64_t*)&l_buf);
+
if( l_fapiRc != FAPI2_RC_SUCCESS )
{
SBE_ERROR(SBE_FUNC" getRing_granule_data failed. "
@@ -197,6 +209,28 @@ uint32_t sbeGetRing(uint8_t *i_pArg)
break;
}
+ //this is only for the first time.
+ if (l_cnt == 0)
+ {
+ l_bitShift = GETRING_GRANULE_SIZE_IN_BITS;
+ l_scomAddress = LONG_ROTATE_ADDRESS | l_chipletId;
+ l_scomAddress |= l_bitShift;
+ l_fapiRc = getscom_abs_wrap (&l_hndl,
+ l_scomAddress,
+ &l_tmpbuf);
+
+ if( l_fapiRc != FAPI2_RC_SUCCESS )
+ {
+ SBE_ERROR(SBE_FUNC" getRing_granule_data failed. "
+ "RingAddress:0x%08X RingMode:0x%04x",
+ l_reqMsg.ringAddr, l_ringMode);
+ respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_GENERIC_FAILURE_IN_EXECUTION);
+ l_ffdc.setRc(l_fapiRc);
+ break;
+ }
+ }
+
// Send it to DS Fifo
// If this is the last iteration in the loop, let the full 64bit
// go, even for 1bit of remaining length. The length passed to
OpenPOWER on IntegriCloud