aboutsummaryrefslogtreecommitdiff
path: root/libpore
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2017-10-26 01:44:57 -0500
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-01 08:01:01 +1100
commitc4ff9557e99a9bb0fa7e771853beb0efc4c09b1d (patch)
tree2449c6a86945788c2f90d6f329ce0f1bb35e6818 /libpore
parent1156b5f04b3e2724ccf4af415c10ea6e8af089ea (diff)
downloadskiboot-c4ff9557e99a9bb0fa7e771853beb0efc4c09b1d.zip
skiboot-c4ff9557e99a9bb0fa7e771853beb0efc4c09b1d.tar.gz
skiboot-c4ff9557e99a9bb0fa7e771853beb0efc4c09b1d.tar.bz2
p9_stop_api: PM: Added support for version control in SCOM restore entries.
- adds version info in SCOM restore entry header - adds version specific details in SCOM restore entry header - retains old behavior of SGPE Hcode's base version Key_Cronus_Test=NO_TEST CQ:HW423686 HW-Image-Prereq: Ie1611b009e95192a0dad3a47af14ef8a36dd454b Change-Id: I43e7e067b59513db1c99ce913009a9a3ef5de90b Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48856 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Dev-Ready: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48859 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> (cherry picked from hostboot commit 47c3bbe42264514a25e00820cac1c8488aed9073) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libpore')
-rw-r--r--libpore/p9_stop_api.C68
-rw-r--r--libpore/p9_stop_api.H9
2 files changed, 73 insertions, 4 deletions
diff --git a/libpore/p9_stop_api.C b/libpore/p9_stop_api.C
index 33a3bf3..cbbdfdd 100644
--- a/libpore/p9_stop_api.C
+++ b/libpore/p9_stop_api.C
@@ -749,6 +749,41 @@ static StopReturnCode_t updateScomEntry( uint32_t i_scomAddr, uint64_t i_scomDat
}
//-----------------------------------------------------------------------------
+/**
+ * @brief populates SCOM restore entry header with version and layout info.
+ * @param[in] i_scomEntry points to SCOM restore entry
+ * @param[in] i_section section of SCOM restore area
+ * @param[in] i_imageVer SGPE image version
+ */
+
+static void updateEntryHeader( ScomEntry_t* i_scomEntry ,
+ const ScomSection_t i_section,
+ uint32_t i_imageVer )
+{
+ uint32_t l_temp = 0;
+ uint32_t l_entryLimit = 0;
+
+ if( i_imageVer >= STOP_API_VER_CONTROL )
+ {
+ if( P9_STOP_SECTION_CORE_SCOM == i_section )
+ {
+ l_entryLimit = MAX_CORE_SCOM_ENTRIES;
+ }
+ else
+ {
+ l_entryLimit = MAX_EQ_SCOM_ENTRIES + MAX_L2_SCOM_ENTRIES +
+ MAX_L3_SCOM_ENTRIES;
+ }
+
+ l_temp |= ( STOP_API_VER & 0x7 ) << 28;
+ l_temp |= ( 0x000000ff & l_entryLimit );
+ i_scomEntry->scomEntryHeader = SWIZZLE_4_BYTE(l_temp);
+
+ MY_INF("SCOM Restore Header 0x%08x", l_temp );
+ }
+}
+
+//-----------------------------------------------------------------------------
StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
const uint32_t i_scomAddress,
@@ -765,14 +800,23 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
uint32_t nopInst;
ScomEntry_t* pEntryLocation = NULL;
ScomEntry_t* pNopLocation = NULL;
+ ScomEntry_t* pEditScomHeader = NULL;
ScomEntry_t* pTableEndLocationtable = NULL;
uint32_t swizzleAddr;
uint64_t swizzleData;
uint32_t swizzleAttn;
- uint32_t swizzleEntry;
+ uint32_t entrySwzHeader = 0;
uint32_t index = 0;
uint32_t swizzleBlr = SWIZZLE_4_BYTE(BLR_INST);
+ //Reads SGPE image version info from QPMR Header in HOMER
+ //For backward compatibility, for base version of SGPE Hcode,
+ //STOP API retains default behavior but adds version specific
+ //details in each entry in later versions.
+
+ uint32_t imageVer = *(uint32_t*)((uint8_t*)i_pImage + QPMR_HOMER_OFFSET + QPMR_BUILD_VER_BYTE);
+ imageVer = SWIZZLE_4_BYTE(imageVer);
+
do
{
chipletId = i_scomAddress >> 24;
@@ -862,11 +906,11 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
swizzleAddr = SWIZZLE_4_BYTE(i_scomAddress);
swizzleData = SWIZZLE_8_BYTE(i_scomData);
swizzleAttn = SWIZZLE_4_BYTE(ATTN_OPCODE);
- swizzleEntry = SWIZZLE_4_BYTE(SCOM_ENTRY_START);
for( index = 0; index < entryLimit; ++index )
{
uint32_t entrySwzAddress = pScomEntry[index].scomEntryAddress;
+ entrySwzHeader = SWIZZLE_4_BYTE(pScomEntry[index].scomEntryHeader);
if( ( swizzleAddr == entrySwzAddress ) && ( !pEntryLocation ) )
@@ -881,7 +925,10 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
pNopLocation = &pScomEntry[index];
}
- if( swizzleEntry == pScomEntry[index].scomEntryHeader )
+ // if entry is either 0xDEADDEAD or has SCOM entry limit in LSB of header
+ // place is already occupied
+ if( ( SCOM_ENTRY_START == entrySwzHeader ) ||
+ ( entrySwzHeader & 0x000000FF ) )
{
continue;
}
@@ -916,6 +963,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = updateScomEntry ( swizzleAddr,
swizzleData, pScomAppend );
+
+ pEditScomHeader = pScomAppend;
}
break;
@@ -934,6 +983,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = updateScomEntry( swizzleAddr,
swizzleData, scomReplace );
+
+ pEditScomHeader = scomReplace;
}
break;
@@ -947,6 +998,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
swizzleData,
pEntryLocation,
i_operation );
+
+ pEditScomHeader = pEntryLocation;
}
else
{
@@ -997,6 +1050,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
swizzleData,
editAppend,
tempOperation );
+
+ pEditScomHeader = editAppend;
}
break;
@@ -1004,7 +1059,6 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = STOP_SAVE_SCOM_INVALID_OPERATION;
break;
}
-
}
while(0);
@@ -1014,6 +1068,12 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
"0x%08x", i_operation, chipletId ,
i_scomAddress );
}
+ else
+ {
+ //Update SCOM Restore entry with version and memory layout
+ //info
+ updateEntryHeader( pEditScomHeader, i_section, imageVer );
+ }
return l_rc;
}
diff --git a/libpore/p9_stop_api.H b/libpore/p9_stop_api.H
index 79abd00..6416771 100644
--- a/libpore/p9_stop_api.H
+++ b/libpore/p9_stop_api.H
@@ -117,6 +117,15 @@ typedef enum
P9_STOP_SECTION_MAX = 5
} ScomSection_t;
+/**
+ * @brief versions pertaining relvant to STOP API.
+ */
+typedef enum
+{
+ STOP_API_VER = 0x00,
+ STOP_API_VER_CONTROL = 0x02,
+} VersionList_t;
+
#ifdef __cplusplus
extern "C" {
#endif