diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2017-07-23 18:25:00 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-22 10:37:01 -0400 |
commit | f01850d033176cb33c2396ed26377a3fc965787a (patch) | |
tree | 91618ccaf0a7baf690295a86271d2b7483d925ee /src/usr/vpd | |
parent | b74c51e043b4466f675cda22591b32aa50cef497 (diff) | |
download | talos-hostboot-f01850d033176cb33c2396ed26377a3fc965787a.tar.gz talos-hostboot-f01850d033176cb33c2396ed26377a3fc965787a.zip |
Adding in MEMD functionality with multiple copies
This commit adds support for a separate version of the MEMD
VPD. In the PNOR, we will have a new optional section that
will contain multiple versions of the MEMD VPD. This code
adds the functionality to loop through the different versions
and check the VM keyword to find a matching one.
Change-Id: I3f8e6e589c31b3b480d915a1b29b4614fa809162
RTC:175158
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43508
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@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: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/vpd')
-rw-r--r-- | src/usr/vpd/ipvpd.C | 22 | ||||
-rw-r--r-- | src/usr/vpd/ipvpd.H | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C index 6c4ff9953..4cd1449c9 100644 --- a/src/usr/vpd/ipvpd.C +++ b/src/usr/vpd/ipvpd.C @@ -41,6 +41,7 @@ #include <vpd/vpd_if.H> #include <config.h> #include <vpd/ipvpdenums.H> +#include <vpd/memd_vpdenums.H> #include "vpd.H" #include "cvpd.H" @@ -67,7 +68,7 @@ extern trace_desc_t* g_trac_vpd; static const uint64_t IPVPD_TOC_SIZE = 0x100; //256 static const uint64_t IPVPD_TOC_ENTRY_SIZE = 8; static const uint64_t IPVPD_TOC_INVALID_DATA = 0xFFFFFFFFFFFFFFFF; - +uint64_t MEMD_HEADER_SIZE = sizeof(MemdHeader_t); /** * @brief Constructor @@ -91,6 +92,7 @@ IpVpdFacade::IpVpdFacade(uint64_t i_vpdSectionSize, ,iv_mutex(i_mutex) ,iv_cachePnorAddr(0x0) ,iv_vpdMsgType(i_vpdMsgType) +,iv_memdAccessed(false) { iv_configInfo.vpdReadPNOR = false; iv_configInfo.vpdReadHW = false; @@ -1755,6 +1757,24 @@ errlHndl_t IpVpdFacade::findKeywordAddr ( const char * i_keywordName, break; } + if((iv_pnorSection == PNOR::MEMD)) + { + static uint64_t l_basePnorAddr = 0;//getPnorAddr(*this); + uint64_t l_cache_address = 0; + + if((iv_cachePnorAddr !=0) && !(iv_memdAccessed)) + { + l_basePnorAddr = getPnorAddr(*this); + iv_memdAccessed = true; + } + + TARGETING::ATTR_MEMD_OFFSET_type l_memd_offset = + i_target->getAttr<TARGETING::ATTR_MEMD_OFFSET>(); + l_cache_address = l_basePnorAddr + + MEMD_HEADER_SIZE + l_memd_offset; + setPnorAddr(l_cache_address); + } + // Byte Swap recordSize = le16toh( recordSize ); diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H index 299233eac..35bc6cac8 100644 --- a/src/usr/vpd/ipvpd.H +++ b/src/usr/vpd/ipvpd.H @@ -785,6 +785,12 @@ class IpVpdFacade */ configInfo iv_configInfo; + /** + * @brief Boolean variable to denote if the pnor section was + * accessed for the MEMD section + */ + bool iv_memdAccessed; + }; |