summaryrefslogtreecommitdiffstats
path: root/src/include/usr/vpd
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-06-18 23:05:31 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-07-03 09:18:52 -0400
commite5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f (patch)
tree76ccf82718d46c0bb7bbb5cbcf451d2bbd03aaf6 /src/include/usr/vpd
parent691894a135de3e81f4318a5498c4a964fdebb8ae (diff)
downloadtalos-hostboot-e5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f.tar.gz
talos-hostboot-e5dfc3ab0ec51ee63205c7064b7b4a4c4b8ba46f.zip
Allow SPDX override as part of FW load
Memory VPD contents have changed since the cards have been built so we need to provide a method to override the data as part of a FW build. We have done the same thing previously for the MEMD record on the Nimbus machines so will use the same design here for SPDX. As part of this change, the previous MEMD support was refactored to be completely generic so a single code path can be used for any arbitrary record. Change-Id: I5af5e965429c881be3de0d18c82b1d7918ac9c22 CQ: SW430659 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61190 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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60980
Diffstat (limited to 'src/include/usr/vpd')
-rw-r--r--src/include/usr/vpd/memd_vpdenums.H201
-rw-r--r--src/include/usr/vpd/vpd_if.H42
-rw-r--r--src/include/usr/vpd/vpdreasoncodes.H1
3 files changed, 39 insertions, 205 deletions
diff --git a/src/include/usr/vpd/memd_vpdenums.H b/src/include/usr/vpd/memd_vpdenums.H
deleted file mode 100644
index ecd20ef04..000000000
--- a/src/include/usr/vpd/memd_vpdenums.H
+++ /dev/null
@@ -1,201 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/include/usr/vpd/memd_vpdenums.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __MEMD_VPDENUMS_H
-#define __MEMD_VPDENUMS_H
-
-#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
-{
-
- /**
- * @brief Enumeration for the MEMD_VPD Records that contain
- * the keyword enumerations below.
- */
- enum MEMD_VPDRecord
- {
- MEMD_VPD_FIRST_RECORD = 0x00,
- VINI = MEMD_VPD_FIRST_RECORD,
- MEMD = 0x01,
-
- // Last Record
- MEMD_VPD_LAST_RECORD,
- MEMD_VPD_TEST_RECORD, // Test purposes ONLY!
-
- //Start common IPVPD enums
- MEMD_VPD_INVALID_RECORD = IPVPD::INVALID_RECORD,
- };
-
- /**
- * @brief Enumerations for MEMD_VPD keywords that can be
- * accessed in the MEMD_VPD.
- */
- enum MEMD_VPDKeyword
- {
- MEMD_VPD_FIRST_KEYWORD = 0x00,
- B3 = MEMD_VPD_FIRST_KEYWORD,
- B4 = 0x01,
- B7 = 0x02,
- CC = 0x03,
- CE = 0x04,
- CT = 0x05,
- DR = 0x06,
- FC = 0x07,
- FN = 0x08,
- HE = 0x09,
- HW = 0x0a,
- I2 = 0x0b,
- IN = 0x0c,
- J0 = 0x0d,
- J1 = 0x0e,
- J2 = 0x0f,
- J3 = 0x10,
- J4 = 0x11,
- J5 = 0x12,
- J6 = 0x13,
- J7 = 0x14,
- J8 = 0x15,
- J9 = 0x16,
- JA = 0x17,
- JB = 0x18,
- JC = 0x19,
- JD = 0x1a,
- JE = 0x1b,
- JF = 0x1c,
- JG = 0x1d,
- JH = 0x1e,
- JI = 0x1f,
- JJ = 0x20,
- JK = 0x21,
- JL = 0x22,
- JM = 0x23,
- JN = 0x24,
- JO = 0x25,
- JP = 0x26,
- JQ = 0x27,
- JR = 0x28,
- JS = 0x29,
- JT = 0x2a,
- JU = 0x2b,
- JV = 0x2c,
- JW = 0x2d,
- JX = 0x2e,
- JY = 0x2f,
- JZ = 0x30,
- LX = 0x31,
- MR = 0x32,
- MT = 0x33,
- PF = 0x34,
- PN = 0x35,
- PR = 0x36,
- RB = 0x37,
- RG = 0x38,
- RT = 0x39,
- SE = 0x3a,
- SN = 0x3b,
- SO = 0x3c,
- TM = 0x3d,
- VM = 0x3e,
- VZ = 0x3f,
- X0 = 0x40,
- X1 = 0x41,
- X2 = 0x42,
- X3 = 0x43,
- X4 = 0x44,
- X5 = 0x45,
- X6 = 0x46,
- X7 = 0x47,
- X8 = 0x48,
- X9 = 0x49,
- XA = 0x4a,
- XB = 0x4b,
- XC = 0x4c,
- XD = 0x4d,
- XE = 0x4e,
- XF = 0x4f,
- XG = 0x50,
- XH = 0x51,
- XI = 0x52,
- XJ = 0x53,
- XK = 0x54,
- XL = 0x55,
- XM = 0x56,
- XN = 0x57,
- XO = 0x58,
- XP = 0x59,
- XQ = 0x5a,
- XR = 0x5b,
- XS = 0x5c,
- XT = 0x5d,
- XU = 0x5e,
- XV = 0x5f,
- XW = 0x60,
- XX = 0x61,
- XY = 0x62,
- XZ = 0x63,
- Q0 = 0x64,
- Q1 = 0x65,
- Q2 = 0x66,
- Q3 = 0x67,
- Q4 = 0x68,
- Q5 = 0x69,
- Q6 = 0x6A,
- Q7 = 0x6B,
- Q8 = 0x6C,
- CK = 0X6D,
-
- // Last Keyword
- MEMD_VPD_LAST_KEYWORD,
- MEMD_VPD_TEST_KEYWORD, // Test purposes ONLY!
-
- //Start common IPVPD enums
- FULL_RECORD = IPVPD::FULL_RECORD,
- MEMD_VPD_INVALID_KEYWORD = IPVPD::INVALID_KEYWORD,
- };
-
-}; // end MEMD_VPD
-
-#endif
diff --git a/src/include/usr/vpd/vpd_if.H b/src/include/usr/vpd/vpd_if.H
index 0d8cc4a2d..4e63a0965 100644
--- a/src/include/usr/vpd/vpd_if.H
+++ b/src/include/usr/vpd/vpd_if.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -25,6 +25,8 @@
#if !defined(__VPD_IF_H)
#define __VPD_IF_H
+#include <pnor/pnorif.H>
+#include <map>
namespace VPD
{
@@ -41,9 +43,18 @@ namespace VPD
*/
enum vpdCmdTarget
{
- AUTOSELECT,
- PNOR,
- SEEPROM,
+ AUTOSELECT = 0x0000,
+
+ // Use our cache or read the eeprom
+ PNOR = 0x0001,
+ SEEPROM = 0x0002,
+ LOCATION_MASK = 0x000F,
+
+ // Use the real vpd or a firmware override
+ USEVPD = 0x0010,
+ USEOVERRIDE = 0x0020,
+ OVERRIDE_MASK = 0x00F0,
+
INVALID_LOCATION = 0xFFFF,
};
@@ -137,6 +148,29 @@ namespace VPD
*/
errlHndl_t goldenCacheInvalidate ( void );
+ /**
+ * @brief Structure used to specify VPD overrides for runtime
+ * reserved memory usage
+ */
+ struct OverrideSpecifier_t
+ {
+ PNOR::SectionId pnorId;
+ size_t size; // size in bytes
+ };
+
+ /**
+ * @brief Map of override labels to sections
+ * index : uint64_t label = right-justified 4-digit ASCII string
+ * result : OverrideSpecifier_t
+ */
+ typedef std::map<uint64_t,OverrideSpecifier_t> OverrideRsvMemMap_t;
+
+ /**
+ * @brief Get a list of all overridden sections
+ * @param[out] List of known override sections
+ */
+ void getListOfOverrideSections( OverrideRsvMemMap_t& o_overrides );
+
}; //end vpd namespace
#endif
diff --git a/src/include/usr/vpd/vpdreasoncodes.H b/src/include/usr/vpd/vpdreasoncodes.H
index 45652bf05..8c7402158 100644
--- a/src/include/usr/vpd/vpdreasoncodes.H
+++ b/src/include/usr/vpd/vpdreasoncodes.H
@@ -147,6 +147,7 @@ enum vpdReasonCode
VPD_TARGET_CHIP_NOT_FOUND = VPD_COMP_ID | 0x39,
VPD_EEPROM_VPD_PRIMARY_INFO_MISSING = VPD_COMP_ID | 0x3a,
VPD_RT_NODE_TOO_LARGE = VPD_COMP_ID | 0x3b,
+ VPD_CANNOT_WRITE_OVERRIDDEN_VPD = VPD_COMP_ID | 0x3c,
};
OpenPOWER on IntegriCloud