summaryrefslogtreecommitdiffstats
path: root/import/chips/p9/procedures/ppe_closed/lib
diff options
context:
space:
mode:
authorYue Du <daviddu@us.ibm.com>2017-03-30 11:57:24 -0500
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2017-10-23 17:19:47 -0500
commit6f40a0a204e8d3963db8f8f794a043b963acc475 (patch)
tree63096df3dc9facf05dea31d67f86ea31ee2ae700 /import/chips/p9/procedures/ppe_closed/lib
parentb4fa67c24830929bbab6ee19e06729ddec890276 (diff)
downloadtalos-hcode-6f40a0a204e8d3963db8f8f794a043b963acc475.tar.gz
talos-hcode-6f40a0a204e8d3963db8f8f794a043b963acc475.zip
STOP: Reduce CME Size
Change-Id: I327cad85f6b2cbfc89b712e4f20e51475dda5749 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38634 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com> Reviewed-by: Michael S. Floyd <mfloyd@us.ibm.com> Reviewed-by: AMIT KUMAR <akumar3@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'import/chips/p9/procedures/ppe_closed/lib')
-rw-r--r--import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.c88
-rw-r--r--import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.h47
2 files changed, 31 insertions, 104 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.c b/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.c
index c0488d63..f66ecd39 100644
--- a/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.c
+++ b/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.c
@@ -42,92 +42,62 @@
#include "p9_hcd_block_copy.h"
#include "cme_register_addresses.h"
-enum
-{
- CME_PER_QUAD = 0x0002,
-};
-
-//------------------------------------------------------------------------------------
-
-void initCmeBceBarAddr( uint8_t i_barIndex, uint64_t i_barRegData, uint8_t i_cmePos )
-{
- uint32_t l_bceBarAddr = (i_barIndex == 0 ) ? SCOM_ADDR_BCEBAR0 : SCOM_ADDR_BCEBAR1;
- uint64_t l_bceBarData = 0;
- int rc = 0;
-
- uint8_t l_quadId = i_cmePos >> 1;
- l_bceBarAddr = SGPE_SCOM_ADDR( l_bceBarAddr, l_quadId, (i_cmePos % 2) );
-
- l_bceBarData = ( i_barRegData & 0x00FFFFFFFFF00000); //To extract bitss 8:43 from the i_barRegData
- l_bceBarData |= (ENABLE_WR_SCOPE | ENABLE_RD_SCOPE | BLOCK_COPY_SIZE_1MB );
- PPE_PUTSCOM(l_bceBarAddr, l_bceBarData); // set the source address for block copy
-
-}
//------------------------------------------------------------------------------------
void startCmeBlockCopy( uint64_t i_cmeStartBlk, uint32_t i_blockLength, uint32_t i_cmePos,
- InitiatorPlat_t i_plat, uint8_t i_barIndex, uint32_t i_mbaseVal )
+ uint8_t i_barIndex, uint32_t i_mbaseVal )
{
- int rc = 0;
+
+#if defined(__PPE_CME) || defined(__PPE_SGPE)
uint64_t l_bceStatusData = ((START_BLOCK_COPY) | // starts block copy operation
(RD_FROM_HOMER_TO_SRAM) | // sets direction of copy HOMER to CME SRAM
- ((i_barIndex == 0) ? SEL_BCEBAR0 : SEL_BCEBAR1) | // BAR register to be used for accessing main memory base
+ // BAR register to be used for accessing main memory base
+ ((i_barIndex == 0) ? SEL_BCEBAR0 : SEL_BCEBAR1) |
(SET_RD_PRIORITY_0) | // No priority set
((i_cmeStartBlk & 0x0000FFF ) << SBASE_SHIFT_POS) | //copy page to this SRAM Block.
- (((uint64_t) i_blockLength & 0x00007FF) << NUM_BLK_SHIFT_POS ) | // number of blocks to be copied
+ // number of blocks to be copied
+ (((uint64_t) i_blockLength & 0x00007FF) << NUM_BLK_SHIFT_POS ) |
(((uint64_t) i_mbaseVal & 0x00000000003FFFFF) ));
- if( PLAT_CME == i_plat )
- {
- // for CME platform use local address for register BCECSR.
- // using BCECSR SCOM address will not work as it is meant
- // for entities external to CME.
- uint32_t l_cmeBceAddr = CME_LCL_BCECSR;
- out64( l_cmeBceAddr, l_bceStatusData );
- }
- else if( PLAT_SGPE == i_plat )
- {
- //getting quad id by dividing cme pos with 2
- uint8_t l_quadId = i_cmePos >> 1;
+#endif
- uint32_t l_sgpeBceAddr = SGPE_SCOM_ADDR( SCOM_ADDR_BCEBCSR, l_quadId,
- (i_cmePos % 2) );
+#ifdef __PPE_CME
+ // for CME platform use local address for register BCECSR.
+ // using BCECSR SCOM address will not work as it is meant
+ // for entities external to CME.
+ out64(CME_LCL_BCECSR, l_bceStatusData);
+#endif
- PPE_PUTSCOM(l_sgpeBceAddr, l_bceStatusData );
- }
+#ifdef __PPE_SGPE
+ //getting quad id by dividing cme pos with 2
+ GPE_PUTSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_BCECSR, (i_cmePos >> 1), (i_cmePos % 2)), l_bceStatusData);
+#endif
}
//------------------------------------------------------------------------------------
-BceReturnCode_t checkCmeBlockCopyStatus( uint32_t i_cmePos, InitiatorPlat_t i_plat )
+BceReturnCode_t checkCmeBlockCopyStatus( uint32_t i_cmePos)
{
BceReturnCode_t l_bcRetCode = BLOCK_COPY_IN_PROGRESS;
do
{
uint64_t l_bceStatusData = 0;
- int rc = 0;
- if( PLAT_CME == i_plat )
- {
- // for CME platform use local address for register BCECSR.
- // using BCECSR SCOM address will not work as it is meant
- // for entities external to CME.
- uint32_t l_cmeBcelAddr = CME_LCL_BCECSR;
- l_bceStatusData = in64(l_cmeBcelAddr);
- }
- else if( PLAT_SGPE == i_plat )
- {
- // getting quad id by dividing cme pos with 2
- uint8_t l_quadId = i_cmePos >> 1;
+#ifdef __PPE_CME
+ // for CME platform use local address for register BCECSR.
+ // using BCECSR SCOM address will not work as it is meant
+ // for entities external to CME.
+ l_bceStatusData = in64(CME_LCL_BCECSR);
+#endif
- uint32_t l_sgpeBceAddr = SGPE_SCOM_ADDR( SCOM_ADDR_BCEBCSR, l_quadId, (i_cmePos % 2) );
- // SGPE reading block copy engine status of CME
- PPE_GETSCOM(l_sgpeBceAddr, l_bceStatusData);
- }
+#ifdef __PPE_SGPE
+ // SGPE reading block copy engine status of CME
+ GPE_GETSCOM(GPE_SCOM_ADDR_CME(CME_SCOM_BCECSR, (i_cmePos >> 1), (i_cmePos % 2)), l_bceStatusData);
+#endif
if( CHECK_ERROR & l_bceStatusData ) // checking if block copy engine reported an error.
{
diff --git a/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.h b/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.h
index c61caa8c..cf78689e 100644
--- a/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.h
+++ b/import/chips/p9/procedures/ppe_closed/lib/p9_hcd_block_copy.h
@@ -55,23 +55,6 @@ typedef enum
BLOCK_COPY_IN_PROGRESS = 4,
} BceReturnCode_t;
-//Platforms that can request block copy transfer.
-typedef enum
-{
- PLAT_NA = 0,
- PLAT_CME = 1,
- PLAT_SGPE = 2,
-} InitiatorPlat_t;
-
-// SCOM addresses associated with a CME BCE.
-typedef enum
-{
- SCOM_ADDR_BCEBAR0 = 0x10012030,
- SCOM_ADDR_BCEBAR1 = 0x10012031,
- SCOM_ADDR_BCEBCSR = 0x1001200F,
- SCOM_ADDR_PBABAR0 = 0x05012B00,
-} ScomAddrList_t;
-
// Bit shifts needed for various fields of CME's BCESCR register
enum
{
@@ -81,23 +64,6 @@ enum
CME_BASE_ADDRESS = 0x10012000,
};
-#define SGPE_SCOM_ADDR(addr, quad, ex) ( addr | CME_BASE_ADDRESS | (quad << 24) | (ex << 10) )
-
-#define PPE_GETSCOM(addr, data) \
- rc = getscom(0, addr, &data); \
- if (rc) { \
- PK_TRACE("getscom@%d failed w/rc=0x%08x", \
- addr, rc); \
- pk_halt(); \
- }
-
-#define PPE_PUTSCOM(addr, data) \
- rc = putscom(0, addr, data); \
- if (rc) { \
- PK_TRACE("putscom@%d failed w/rc=0x%08x", \
- addr, rc); \
- pk_halt(); \
- }
/// @brief accomplishes block copy from mainstore to CME SRAM.
/// @param [in] i_cmeStartBlk Block no associated with CME SRAM( a block is 32B )
/// @param [in] i_blockLength number of block to be transferred.
@@ -107,8 +73,7 @@ enum
/// @note It is a non blocking function. It doesn't poll the status and error bits.
/// It is expected to be called by CME and SGPE only.
void startCmeBlockCopy( uint64_t i_cmeStartBlk, uint32_t i_blockLength,
- uint32_t i_cmePos, InitiatorPlat_t i_plat, uint8_t i_barIndex,
- uint32_t i_mbaseVal );
+ uint32_t i_cmePos, uint8_t i_barIndex, uint32_t i_mbaseVal );
/// @brief accomplishes block copy from mainstore to CME SRAM.
/// @param [in] i_cmePos Position of CME in the P9 chip.
@@ -116,14 +81,6 @@ void startCmeBlockCopy( uint64_t i_cmeStartBlk, uint32_t i_blockLength,
/// @retVal BLOCK_COPY_SUCCESS is block succeeds, return code otherwise.
/// @note It is a non blocking function. It doesn't poll the status and error bits.
/// It is expected to be called by CME and SGPE only.
-BceReturnCode_t checkCmeBlockCopyStatus( uint32_t i_cmePos, InitiatorPlat_t i_plat );
+BceReturnCode_t checkCmeBlockCopyStatus( uint32_t i_cmePos);
-/// @brief initializes the BCENARn register.
-/// @param [in] i_plat platform calling CME's block copy engine.
-/// @param [in] i_barIndex 0 for BCEBAR0 and 1 for BCEBAR1
-/// @param [in] i_barRegData address to be written to BCEBARn
-/// @param [in] i_cmePos position of CME.
-/// @note No PPE other than SGPE is expected to call this function. It is expected to
-/// be called by SGPE only.
-void initCmeBceBarAddr( uint8_t i_barIndex, uint64_t i_barRegData, uint8_t i_cmePos );
#endif
OpenPOWER on IntegriCloud