summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/utils/stopreg
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2018-07-17 02:28:32 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-08-01 10:30:39 -0500
commit0d47fa9358e2ac2326bc74e18b58401322ab10f6 (patch)
tree4f7b10d96259dc744f0ad1dab58f08a5ce6f8ff0 /src/import/chips/p9/procedures/utils/stopreg
parent931118120f2bb5c0e38271582b5b322ed830f661 (diff)
downloadtalos-hostboot-0d47fa9358e2ac2326bc74e18b58401322ab10f6.tar.gz
talos-hostboot-0d47fa9358e2ac2326bc74e18b58401322ab10f6.zip
SCOM Restore: Handle case of old HB and new STOP API case.
Commit addresses a situation where STOP API is new and HB is old. It detects the siutation and retains legacy behavior. This situation can arise if PHYP tries to use SCOM restore changes of STOP API with older fipsdriver or OPAL does the same on older HB binaries. Key_Cronus_Test=PM_REGRESS Change-Id: Iaaa866169904a47e10c79ae4894d2eedccfafe53 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62610 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com> Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62614 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/utils/stopreg')
-rwxr-xr-xsrc/import/chips/p9/procedures/utils/stopreg/p9_stop_api.C23
1 files changed, 21 insertions, 2 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 df1188c50..03d9ff99d 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
@@ -32,6 +32,8 @@
// *HWP Team : PM
// *HWP Level : 2
// *HWP Consumed by : HB:HYP
+
+// *INDENT-OFF*
#ifdef PPC_HYP
#include <HvPlicModule.H>
#endif
@@ -69,6 +71,8 @@ const StopSprReg_t g_sprRegister[] =
};
const uint32_t MAX_SPR_SUPPORTED = 10;
+const uint32_t LEGACY_CORE_SCOM_SUPPORTED = 15;
+const uint32_t LEGACY_QUAD_SCOM_SUPPORTED = 63;
//-----------------------------------------------------------------------------
@@ -835,12 +839,24 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
l_maxScomRestoreEntry =
*(uint32_t*)((uint8_t*)i_pImage + CPMR_HOMER_OFFSET + CPMR_MAX_SCOM_REST_PER_CORE_BYTE);
pScomEntry = CORE_ID_SCOM_START(i_pImage, chipletId )
- cacheEntry = false;
+ cacheEntry = false;
+
+ if( !l_maxScomRestoreEntry )
+ {
+ //Old HB and new STOP API case. Retain legacy Number
+ l_maxScomRestoreEntry = SWIZZLE_4_BYTE(LEGACY_CORE_SCOM_SUPPORTED);
+ }
}
else
{
l_maxScomRestoreEntry =
*(uint32_t*)((uint8_t*)i_pImage + QPMR_HOMER_OFFSET + QPMR_QUAD_MAX_SCOM_ENTRY_BYTE);
+
+ if( !l_maxScomRestoreEntry )
+ {
+ // Incase of a bad HOMER header initialization, fall back on legacy number.
+ l_maxScomRestoreEntry = SWIZZLE_4_BYTE(LEGACY_QUAD_SCOM_SUPPORTED);
+ }
// chiplet is a cache. let us find start address of cache section
// associated with given chiplet. A cache section associated with
// given chiplet is split in to L2, L3 and EQ area.
@@ -891,13 +907,16 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage,
break;
}
+
if(( imageVer > LEGACY_SCOM_RESTORE_VER ) && ( cacheEntry ) )
{
//STOP API migrated to newer algorithm for creation of entries
+
pScomEntry = CACHE_SCOM_ADDR(i_pImage,
chipletId,
l_maxScomRestoreEntry )
- entryLimit = l_maxScomRestoreEntry;
+
+ entryLimit = l_maxScomRestoreEntry;
}
if(( !pScomEntry ) || ( l_rc ) )
OpenPOWER on IntegriCloud