Skip to content

Commit

Permalink
SCOM Restore: Updated EQ SCOM Restore logic.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
premsjha authored and op-jenkins committed Aug 22, 2018
1 parent 058ab06 commit 64f1e84
Showing 1 changed file with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
/* COPYRIGHT 2015,2017 */
/* COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 64f1e84

Please sign in to comment.