diff options
author | crgeddes <crgeddes@us.ibm.com> | 2016-12-02 10:27:54 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-12-13 16:49:46 -0500 |
commit | 26a18a5dc30e6a55d2ee6d843e0dec895e3cf0df (patch) | |
tree | 43eee02fd94839505650a68f8642bc243c677ace | |
parent | 0108c616dd7e4311d47d23c9f77b80ea21487ec9 (diff) | |
download | talos-hostboot-26a18a5dc30e6a55d2ee6d843e0dec895e3cf0df.tar.gz talos-hostboot-26a18a5dc30e6a55d2ee6d843e0dec895e3cf0df.zip |
Fix some pointer issues for initializing ATTRRP for MPIPL
There are two bugs being fixed in this commit
- The first was that the attrrp function save(address) changes
the value of the "address" parm and returns the initial value
so I was unmapping the wrong address
- The second makes sure are incrementing the attrp's knowledge
of the HBD data's sections in real memory
Change-Id: I10cd887fb1892bd479046f42d0ba4ca1c680f858
RTC: 165369
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33329
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/usr/runtime/populate_hbruntime.C | 9 | ||||
-rwxr-xr-x | src/usr/targeting/attrrp.C | 15 |
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, |