diff options
| author | Prem Shanker Jha <premjha2@in.ibm.com> | 2016-10-21 02:07:16 -0500 |
|---|---|---|
| committer | Joshua Hunsberger <jahunsbe@us.ibm.com> | 2017-10-23 16:53:18 -0500 |
| commit | e8562da550069c2045aa4cf856a251a303539fff (patch) | |
| tree | 547bb2004de347ceda6441ac204939fb18aed7f9 /import/chips/p9/procedures/utils | |
| parent | dd088b547f762421f9fe4dd6630c1522e169814a (diff) | |
| download | talos-hcode-e8562da550069c2045aa4cf856a251a303539fff.tar.gz talos-hcode-e8562da550069c2045aa4cf856a251a303539fff.zip | |
PM: Image layout change for CME/SGPE Region of P9 HOMER.
- implements compact image layout for CME
- implements compact image layout for SGPE
- enhances ring debug infrastructure
- implements size check for consolidated CME/SGPE SRAM Image.
- Reversal of magic byte used to represent FUSED and NON FUSED core.
- enhances putring to support scan ring overrides.
- added gptr and time rings
- updated in SGPE debug pointer location and boot loader constants.
- Fixed ex instance ring issue (need to skip conversion of scan
region type for ex instance ring)
- memset for CME, SGPE override offset init and
sanity check in ring code.
Change-Id: Ifb6157dd73a24e0158e6a5f39844d897fba6af56
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32544
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: AMIT KUMAR <akumar3@us.ibm.com>
Reviewed-by: CHRISTOPHER M. RIEDL <cmriedl@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'import/chips/p9/procedures/utils')
3 files changed, 107 insertions, 98 deletions
diff --git a/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C b/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C index 85664524..ba5547f9 100755 --- a/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C +++ b/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C @@ -487,6 +487,13 @@ StopReturnCode_t p9_stop_save_cpureg( void* const i_pImage, l_rc = getCoreAndThread( i_pImage, i_pir, &coreId, &threadId ); + if( l_rc ) + { + MY_ERR("Failed to determine Core Id and Thread Id from PIR 0x%016llx", + i_pir); + break; + } + MY_INF( " PIR 0x%016llx coreId %d threadid %d " " registerId %d", i_pir, coreId, threadId, i_regId ); diff --git a/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H b/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H index 2f9f8ce3..21f0a077 100755 --- a/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H +++ b/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H @@ -78,7 +78,8 @@ typedef enum STOP_SAVE_SCOM_INVALID_ADDRESS = 10, STOP_SAVE_SCOM_INVALID_CHIPLET = 11, STOP_SAVE_SCOM_ENTRY_UPDATE_FAILED = 12, - STOP_SAVE_FAIL = 13, // for internal failure within firmware. + STOP_SAVE_INVALID_FUSED_CORE_STATUS = 13, + STOP_SAVE_FAIL = 14, // for internal failure within firmware. } StopReturnCode_t; /** diff --git a/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C b/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C index 27f3ad61..902ed28d 100755 --- a/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C +++ b/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C @@ -45,53 +45,53 @@ namespace stopImageSection /** * @brief Returns proc chip's fuse mode status. * @param i_pImage points to start of chip's HOMER image. - * @param o_fuseMode points to fuse mode information. + * @param o_fusedMode points to fuse mode information. * @return STOP_SAVE_SUCCESS if functions succeeds, error code otherwise. */ -StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fuseMode ) +StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fusedMode ) { - *o_fuseMode = false; - StopReturnCode_t l_rc = STOP_SAVE_SUCCESS; +*o_fusedMode = false; +StopReturnCode_t l_rc = STOP_SAVE_SUCCESS; - do +do +{ + if( !i_pImage ) { - if( !i_pImage ) - { - MY_ERR( "invalid pointer to HOMER image"); - l_rc = STOP_SAVE_ARG_INVALID_IMG; - break; - } + MY_ERR( "invalid pointer to HOMER image"); + l_rc = STOP_SAVE_ARG_INVALID_IMG; + break; + } - HomerSection_t* pHomerDesc = ( HomerSection_t* ) i_pImage; - HomerImgDesc_t* pHomer = (HomerImgDesc_t*)( pHomerDesc->interrruptHandler ); - - if( SWIZZLE_8_BYTE(HOMER_MAGIC_WORD) != pHomer->homerMagicNumber ) - { - MY_ERR("corrupt or invalid HOMER image location 0x%016llx", - pHomer->homerMagicNumber ); - break; - } + HomerSection_t* pHomerDesc = ( HomerSection_t* ) i_pImage; + HomerImgDesc_t* pHomer = (HomerImgDesc_t*)( pHomerDesc->interrruptHandler ); + if( SWIZZLE_8_BYTE(CPMR_MAGIC_WORD) != pHomer->cpmrMagicWord ) + { + MY_ERR("corrupt or invalid HOMER image location 0x%016llx", + SWIZZLE_8_BYTE(pHomer->cpmrMagicWord) ); + l_rc = STOP_SAVE_ARG_INVALID_IMG; + break; + } - if( (uint8_t) FUSE_MODE == pHomer->fuseModeStatus ) - { - *o_fuseMode = true; - break; - } + if( (uint8_t) FUSED_MODE == pHomer->fusedModeStatus ) + { + *o_fusedMode = true; + break; + } - if( (uint8_t) REGULAR_MODE == pHomer->fuseModeStatus ) - { - break; - } + if( (uint8_t) NONFUSED_MODE == pHomer->fusedModeStatus ) + { + break; + } - MY_ERR("Unexpected value 0x%08x for fuse mode. Bad or corrupt " - "HOMER location", pHomer->fuseModeStatus ); - l_rc = STOP_SAVE_FAIL; + MY_ERR("Unexpected value 0x%08x for fused mode. Bad or corrupt " + "HOMER location", pHomer->fuseModeStatus ); + l_rc = STOP_SAVE_INVALID_FUSED_CORE_STATUS ; - } - while(0); +} +while(0); - return l_rc; +return l_rc; } //---------------------------------------------------------------------- @@ -99,80 +99,81 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fuseMode ) StopReturnCode_t getCoreAndThread( void* const i_pImage, const uint64_t i_pir, uint32_t* o_pCoreId, uint32_t* o_pThreadId ) { - StopReturnCode_t l_rc = STOP_SAVE_SUCCESS; +StopReturnCode_t l_rc = STOP_SAVE_SUCCESS; - do +do +{ + // for SPR restore using 'Virtual Thread' and 'Physical Core' number + // In Fused Mode: + // bit b28 and b31 of PIR give physical core and b29 and b30 gives + // virtual thread id. + // In Non Fused Mode + // bit 28 and b29 of PIR give both logical and physical core number + // whereas b30 and b31 gives logical and virtual thread id. + bool fusedMode = false; + uint8_t coreThreadInfo = (uint8_t)i_pir; + *o_pCoreId = 0; + *o_pThreadId = 0; + l_rc = isFusedMode( i_pImage, &fusedMode ); + + if( l_rc ) { - // for SPR restore using 'Virtual Thread' and 'Physical Core' number - // In Fuse Mode: - // bit b28 and b31 of PIR give physical core and b29 and b30 gives - // virtual thread id. - // In Non Fuse Mode - // bit 28 and b29 of PIR give both logical and physical core number - // whereas b30 and b31 gives logical and virtual thread id. - bool fuseMode = false; - uint8_t coreThreadInfo = (uint8_t)i_pir; - *o_pCoreId = 0; - *o_pThreadId = 0; - l_rc = isFusedMode( i_pImage, &fuseMode ); - - if( l_rc ) + MY_ERR(" Checking Fused mode. Read failed 0x%08x", l_rc ); + break; + } + + if( fusedMode ) + { + if( coreThreadInfo & FUSED_CORE_BIT1 ) + { + *o_pThreadId = 2; + } + + if( coreThreadInfo & FUSED_CORE_BIT2 ) + { + *o_pThreadId += 1; + } + + if( coreThreadInfo & FUSED_CORE_BIT0 ) + { + *o_pCoreId = 2; + } + + if( coreThreadInfo & FUSED_CORE_BIT3 ) + { + *o_pCoreId += 1; + } + } + else + { + if( coreThreadInfo & FUSED_CORE_BIT0 ) { - MY_ERR(" Checking Fuse mode. Read failed 0x%08x", l_rc ); - break; + *o_pCoreId = 2; } - if( fuseMode ) + if ( coreThreadInfo & FUSED_CORE_BIT1 ) { - if( coreThreadInfo & FUSE_BIT1 ) - { - *o_pThreadId = 2; - } - - if( coreThreadInfo & FUSE_BIT2 ) - { - *o_pThreadId += 1; - } - - if( coreThreadInfo & FUSE_BIT0 ) - { - *o_pCoreId = 2; - } - - if( coreThreadInfo & FUSE_BIT3 ) - { - *o_pCoreId += 1; - } + *o_pCoreId += 1; } - else + + if( coreThreadInfo & FUSED_CORE_BIT2 ) { - if( coreThreadInfo & FUSE_BIT0 ) - { - *o_pCoreId = 2; - } - - if ( coreThreadInfo & FUSE_BIT1 ) - { - *o_pCoreId += 1; - } - - if( coreThreadInfo & FUSE_BIT2 ) - { - *o_pThreadId = 2; - } - - if( coreThreadInfo & FUSE_BIT3 ) - { - *o_pThreadId += 1; - } + *o_pThreadId = 2; } - //quad field is not affected by fuse mode - *o_pCoreId += 4 * (( coreThreadInfo & 0x70 ) >> 4 ); + if( coreThreadInfo & FUSED_CORE_BIT3 ) + { + *o_pThreadId += 1; + } } - while(0); - return l_rc; + MY_INF("Core Type %s", fusedMode ? "Fused" : "Un-Fused" ); + //quad field is not affected by fuse mode + *o_pCoreId += 4 * (( coreThreadInfo & 0x70 ) >> 4 ); +} +while(0); + +return l_rc; } #ifdef __cplusplus |

