diff options
author | Prem Shanker Jha <premjha2@in.ibm.com> | 2018-03-29 09:23:26 -0500 |
---|---|---|
committer | hostboot <hostboot@us.ibm.com> | 2018-08-22 17:56:03 -0500 |
commit | 64f1e841cc6647e73adb105269553da05dc75a92 (patch) | |
tree | fa4d066d21dcf915d36e1a4aa9bda9a1ad712c00 /import/chips/p9/procedures/ppe_closed | |
parent | 058ab063c16f195dfa157bc44deeaa1e5522d284 (diff) | |
download | talos-hcode-64f1e841cc6647e73adb105269553da05dc75a92.tar.gz talos-hcode-64f1e841cc6647e73adb105269553da05dc75a92.zip |
SCOM Restore: Updated EQ SCOM Restore logic.
Commit looks in to QPMR header and determines max number of
SCOM restore entries supported. This info is used to determine
start address of quad SCOM restore entries for each quad.
Key_Cronus_Test=PM_REGRESS
RTC: 188827
CQ: SW440378
Change-Id: Ie13a5110384e4161615167b238aecd4e2e0b9902
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/56502
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Dev-Ready: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Diffstat (limited to 'import/chips/p9/procedures/ppe_closed')
-rw-r--r-- | import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_hcd_cache_scomcust.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_hcd_cache_scomcust.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_hcd_cache_scomcust.c index 7295ae5e..a69f561e 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_hcd_cache_scomcust.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_hcd_cache_scomcust.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2015,2017 */ +/* COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -42,37 +42,40 @@ p9_hcd_cache_scomcust(uint32_t quad, uint32_t m_ex, int is_stop8) uint16_t scom_rest_len = 0; // To access memory, need to set MSB of homer address - QpmrHeaderLayout_t* pQpmrHdrAddr = (QpmrHeaderLayout_t*)(HOMER_QPMR_HEADER_ADDR); - ScomEntry_t* pSgpeScomRes = ( ScomEntry_t*) ( pQpmrHdrAddr->quadScomOffset + (uint32_t)pQpmrHdrAddr ); - scom_rest_len = ( pQpmrHdrAddr->quadScomLength / (sizeof( ScomEntry_t )) ); - - for( i = 0; i < scom_rest_len; i++ ) + QpmrHeaderLayout_t* pQpmrHdrAddr = (QpmrHeaderLayout_t*)(HOMER_QPMR_HEADER_ADDR); + ScomEntry_t* pSgpeScomRes = ( ScomEntry_t*) ( pQpmrHdrAddr->quadScomOffset + (uint32_t)pQpmrHdrAddr ); + scom_rest_size = pQpmrHdrAddr->maxQuadScomRestoreEntry; + scom_rest_size++; + scom_rest_size = (scom_rest_size * sizeof(ScomEntry_t)); + scom_rest_len = ( pQpmrHdrAddr->quadScomLength / (sizeof( ScomEntry_t )) ); + + if( !pQpmrHdrAddr->maxQuadScomRestoreEntry ) { - if( SCOM_ENTRY_MARK == pSgpeScomRes->scomEntryHeader.scomRestHeaderValue ) - { - scom_rest_size = SCOM_REST_SIZE_PER_EQ; - break; - } - else if ( pSgpeScomRes->scomEntryHeader.scomRestHeaderValue ) - { - scom_rest_size = - ( pSgpeScomRes->scomEntryHeader.scomRestHeader.entryLimit + 1 ) * sizeof( ScomEntry_t ); - break; - } - else + //We failed to get max entries supported from header. + //Let us try to determine it from SCOM Restore entry + //This also maintains backward compatibility. + + for( i = 0; i < scom_rest_len; i++ ) { - pSgpeScomRes++; - continue; + if( SCOM_ENTRY_MARK == pSgpeScomRes->scomEntryHeader.scomRestHeaderValue ) + { + scom_rest_size = SCOM_REST_SIZE_PER_EQ; + break; + } + else if ( pSgpeScomRes->scomEntryHeader.scomRestHeaderValue ) + { + scom_rest_size = + ( pSgpeScomRes->scomEntryHeader.scomRestHeader.entryLimit + 1 ) * sizeof( ScomEntry_t ); + break; + } + else + { + pSgpeScomRes++; + continue; + } } } - if( !scom_rest_size ) - { - PK_TRACE("ERR: Quad SCOM Restore Entry Not Found"); - asm volatile( "trap" ::: ); - } - - // doing this instead of multiply since there is no multiply instruction with ppe. for(i = 0; i < quad; i++) { qoffset += scom_rest_size; |