summaryrefslogtreecommitdiffstats
path: root/src/include
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
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')
-rw-r--r--src/include/usr/devicefw/userif.H26
-rw-r--r--src/include/usr/fapi2/plat_vpd_access.H17
-rw-r--r--src/include/usr/runtime/runtime_reasoncodes.H1
-rw-r--r--src/include/usr/util/utilrsvdmem.H20
-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
7 files changed, 57 insertions, 251 deletions
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H
index 4df37c8a8..68f923f95 100644
--- a/src/include/usr/devicefw/userif.H
+++ b/src/include/usr/devicefw/userif.H
@@ -67,7 +67,7 @@ namespace DeviceFW
SIO,
AHB_SIO,
DVPD, // Direct access memory VPD
- MEMD_VPD,
+ DEPRECATED_MEMD_VPD,
NODECOMM,
LAST_ACCESS_TYPE,
@@ -256,30 +256,6 @@ namespace DeviceFW
static_cast<uint64_t>(( i_location ))
/**
- * Construct the device addressing parameters for the DVPD (Direct access
- * memory VPD) device ops.
- * @param[in] i_record - The enumeration of the DVPD record to access.
- * @param[in] i_keyword - The enumeration of the DVPD keyword, located
- * within the i_record Record to access.
- */
- #define DEVICE_MEMD_VPD_ADDRESS( i_record, i_keyword )\
- DEVICE_MEMD_VPD_FORCE_ADDRESS( i_record, i_keyword, VPD::PNOR )
-
- /**
- * Construct the device addressing parameters for the DVPD device ops.
- * @param[in] i_record - The enumeration of the DVPD record to access.
- * @param[in] i_keyword - The enumeration of the DVPD keyword, located
- * within the i_record Record to access.
- * @param[in] i_location - The location of the data (PNOR/SEEPROM)
- see vpd_if.H
- */
- #define DEVICE_MEMD_VPD_FORCE_ADDRESS( i_record, i_keyword, i_location )\
- DeviceFW::MEMD_VPD, static_cast<uint64_t>(( i_record )),\
- static_cast<uint64_t>(( i_keyword )),\
- static_cast<uint64_t>(( i_location ))
-
-
- /**
* Construct the device addressing parameters for the SCAN device ops.
* @param[in] i_ring - The ring address to scan
* @param[in] i_ringlen - The length of the ring to scan in bits
diff --git a/src/include/usr/fapi2/plat_vpd_access.H b/src/include/usr/fapi2/plat_vpd_access.H
index f28317df9..0bde2f363 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,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -31,7 +31,6 @@
#define _FAPI2_PLAT_VPDACCESS_H_
#include <fapi2_vpd_access.H>
-#include <vpd/memd_vpdenums.H>
namespace fapi2
{
@@ -52,19 +51,5 @@ 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/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H
index 79ebe37a8..6b77d621a 100644
--- a/src/include/usr/runtime/runtime_reasoncodes.H
+++ b/src/include/usr/runtime/runtime_reasoncodes.H
@@ -138,6 +138,7 @@ namespace RUNTIME
RC_RT_RES_TRACE_BUF_INVALID = RUNTIME_COMP_ID | 0x41,
RC_SP_ATTN_AREA_OVERFLOW = RUNTIME_COMP_ID | 0x42,
RC_SP_ATTN_AREA1_SIZE_OVERFLOW = RUNTIME_COMP_ID | 0x43,
+ RC_UNKNOWN_LABEL = RUNTIME_COMP_ID | 0x44,
};
enum UserDetailsTypes
diff --git a/src/include/usr/util/utilrsvdmem.H b/src/include/usr/util/utilrsvdmem.H
index ed4d0e4f5..d93819b7b 100644
--- a/src/include/usr/util/utilrsvdmem.H
+++ b/src/include/usr/util/utilrsvdmem.H
@@ -35,23 +35,33 @@ namespace Util
typedef uint64_t hbrt_mem_label_t;
// Ascii label "VPD " in hex
- constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD = 0x5650442020202020;
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD = 0x5650442020202020;
// Ascii label "ATTR " in hex
- constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTR = 0x4154545220202020;
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTR = 0x4154545220202020;
// Ascii label "ATTROVER" in hex
- constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTROVER = 0x415454524F564552;
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_ATTROVER = 0x415454524F564552;
// Ascii label "PADDING " in hex
- constexpr hbrt_mem_label_t HBRT_MEM_LABEL_PADDING = 0x50414444494E4720;
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_PADDING = 0x50414444494E4720;
// Ascii label "HYPCOMM " in hex
- constexpr hbrt_mem_label_t HBRT_MEM_LABEL_HYPCOMM = 0x485950434f4d4d20;
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_HYPCOMM = 0x485950434f4d4d20;
// Ascii label "TRACEBUF" in hex
constexpr hbrt_mem_label_t HBRT_MEM_LABEL_TRACEBUF = 0x5452414345425546;
+ // Note : may be several sections of the format 'VPD_xxxx' if support
+ // other overrides in the future
+ // Ascii label "VPD_"<blank> in hex
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD_XXXX = 0x5650445F00000000;
+ // Mask off specific VPD label
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD_MASK = 0x00000000FFFFFFFF;
+ // Ascii label "VPD_MEMD in hex
+ constexpr hbrt_mem_label_t HBRT_MEM_LABEL_VPD_MEMD = 0x5650445F4D454D44;
+
+
/** @brief A 32 byte table of contents entry */
struct hbrtTableOfContentsEntry_t
{
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