summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/utils
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2017-10-26 01:44:57 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2017-11-16 17:57:11 -0500
commit47c3bbe42264514a25e00820cac1c8488aed9073 (patch)
tree5671f87feebd4839514c81e410479d4d838cb24b /src/import/chips/p9/procedures/utils
parent5ef4ce5ebbcdd8800fbbf4b20ca44e7443d4ebaf (diff)
downloadtalos-hostboot-47c3bbe42264514a25e00820cac1c8488aed9073.tar.gz
talos-hostboot-47c3bbe42264514a25e00820cac1c8488aed9073.zip
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>
Diffstat (limited to 'src/import/chips/p9/procedures/utils')
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C68
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H9
2 files changed, 73 insertions, 4 deletions
diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C
index 26a14bbfa..7242c423c 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C
+++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C
@@ -751,6 +751,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,
@@ -767,14 +802,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;
@@ -864,11 +908,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 ) )
@@ -883,7 +927,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;
}
@@ -918,6 +965,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = updateScomEntry ( swizzleAddr,
swizzleData, pScomAppend );
+
+ pEditScomHeader = pScomAppend;
}
break;
@@ -936,6 +985,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = updateScomEntry( swizzleAddr,
swizzleData, scomReplace );
+
+ pEditScomHeader = scomReplace;
}
break;
@@ -949,6 +1000,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
swizzleData,
pEntryLocation,
i_operation );
+
+ pEditScomHeader = pEntryLocation;
}
else
{
@@ -999,6 +1052,8 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
swizzleData,
editAppend,
tempOperation );
+
+ pEditScomHeader = editAppend;
}
break;
@@ -1006,7 +1061,6 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_rc = STOP_SAVE_SCOM_INVALID_OPERATION;
break;
}
-
}
while(0);
@@ -1016,6 +1070,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/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H
index 79abd0006..6416771d1 100755
--- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_api.H
+++ b/src/import/chips/p9/procedures/utils/stopreg/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
OpenPOWER on IntegriCloud