diff options
author | Mike Baiocchi <mbaiocch@us.ibm.com> | 2018-02-07 10:08:45 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-02-08 14:21:57 -0500 |
commit | b1d0900ad706cd8e2a91a1acab016f5b681e23ef (patch) | |
tree | f881039f56e4ed423401bd54d3f10fb90800d10e /src/usr/runtime | |
parent | 03de84e713fb21f0e091ff29f05a77fec9e240b3 (diff) | |
download | talos-hostboot-b1d0900ad706cd8e2a91a1acab016f5b681e23ef.tar.gz talos-hostboot-b1d0900ad706cd8e2a91a1acab016f5b681e23ef.zip |
Find location of HDAT relocation dynamically from PAYLOAD
This commit looks at the NACA structure in the Primary PAYLOAD lid
to determine the final destination of the HDAT structure that the
FSP loaded into a temporary memory space using TCEs.
Change-Id: I82b94f5fc133e4222d4efdcc7444012d7bcb5166
RTC:168745
Backport:release-fips910
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53564
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@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/runtime')
-rw-r--r-- | src/usr/runtime/hdatservice.C | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C index 3986efce6..4fd752653 100644 --- a/src/usr/runtime/hdatservice.C +++ b/src/usr/runtime/hdatservice.C @@ -1772,6 +1772,40 @@ errlHndl_t clear_host_data_section(const RUNTIME::SectionId i_section) return Singleton<hdatService>::instance().clearHostDataSection(i_section); } + +void findHdatLocation(const uint64_t i_payloadBase_va, uint64_t& o_hdat_offset) +{ + + TRACFCOMP( g_trac_runtime, ENTER_MRK"findHdatLocation> i_payloadBase_va = 0x%.16llX", i_payloadBase_va); + + do { + + // Everything starts at the NACA + // The NACA is part of the platform dependent LID which + // is loaded at relative memory address 0x0 + const hdatNaca_t* naca = reinterpret_cast<const hdatNaca_t*> + (HDAT_NACA_OFFSET + i_payloadBase_va); + TRACFCOMP( g_trac_runtime, "findHdatLocation> NACA=0x%.X->0x%p", HDAT_NACA_OFFSET, naca ); + + // Find SpiraH information in NACA + const hdatSpira_t* spiraH = reinterpret_cast<const hdatSpira_t*> + (naca->spiraH + i_payloadBase_va); + TRACFCOMP( g_trac_runtime, "findHdatLocation> SPIRA-H=0x%X->0x%p", naca->spiraH, spiraH ); + + // SPIRA-S is at the beginning of the Host Data Area Tuple of SpiraH + const hdat5Tuple_t* tuple = reinterpret_cast<const hdat5Tuple_t*> + (&(spiraH->hdatDataArea[SPIRAH_HOST_DATA_AREAS])); + TRACFCOMP( g_trac_runtime, "findHdatLocation> SPIRA-S tuple at 0x%p, tuple->hdatAbsAddr=0x%X", tuple, tuple->hdatAbsAddr ); + + o_hdat_offset = tuple->hdatAbsAddr; + + } while (0); + + TRACFCOMP( g_trac_runtime, EXIT_MRK"findHdatLocation> o_hdat_offset = 0x%X", o_hdat_offset); + +} + + }; void hdatMsVpdRhbAddrRange_t::set(const HDAT::hdatMsVpdRhbAddrRangeType i_type, |