summaryrefslogtreecommitdiffstats
path: root/src/include/runtime/generic_hbrt_fsp_message.H
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2017-11-21 15:02:53 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-12-20 17:47:12 -0500
commit8e6bd68539af8394a3f96dab15464edc151794bb (patch)
tree03e3f07d0599bc0e60b54e4e3aa4d4c38b333f37 /src/include/runtime/generic_hbrt_fsp_message.H
parent5cd50322982059a6b71d5957e22f6f85da17404e (diff)
downloadtalos-hostboot-8e6bd68539af8394a3f96dab15464edc151794bb.tar.gz
talos-hostboot-8e6bd68539af8394a3f96dab15464edc151794bb.zip
Updated the GenericFspMboxMessage_t struct
The GenericFspMboxMessage_t struct has been expanded to provide a lot more data than before. The highlights are that it now carries the data size, an error only flag, a sequence number and a magic number to identify the message. An initialize method has been provided to set some of these to default values. In addition the message types are consolidated into one enum. All enums have a prefix of GFMM to avoid name collisions. The sequence number is an auto incrementing number so we can keep track if the messages are received out of order. Change-Id: Ic0f1c2546ff1ce14f163d1da55646ed089216d19 RTC: 182267 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49960 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/include/runtime/generic_hbrt_fsp_message.H')
-rw-r--r--src/include/runtime/generic_hbrt_fsp_message.H105
1 files changed, 85 insertions, 20 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
OpenPOWER on IntegriCloud