summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/runtime/populate_hbruntime.C9
-rwxr-xr-xsrc/usr/targeting/attrrp.C15
2 files changed, 17 insertions, 7 deletions
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 828ca0572..f394f58bf 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -162,11 +162,12 @@ errlHndl_t populate_RtDataByNode(uint64_t iNodeId)
//Make sure the address returned from the block map call is not NULL
if(l_attrCopyVmemAddr != 0)
{
- //Save the memory map
- TARGETING::AttrRP::save(l_attrCopyVmemAddr);
+ //The function save() for AttrRP saves then entire HBD data
+ // section of PNOR to the provided vmm address
+ void * l_region = TARGETING::AttrRP::save(l_attrCopyVmemAddr);
- //Make sure to the virtual address because we won't need it anymore
- int l_rc = mm_block_unmap(reinterpret_cast<void*>(l_attrCopyVmemAddr));
+ //Make sure to unmap the virtual address because we won't need it anymore
+ int l_rc = mm_block_unmap(reinterpret_cast<void*>(l_region));
if(l_rc)
{
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index cce45e59c..e19463642 100755
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -392,6 +392,9 @@ namespace TARGETING
}
+ //Keep a running offset of how far into our real memory section we are
+ uint64_t l_realMemOffset = 0;
+
// Parse each section.
for (size_t i = 0; i < iv_sectionCount; i++, ++l_section)
{
@@ -407,15 +410,21 @@ namespace TARGETING
l_header->vmmSectionOffset*i;
- iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + l_section->sectionOffset;
+ iv_sections[i].pnorAddress =
+ l_pnorSectionInfo.vaddr + l_section->sectionOffset;
if(iv_isMpipl)
{
- //For MPIPL we are reading from real memory, not pnor flash. Set the real memory address
- iv_sections[i].realMemAddress = reinterpret_cast<uint64_t>(l_header) + l_section->sectionOffset;
+ //For MPIPL we are reading from real memory,
+ //not pnor flash. Set the real memory address
+ iv_sections[i].realMemAddress =
+ reinterpret_cast<uint64_t>(l_header) + l_realMemOffset;
}
iv_sections[i].size = l_section->sectionSize;
+ //Increment our offset variable by the size of this section
+ l_realMemOffset += iv_sections[i].size;
+
TRACFCOMP(g_trac_targeting,
"Decoded Attribute Section: %d, 0x%lx 0x%lx 0x%lx 0x%lx",
iv_sections[i].type,
OpenPOWER on IntegriCloud