diff options
author | Girisankar Paulraj <gpaulraj@in.ibm.com> | 2016-08-16 04:13:22 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-09-26 03:13:48 -0400 |
commit | 3b878b3f38e61a4f407888c4d1f7eab0cfcec22f (patch) | |
tree | 8dbf86d890eba4f3addb6ae67a7d622b1c7aea92 /src/import | |
parent | 1a6b96d18a539bbe6875f97a7f3ee4da32b47d34 (diff) | |
download | talos-sbe-3b878b3f38e61a4f407888c4d1f7eab0cfcec22f.tar.gz talos-sbe-3b878b3f38e61a4f407888c4d1f7eab0cfcec22f.zip |
Adding CME/SGPE ppe get_single_ring support
get_ring_from_sgpe_image and get_ring_from_cme_image function
support only HW_image get ring. add condition for support CME and
SGPE ppe type get ring functionality. Now, Extracted CME and SGPE
ppe ring passed through tor_access_ring. So,User can extract
single ring container from CME and SGPE ppe type rings block.
Change-Id: I198976deac00e4d0237be14933dded1c35131931
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28299
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30262
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.C | 95 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.H | 4 |
2 files changed, 70 insertions, 29 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.C b/src/import/chips/p9/utils/imageProcs/p9_tor.C index c96b859b..f03093e9 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.C @@ -531,8 +531,20 @@ int get_ring_from_sgpe_image ( void* i_ringSection, // Image pointer uint32_t ringSize = 0; int temp = (i_ddLevel >> 2) + 4; // converting byte to word counter uint32_t* deltaRingRS4_4B; - uint32_t spge_offset = *((uint32_t*)i_ringSection + temp); - temp = htobe32(spge_offset); + uint32_t spge_offset = 0; + + if (i_magic == P9_XIP_MAGIC_HW) + { + spge_offset = *((uint32_t*)i_ringSection + temp); //DD level offset index + temp = htobe32(spge_offset); + } + else if (i_magic == P9_XIP_MAGIC_SGPE) + { + spge_offset = 0; + i_ddLevel = 0; + temp = htobe32(spge_offset); + } + GenRingIdList* ring_id_list_common = NULL; GenRingIdList* ring_id_list_instance = NULL; uint8_t iv_num_variant = (uint8_t)sizeof(EQ::RingVariants) / sizeof(uint16_t); @@ -808,8 +820,20 @@ int get_ring_from_cme_image ( void* uint32_t ringSize = 0; int temp = (i_ddLevel >> 2) + 2; // converting byte to word counter uint32_t* deltaRingRS4_4B; - uint32_t cme_offset = *((uint32_t*)i_ringSection + temp); - temp = htobe32(cme_offset); + uint32_t cme_offset = 0; + + if (i_magic == P9_XIP_MAGIC_HW) + { + cme_offset = *((uint32_t*)i_ringSection + temp); //DD level offset index + temp = htobe32(cme_offset); + } + else if (i_magic == P9_XIP_MAGIC_CME) + { + cme_offset = 0; + i_ddLevel = 0; + temp = htobe32(cme_offset); + } + GenRingIdList* ring_id_list_common = NULL; GenRingIdList* ring_id_list_instance = NULL; uint8_t iv_num_variant = (uint8_t)sizeof(EC::RingVariants) / sizeof(uint16_t); @@ -1146,29 +1170,42 @@ int tor_access_ring( void* } else if( i_magic == P9_XIP_MAGIC_SEEPROM) { - if ( i_PpeType == CME) + if ( i_PpeType == CME || i_PpeType == SGPE + || i_RingBlockType == GET_DD_LEVEL_RINGS + || i_RingBlockType == GET_PPE_LEVEL_RINGS ) { - MY_INF("Ambiguity on input PARMS for calling SEEPROM Ring copy API. \n "\ - " CME rings not populated on SEEPROM image \n"); - return IMGBUILD_TGR_IMAGE_DOES_NOT_SUPPORT_CME; + MY_INF("Ambiguity on input PARMS for calling SEEPROM Ring copy API. \n"); + return IMGBUILD_TGR_AMBIGUOUS_API_PARMS; } - else if (i_PpeType == SGPE) + else { - MY_INF("Ambiguity on input PARMS for calling SEEPROM Ring copy API. \n "\ - "SGPE rings not populated on SEEPROM image \n"); - return IMGBUILD_TGR_IMAGE_DOES_NOT_SUPPORT_SGPE; + ddLevelOffset = 0; + temp1 = 0; } - else if (i_RingBlockType == GET_DD_LEVEL_RINGS) + } + else if( i_magic == P9_XIP_MAGIC_CME) + { + if ( i_PpeType == SBE || i_PpeType == SGPE + || i_RingBlockType == GET_DD_LEVEL_RINGS + || i_RingBlockType == GET_PPE_LEVEL_RINGS ) { - MY_INF("Ambiguity on input PARMS for calling SEEPROM Ring copy API. \n "\ - " DD level ring copy are not supported \n"); - return IMGBUILD_TGR_IMAGE_DOES_NOT_SUPPORT_DD_LEVEL; + MY_INF("Ambiguity on input PARMS for calling CME Ring copy API. \n"); + return IMGBUILD_TGR_AMBIGUOUS_API_PARMS; } - else if (i_RingBlockType == GET_PPE_LEVEL_RINGS ) + else { - MY_INF("Ambiguity on input PARMS for calling SEEPROM Ring copy API. \n "\ - " PPE level ring copy are not supported \n"); - return IMGBUILD_TGR_IMAGE_DOES_NOT_SUPPORT_PPE_LEVEL; + ddLevelOffset = 0; + temp1 = 0; + } + } + else if( i_magic == P9_XIP_MAGIC_SGPE) + { + if ( i_PpeType == SBE || i_PpeType == CME + || i_RingBlockType == GET_DD_LEVEL_RINGS + || i_RingBlockType == GET_PPE_LEVEL_RINGS ) + { + MY_INF("Ambiguity on input PARMS for calling SGPE Ring copy API. \n"); + return IMGBUILD_TGR_AMBIGUOUS_API_PARMS; } else { @@ -1785,13 +1822,13 @@ int tor_access_ring( void* } else if ( rc == IMGBUILD_TGR_RING_AVAILABLE_IN_RINGSECTION) { - MY_INF("\t After SBE single ring call, Ring container is available in the image \n"); + MY_INF("\t After CME single ring call, Ring container is available in the image \n"); return rc; } if(i_dbgl > 1) { - MY_INF("TOR_ACCESS_RING(11): After get_ring_from_sbe_image Size %d \n", + MY_INF("TOR_ACCESS_RING(11): After get_ring_from_cme_image Size %d \n", io_ringBlockSize ); } } @@ -1824,13 +1861,13 @@ int tor_access_ring( void* } else if ( rc == IMGBUILD_TGR_RING_AVAILABLE_IN_RINGSECTION) { - MY_INF("\t After SBE single ring call, Ring container is available in the image \n"); + MY_INF("\t After SGPE single ring call, Ring container is available in the image \n"); return rc; } if(i_dbgl > 1) { - MY_INF("TOR_ACCESS_RING(12): After get_ring_from_sbe_image Size %d \n", + MY_INF("TOR_ACCESS_RING(12): After get_ring_from_sgpe_image Size %d \n", io_ringBlockSize ); } } @@ -1846,13 +1883,14 @@ int tor_access_ring( void* ///////////////////////////////////////////////////////////////////////////////////// int tor_get_single_ring ( void* i_ringSection, // ring section pointer + uint64_t i_magic, // Image Magic Number uint16_t i_ddLevel, // DD level info RingID i_ringId, // Ring ID info PpeType_t i_PpeType, // ppe Type info RingVariant_t i_RingVariant, // ring variant info -Base, CC, RL,OR,OL uint8_t i_instanceId, // chiplet Instance Id void** io_ringBlockPtr, // Output void pointer - uint32_t& io_ringBlockSize, // size of ring + uint32_t& io_ringBlockSize, // size of ring uint32_t i_dbgl ) { @@ -1870,7 +1908,7 @@ int tor_get_single_ring ( void* i_ringSection, // ring section pointer rc = tor_access_ring( i_ringSection, - P9_XIP_MAGIC_HW, + i_magic, i_ringId, i_ddLevel, i_PpeType, @@ -1904,7 +1942,7 @@ int tor_get_block_of_rings ( void* i_ringSection, uint8_t i_instanceId, void** io_ringBlockPtr, uint32_t& io_ringBlockSize, - uint32_t i_dbgl ) + uint32_t i_dbgl ) { if(i_dbgl > 1) { @@ -2000,7 +2038,6 @@ int tor_append_ring( void* i_ringSection, // Ring address Ptr an uint32_t i_dbgl ) { uint32_t rc = 0; - uint32_t dbgl = 2; char i_ringName[25]; uint16_t l_ringTypeBuf = 0; uint16_t* l_ringTypeStart = &l_ringTypeBuf; @@ -2049,7 +2086,7 @@ int tor_append_ring( void* i_ringSection, // Ring address Ptr an return rc; } - if(dbgl > 1) + if(i_dbgl > 1) { MY_INF(" TOR_APPEND_RING(4): Ring offset address %d \n", l_torOffsetSlot ); diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.H b/src/import/chips/p9/utils/imageProcs/p9_tor.H index 78ce7e8b..d51061df 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.H +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.H @@ -297,6 +297,9 @@ int tor_access_ring( void* i_ringSection, // Ring address Ptr any of . /// It contain details of p9 Ring which is used for scanning operation. /// TOR API supports HW image format only /// +/// \param[in] i_magic A uint64_t variable to indicate XIP image format +/// ring section passed +/// /// \param[in] i_ringId A enum to indicate unique ID for the ring /// /// \param[in] i_ddLevel A variable to indicate chip DD level. TOR API @@ -328,6 +331,7 @@ int tor_access_ring( void* i_ringSection, // Ring address Ptr any of . /// /// \retval non-0 See \ref TOR API RETURN errors int tor_get_single_ring ( void* i_ringSection, + uint64_t i_magic, // Image Magic Number uint16_t i_ddLevel, RingID i_ringId, PpeType_t i_PpeType, |