From d203132a331691e653aee54b339453b391b5e7a0 Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Mon, 26 Sep 2016 03:14:57 -0500 Subject: Removed PPE specific code for SCOMs Change-Id: Ib15f7f204d5afdba8ce23eaa2b749383b81ae3bc Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30280 Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: Sachin Gupta Reviewed-by: Gregory S. Still Reviewed-by: PARVATHI RACHAKONDA Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30286 Reviewed-by: Hostboot Team Tested-by: FSP CI Jenkins Reviewed-by: Santosh S. Puranik --- src/hwpf/include/plat/plat_hw_access.H | 10 +- src/hwpf/include/plat/target.H | 59 ++--------- src/hwpf/src/plat/plat_hw_access.C | 96 +++++++++++++----- src/import/chips/p9/utils/p9_putRingUtils.C | 152 ++-------------------------- src/sbefw/sbecmdcntrldmt.C | 11 +- src/sbefw/sbescom.C | 11 +- 6 files changed, 101 insertions(+), 238 deletions(-) diff --git a/src/hwpf/include/plat/plat_hw_access.H b/src/hwpf/include/plat/plat_hw_access.H index c7c73325..cd0078f9 100644 --- a/src/hwpf/include/plat/plat_hw_access.H +++ b/src/hwpf/include/plat/plat_hw_access.H @@ -34,6 +34,7 @@ #include #include "hw_access_def.H" #include +#include // PIB errors enum PCB_ERRORS @@ -84,11 +85,11 @@ asm volatile \ /// GetScom #define PLAT_GETSCOM(_m_rc, _m_base, _m_offset, _m_data) \ - _m_rc = fapi2::getscom_abs_wrap(getEffectiveAddress(_m_base, _m_offset), _m_data) + _m_rc = fapi2::getscom_abs_wrap(&(_m_base), _m_offset, _m_data) /// PutScom #define PLAT_PUTSCOM(_m_rc, _m_base, _m_offset, _m_data) \ - _m_rc = fapi2::putscom_abs_wrap(getEffectiveAddress(_m_base, _m_offset), _m_data) + _m_rc = fapi2::putscom_abs_wrap(&(_m_base), _m_offset, _m_data) /// GetCFAM #define PLAT_GETCFAM(_m_base, _m_offset, _m_data) \ @@ -135,6 +136,7 @@ namespace fapi2 fapi2::ReturnCode getRing_verifyAndcleanup(const uint32_t i_ringAddress, const fapi2::RingMode i_ringMode); + typedef union plat_target_handle plat_target_handle_t; /// /// @brief Platform wrapper over PK getscom_abs /// @@ -143,7 +145,7 @@ namespace fapi2 /// /// @return PCB-PIB return code /// - uint32_t getscom_abs_wrap(const uint32_t i_addr, uint64_t *o_data); + uint32_t getscom_abs_wrap(const void *i_target, const uint32_t i_addr, uint64_t *o_data); /// /// @brief Platform wrapper over PK putscom_abs @@ -153,7 +155,7 @@ namespace fapi2 /// /// @return PCB-PIB return code /// - uint32_t putscom_abs_wrap(const uint32_t i_addr, uint64_t i_data); + uint32_t putscom_abs_wrap(const void *i_target, const uint32_t i_addr, uint64_t i_data); /// /// @brief Platform wrapper to retry scom for parity/timeout errors diff --git a/src/hwpf/include/plat/target.H b/src/hwpf/include/plat/target.H index 09c27d0b..c7baef55 100644 --- a/src/hwpf/include/plat/target.H +++ b/src/hwpf/include/plat/target.H @@ -178,18 +178,19 @@ namespace fapi2 template inline Target Target::getParent(void) const { - static_assert(((K == TARGET_TYPE_EQ) || + static_assert((((K == TARGET_TYPE_EQ) || (K == TARGET_TYPE_CORE) || (K == TARGET_TYPE_MCBIST) || (K == TARGET_TYPE_PERV) || (K == TARGET_TYPE_EX) || (K == TARGET_TYPE_PROC_CHIP) || (K == (TARGET_TYPE_PROC_CHIP | TARGET_TYPE_EQ)) || - (K == (TARGET_TYPE_PROC_CHIP | TARGET_TYPE_CORE))) && + (K == (TARGET_TYPE_PROC_CHIP | TARGET_TYPE_CORE)) || + (K == TARGET_TYPE_ALL)) && ((T == TARGET_TYPE_EQ) || (T == TARGET_TYPE_EX) || (T == TARGET_TYPE_PROC_CHIP) || - (T == TARGET_TYPE_PERV)), + (T == TARGET_TYPE_PERV))), "Invalid parent/child target type passed"); static_assert(!((K == TARGET_TYPE_EQ) && @@ -198,6 +199,11 @@ namespace fapi2 "Invalid parent for EQ target, must be PERV or " "PROC_CHIP"); + static_assert(!((K == TARGET_TYPE_ALL) && + (T != TARGET_TYPE_PROC_CHIP)), + "Invalid parent for ALL target, must be " + "PROC_CHIP"); + static_assert(!((K == TARGET_TYPE_MCBIST) && (T != TARGET_TYPE_PERV) && (T != TARGET_TYPE_PROC_CHIP)), @@ -348,53 +354,6 @@ namespace fapi2 snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target.get(), T); } - template - __attribute__((always_inline)) - inline uint32_t getEffectiveAddress(const Target &i_target, - const uint32_t i_addr) - { - ScomAddr l_addr = i_addr; - if(0 != static_cast(i_target.get()).getAddressOverlay()) - { - l_addr.iv_chiplet = i_target.getChipletNumber(); - } - return l_addr; - } - - inline uint32_t getEffectiveAddress(const Target &i_target, - const uint32_t i_addr) - { - ScomAddr l_addr = i_addr; - - if((EQ_CHIPLET_OFFSET <= l_addr.iv_chiplet) && - ((EQ_CHIPLET_OFFSET + EQ_TARGET_COUNT) > l_addr.iv_chiplet)) - { - l_addr.iv_chiplet = i_target.getChipletNumber(); - l_addr.iv_ring = (l_addr.iv_ring - (l_addr.iv_ring % 2)) + - (static_cast(i_target.get()).getTargetInstance() % 2); - } - else if ((CORE_CHIPLET_OFFSET <= l_addr.iv_chiplet) && - ((CORE_CHIPLET_OFFSET + CORE_TARGET_COUNT) > l_addr.iv_chiplet)) - { - l_addr.iv_chiplet = CORE_CHIPLET_OFFSET + (l_addr.iv_chiplet % 2) + - (static_cast(i_target.get()).getTargetInstance() * 2); - } - else - { - assert(false); - } - return l_addr; - } - - inline uint32_t getEffectiveAddress(const Target &i_target, - const uint32_t i_addr) - { - ScomAddr l_addr = i_addr; - l_addr.iv_chiplet = i_target.getChipletNumber(); - l_addr.iv_satId = (2 * (static_cast(i_target.get()).getTargetInstance() % 2)); - return l_addr; - } - /// /// @brief Return the string interpretation of this target /// @tparam T The type of the target diff --git a/src/hwpf/src/plat/plat_hw_access.C b/src/hwpf/src/plat/plat_hw_access.C index b460946f..a6eaf91c 100644 --- a/src/hwpf/src/plat/plat_hw_access.C +++ b/src/hwpf/src/plat/plat_hw_access.C @@ -41,14 +41,14 @@ uint64_t decodeScanRegionData(const uint32_t i_ringAddress) uint32_t l_scan_type = 0x00008000 >> (i_ringAddress & 0x0000000F); // This is special case if encoded type is 0xF - + if ( (i_ringAddress & 0x0000000F) == 0xF) { l_scan_type = 0x00008000 | (l_scan_type << 12); } uint64_t l_value = l_scan_region; l_value = (l_value << 32) | l_scan_type; - + return l_value; } @@ -73,7 +73,7 @@ ReturnCode getRing_setup(const uint32_t i_ringAddress, break; } - l_rc = setupScanRegionForSetPulse(l_proc, l_scanRegion, + l_rc = setupScanRegionForSetPulse(l_proc, l_scanRegion, i_ringMode,l_chipletId); if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -162,41 +162,81 @@ ReturnCode getRing_verifyAndcleanup(const uint32_t i_ringAddress, break; } } - + }while(0); return l_rc; } - uint32_t getscom_abs_wrap(const uint32_t i_addr, uint64_t *o_data) +static uint32_t getEffectiveAddress(const plat_target_handle_t &i_target, const uint32_t i_addr) +{ + ScomAddr l_addr(i_addr); + switch(i_target.getTargetType()) { - uint32_t l_rc = 0; - FAPI_INF("getScom: address: 0x%08X", i_addr); - l_rc = getscom_abs(i_addr, o_data); - if( PIB_NO_ERROR != l_rc ) - { - l_rc = p9_pibErrRetry( i_addr, o_data, l_rc, true); - } - FAPI_INF("getScom: returned rc: 0x%08X, data HI: 0x%08X, " - "data LO: 0x%08X", l_rc, (*o_data >> 32), - static_cast(*o_data & 0xFFFFFFFF)); - return l_rc; + case PPE_TARGET_TYPE_EX: + if((EQ_CHIPLET_OFFSET <= l_addr.iv_chiplet) && + ((EQ_CHIPLET_OFFSET + EQ_TARGET_COUNT) > l_addr.iv_chiplet)) + { + l_addr.iv_chiplet = i_target.fields.chiplet_num; + l_addr.iv_ring = (l_addr.iv_ring - (l_addr.iv_ring % 2)) + + (i_target.getTargetInstance() % 2); + } + else if ((CORE_CHIPLET_OFFSET <= l_addr.iv_chiplet) && + ((CORE_CHIPLET_OFFSET + CORE_TARGET_COUNT) > l_addr.iv_chiplet)) + { + l_addr.iv_chiplet = CORE_CHIPLET_OFFSET + (l_addr.iv_chiplet % 2) + + (i_target.getTargetInstance() * 2); + } + else + { + assert(false); + } + break; + case PPE_TARGET_TYPE_MCS: + l_addr.iv_chiplet = i_target.fields.chiplet_num; + l_addr.iv_satId = (2 * (i_target.getTargetInstance() % 2)); + break; + default: + if(0 != i_target.getAddressOverlay()) + { + l_addr.iv_chiplet = i_target.fields.chiplet_num; + } + break; } + return l_addr; +} - uint32_t putscom_abs_wrap(const uint32_t i_addr, uint64_t i_data) +uint32_t getscom_abs_wrap(const void *i_target, const uint32_t i_addr, uint64_t *o_data) +{ + uint32_t l_rc = 0; + uint32_t l_addr = getEffectiveAddress(*(plat_target_handle_t*)i_target, i_addr); + FAPI_INF("getScom: address: 0x%08X", l_addr); + l_rc = getscom_abs(l_addr, o_data); + if( PIB_NO_ERROR != l_rc ) { - uint32_t l_rc = 0; - FAPI_INF("putScom: address: 0x%08X, data HI: 0x%08X, data LO: 0x%08X", - i_addr, (i_data >> 32), - static_cast(i_data & 0xFFFFFFFF)); - l_rc = putscom_abs(i_addr, i_data); - if( PIB_NO_ERROR != l_rc ) - { - l_rc = p9_pibErrRetry( i_addr, &i_data, l_rc, false); - } - FAPI_INF("putScom: returned rc: 0x%08X", l_rc); - return l_rc; + l_rc = p9_pibErrRetry( l_addr, o_data, l_rc, true); } + FAPI_INF("getScom: returned rc: 0x%08X, data HI: 0x%08X, " + "data LO: 0x%08X", l_rc, (*o_data >> 32), + static_cast(*o_data & 0xFFFFFFFF)); + return l_rc; +} + +uint32_t putscom_abs_wrap(const void *i_target, const uint32_t i_addr, uint64_t i_data) +{ + uint32_t l_rc = 0; + uint32_t l_addr = getEffectiveAddress(*(plat_target_handle_t*)i_target, i_addr); + FAPI_INF("putScom: address: 0x%08X, data HI: 0x%08X, data LO: 0x%08X", + l_addr, (i_data >> 32), + static_cast(i_data & 0xFFFFFFFF)); + l_rc = putscom_abs(l_addr, i_data); + if( PIB_NO_ERROR != l_rc ) + { + l_rc = p9_pibErrRetry( l_addr, &i_data, l_rc, false); + } + FAPI_INF("putScom: returned rc: 0x%08X", l_rc); + return l_rc; +} uint32_t p9_pibErrRetry( const uint32_t i_addr, uint64_t *io_data, const uint8_t i_pibErr, const bool i_isRead) diff --git a/src/import/chips/p9/utils/p9_putRingUtils.C b/src/import/chips/p9/utils/p9_putRingUtils.C index e4c39b14..15c4da60 100644 --- a/src/import/chips/p9/utils/p9_putRingUtils.C +++ b/src/import/chips/p9/utils/p9_putRingUtils.C @@ -226,18 +226,10 @@ fapi2::ReturnCode standardScan( #endif -#ifndef __PPE__ - // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. - fapi2::Target l_parent; - - if (i_target.getType() == fapi2::TARGET_TYPE_CORE) - { - l_parent = i_target.template getParent (); - } - -#endif + fapi2::Target l_parent = + i_target.template getParent (); do { @@ -282,11 +274,7 @@ fapi2::ReturnCode standardScan( FAPI_INF("l_rotateCount %u", l_rotateCount); fapi2::buffer l_scomData(l_rotateCount); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_scomData); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_scomData); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -308,11 +296,8 @@ fapi2::ReturnCode standardScan( l_attempts--; fapi2::buffer l_opcgStatus; -#ifndef __PPE__ + l_rc = fapi2::getScom(l_parent, l_OPCGAddress, l_opcgStatus); -#else - l_rc = fapi2::getScom(i_target, l_OPCGAddress, l_opcgStatus); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -355,11 +340,7 @@ fapi2::ReturnCode standardScan( // Set the scan count to the actual value l_scomAddress |= l_scanCount; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_scomData); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_scomData); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -419,14 +400,10 @@ fapi2::ReturnCode setupScanRegion(const fapi2::Target& #endif - - -#ifndef __PPE__ // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. fapi2::Target l_parent( i_target.template getParent()); -#endif do { @@ -440,11 +417,8 @@ fapi2::ReturnCode setupScanRegion(const fapi2::Target& // Do the scom fapi2::buffer l_scanRegion(l_scan_region); -#ifndef __PPE__ + l_rc = fapi2::putScom(l_parent, l_scomAddress, l_scanRegion); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_scanRegion); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -489,14 +463,10 @@ fapi2::ReturnCode writeHeader(const fapi2::Target& l_scomAddress |= l_chiplet; // I think we won't require this -#ifndef __PPE__ l_rc = fapi2::putScom( i_target.template getParent(), l_scomAddress, i_header); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_header); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -545,14 +515,10 @@ fapi2::ReturnCode verifyHeader(const fapi2::Target& fapi2::buffer l_readHeader; -#ifndef __PPE__ l_rc = fapi2::getScom( i_target.template getParent(), l_scomAddress, l_readHeader); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, l_readHeader); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -576,14 +542,10 @@ fapi2::ReturnCode verifyHeader(const fapi2::Target& // Add the chiplet ID in the Scom Address l_address |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom( i_target.template getParent(), l_address, l_header); -#else - l_rc = fapi2::putScom(i_target, l_address, l_header); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -622,12 +584,10 @@ fapi2::ReturnCode setupScanRegionForSetPulse( #endif -#ifndef __PPE__ // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. fapi2::Target l_parent( i_target.template getParent()); -#endif do { @@ -641,11 +601,8 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgAlign; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, l_opcgAlign); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, l_opcgAlign); -#endif + //set SNOP Align=8:1 and SNOP Wait=7 // bits: 4:7 SNOP_ALIGN(0:3) 5: 8:1 // bits: 20:31 SNOP_WAIT(0:11) @@ -657,11 +614,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( l_opcgAlign.setBit<31>(); // Do the scom -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgAlign); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgAlign); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -679,11 +632,8 @@ fapi2::ReturnCode setupScanRegionForSetPulse( // Do the scom fapi2::buffer l_scanRegion(i_scanRegion); -#ifndef __PPE__ + l_rc = fapi2::putScom(l_parent, l_scomAddress, l_scanRegion); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_scanRegion); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -704,11 +654,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_clkRegion(l_clk_region); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_clkRegion); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_clkRegion); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -729,11 +675,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgReg0(l_opcg_reg0); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgReg0); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgReg0); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -791,11 +733,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgReg1(l_opcg_reg1); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgReg1); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgReg1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -812,11 +750,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgReg2(l_opcg_reg2); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgReg2); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgReg2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -833,11 +767,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgCapt1(l_opcg_capt1); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgCapt1); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgCapt1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -854,11 +784,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgCapt2(l_opcg_capt2); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgCapt2); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgCapt2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -875,11 +801,7 @@ fapi2::ReturnCode setupScanRegionForSetPulse( fapi2::buffer l_opcgCapt3(l_opcg_capt3); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_opcgCapt3); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_opcgCapt3); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -913,12 +835,10 @@ fapi2::ReturnCode storeOPCGRegData( #endif -#ifndef __PPE__ // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. fapi2::Target l_parent( i_target.template getParent()); -#endif do { @@ -931,11 +851,7 @@ fapi2::ReturnCode storeOPCGRegData( l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgReg0); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgReg0); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -949,11 +865,7 @@ fapi2::ReturnCode storeOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgReg1); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgReg1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -967,11 +879,7 @@ fapi2::ReturnCode storeOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgReg2); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgReg2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -986,11 +894,7 @@ fapi2::ReturnCode storeOPCGRegData( l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgCapt1); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgCapt1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1004,11 +908,7 @@ fapi2::ReturnCode storeOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgCapt2); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgCapt2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1022,11 +922,7 @@ fapi2::ReturnCode storeOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::getScom(l_parent, l_scomAddress, o_OPCGData.l_opcgCapt3); -#else - l_rc = fapi2::getScom(i_target, l_scomAddress, o_OPCGData.l_opcgCapt3); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1059,12 +955,10 @@ fapi2::ReturnCode restoreOPCGRegData( #endif -#ifndef __PPE__ // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. fapi2::Target l_parent( i_target.template getParent()); -#endif do { @@ -1078,11 +972,7 @@ fapi2::ReturnCode restoreOPCGRegData( fapi2::buffer l_clkReg(0); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_clkReg); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_clkReg); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1099,11 +989,7 @@ fapi2::ReturnCode restoreOPCGRegData( l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgReg0); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgReg0); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1117,11 +1003,7 @@ fapi2::ReturnCode restoreOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgReg1); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgReg1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1135,11 +1017,7 @@ fapi2::ReturnCode restoreOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgReg2); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgReg2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1154,11 +1032,7 @@ fapi2::ReturnCode restoreOPCGRegData( l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgCapt1); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgCapt1); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1172,11 +1046,7 @@ fapi2::ReturnCode restoreOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgCapt2); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgCapt2); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1190,11 +1060,7 @@ fapi2::ReturnCode restoreOPCGRegData( // Add the chiplet ID in the Scom Address l_scomAddress |= l_chiplet; -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, i_OPCGData.l_opcgCapt3); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, i_OPCGData.l_opcgCapt3); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { @@ -1658,12 +1524,10 @@ fapi2::ReturnCode cleanScanRegionandTypeData( #endif -#ifndef __PPE__ // Non-PPE platform - Cronus need a Chip target to be used // in putScom/getScom. fapi2::Target l_parent( i_target.template getParent()); -#endif do { @@ -1677,11 +1541,7 @@ fapi2::ReturnCode cleanScanRegionandTypeData( fapi2::buffer l_data(0); -#ifndef __PPE__ l_rc = fapi2::putScom(l_parent, l_scomAddress, l_data); -#else - l_rc = fapi2::putScom(i_target, l_scomAddress, l_data); -#endif if(l_rc != fapi2::FAPI2_RC_SUCCESS) { diff --git a/src/sbefw/sbecmdcntrldmt.C b/src/sbefw/sbecmdcntrldmt.C index d948310b..49a5851d 100644 --- a/src/sbefw/sbecmdcntrldmt.C +++ b/src/sbefw/sbecmdcntrldmt.C @@ -45,11 +45,9 @@ using namespace fapi2; -#ifdef SEEPROM_IMAGE // Using Function pointer to force long call p9_sbe_check_master_stop15_FP_t p9_sbe_check_master_stop15_hwp = &p9_sbe_check_master_stop15; -#endif //////////////////////////////////////////////////////////////////// //Static initialization of the Dmt Pk timer @@ -70,7 +68,8 @@ void sbeDmtPkExpiryCallback(void *) // check stop the system uint32_t l_status = PIB_NO_ERROR; - l_status = putscom_abs_wrap(PERV_N3_LOCAL_FIR_OR, + plat_target_handle_t l_hndl; + l_status = putscom_abs_wrap(&l_hndl, PERV_N3_LOCAL_FIR_OR, N3_FIR_CORE_CHECKSTOP_BIT); if(PIB_NO_ERROR != l_status) { @@ -156,7 +155,7 @@ uint32_t sbeStartCntlDmt() // Go around a loop till you get FAPI2_RC_SUCCESS do { - SBE_EXEC_HWP(l_fapiRc, p9_sbe_check_master_stop15_hwp, l_coreTgt) + l_fapiRc = p9_sbe_check_master_stop15_hwp(l_coreTgt); //Conversion is required here, since ReturnCode doesn't support //comparision '!=' or '==' //TODO RTC:149021 @@ -174,8 +173,8 @@ uint32_t sbeStartCntlDmt() // Only for Pending and Success case if(RC_CHECK_MASTER_STOP15_PENDING != l_rcFapi) // Success { - SBE_EXEC_HWP(l_fapiRc, p9_block_wakeup_intr, l_coreTgt, - p9pmblockwkup::CLEAR ) + l_fapiRc = p9_block_wakeup_intr(l_coreTgt, + p9pmblockwkup::CLEAR ); if( l_fapiRc ) { SBE_ERROR(SBE_FUNC" p9_block_wakeup_intr failed "); diff --git a/src/sbefw/sbescom.C b/src/sbefw/sbescom.C index 81cfafde..b76f51a4 100644 --- a/src/sbefw/sbescom.C +++ b/src/sbefw/sbescom.C @@ -27,6 +27,7 @@ #include "sbe_sp_intf.H" #include "sbetrace.H" #include "plat_hw_access.H" +#include "plat_target.H" using namespace fapi2; /** @@ -80,15 +81,16 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, // If the indirect scom bit is 0, then doing a regular scom if( (i_addr & DIRECT_SCOM_ADDR_MASK) == 0) { + plat_target_handle_t l_hndl; SBE_INFO(SBE_FUNC "Performing Direct scom."); if( i_isRead ) { - o_pcbPibStatus = getscom_abs_wrap ( (uint32_t)i_addr, + o_pcbPibStatus = getscom_abs_wrap (&l_hndl, (uint32_t)i_addr, & io_data); } else { - o_pcbPibStatus = putscom_abs_wrap ( (uint32_t)i_addr, + o_pcbPibStatus = putscom_abs_wrap (&l_hndl, (uint32_t)i_addr, io_data); } break; @@ -129,6 +131,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, // bit 33-47 - bcast/chipletID/port // bit 48-63 - local addr uint64_t tempAddr = i_addr & 0x000000007FFFFFFF; + plat_target_handle_t l_hndl; // If we are doing a read. We need to do a write first.. if( i_isRead) @@ -145,7 +148,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, // perform write before the read with the new // IO_buffer with the imbedded indirect scom addr. - o_pcbPibStatus = putscom_abs_wrap ( tempAddr, tempBuffer); + o_pcbPibStatus = putscom_abs_wrap (&l_hndl, tempAddr, tempBuffer); if( ( o_pcbPibStatus ) || ( scomType == SBE_SCOM_TYPE_INDIRECT_2 )) { @@ -159,7 +162,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, { // Now perform the op requested using the passed in // IO_Buffer to pass the read data back to caller. - o_pcbPibStatus = getscom_abs_wrap ( tempAddr, &(scomout.data64)); + o_pcbPibStatus = getscom_abs_wrap (&l_hndl, tempAddr, &(scomout.data64)); if( o_pcbPibStatus ) break; // if bit 32 is on indicating a complete bit -- cgit v1.2.1