summaryrefslogtreecommitdiffstats
path: root/src/include/usr/expupd
diff options
context:
space:
mode:
authorGlenn Miles <milesg@ibm.com>2019-04-24 19:09:15 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-07 09:35:39 -0500
commitf1b76d406973cffd6276fcbf05a036a0ef31b150 (patch)
tree939bd1a6fd2be0b3539e87a5272d7e6f1c2c901d /src/include/usr/expupd
parentee2270e80fc2d925dc1a93f987035bb8fba15cff (diff)
downloadtalos-hostboot-f1b76d406973cffd6276fcbf05a036a0ef31b150.tar.gz
talos-hostboot-f1b76d406973cffd6276fcbf05a036a0ef31b150.zip
Load and validate OCMB FW image in istep 12.13
Adds function for loading and validating the OCMB firmware image. RTC: 193924 Change-Id: I398d80940710f46cf7e0b66ed663116e574e54b9 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76624 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: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/expupd')
-rw-r--r--src/include/usr/expupd/expupd.H45
-rw-r--r--src/include/usr/expupd/expupd_reasoncodes.H13
-rw-r--r--src/include/usr/expupd/ocmbFwImage_const.H111
3 files changed, 166 insertions, 3 deletions
diff --git a/src/include/usr/expupd/expupd.H b/src/include/usr/expupd/expupd.H
new file mode 100644
index 000000000..a686d7f91
--- /dev/null
+++ b/src/include/usr/expupd/expupd.H
@@ -0,0 +1,45 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/expupd/expupd.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 __EXPUPD_H
+#define __EXPUPD_H
+
+#include <isteps/hwpisteperror.H>
+
+namespace expupd
+{
+
+/**
+ * @brief Check flash image SHA512 hash value of each explorer chip
+ * and update the flash if it does not match the SHA512 hash
+ * of the image in PNOR.
+ *
+ * @param[out] o_stepError Error handle for logging istep failures
+ *
+ */
+void updateAll(ISTEP_ERROR::IStepError& o_stepError);
+
+}//namespace expupd
+
+#endif
diff --git a/src/include/usr/expupd/expupd_reasoncodes.H b/src/include/usr/expupd/expupd_reasoncodes.H
index ed3cd2717..d5837206a 100644
--- a/src/include/usr/expupd/expupd_reasoncodes.H
+++ b/src/include/usr/expupd/expupd_reasoncodes.H
@@ -33,13 +33,20 @@ namespace EXPUPD
enum ExpUpdModuleId
{
- MOD_UPDATE_ALL_EXP_FLASH_IMAGES = 0x01,
+ MOD_OCMB_FW_VALIDATE_IMAGE = 0x01,
+ MOD_PARSE_TAGGED_DATA_TRIPLET = 0x02,
};
enum ExpUpdReasonCode
{
- EXPUPD_INVALID_EYECATCHER = UCD_COMP_ID | 0x01,
- EXPUPD_INVALID_MAJOR_VER = UCD_COMP_ID | 0x02,
+ INVALID_PARMS = EXPUPD_COMP_ID | 0x01,
+ INVALID_EYE_CATCHER = EXPUPD_COMP_ID | 0x02,
+ INVALID_HEADER_VERSION = EXPUPD_COMP_ID | 0x03,
+ INVALID_HEADER_SIZE = EXPUPD_COMP_ID | 0x04,
+ MISSING_SHA512_HASH = EXPUPD_COMP_ID | 0x05,
+ INVALID_DATA_TRIPLET_SIZE = EXPUPD_COMP_ID | 0x06,
+ INVALID_HASH_TRIPLET_SIZE = EXPUPD_COMP_ID | 0x07,
+ INVALID_TAG_ID = EXPUPD_COMP_ID | 0x08,
};
}; // namespace EXPUPD
diff --git a/src/include/usr/expupd/ocmbFwImage_const.H b/src/include/usr/expupd/ocmbFwImage_const.H
new file mode 100644
index 000000000..b97b1adcf
--- /dev/null
+++ b/src/include/usr/expupd/ocmbFwImage_const.H
@@ -0,0 +1,111 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/expupd/ocmbFwImage_const.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 __OCMBFWIMAGE_CONST_H
+#define __OCMBFWIMAGE_CONST_H
+
+namespace expupd
+{
+
+// ********************************WARNING**********************************
+//
+// THIS FILE MUST BE KEPT IN SYNC WITH src/build/buildpnor/pkgOcmbFw.pl
+//
+// ********************************WARNING**********************************
+
+
+/**
+ * @brief Eyecatcher value is the ascii representation of the
+ * null terminated string, "OCMBHDR".
+ */
+constexpr uint64_t EYE_CATCHER_VALUE = 0x4F434D4248445200ULL;
+
+constexpr uint32_t MAX_BIN_TRACE = 256;
+
+/**
+ * @brief Miscellaneous constants related to the OCMB firmware header
+ */
+enum OCMBFW_HEADER_CONSTS: uint32_t
+{
+ HEADER_VERSION_MAJOR = 1,
+ HEADER_VERSION_MINOR = 0,
+ HEADER_MAX_SIZE = 4096,
+};
+
+/**
+ * @brief Header for the OCMB flash image content
+ */
+typedef struct ocmbFwHeader
+{
+ // See EYE_CATCHER_VALUE above
+ uint64_t eyeCatcher;
+
+ // The major and minor version of this header
+ uint32_t majorVersion;
+ uint32_t minorVersion;
+
+ // The total size of this header (must be 8 byte aligned)
+ uint32_t headerSize;
+
+ // The number of "tagged data triplets" included
+ // in this header. (see taggedTriplet_t)
+ uint32_t numTriplets;
+
+ // Variable sized, unordered tagged data triplets start here
+}ocmbFwHeader_t;
+
+/**
+ * @brief Tag Id's for tagged triplets
+ */
+enum TRIPLET_TAG_IDS: uint32_t
+{
+ // Data contains 64 bytes of SHA512 hash data
+ TAG_SHA512 = 1,
+
+ // Data contains a null-terminated string of comma separated
+ // key/value pairs with the following format:
+ // <key1>=<value1>,<key2>=<value2>,<key3>=<value3>
+ //
+ // Keys and values are defined by the manufacturer and must
+ // not contain the characters "=" or ","
+ TAG_KEY_VALUE_PAIRS = 2,
+};
+
+/**
+ * @brief Tagged triplet data format
+ */
+typedef struct taggedTriplet
+{
+ // Identifies the data format for this triplet
+ uint32_t tagId;
+
+ // Size of the data that follows (must be 8 byte aligned)
+ uint32_t dataSize;
+
+ // variable sized data starts here
+}taggedTriplet_t;
+
+} //namespace expupd
+
+#endif
OpenPOWER on IntegriCloud