summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/runtime/generic_hbrt_fsp_message.H105
-rw-r--r--src/include/runtime/interface.h18
-rw-r--r--src/include/usr/runtime/runtime_reasoncodes.H6
3 files changed, 98 insertions, 31 deletions
diff --git a/src/include/runtime/generic_hbrt_fsp_message.H b/src/include/runtime/generic_hbrt_fsp_message.H
index 742270e66..1eebb7b09 100644
--- a/src/include/runtime/generic_hbrt_fsp_message.H
+++ b/src/include/runtime/generic_hbrt_fsp_message.H
@@ -34,40 +34,105 @@
* FSP/HWSV team to send and receive data.
*/
+
+/**
+ * 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,
+};
+
/**
- * This struct sends an MBox message to the FSP
+ * 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
+ * consumes.
+ */
+struct SeqId_t
+{
+public:
+ static uint16_t getNextSeqId();
+ static uint16_t getCurrentSeqId();
+
+private:
+ static uint16_t GFMM_SEQ_ID;
+};
+
+/**
+ * This struct sends/receives an MBox message to the FSP
*/
struct GenericFspMboxMessage_t
{
- uint32_t msgq; // Example: MBOX::FSP_VPD_MSGQ
- uint32_t msgType; // Example: VPD_MSG_TYPE:VPD_WRITE_PROC
+ uint32_t magic; // ='GFMM'
+ uint32_t dataSize; // total number of bytes in the entire message,
+ // includes structure plus data buffer,
+ // minimum is sizeof(GenericFspMboxMessage_t)
+ uint8_t structVer; // =1, allow for future modifications
+ uint8_t reserved; // unused, just for alignment and expansion
+ uint16_t seqnum; // incremented for each new request, bit0=1 indicates
+ // the request came from the FSP, i.e. 0x0000->0x7FFF
+ // are from HBRT, 0x8000->0xFFFF are from HWSV.
+ uint32_t msgq; // Example: MBOX::FSP_VPD_MSGQ
+ uint32_t msgType; // Example: VPD_MSG_TYPE:VPD_WRITE_PROC
struct // flags
{
- uint32_t __reserved__async:1;
- uint32_t __reserved__pseudosync:1;
- uint32_t __reserved__unused:30;
+ uint32_t __req:1; // 1=this is a request, 0=this is a response
+ uint32_t __async:1; // =0 for now, future async req/resp support
+ uint32_t __onlyError:1; // 1=this is a response that only contains a
+ // single 32-bit plid in the first 4 bytes of
+ // the data payload
+ uint32_t __unused:29; // reserved for future
};
uint64_t data; // generic member that can be used
// to do casting to other types:
// MyDataType_t* mydatatype =
// (MyDataType_t*)&(l_generic_msg.data);
-} PACKED ;
-/**
- * This struct receives the response message from the FSP
- */
-struct GenericFspRspMessage_t
-{
- uint32_t msgq; // Example: MBOX::FSP_VPD_MSGQ
- uint32_t msgType; // Example: VPD_MSG_TYPE:VPD_WRITE_PROC
- struct // flags
+ // A method to set the local vars to a default state
+ void initialize()
{
- uint32_t __reserved__async:1;
- uint32_t __reserved__pseudosync:1;
- uint32_t __reserved__unused:30;
+ magic = GFMM_MAGIC_NUMBER;
+ dataSize = sizeof(GenericFspMboxMessage_t);
+ structVer = GFMM_VERSION;
+ reserved = 0;
+ seqnum = SeqId_t::getNextSeqId();
+ msgq = 0;
+ msgType = 0;
+ __req = GFMM_RESPONSE;
+ __async = 0;
+ __onlyError = GFMM_NOT_ERROR_ONLY;
+ __unused = 0;
+ data = 0;
};
- uint32_t errPlid; // error log id
} PACKED ;
-
#endif // __RUNTIME__GENERIC_HBRT_FSP_MESSAGE_H
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 7258826ca..8aad5d5fb 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -503,7 +503,7 @@ typedef struct hostInterfaces
HBRT_FW_MSG_TYPE_RESP_NOP = 1,
HBRT_FW_MSG_TYPE_RESP_GENERIC = 2,
HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3,
- HBRT_FW_MSG_HBRT_FSP = 4,
+ HBRT_FW_MSG_HBRT_FSP_REQ = 4,
HBRT_FW_MSG_TYPE_ERROR_LOG = 5,
HBRT_FW_MSG_HBRT_FSP_RESP = 6,
};
@@ -550,21 +550,17 @@ typedef struct hostInterfaces
} __attribute__ ((packed)) error_log;
// This struct is sent from HBRT with
- // io_type set to HBRT_FW_MSG_HBRT_FSP
- // This struct sends an MBox message to the FSP
- struct GenericFspMboxMessage_t generic_message;
-
- // This struct is sent from FSP with
- // io_type set to HBRT_FW_MSG_HBRT_FSP_RESP
- // This struct receives a message from the FSP
- struct GenericFspRspMessage_t generic_message_resp;
-
+ // io_type set to HBRT_FW_MSG_HBRT_FSP_REQ or
+ // HBRT_FW_MSG_HBRT_FSP_RESP
+ // This struct sends/receives an MBox message to the FSP
+ struct GenericFspMboxMessage_t generic_msg;
}; // end union
}; // end struct hbrt_fw_msg
// Created a static constexpr to return the base size of hbrt_fw_msg
// Can't do #define - sizeof not allowed to be used in #defines
- static constexpr size_t HBRT_FW_MSG_BASE_SIZE = sizeof(uint64_t);
+ static constexpr size_t HBRT_FW_MSG_BASE_SIZE =
+ sizeof(hbrt_fw_msg::io_type);
/**
* @brief Send a request to firmware, and receive a response
diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H
index 4ce07c0c2..5b38a8b08 100644
--- a/src/include/usr/runtime/runtime_reasoncodes.H
+++ b/src/include/usr/runtime/runtime_reasoncodes.H
@@ -60,6 +60,7 @@ namespace RUNTIME
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 */
};
enum RuntimeReasonCode
@@ -114,6 +115,11 @@ namespace RUNTIME
RC_TPM_HDAT_BAD_NUM_I2C = RUNTIME_COMP_ID | 0x2F,
RC_INVALID_LID = RUNTIME_COMP_ID | 0x30,
RC_PREVER_INVALID_SIZE = RUNTIME_COMP_ID | 0x31,
+ RC_FW_NOTIFY_RT_INVALID_MSG = RUNTIME_COMP_ID | 0x32,
+ RC_FW_NOTIFY_RT_INVALID_MSG_TYPE = RUNTIME_COMP_ID | 0x33,
+ 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,
};
enum UserDetailsTypes
OpenPOWER on IntegriCloud