summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/attrrp.C
diff options
context:
space:
mode:
authorBrian Stegmiller <bjs@us.ibm.com>2016-02-22 16:20:20 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-23 16:21:46 -0400
commite860d319c4e54ca061283fcd2342e4deb38c467d (patch)
treea7bf5319f8ce1d6cd70a27e233501c8007cd43db /src/usr/targeting/attrrp.C
parent49eae5fb8adc7df4decb59ad0e788330ba2bff16 (diff)
downloadtalos-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/attrrp.C')
-rwxr-xr-xsrc/usr/targeting/attrrp.C47
1 files changed, 34 insertions, 13 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)
{
OpenPOWER on IntegriCloud