From 9ff9e978ad4124c8fcd94339aa40f3a9d3a4f40a Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 25 Nov 2013 23:38:56 -0600 Subject: Increment base memory address by node Change-Id: I524a9814cfc9a2b0d831ab31f9ed63e008ffa304 CQ: SW236248 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7429 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert Reviewed-by: A. Patrick Williams III --- .../hwp/build_winkle_images/build_winkle_images.C | 11 +++++-- src/usr/hwpf/hwp/mc_config/mc_config.C | 35 +++++++++------------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/usr/hwpf/hwp') diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C index 739533493..962d097c8 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C +++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C @@ -361,7 +361,6 @@ void* call_host_build_winkle( void *io_pArgs ) uint32_t l_poreSize = 0; void *l_pRealMemBase = NULL; void* l_pVirtMemBase = NULL; - uint64_t l_memBase = VMM_HOMER_REGION_START_ADDR; ISTEP_ERROR::IStepError l_StepError; @@ -376,13 +375,21 @@ void* call_host_build_winkle( void *io_pArgs ) 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 // SLW images. assert(VMM_HOMER_REGION_SIZE <= THIRTYTWO_GB, "host_build_winkle: Unsupported HOMER Region size"); - //If running Sapphire need to place this at the top of memory + //If running Sapphire need to place this at the top of memory instead if(is_sapphire_load()) { l_memBase = get_top_mem_addr(); diff --git a/src/usr/hwpf/hwp/mc_config/mc_config.C b/src/usr/hwpf/hwp/mc_config/mc_config.C index 9d05c062e..dad3fa964 100644 --- a/src/usr/hwpf/hwp/mc_config/mc_config.C +++ b/src/usr/hwpf/hwp/mc_config/mc_config.C @@ -324,7 +324,7 @@ errlHndl_t call_mss_eff_grouping() return l_err; } -errlHndl_t call_opt_memmap() +errlHndl_t call_opt_memmap( bool i_initBase ) { errlHndl_t l_err = NULL; @@ -348,8 +348,7 @@ errlHndl_t call_opt_memmap() l_fapi_procs.push_back(l_fapi_target); } - bool l_initProcMemBaseAttr = false; - FAPI_INVOKE_HWP(l_err, opt_memmap, l_fapi_procs, l_initProcMemBaseAttr); + FAPI_INVOKE_HWP(l_err, opt_memmap, l_fapi_procs, i_initBase); if ( l_err ) { @@ -436,30 +435,24 @@ void* call_mss_eff_config( void *io_pArgs ) if (l_StepError.isNull()) { - TARGETING::TargetHandleList l_procs; - getAllChips(l_procs, TYPE_PROC); - - for (TARGETING::TargetHandleList::const_iterator - l_iter = l_procs.begin(); l_iter != l_procs.end(); ++l_iter) - { - TARGETING::Target* l_target = *l_iter; - - uint64_t l_base = 0; - l_target->setAttr( l_base ); - - l_base = 0x0002000000000000UL; // 512TB - l_target->setAttr( l_base ); - } - - l_err = call_mss_eff_grouping(); + // Flush out BASE attributes to starting values + l_err = call_opt_memmap(true); if (!l_err) { - l_err = call_opt_memmap(); + // Stack the memory on each chip + l_err = call_mss_eff_grouping(); if (!l_err) { - l_err = call_mss_eff_grouping(); + // Move the BASES around to the real final values + l_err = call_opt_memmap(false); + + if (!l_err) + { + // Stack the memory again based on system-wide positions + l_err = call_mss_eff_grouping(); + } } } -- cgit v1.2.1