diff options
author | Brian Stegmiller <bjs@us.ibm.com> | 2016-02-22 16:20:20 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-23 16:21:46 -0400 |
commit | e860d319c4e54ca061283fcd2342e4deb38c467d (patch) | |
tree | a7bf5319f8ce1d6cd70a27e233501c8007cd43db /src/usr/targeting | |
parent | 49eae5fb8adc7df4decb59ad0e788330ba2bff16 (diff) | |
download | talos-hostboot-e860d319c4e54ca061283fcd2342e4deb38c467d.tar.gz talos-hostboot-e860d319c4e54ca061283fcd2342e4deb38c467d.zip |
Support HB runtime data for adjunct partition
Change-Id: I7249f2b195dd02a0ab5a88b53d63cc4a1663cf9d
RTC: 138638
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25373
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rwxr-xr-x | src/usr/targeting/attrrp.C | 47 | ||||
-rw-r--r-- | src/usr/targeting/runtime/attrPlatOverride_rt.C | 9 |
2 files changed, 42 insertions, 14 deletions
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index 780de9568..86cd1b748 100755 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -496,29 +496,50 @@ namespace TARGETING return Singleton<AttrRP>::instance()._save(io_addr); } - void* AttrRP::_save(uint64_t& io_addr) - { - TRACDCOMP(g_trac_targeting, "AttrRP::save: top @ 0x%lx", io_addr); - io_addr = ALIGN_PAGE_DOWN(io_addr); + uint64_t AttrRP::maxSize( ) + { // Find total size of the sections. uint64_t l_size = 0; - for(size_t i = 0; i < iv_sectionCount; ++i) + for( size_t i = 0; + i < Singleton<AttrRP>::instance().iv_sectionCount; + ++i) { - l_size += ALIGN_PAGE(iv_sections[i].size); + l_size += ALIGN_PAGE(Singleton<AttrRP>:: + instance().iv_sections[i].size); } - // Determine bottom of the address region. - io_addr = io_addr - l_size; - // Align to 64KB for Opal - io_addr = ALIGN_DOWN_X(io_addr,64*KILOBYTE); + return(l_size); + } // end maxSize - // Map in region. - void* region = mm_block_map(reinterpret_cast<void*>(io_addr), - l_size); + + void* AttrRP::_save(uint64_t& io_addr) + { + TRACDCOMP(g_trac_targeting, "AttrRP::save: top @ 0x%lx", io_addr); + + // Find total size of the sections. + uint64_t l_size = maxSize(); + + void* region = reinterpret_cast<void*>(io_addr); uint8_t* pointer = reinterpret_cast<uint8_t*>(region); + // For PHYP adjunct partition, use HDAT ptr as is + bool l_isPhyp = TARGETING::is_phyp_load(); + if (!l_isPhyp) + { + io_addr = ALIGN_PAGE_DOWN(io_addr); + // Determine bottom of the address region. + io_addr = io_addr - l_size; + // Align to 64KB for Opal + io_addr = ALIGN_DOWN_X(io_addr,64*KILOBYTE); + + // Map in region. + region = mm_block_map(reinterpret_cast<void*>(io_addr),l_size); + pointer = reinterpret_cast<uint8_t*>(region); + + } // end if NOT PHYP + // Copy content. for (size_t i = 0; i < iv_sectionCount; ++i) { diff --git a/src/usr/targeting/runtime/attrPlatOverride_rt.C b/src/usr/targeting/runtime/attrPlatOverride_rt.C index 9a5498111..537e36464 100644 --- a/src/usr/targeting/runtime/attrPlatOverride_rt.C +++ b/src/usr/targeting/runtime/attrPlatOverride_rt.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -31,6 +31,7 @@ //#include <hwpf/plat/fapiPlatAttrOverrideSync.H> #include <targeting/common/trace.H> #include <errl/errlmanager.H> +#include <initservice/initserviceif.H> using namespace TARGETING; @@ -92,6 +93,12 @@ int apply_attr_override(uint8_t* i_data, void applyTempOverrides() { + // With FSP, we can not access PNOR, just return + if(INITSERVICE::spBaseServicesEnabled()) + { + return; + } + TRACFCOMP(g_trac_targeting, ENTER_MRK"applyTempOverrides"); errlHndl_t l_err = NULL; PNOR::SectionInfo_t l_info; |