summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaus Michael Olsen <cmolsen@us.ibm.com>2017-12-29 14:04:28 -0600
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2018-02-01 16:15:37 -0600
commitdf9c1ff872de4e3a71fa9b49281fed484633c1bc (patch)
treec11888ebf4e5521e66c562d51236c00df90f0558
parenta6bc2967232a7155b5c61f5feaed21a0f36733bf (diff)
downloadtalos-hcode-df9c1ff872de4e3a71fa9b49281fed484633c1bc.tar.gz
talos-hcode-df9c1ff872de4e3a71fa9b49281fed484633c1bc.zip
xip_customize and TOR API: Improved DD level verification
This update propagates the extracted EC level in xip_customize through to the TOR API via the call to tor_get_single_ring(). The TOR API has been updated to verify that the requested DD level matches matches the DD level in the TOR header of the supplied ring section which, in the case of xip_customize, is an .overlays ring section. Key_Cronus_Test=XIP_REGRESS Change-Id: Ic087c269306acc0afcb8c759fe68eac63ae93d29 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51339 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Sumit Kumar <sumit_kumar@in.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
-rw-r--r--import/chips/p9/utils/imageProcs/p9_tor.C18
-rw-r--r--import/chips/p9/utils/imageProcs/p9_tor.H6
-rw-r--r--import/chips/p9/xip/p9_xip_tool.C10
3 files changed, 22 insertions, 12 deletions
diff --git a/import/chips/p9/utils/imageProcs/p9_tor.C b/import/chips/p9/utils/imageProcs/p9_tor.C
index e2bd3890..5be81318 100644
--- a/import/chips/p9/utils/imageProcs/p9_tor.C
+++ b/import/chips/p9/utils/imageProcs/p9_tor.C
@@ -284,7 +284,7 @@ int get_ring_from_ring_section( void* i_ringSection, // Ring secti
//////////////////////////////////////////////////////////////////////////////////////////
int tor_access_ring( void* i_ringSection, // Ring section ptr
RingId_t i_ringId, // Ring ID
- uint16_t i_ddLevel, // DD level
+ uint8_t i_ddLevel, // DD level
PpeType_t i_ppeType, // SBE, CME, SGPE
RingVariant_t i_ringVariant, // Base,CC,RL (SBE,CME,SGPE only)
uint8_t& io_instanceId, // Instance ID
@@ -372,6 +372,16 @@ int tor_access_ring( void* i_ringSection, // Ring section ptr
}
}
+ else
+ {
+ if ( i_ddLevel != torHeader->ddLevel &&
+ i_ddLevel != UNDEFINED_DD_LEVEL )
+ {
+ MY_ERR("Requested DD level (=0x%x) doesn't match TOR header DD level (=0x%x) nor UNDEFINED_DD_LEVEL\n",
+ i_ddLevel, torHeader->ddLevel);
+ return TOR_DD_LEVEL_NOT_FOUND;
+ }
+ }
if ( ( i_ringBlockType == GET_SINGLE_RING ) || // All Magics supported for GET
( i_ringBlockType == PUT_SINGLE_RING && // Can only append to SBE,CME,SGPE
@@ -491,7 +501,7 @@ int tor_access_ring( void* i_ringSection, // Ring section ptr
//
/////////////////////////////////////////////////////////////////////////////////////
int tor_get_single_ring ( void* i_ringSection, // Ring section ptr
- uint16_t i_ddLevel, // DD level
+ uint8_t i_ddLevel, // DD level
RingId_t i_ringId, // Ring ID
PpeType_t i_ppeType, // SBE, CME, SGPE
RingVariant_t i_ringVariant, // Base,CC,RL (SBE/CME/SGPE only)
@@ -537,7 +547,7 @@ int tor_get_single_ring ( void* i_ringSection, // Ring section ptr
//
///////////////////////////////////////////////////////////////////////////////////////
int tor_get_block_of_rings ( void* i_ringSection, // Ring section ptr
- uint16_t i_ddLevel, // DD level
+ uint8_t i_ddLevel, // DD level
PpeType_t i_ppeType, // SBE,CME,SGPE
RingVariant_t i_ringVariant, // Base,CC,RL
void** io_ringBlockPtr, // Output ring buffer
@@ -643,7 +653,7 @@ int tor_append_ring( void* i_ringSection, // Ring section ptr
rc = tor_access_ring( i_ringSection,
i_ringId,
- 0x00,
+ UNDEFINED_DD_LEVEL,
i_ppeType,
i_ringVariant,
i_instanceId,
diff --git a/import/chips/p9/utils/imageProcs/p9_tor.H b/import/chips/p9/utils/imageProcs/p9_tor.H
index 4453d373..0ab3eb01 100644
--- a/import/chips/p9/utils/imageProcs/p9_tor.H
+++ b/import/chips/p9/utils/imageProcs/p9_tor.H
@@ -127,7 +127,7 @@ typedef enum RingBlockType
/// \retval non-0 See \ref TOR API RETURN errors
int tor_access_ring( void* i_ringSection, // Ring section ptr
RingId_t i_ringId, // Unique ring ID
- uint16_t i_ddLevel, // DD level info
+ uint8_t i_ddLevel, // DD level info
PpeType_t i_PpeType, // PPE type : SBE, CME, etc
RingVariant_t i_RingVariant, // Base, Cache etc
uint8_t& io_instanceId, // chiplet instance ID
@@ -176,7 +176,7 @@ int tor_access_ring( void* i_ringSection, // Ring section ptr
///
/// \retval non-0 See \ref TOR API RETURN errors
int tor_get_single_ring ( void* i_ringSection,
- uint16_t i_ddLevel,
+ uint8_t i_ddLevel,
RingId_t i_ringId,
PpeType_t i_PpeType,
RingVariant_t i_RingVariant,
@@ -220,7 +220,7 @@ int tor_get_single_ring ( void* i_ringSection,
///
/// \retval non-0 See \ref TOR API RETURN errors
int tor_get_block_of_rings ( void* i_ringSection,
- uint16_t i_ddLevel,
+ uint8_t i_ddLevel,
PpeType_t i_PpeType,
RingVariant_t i_RingVariant,
void** io_ringBlockPtr,
diff --git a/import/chips/p9/xip/p9_xip_tool.C b/import/chips/p9/xip/p9_xip_tool.C
index ef05408a..c5f5782c 100644
--- a/import/chips/p9/xip/p9_xip_tool.C
+++ b/import/chips/p9/xip/p9_xip_tool.C
@@ -1320,7 +1320,7 @@ extract(const char* i_imageFile, const int i_imageFd, void* io_image,
const char* i_sectionName; //Direct copy of input arg, thus i_
const char* i_fileName; //Same
std::string i_ddLevelStr; //Same
- uint8_t ddLevel = P9_XIP_UNDEFINED_DDLEVEL;
+ uint8_t ddLevel = UNDEFINED_DD_LEVEL;
bool bDdSuppExpected = false;
int fileFd, sectionId;
void* newImage;
@@ -1356,7 +1356,7 @@ extract(const char* i_imageFile, const int i_imageFd, void* io_image,
" Output file: %s\n",
i_sectionName, i_fileName);
- ddLevel = P9_XIP_UNDEFINED_DDLEVEL;
+ ddLevel = UNDEFINED_DD_LEVEL;
bDdSuppExpected = false;
if (i_argc == 3)
@@ -1402,7 +1402,7 @@ extract(const char* i_imageFile, const int i_imageFd, void* io_image,
if (ddLevel == 0)
{
- ddLevel = P9_XIP_UNDEFINED_DDLEVEL;
+ ddLevel = UNDEFINED_DD_LEVEL;
// Even though this may seem like we should just exit here, we'll leave it up
// to xip_get_section what to do in this case. Who knows, maybe it'll eventually
// return a list of supported DD levels.
@@ -1884,9 +1884,9 @@ int dissectRingSectionTor( uint8_t* i_ringSection,
uint32_t i;
RingId_t numRingIds = 0;
uint32_t torMagic = 0xffffffff; // Undefined value
- ChipType_t chipType = UNDEFINED_CHIP_TYPE; // Undefined value
+ ChipType_t chipType = UNDEFINED_CHIP_TYPE;
uint32_t numDdLevels = 0; // Undefined value
- uint8_t iDdLevel, ddLevel = 0xff; // Undefined value
+ uint8_t iDdLevel, ddLevel = UNDEFINED_DD_LEVEL;
PpeType_t ppeType;
RingId_t ringId;
RingVariant_t ringVariant;
OpenPOWER on IntegriCloud