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 /src/usr/targeting | |
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>
Diffstat (limited to 'src/usr/targeting')
-rwxr-xr-x | src/usr/targeting/attrrp.C | 15 |
1 files changed, 12 insertions, 3 deletions
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, |