summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2016-10-21 02:07:16 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-12-05 18:36:43 -0500
commit39e3956aba9ee7b7edf53aadcdec8f506429369b (patch)
tree7aaa79c29275f78ef1e4319e0af25477cfd7277e /src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
parent8047a6422e3d7a205ea7496c94c986d10de1f094 (diff)
downloadtalos-hostboot-39e3956aba9ee7b7edf53aadcdec8f506429369b.tar.gz
talos-hostboot-39e3956aba9ee7b7edf53aadcdec8f506429369b.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> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32567 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C')
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C195
1 files changed, 98 insertions, 97 deletions
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
index 0b89c164f..fa13eee64 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C
+++ b/src/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
OpenPOWER on IntegriCloud