summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2017-12-04 17:37:05 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-12-21 00:12:25 -0500
commit44d0f070400aabde3a06eb7b836923577a117cc0 (patch)
tree464a51f429057595436e47e510913a9a7a03f8d2 /src/include
parenta334e5aa3f11fe4f4657ba89139ac0a543845af1 (diff)
downloadtalos-hostboot-44d0f070400aabde3a06eb7b836923577a117cc0.tar.gz
talos-hostboot-44d0f070400aabde3a06eb7b836923577a117cc0.zip
Handles FSP reset-reload in HBRT messages
For every instance where a firmware_request is made, it is possible to get an error if the FSP is doing a reset/reload. Now, if an error returned from the firmware_request call indicates that the FSP is doing a reset/reload, the firmware_request call will be made again. Also refactored the code. Consolidated the calls to firmware_request to another file to facilitate the adding/updating of messages. Change-Id: I5be440927ab255c55b40a0a0ed26f786d31a9317 RTC:182606 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50505 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/runtime/generic_hbrt_fsp_message.H107
-rw-r--r--src/include/runtime/interface.h9
-rw-r--r--src/include/usr/isteps/tod/runtime/rt_todintf.H9
-rw-r--r--src/include/usr/isteps/tod_init_reasoncodes.H3
-rw-r--r--src/include/usr/runtime/runtime_reasoncodes.H5
-rw-r--r--src/include/usr/util/runtime/rt_fwreq_helper.H60
-rw-r--r--src/include/usr/vpd/vpdreasoncodes.H5
7 files changed, 146 insertions, 52 deletions
diff --git a/src/include/runtime/generic_hbrt_fsp_message.H b/src/include/runtime/generic_hbrt_fsp_message.H
index 1eebb7b09..6fa9ae9cb 100644
--- a/src/include/runtime/generic_hbrt_fsp_message.H
+++ b/src/include/runtime/generic_hbrt_fsp_message.H
@@ -35,43 +35,6 @@
*/
-/**
- * Values for the GenericFspMboxMessage_t::magic
- * and GenericFspMboxMessage_t::structVer data members
- */
-const uint32_t GFMM_MAGIC_NUMBER = 0x4746464D; // `GFFM`
-const uint16_t GFMM_VERSION = 1;
-
-/**
- * Values for the GenericFspMboxMessage_t::__req flag
- */
-enum GENERIC_FSP_MBOX_MESSAGE_FLOW
-{
- GFMM_RESPONSE = 0,
- GFMM_REQUEST = 1,
-};
-
-/**
- * Values for the GenericFspMboxMessage_t::__onlyError flag
- */
-enum GENERIC_FSP_MBOX_MESSAGE_ERROR_FLAG
-{
- GFMM_NOT_ERROR_ONLY = 0,
- GFMM_ERROR_ONLY = 1,
-};
-
-/**
- * The different message types for the GenericFspMboxMessage_t
- */
-enum GENERIC_FSP_MBOX_MESSAGE_MSG_TYPE
-{
- GFMM_MSG_TOD_BACKUP_RESET = 0x0001,
- GFMM_MSG_TOD_BACKUP_RESET_INFORM_PHYP = 0x0002,
- GFMM_MSG_TOD_TOPOLOGY_DATA = 0x0003,
- GFMM_MSG_SBE_ERROR = 0x000000E1,
- GFMM_MSG_SBE_RECOVERY_SUCCESS = 0x000000E2,
- GFMM_MSG_SBE_RECOVERY_FAILED = 0x000000E3,
-};
/**
* This generates a sequence ID that the GenericFspMboxMessage_t
@@ -84,14 +47,74 @@ public:
static uint16_t getCurrentSeqId();
private:
- static uint16_t GFMM_SEQ_ID;
+ static uint16_t SEQ_ID;
};
/**
+ * A useful struct to access the PLID from GenericFspMboxMessage_t.data
+ * The PLID will be in the first 4 bytes followed by some other data.
+ */
+struct HbrtFspData_t
+{
+ uint32_t plid;
+ uint32_t userData;
+} PACKED ;
+
+/**
* This struct sends/receives an MBox message to the FSP
*/
struct GenericFspMboxMessage_t
{
+
+ /**
+ * Value for the GenericFspMboxMessage_t::magic
+ */
+ static constexpr uint32_t MAGIC_NUMBER = 0x4746464D; // `GFFM`
+
+ /**
+ * GenericFspMboxMessage_t Version info
+ *
+ */
+ enum GENERIC_FSP_MBOX_MESSAGE_VERSION
+ {
+ STRUCT_VERSION_FIRST = 0x1,
+ STRUCT_VERSION_LATEST = STRUCT_VERSION_FIRST,
+ };
+
+ /**
+ * Values for the GenericFspMboxMessage_t::__req flag
+ */
+ enum GENERIC_FSP_MBOX_MESSAGE_FLOW
+ {
+ RESPONSE = 0,
+ REQUEST = 1,
+ };
+
+ /**
+ * Values for the GenericFspMboxMessage_t::__onlyError flag
+ */
+ enum GENERIC_FSP_MBOX_MESSAGE_ERROR_FLAG
+ {
+ NOT_ERROR_ONLY = 0,
+ ERROR_ONLY = 1,
+ };
+
+ /**
+ * The different message types for the GenericFspMboxMessage_t
+ */
+ enum GENERIC_FSP_MBOX_MESSAGE_MSG_TYPE
+ {
+ MSG_TOD_BACKUP_RESET = 0x0001,
+ MSG_TOD_BACKUP_RESET_INFORM_PHYP = 0x0002,
+ MSG_TOD_TOPOLOGY_DATA = 0x0003,
+ MSG_SBE_ERROR = 0x000000E1,
+ MSG_SBE_RECOVERY_SUCCESS = 0x000000E2,
+ MSG_SBE_RECOVERY_FAILED = 0x000000E3,
+ };
+
+ /**
+ * GenericFspMboxMessage_t data members
+ */
uint32_t magic; // ='GFMM'
uint32_t dataSize; // total number of bytes in the entire message,
// includes structure plus data buffer,
@@ -120,16 +143,16 @@ struct GenericFspMboxMessage_t
// A method to set the local vars to a default state
void initialize()
{
- magic = GFMM_MAGIC_NUMBER;
+ magic = MAGIC_NUMBER;
dataSize = sizeof(GenericFspMboxMessage_t);
- structVer = GFMM_VERSION;
+ structVer = STRUCT_VERSION_LATEST;
reserved = 0;
seqnum = SeqId_t::getNextSeqId();
msgq = 0;
msgType = 0;
- __req = GFMM_RESPONSE;
+ __req = RESPONSE;
__async = 0;
- __onlyError = GFMM_NOT_ERROR_ONLY;
+ __onlyError = NOT_ERROR_ONLY;
__unused = 0;
data = 0;
};
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 96eb62c2c..3a6ac6b93 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -147,6 +147,15 @@ enum MemoryError_t
/* PHYP fixes */
#define HBRT_CAPS_SET2_PHYP 2
+/* FSP failed due to a a reset/reload. Only applicable when
+ * hostInterfaces::hbrt_fw_msg::io_type is set to
+ * HBRT_FW_MSG_HBRT_FSP_REQ
+ */
+#define HBRT_RC_FSPDEAD -8193 //0x2001
+
+/* FSP failed due to a a reset/reload */
+#define HBRT_FW_REQUEST_RETRIES 1
+
/** @typedef hostInterfaces_t
* @brief Interfaces provided by the underlying environment (ex. Sapphire).
diff --git a/src/include/usr/isteps/tod/runtime/rt_todintf.H b/src/include/usr/isteps/tod/runtime/rt_todintf.H
index b79e24c1c..4e0c005ae 100644
--- a/src/include/usr/isteps/tod/runtime/rt_todintf.H
+++ b/src/include/usr/isteps/tod/runtime/rt_todintf.H
@@ -44,14 +44,15 @@ namespace TOD
* @brief This interface creates a new backup TOD topology. This request
* is sent to the FSP for resetting the backup topology.
*
- * @param[in] i_oscPos the ordinal ID of the failing OSC. Value of
- * 0xFFFFFFFF means no OSC to avoid.
+ * @param[in] i_oscPos the ordinal ID of the failing OSC (Oscillator).
+ * Value of 0xFFFFFFFF means no OSC to avoid.
* @param[in] i_procOscTgt target of the processor with which the failing OSC
* is associated with. If ordinal ID is 0xFFFFFFFF then this should
* be NULL, otherwise provide a valid target. If ordinal ID is
* 0xFFFFFFFF, i_procOscTgt is ignored regardless of it's validity.
- * @param[in] i_badChipList input list of targets.
- * @param[in] i_informPhyp flag to inform the PHYP that it won't have a
+ * @param[in] i_badChipList list of oscillator targets that have been marked
+ * by PRD as faulty.
+ * @param[in] i_informPhyp flag to inform PHYP that it won't have a
* backup available for fail over while we are re-configuring it.
*
* @return Error log handle indicating the status of the request
diff --git a/src/include/usr/isteps/tod_init_reasoncodes.H b/src/include/usr/isteps/tod_init_reasoncodes.H
index 9580e890b..17f8cea23 100644
--- a/src/include/usr/isteps/tod_init_reasoncodes.H
+++ b/src/include/usr/isteps/tod_init_reasoncodes.H
@@ -94,8 +94,7 @@ namespace TOD
TOD_DRAWER_SET_MDMT = TOD_COMP_ID | 0x18,
TOD_TOP_LEVEL_TARGET_NOT_FOUND = TOD_COMP_ID | 0x19,
TOD_RT_NULL_FIRMWARE_REQUEST_PTR = TOD_COMP_ID | 0x1A,
- TOD_RT_TOPOLOGY_RESET_BACKUP_ERR = TOD_COMP_ID | 0x1B,
- TOD_RT_TOPOLOGY_DATA_ERR = TOD_COMP_ID | 0x1C,
+ TOD_XXX = TOD_COMP_ID | 0x1C,
};
enum TODUserDetailDataSubSection
diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H
index 5b38a8b08..7ff89d712 100644
--- a/src/include/usr/runtime/runtime_reasoncodes.H
+++ b/src/include/usr/runtime/runtime_reasoncodes.H
@@ -59,8 +59,8 @@ namespace RUNTIME
MOD_POPULATE_TPMINFOBYNODE = 0x19, /**< populate_hbruntime.C */
MOD_FILL_RSVMEM_HBDATA = 0x20, /**< populate_hbruntime.C */
MOD_ATTR_RUNTIME_CHECK_PREP_FAIL = 0x21, /**< populate_hbruntime.C */
- MOD_PM_RT_FIRMWARE_REQUEST = 0x22, /**< rt_pm.C */
MOD_RT_FIRMWARE_NOTIFY = 0x23, /**< rt_fwnotify.C */
+ MOD_RT_FIRMWARE_REQUEST = 0x24, /**< rt_fwreq_helper.C */
};
enum RuntimeReasonCode
@@ -120,6 +120,9 @@ namespace RUNTIME
RC_FW_REQUEST_RT_NULL_PTR = RUNTIME_COMP_ID | 0x34,
RC_SBE_RT_INVALID_HUID = RUNTIME_COMP_ID | 0x35,
RC_SBE_RT_RECOVERY_ERR = RUNTIME_COMP_ID | 0x36,
+ RC_FW_REQUEST_HWSV_ERR = RUNTIME_COMP_ID | 0x37,
+ RC_FW_REQUEST_RESET_RELOAD_ERR = RUNTIME_COMP_ID | 0x38,
+ RC_FW_REQUEST_ERR = RUNTIME_COMP_ID | 0x39,
};
enum UserDetailsTypes
diff --git a/src/include/usr/util/runtime/rt_fwreq_helper.H b/src/include/usr/util/runtime/rt_fwreq_helper.H
new file mode 100644
index 000000000..ceac3a031
--- /dev/null
+++ b/src/include/usr/util/runtime/rt_fwreq_helper.H
@@ -0,0 +1,60 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/util/runtime/rt_fwreq_helper.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2010,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 __RUNTIME_FWREQ_HELPER_H
+#define __RUNTIME_FWREQ_HELPER_H
+
+#include <errl/errlentry.H> // errlHndl_t
+
+/**
+ * @brief This is a wrapper function for the
+ * hostInterfaces::firmware_request method. This method
+ * will do the repetitious job of checking for errors,
+ * retry call if necessary and logging errors.
+ * @details
+ * req_len bytes are sent to runtime firmware, and resp_len
+ * bytes received in response.
+ *
+ * Both req and resp are allocated by the caller. If resp_len
+ * is not large enough to contain the full response, an error
+ * is returned.
+ *
+ * @param[in] i_reqLen length of request data
+ * @param[in] i_req request data
+ * @param[inout] o_respLen in: size of request data buffer
+ * out: length of response data
+ * @param[in] o_resp response data
+ * @return errlHndl_t NULL if successful, otherwise a pointer
+ * to the error log.
+ * @see src/include/runtime/interface.h for definition of call
+ */
+errlHndl_t
+firmware_request_helper(uint64_t i_reqLen,
+ void *i_req,
+ uint64_t* o_respLen,
+ void *o_resp);
+
+
+
+#endif // __RUNTIME_FWREQ_HELPER_H
diff --git a/src/include/usr/vpd/vpdreasoncodes.H b/src/include/usr/vpd/vpdreasoncodes.H
index 8007d0a7b..a9c62aca5 100644
--- a/src/include/usr/vpd/vpdreasoncodes.H
+++ b/src/include/usr/vpd/vpdreasoncodes.H
@@ -92,8 +92,7 @@ enum vpdModuleId
VPD_RT_WRITE_PNOR = 0x81,
VPD_BLD_RT_IMAGE = 0x82,
VPD_SEND_MBOX_WRITE_MESSAGE = 0x83,
- VPD_RT_FIRMWARE_REQUEST = 0x84,
-
+ VPD_MOD_XXX = 0x84,
};
/**
@@ -141,7 +140,7 @@ enum vpdReasonCode
VPD_CACHE_SIZE_EXCEEDED = VPD_COMP_ID | 0x35,
VPD_INVALID_LENGTH = VPD_COMP_ID | 0x36,
VPD_RT_NULL_FIRMWARE_REQUEST_PTR = VPD_COMP_ID | 0x37,
- VPD_RT_WRITE_MSG_ERR = VPD_COMP_ID | 0x38,
+ VPD_RC_XXX = VPD_COMP_ID | 0x38,
};
OpenPOWER on IntegriCloud