diff options
author | Yue Du <daviddu@us.ibm.com> | 2017-02-09 17:07:44 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-03-06 16:30:56 -0500 |
commit | 9630c0f54dbac14cd848b3673f2556e72d273059 (patch) | |
tree | 826761f9f76fee4fa2928089884bc662ee4ea954 /src/import/chips/p9/procedures/utils | |
parent | d0bc5a168223ce85d1f3810edc0a93608a18b4b6 (diff) | |
download | talos-hostboot-9630c0f54dbac14cd848b3673f2556e72d273059.tar.gz talos-hostboot-9630c0f54dbac14cd848b3673f2556e72d273059.zip |
Hcode: Create centralized memory map headers
findings and todos:
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
redundant cpmr linker
not sure which one is in use
cme/link.cmd
cme/linkcpmr.cmd
cme/stop_cme/link_cpmr.cmd
sgpe/stop_gpe/link.cmd
sgpe/stop_gpe/linkqpmr.cmd
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
redundant asm of cpmr and qpmr headers:
not sure which one is in use
file names are inconsistant and confusing
cme/p9_cpmr_header.S
cme/stop_cme/p9_cme_cpmr.S
cme/stop_cme/p9_cme_header.S
sgpe/p9_sgpe_qpmr.S
sgpe/stop_gpe/p9_sgpe_qpmr.S
sgpe/stop_gpe/p9_sgpe_image_header.S
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
redundant edit programs
not sure which ones are still useful
contents are overlapping and out updated
(i.e. cme one still try to edit build date/ver)
cme/p9_cpmr_img_edit.C
cme/stop_cme/p9_cme_img_edit.c
cme/stop_cme/p9_cme_edit.mk
sgpe/p9_sgpe_img_edit.c
sgpe/stop_gpe/p9_sgpe_img_edit.c
sgpe/stop_gpe/p9_sgpe_edit.mk
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
previous local makefiles
not sure if still useful
optional to keep or delete
cme/Makefile
cme/img_defs.mk
sgpe/Makefile
sgpe/img_defs.mk
sgpe/stop_gpe/Makefile
sgpe/stop_gpe/img_defs.mk
sgpe/boot/Makefile
sgpe/boot/img_defs.mk
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Change-Id: I94fbd28fc3e3c125e43232ea556a4e70b293db6d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36253
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: AMIT KUMAR <akumar3@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36321
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/utils')
4 files changed, 23 insertions, 122 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 ebf7da61b..cdebc2723 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 @@ -325,7 +325,8 @@ StopReturnCode_t lookUpSprInImage( uint32_t* i_pThreadSectLoc, void** io_pSprEntryLoc ) { StopReturnCode_t l_rc = STOP_SAVE_FAIL; - uint32_t temp = i_isCoreReg ? CORE_SPR_SECTN_SIZE : THREAD_SECTN_SIZE; + uint32_t temp = i_isCoreReg ? uint32_t(CORE_RESTORE_CORE_AREA_SIZE) : + uint32_t(CORE_RESTORE_THREAD_AREA_SIZE); uint32_t* i_threadSectEnd = i_pThreadSectLoc + temp; uint32_t bctr_inst = SWIZZLE_4_BYTE(BLR_INST); *io_pSprEntryLoc = NULL; @@ -967,7 +968,7 @@ StopReturnCode_t p9_stop_save_scom( void* const i_pImage, if( P9_STOP_SECTION_CORE_SCOM == i_section ) { - memset( pScomEntry, 0x00, SCOM_SIZE_PER_CORE ); + memset( pScomEntry, 0x00, CORE_SCOM_RESTORE_SIZE_PER_CORE ); } break; diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_data_struct.H b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_data_struct.H index e9cfa29a7..8a5c2b4ed 100755 --- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_data_struct.H +++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_data_struct.H @@ -39,7 +39,7 @@ #include <endian.h> #endif -#include "p9_stop_section_defines.H" +#include "p9_hcd_memmap_base.H" #ifdef __FAPI_2_ #include <fapi2.H> @@ -52,6 +52,12 @@ namespace stopImageSection { #endif +enum +{ + MAX_SPR_RESTORE_INST = 0x08, + SIZE_PER_SPR_RESTORE_INST = ((4 * sizeof(uint8_t)) / sizeof(uint32_t)), +}; + typedef struct { uint32_t scomEntryHeader; @@ -64,8 +70,8 @@ typedef struct */ typedef struct { - uint8_t threadArea[THREAD_AREA_SIZE]; - uint8_t coreArea[CORE_SPR_SECTN_SIZE]; + uint8_t threadArea[CORE_RESTORE_THREAD_AREA_SIZE]; + uint8_t coreArea[CORE_RESTORE_CORE_AREA_SIZE]; } SprRestoreArea_t; /** @@ -76,10 +82,10 @@ typedef struct typedef struct { uint8_t occ_host_sgpe_area[ TWO_MB ]; // CPU restore area starts at an offset of 2MB from chip HOMER - uint8_t interrruptHandler[INTERRUPT_HANDLER_SIZE]; + uint8_t interrruptHandler[SELF_RESTORE_INT_SIZE]; uint8_t threadLauncher[THREAD_LAUNCHER_SIZE]; - SprRestoreArea_t coreThreadRestore[MAX_CORE_ID_SUPPORTED + 1][MAX_THREAD_ID_SUPPORTED + 1]; - uint8_t reserve[(ONE_KB * ONE_KB) - SPR_RESTORE_PER_CHIP]; + SprRestoreArea_t coreThreadRestore[MAX_CORES_PER_CHIP][MAX_THREADS_PER_CORE]; + uint8_t reserve[(ONE_KB * ONE_KB) - SELF_RESTORE_SIZE_TOTAL]; } HomerSection_t; /** @@ -121,15 +127,15 @@ enum #define CORE_ID_SCOM_START(io_image,\ i_chipletId) \ -((ScomEntry_t*)(((uint8_t*)(io_image))+ CORE_SCOM_SECTN_START +\ +((ScomEntry_t*)(((uint8_t*)(io_image)) + CORE_SCOM_RESTORE_HOMER_OFFSET +\ ((i_chipletId - CORE_CHIPLET_ID_MIN) * \ - SCOM_SIZE_PER_CORE))); + CORE_SCOM_RESTORE_SIZE_PER_CORE))); #define CACHE_SECTN_START(io_image,\ i_chipletId) \ -((StopCacheSection_t *)(((uint8_t *)(io_image))+CACHE_SCOM_SECTN_START \ - + ( i_chipletId - CACHE_CHIPLET_ID_MIN ) * \ - SCOM_SIZE_PER_CACHE_CHIPLET )); +((StopCacheSection_t *)(((uint8_t *)(io_image)) + QUAD_SCOM_RESTORE_HOMER_OFFSET +\ + ((i_chipletId - CACHE_CHIPLET_ID_MIN) * \ + QUAD_SCOM_RESTORE_SIZE_PER_QUAD))); #ifdef __cplusplus } // extern "C" diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H deleted file mode 100755 index d660e5fb7..000000000 --- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H +++ /dev/null @@ -1,106 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/import/chips/p9/procedures/utils/stopreg/p9_stop_section_defines.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -/// -/// @file p9_stop_section_defines.H -/// @brief defines all constants associated with STOP image layout. -/// -// *HWP HW Owner : Greg Still <stillgs@us.ibm.com> -// *HWP FW Owner : Prem Shanker Jha <premjha2@in.ibm.com> -// *HWP Team : PM -// *HWP Level : 2 -// *HWP Consumed by : HB:HYP - -#ifndef _STOP_SECTION_DEFINES_H -#define _STOP_SECTION_DEFINES_H - -#ifdef __cplusplus -namespace stopImageSection -{ -#endif - -//basic constants -enum -{ -ONE_KB = 1024, -ONE_MB = ONE_KB * ONE_KB, -TWO_MB = 2 * ONE_MB, -MAX_CORE_SCOM_ENTRIES = 15, -MAX_EQ_SCOM_ENTRIES = 15, -MAX_L2_SCOM_ENTRIES = 16, -MAX_L3_SCOM_ENTRIES = 16, -MAX_CORE_ID_SUPPORTED = 23, -MAX_THREAD_ID_SUPPORTED = 3, -MAX_CACHE_SECTN_SIZE_PER_CHIPLET = - MAX_EQ_SCOM_ENTRIES + MAX_L2_SCOM_ENTRIES + MAX_L3_SCOM_ENTRIES, - -// start offset for SPR register restore, core scom or cache scom register -// restore regions in homer image. -CORE_SCOM_SECTN_START = ( TWO_MB + ( 256 * ONE_KB )), //offset from start of chip HOMER -CACHE_SCOM_SECTN_START = ( ONE_MB + ( 128 * ONE_KB )), // start of cache section - -//constants in HOMER's header area. -FUSED_MODE = 0xBB, -NONFUSED_MODE = 0xAA, -CPMR_MAGIC_WORD = 0x43504d525f312e30, -CACHE_CHIPLET_ID_MIN = 0x10, -CACHE_CHIPLET_ID_MAX = 0x15, -CORE_CHIPLET_ID_MIN = 0x20, -CORE_CHIPLET_ID_MAX = 0x37, -MAX_SPR_RESTORE_INST = 0x08, -SIZE_PER_SPR_RESTORE_INST = ((4 * sizeof(uint8_t)) / sizeof(uint32_t)), -}; - -// all section sizes below are in bytes -enum -{ -SCOM_ENTRY_SIZE = 16, -INTERRUPT_HANDLER_SIZE = 8 * ONE_KB, -THREAD_LAUNCHER_SIZE = 256, -THREAD_RESTORE_SECTN = 192, -THREAD_COMPLETION = 64, -THREAD_AREA_SIZE = ONE_KB, -THREAD_SECTN_SIZE = THREAD_RESTORE_SECTN + THREAD_COMPLETION, -CORE_SPR_SECTN_SIZE = ONE_KB, -L2_AREA = (SCOM_ENTRY_SIZE * MAX_L2_SCOM_ENTRIES), -L3_AREA = (SCOM_ENTRY_SIZE * MAX_L2_SCOM_ENTRIES ), -EQ_AREA = SCOM_ENTRY_SIZE * MAX_EQ_SCOM_ENTRIES, -MAX_SIZE_PER_CORE = 8 * ONE_KB, -SPR_RESTORE_PER_CHIP = ( MAX_SIZE_PER_CORE * - ( MAX_CORE_ID_SUPPORTED + 1)) + - ( INTERRUPT_HANDLER_SIZE + THREAD_LAUNCHER_SIZE), -SCOM_SIZE_PER_CORE = ( MAX_CORE_SCOM_ENTRIES + 1 ) * SCOM_ENTRY_SIZE, -SCOM_SIZE_PER_CHIP = SCOM_SIZE_PER_CORE * ( MAX_CORE_ID_SUPPORTED + 1), -SCOM_SIZE_PER_CACHE_CHIPLET = L2_AREA + L3_AREA + EQ_AREA - + SCOM_ENTRY_SIZE, -//size in byte ends -}; - -#ifdef __cplusplus -}//stopImageSection ends -#endif //__cplusplus - -#endif - diff --git a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C index 7fdc1deee..9e9874ad9 100755 --- a/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C +++ b/src/import/chips/p9/procedures/utils/stopreg/p9_stop_util.C @@ -65,7 +65,7 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fusedMode ) HomerSection_t* pHomerDesc = ( HomerSection_t* ) i_pImage; HomerImgDesc_t* pHomer = (HomerImgDesc_t*)( pHomerDesc->interrruptHandler ); - if( SWIZZLE_8_BYTE(CPMR_MAGIC_WORD) != pHomer->cpmrMagicWord ) + if( SWIZZLE_8_BYTE(CPMR_MAGIC_NUMBER) != pHomer->cpmrMagicWord ) { MY_ERR("corrupt or invalid HOMER image location 0x%016llx", SWIZZLE_8_BYTE(pHomer->cpmrMagicWord) ); @@ -73,13 +73,13 @@ StopReturnCode_t isFusedMode( void* const i_pImage, bool* o_fusedMode ) break; } - if( (uint8_t) FUSED_MODE == pHomer->fusedModeStatus ) + if( (uint8_t) FUSED_CORE_MODE == pHomer->fusedModeStatus ) { *o_fusedMode = true; break; } - if( (uint8_t) NONFUSED_MODE == pHomer->fusedModeStatus ) + if( (uint8_t) NONFUSED_CORE_MODE == pHomer->fusedModeStatus ) { break; } |