summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorElizabeth Liner <eliner@us.ibm.com>2017-07-23 18:25:00 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-22 10:37:01 -0400
commitf01850d033176cb33c2396ed26377a3fc965787a (patch)
tree91618ccaf0a7baf690295a86271d2b7483d925ee /src/include
parentb74c51e043b4466f675cda22591b32aa50cef497 (diff)
downloadtalos-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/include')
-rw-r--r--src/include/usr/fapi2/plat_vpd_access.H17
-rw-r--r--src/include/usr/vpd/memd_vpdenums.H21
2 files changed, 37 insertions, 1 deletions
diff --git a/src/include/usr/fapi2/plat_vpd_access.H b/src/include/usr/fapi2/plat_vpd_access.H
index 715ddc875..f28317df9 100644
--- a/src/include/usr/fapi2/plat_vpd_access.H
+++ b/src/include/usr/fapi2/plat_vpd_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -31,6 +31,7 @@
#define _FAPI2_PLAT_VPDACCESS_H_
#include <fapi2_vpd_access.H>
+#include <vpd/memd_vpdenums.H>
namespace fapi2
{
@@ -51,5 +52,19 @@ fapi2::ReturnCode platGetVPD(
VPDInfo<fapi2::TARGET_TYPE_MCS>& io_vpd_info,
uint8_t* o_blob);
+/**
+ * @brief Search through the PNOR::MEMD section to find the copy with
+ * a matching VM keyword compared to the EEPROM's VM.
+ *
+ * @param[in] i_eepromVM - The EEPROM's copy of the VM keyword
+ * @param[in] i_header - The header from PNOR::MEMD
+ * @param[in] i_target - A valid fapi2 MCS target
+ * @param[in] i_vm_size - Size of the VM keyword
+ *
+ * @return boolean - true if a matching MEMD was found, false if not
+ */
+bool find_memd_in_pnor(uint8_t* i_eepromVM, MemdHeader_t i_header,
+ TARGETING::Target * i_target, size_t i_vm_size);
+
};
#endif // _FAPI2_PLAT_VPDACCESS_H_
diff --git a/src/include/usr/vpd/memd_vpdenums.H b/src/include/usr/vpd/memd_vpdenums.H
index 345d77d60..ecd20ef04 100644
--- a/src/include/usr/vpd/memd_vpdenums.H
+++ b/src/include/usr/vpd/memd_vpdenums.H
@@ -27,6 +27,27 @@
#include <vpd/ipvpdenums.H>
+/**
+ * @brief Define the set of information included at the beginning of the
+ * MEMD PNOR section
+ */
+struct MemdHeader_t
+{
+ uint32_t eyecatch; /* Eyecatch to determine validity. "OKOK" */
+ uint32_t header_version; /* What version of the header this is in */
+ uint32_t memd_version; /* What version of the MEMD this includes */
+ uint32_t expected_size_kb; /* Size in kilobytes of each MEMD instance */
+ uint16_t expected_num; /* Number of MEMD instances in this section */
+ uint8_t padding[14]; /* Padding for future changes */
+}__attribute__((packed));
+
+enum MEMD_valid_constants
+{
+ MEMD_VALID_HEADER = 0x4f4b4f4b, // "OKOK"
+ MEMD_VALID_HEADER_VERSION = 0x30312e30, // "01.0";
+ MEMD_VALID_MEMD_VERSION = 0x30312e30, //"01.0";
+};
+
namespace MEMD_VPD
{
OpenPOWER on IntegriCloud