diff options
Diffstat (limited to 'src/import/chips/p9')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C | 43 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.C | 20 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.H | 8 | ||||
-rw-r--r-- | src/import/chips/p9/xip/p9_xip_image.C | 4 | ||||
-rw-r--r-- | src/import/chips/p9/xip/p9_xip_image.h | 8 |
5 files changed, 52 insertions, 31 deletions
diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C index bfc425dca..5d4e38372 100644 --- a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C +++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -263,6 +263,7 @@ fapi_try_exit: // Parameter list: // const fapi2::Target &i_target: Processor chip target. // void* i_overlaysSection: Pointer to extracted DD section in hw image +// uint8_t i_ddLevel: DD level (to be used for TOR API level verif) // RingId_t i_ringId: GPTR ring id // void* io_ringBuf2: Work buffer which contains RS4 overlay ring on return. // void* io_ringBuf3: Work buffer which contains data+care raw overlay ring on return. @@ -275,6 +276,7 @@ fapi2::ReturnCode get_overlays_ring( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget, #endif void* i_overlaysSection, + uint8_t i_ddLevel, RingId_t i_ringId, void** io_ringBuf2, void** io_ringBuf3, @@ -289,7 +291,6 @@ fapi2::ReturnCode get_overlays_ring( // As we'll be using tor_get_single_ring() with P9_XIP_MAGIC_SEEPROM // to identify TOR layout for overlays/overrides sections we have to define // following variables (though unused in this context) to support the API. - uint16_t l_ddLevel = 0; // Unused param (dd level) uint8_t l_instanceId = 0; // Unused param (instance id) uint32_t l_ringBlockSize = 0xFFFFFFFF; // Unused param (ringBlockSize) @@ -298,7 +299,7 @@ fapi2::ReturnCode get_overlays_ring( // Get Gptr overlay ring from overlays section into ringBuf2 l_rc = tor_get_single_ring( i_overlaysSection, - l_ddLevel, + i_ddLevel, i_ringId, PT_SBE, OVERLAY, @@ -535,6 +536,7 @@ fapi_try_exit: // Parameter list: // const fapi2::Target &i_target: Processor chip target. // void* i_overlaysSection: Pointer to extracted DD section in hw image +// uint8_t i_ddLevel: DD level (to be used by TOR API level verif) // void* io_vpdRing: Has Mvpd RS4 ring on input and final Vpd RS4 ring on output // void* io_ringBuf2: Ring work buffer(used for RS4 overlay ring) // void* io_ringBuf3: Ring work buffer(used for raw data+care overlay ring) @@ -545,10 +547,11 @@ int process_gptr_rings( fapi2::ReturnCode process_gptr_rings( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget, #endif - void* i_overlaysSection, - void* io_vpdRing, - void* io_ringBuf2, - void* io_ringBuf3) + void* i_overlaysSection, + uint8_t i_ddLevel, + void* io_vpdRing, + void* io_ringBuf2, + void* io_ringBuf3) { ReturnCode l_fapiRc = fapi2::FAPI2_RC_SUCCESS; fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; @@ -566,6 +569,7 @@ fapi2::ReturnCode process_gptr_rings( FAPI_TRY( get_overlays_ring( i_procTarget, i_overlaysSection, + i_ddLevel, l_vpdRingId, &l_ovlyRs4Ring, // Has RS4 ring on return &l_ovlyRawRing, // Has raw data+care ring on return @@ -643,6 +647,7 @@ fapi_try_exit: // uint32_t& io_ringSectionSize: Running ring section size // uint32_t i_maxRingSectionSize: Max ring section size // void* i_overlaysSection: Overlays ring section +// uint8_t i_ddLevel: DD level (to be used for TOR API level verif) // uint8_t i_sysPhase: ={HB_SBE, RT_CME, RT_SGPE} // void* i_vpdRing: VPD ring buffer. // uint32_t i_vpdRingSize: Size of VPD ring buffer. @@ -668,6 +673,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( uint32_t& io_ringSectionSize, uint32_t i_maxRingSectionSize, void* i_overlaysSection, + uint8_t i_ddLevel, uint8_t i_sysPhase, void* i_vpdRing, uint32_t i_vpdRingSize, @@ -779,6 +785,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( FAPI_TRY( process_gptr_rings( i_procTarget, i_overlaysSection, + i_ddLevel, i_vpdRing, i_ringBuf2, i_ringBuf3), @@ -979,6 +986,7 @@ fapi_try_exit: // const fapi::Target &i_target: Processor chip target. // void* i_hwImage: Ptr to ring section. // void** o_overlaysSection: Ptr to extracted DD section in hwImage. +// uint8_t& o_ddLevel: DD level extracted from host services. // bool& o_bGptrMvpdSupport: Boolean art indicating whether Gptr support or not. #ifdef WIN32 int resolve_gptr_overlays( @@ -987,9 +995,10 @@ int resolve_gptr_overlays( fapi2::ReturnCode resolve_gptr_overlays( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget, #endif - void* i_hwImage, - void** o_overlaysSection, - bool& o_bGptrMvpdSupport ) + void* i_hwImage, + void** o_overlaysSection, + uint8_t& o_ddLevel, + bool& o_bGptrMvpdSupport ) { fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; @@ -1041,16 +1050,14 @@ fapi2::ReturnCode resolve_gptr_overlays( } else { - uint8_t l_ddLevel; - // Get the Overlays dd level FAPI_TRY( FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, i_procTarget, - l_ddLevel), + o_ddLevel), "Error: Attribute ATTR_EC failed w/rc=0x%08x", (uint64_t)current_err ); - l_rc = p9_xip_get_section(i_hwImage, P9_XIP_SECTION_HW_OVERLAYS, &l_xipSection, l_ddLevel); + l_rc = p9_xip_get_section(i_hwImage, P9_XIP_SECTION_HW_OVERLAYS, &l_xipSection, o_ddLevel); FAPI_ASSERT( l_rc == 0, fapi2::XIPC_XIP_API_MISC_ERROR(). @@ -1064,7 +1071,7 @@ fapi2::ReturnCode resolve_gptr_overlays( o_bGptrMvpdSupport = true; FAPI_DBG("GPTR support available in overlays for ddLevel=0x%x " "located at addr=0x%08x (hwImage=0x%08x)", - l_ddLevel, *(uint32_t*)o_overlaysSection, *(uint32_t*)i_hwImage); + o_ddLevel, *(uint32_t*)o_overlaysSection, *(uint32_t*)i_hwImage); } fapi_try_exit: @@ -1125,6 +1132,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( uint32_t l_activeCoreMask = 0x0; uint32_t l_bootCoreMaskMin = 0x0; void* l_overlaysSection; + uint8_t l_ddLevel = UNDEFINED_DD_LEVEL; bool bGptrMvpdSupport = false; @@ -1133,6 +1141,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( FAPI_TRY( resolve_gptr_overlays( i_procTarget, i_hwImage, &l_overlaysSection, + l_ddLevel, bGptrMvpdSupport ), "resolve_gptr_overlays() failed w/rc=0x%08x", (uint32_t)current_err ); @@ -1209,6 +1218,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( io_ringSectionSize, i_maxRingSectionSize, l_overlaysSection, + l_ddLevel, i_sysPhase, i_vpdRing, i_vpdRingSize, @@ -1315,6 +1325,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( io_ringSectionSize, i_maxRingSectionSize, l_overlaysSection, + l_ddLevel, i_sysPhase, i_vpdRing, i_vpdRingSize, @@ -1423,6 +1434,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( io_ringSectionSize, i_maxRingSectionSize, l_overlaysSection, + l_ddLevel, i_sysPhase, i_vpdRing, i_vpdRingSize, @@ -1507,6 +1519,7 @@ fapi2::ReturnCode fetch_and_insert_vpd_rings( io_ringSectionSize, i_maxRingSectionSize, l_overlaysSection, + l_ddLevel, i_sysPhase, i_vpdRing, i_vpdRingSize, diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.C b/src/import/chips/p9/utils/imageProcs/p9_tor.C index ac89282a5..b589ad9cc 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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/src/import/chips/p9/utils/imageProcs/p9_tor.H b/src/import/chips/p9/utils/imageProcs/p9_tor.H index 5f38c6739..cd23d4cc3 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.H +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -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/src/import/chips/p9/xip/p9_xip_image.C b/src/import/chips/p9/xip/p9_xip_image.C index 628f5163f..d02186782 100644 --- a/src/import/chips/p9/xip/p9_xip_image.C +++ b/src/import/chips/p9/xip/p9_xip_image.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -2061,7 +2061,7 @@ p9_xip_get_section(const void* i_image, xipTranslateSection(o_hostSection, imageSection); } - if (i_ddLevel == P9_XIP_UNDEFINED_DDLEVEL) + if (i_ddLevel == UNDEFINED_DD_LEVEL) { //Here we always return the entire XIP section. Nothing more to do. } diff --git a/src/import/chips/p9/xip/p9_xip_image.h b/src/import/chips/p9/xip/p9_xip_image.h index 2da60be8d..f92306339 100644 --- a/src/import/chips/p9/xip/p9_xip_image.h +++ b/src/import/chips/p9/xip/p9_xip_image.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -248,9 +248,6 @@ typedef enum { /// gaurantee that the something will be able to complete any 8-byte load/store. #define P9_XIP_FINAL_ALIGNMENT 8 -/// Local undefined DD level value. -#define P9_XIP_UNDEFINED_DDLEVEL (uint8_t)0xff - //////////////////////////////////////////////////////////////////////////// // C Definitions @@ -263,6 +260,7 @@ typedef enum { #include <stdint.h> #endif #include <stddef.h> +#include <common_ringId.H> #ifdef __cplusplus extern "C" { @@ -713,7 +711,7 @@ p9_xip_get_section(const void* i_image, P9XipSection* o_hostSection); #else P9XipSection* o_hostSection, - uint8_t i_ddLevel=P9_XIP_UNDEFINED_DDLEVEL); + uint8_t i_ddLevel=UNDEFINED_DD_LEVEL); #endif |