diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2016-06-15 09:06:19 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-21 11:27:34 -0400 |
commit | 312020362421d107c3e2886168f30ebf6b91ade2 (patch) | |
tree | 0cf972957d860f0bdb809afc7354f62a909f7e72 | |
parent | 2b1e4dd47177d811e86baae7f4bb0a6de0a9f1e6 (diff) | |
download | talos-hostboot-312020362421d107c3e2886168f30ebf6b91ade2.tar.gz talos-hostboot-312020362421d107c3e2886168f30ebf6b91ade2.zip |
Updates for building host stop image
Change-Id: Iff457224696be3f99e44ca7ac896fe3ff1957e3e
RTC: 155196
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25857
Tested-by: Jenkins Server
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/usr/isteps/istep15/host_build_stop_image.C | 36 | ||||
-rw-r--r-- | src/usr/isteps/istep15/makefile | 12 | ||||
-rw-r--r-- | src/usr/isteps/pm/pm.mk | 9 | ||||
-rw-r--r-- | src/usr/isteps/pm/pm_common.C | 22 |
4 files changed, 53 insertions, 26 deletions
diff --git a/src/usr/isteps/istep15/host_build_stop_image.C b/src/usr/isteps/istep15/host_build_stop_image.C index f89008883..a1e1284b2 100644 --- a/src/usr/isteps/istep15/host_build_stop_image.C +++ b/src/usr/isteps/istep15/host_build_stop_image.C @@ -327,22 +327,20 @@ void* host_build_stop_image (void *io_pArgs) TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "host_build_stop_image entry" ); - // allocate a temporary buffer - void* l_temp_buffer = malloc(FIXED_RING_BUF_SIZE); - + // allocate two temporary work buffer + void* l_temp_buffer0 = malloc(FIXED_RING_BUF_SIZE); + void* l_temp_buffer1 = malloc(FIXED_RING_BUF_SIZE); do { // Get the node-offset for our instance by looking at the HRMOR uint64_t l_memBase = cpu_spr_value(CPU_SPR_HRMOR); // mask off the secureboot offset l_memBase = 0xFFFFF00000000000 & l_memBase; - // Now offset up to our hardcoded region l_memBase += VMM_HOMER_REGION_START_ADDR; // Get a chunk of real memory big enough to store all the possible // HCODE images. (4MB is size of HOMER) - assert(VMM_HOMER_REGION_SIZE <= (P9_MAX_PROCS * (4 * MEGABYTE)), "host_build_stop_image: Unsupported HOMER Region size"); @@ -356,7 +354,6 @@ void* host_build_stop_image (void *io_pArgs) } TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "HOMER base = %x", l_memBase); - l_pRealMemBase = reinterpret_cast<void * const>(l_memBase ); //Convert the real memory pointer to a pointer in virtual memory @@ -369,7 +366,7 @@ void* host_build_stop_image (void *io_pArgs) l_pVirtMemBase ); // Continue, build hcode images - + // //Load the reference image from PNOR l_errl = loadHcodeImage( l_pHcodeImage ); if ( l_errl ) @@ -377,12 +374,10 @@ void* host_build_stop_image (void *io_pArgs) TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "host_build_stop_image ERROR : errorlog PLID=0x%x", l_errl->plid() ); - // drop out of do block with errorlog. break; } - // Loop through all functional Procs and generate images for them. TARGETING::TargetHandleList l_procChips; getAllChips( l_procChips, @@ -395,13 +390,11 @@ void* host_build_stop_image (void *io_pArgs) for (const auto & l_procChip: l_procChips) { do { - // write the HUID of the core we are writing to TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "Build STOP image for proc " "target HUID %.8X", TARGETING::get_huid(l_procChip)); - // calculate size and location of the HCODE output buffer uint32_t l_procNum = l_procChip->getAttr<TARGETING::ATTR_POSITION>(); @@ -420,7 +413,7 @@ void* host_build_stop_image (void *io_pArgs) uint32_t l_sizeImageOut = ((P9_MAX_PROCS * (4 * MEGABYTE))); - // set default values, p9_hcode_build will provide actual size + //Set default values, p9_hcode_build will provide actual size l_procChip->setAttr<TARGETING::ATTR_HCODE_IMAGE_ADDR> ( l_procRealMemAddr ); l_procChip->setAttr<TARGETING::ATTR_HCODE_IMAGE_SIZE> @@ -432,21 +425,27 @@ void* host_build_stop_image (void *io_pArgs) l_procRealMemAddr, l_pImageOut); - // cast OUR type of target to a FAPI2 type of target. + //Cast OUR type of target to a FAPI2 type of target. const fapi2::Target<TARGET_TYPE_PROC_CHIP> l_fapiCpuTarget( const_cast<TARGETING::Target*>(l_procChip)); + //Default constructor sets the appropriate settings ImageType_t img_type; //Call p9_hcode_image_build.C HWP FAPI_INVOKE_HWP( l_errl, p9_hcode_image_build, - l_fapiCpuTarget, //Proc chip target. + l_fapiCpuTarget, reinterpret_cast<void*>(l_pHcodeImage), - l_pImageOut, - PHASE_IPL, //sys_Phase + l_pImageOut, //homer image buffer + NULL, //default is no ring overrides + PHASE_IPL, img_type, - l_temp_buffer) + l_temp_buffer0, + FIXED_RING_BUF_SIZE, + l_temp_buffer1, + FIXED_RING_BUF_SIZE ); + if ( l_errl ) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, @@ -511,7 +510,8 @@ void* host_build_stop_image (void *io_pArgs) } // delete working buffers - if( l_temp_buffer ) { free(l_temp_buffer); } + if( l_temp_buffer0 ) { free(l_temp_buffer0); } + if( l_temp_buffer1 ) { free(l_temp_buffer1); } if(l_pVirtMemBase) { diff --git a/src/usr/isteps/istep15/makefile b/src/usr/isteps/istep15/makefile index b2d6b2967..461247f38 100644 --- a/src/usr/isteps/istep15/makefile +++ b/src/usr/isteps/istep15/makefile @@ -44,17 +44,27 @@ OBJS += proc_set_pba_homer_bar.o OBJS += host_establish_ex_chiplet.o OBJS += host_start_stop_engine.o +#@TODO RTC:147621 Pull p9_stop_util into a seperate library +OBJS += p9_stop_util.o + + include ${ROOTPATH}/procedure.rules.mk include $(PROCEDURES_PATH)/hwp/pm/p9_pm_pfet_init.mk include $(PROCEDURES_PATH)/hwp/pm/p9_pm_pba_bar_config.mk include $(PROCEDURES_PATH)/hwp/pm/p9_pm_set_homer_bar.mk include $(PROCEDURES_PATH)/hwp/pm/p9_pm_stop_gpe_init.mk +include $(PROCEDURES_PATH)/hwp/pm/p9_pm_utils.mk include $(PROCEDURES_PATH)/hwp/pm/p9_update_ec_eq_state.mk include $(PROCEDURES_PATH)/hwp/pm/p9_hcode_image_build.mk +include $(PROCEDURES_PATH)/utils/stopreg/p9_stop_api.mk include $(PROCEDURES_PATH)/hwp/pm/p9_pm_pba_init.mk include ${ROOTPATH}/src/import/chips/p9/xip/p9_xip_image.mk - +include ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/p9_tor.mk +include ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/p9_ring_identification.mk +include ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/p9_ringId.mk include ${ROOTPATH}/config.mk VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/ +VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/utils/stopreg/ VPATH += ${ROOTPATH}/src/import/chips/p9/xip/ +VPATH += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ diff --git a/src/usr/isteps/pm/pm.mk b/src/usr/isteps/pm/pm.mk index 19d301b67..315a4cf36 100644 --- a/src/usr/isteps/pm/pm.mk +++ b/src/usr/isteps/pm/pm.mk @@ -29,7 +29,6 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/ ## pointer to common HWP files EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ -EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/xip/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/utils/stopreg/ @@ -38,6 +37,8 @@ HWP_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm EXTRAINCDIR += ${HWP_PATH} HWP_XIP_PATH += ${ROOTPATH}/src/import/chips/p9/xip EXTRAINCDIR += ${HWP_XIP_PATH} +HWP_IMAGEPROCS_PATH += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ +EXTRAINCDIR += ${HWP_IMAGEPROCS_PATH} ## pointer to already consumed procedures. @@ -48,12 +49,16 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/ OBJS += pm_common.o ## NOTE: add a new directory onto the vpaths when you add a new HWP -VPATH += ${HWP_PATH} ${HWP_XIP_PATH} +VPATH += ${HWP_PATH} ${HWP_XIP_PATH} ${HWP_IMAGEPROCS_PATH} include ${ROOTPATH}/procedure.rules.mk include $(HWP_PATH)/p9_hcode_image_build.mk include $(HWP_PATH)/p9_pm_pba_bar_config.mk include $(HWP_PATH)/p9_pm_init.mk include ${HWP_XIP_PATH}/p9_xip_image.mk +include ${HWP_IMAGEPROCS_PATH}/p9_tor.mk +include ${HWP_IMAGEPROCS_PATH}/p9_ring_identification.mk +include ${HWP_IMAGEPROCS_PATH}/p9_ringId.mk + include ${ROOTPATH}/config.mk diff --git a/src/usr/isteps/pm/pm_common.C b/src/usr/isteps/pm/pm_common.C index c60a362e8..60c42a855 100644 --- a/src/usr/isteps/pm/pm_common.C +++ b/src/usr/isteps/pm/pm_common.C @@ -145,7 +145,7 @@ namespace HBPM tS.getTopLevelTarget( sysTarget ); assert( sysTarget != NULL ); - uint32_t nestFreq = sysTarget->getAttr<ATTR_FREQ_PB_MHZ>(); + uint32_t nestFreq = sysTarget->getAttr<ATTR_FREQ_PB>(); config_data->version = HBPM::OccHostDataVersion; config_data->nestFrequency = nestFreq; @@ -251,17 +251,22 @@ namespace HBPM l_pImageIn); ImageType_t l_imgType; - void *l_buffer = (void*)malloc(HW_IMG_RING_SIZE); + void *l_buffer0 = (void*)malloc(HW_IMG_RING_SIZE); + void *l_buffer1 = (void*)malloc(HW_IMG_RING_SIZE); FAPI_INVOKE_HWP( l_errl, p9_hcode_image_build, l_fapiTarg, - l_pImageIn, - i_pImageOut, + l_pImageIn, //reference image + i_pImageOut, //homer image buffer + NULL, //default is no ring overrides (HBRT_PM_LOAD == i_mode) ? PHASE_IPL : PHASE_REBUILD, l_imgType, - l_buffer ); + l_buffer0, + HW_IMG_RING_SIZE, + l_buffer1, + HW_IMG_RING_SIZE ); if (l_errl) { @@ -280,6 +285,10 @@ namespace HBPM TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "lidSize=%d",lidSize); + /* TODO RTC: 155384 + Many of these structures moved around and this needs to be + refactored + // Log some info from the headers Homerlayout_t* pChipHomer = (Homerlayout_t*)i_pImageOut; @@ -322,6 +331,9 @@ namespace HBPM TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "PGPE -- Location: %p", pPgpeLayout); + + **/ + } while(0); /* end @TODO RTC: 148935 */ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, |