summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd/runtime
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/usr/vpd/runtime
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/usr/vpd/runtime')
-rw-r--r--src/usr/vpd/runtime/rt_vpd.C44
1 files changed, 27 insertions, 17 deletions
diff --git a/src/usr/vpd/runtime/rt_vpd.C b/src/usr/vpd/runtime/rt_vpd.C
index d23fc969d..d85440e56 100644
--- a/src/usr/vpd/runtime/rt_vpd.C
+++ b/src/usr/vpd/runtime/rt_vpd.C
@@ -419,9 +419,12 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
}
// Get an accurate size of memory actually needed to transport the data
+ size_t l_generic_msg_size =
+ sizeof(hostInterfaces::hbrt_fw_msg::generic_msg) +
+ i_numBytes -
+ sizeof(hostInterfaces::hbrt_fw_msg::generic_msg.data);
size_t l_req_fw_msg_size = hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
- sizeof(hostInterfaces::hbrt_fw_msg::generic_message) +
- i_numBytes;
+ l_generic_msg_size;
//create the firmware_request structure to carry the vpd write msg data
l_req_fw_msg =
@@ -429,10 +432,14 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
memset(l_req_fw_msg, 0, l_req_fw_msg_size);
// populate the firmware_request structure with given data
- l_req_fw_msg->io_type = hostInterfaces::HBRT_FW_MSG_HBRT_FSP;
- l_req_fw_msg->generic_message.msgq = MBOX::FSP_VPD_MSGQ;
- l_req_fw_msg->generic_message.msgType = i_type;
- memcpy(&l_req_fw_msg->generic_message.data, i_data, i_numBytes);
+ l_req_fw_msg->io_type = hostInterfaces::HBRT_FW_MSG_HBRT_FSP_REQ;
+ l_req_fw_msg->generic_msg.initialize();
+ l_req_fw_msg->generic_msg.dataSize = l_generic_msg_size;
+ l_req_fw_msg->generic_msg.msgq = MBOX::FSP_VPD_MSGQ;
+ l_req_fw_msg->generic_msg.msgType = i_type;
+ l_req_fw_msg->generic_msg.__req = GFMM_REQUEST;
+ l_req_fw_msg->generic_msg.__onlyError = GFMM_NOT_ERROR_ONLY;
+ memcpy(&l_req_fw_msg->generic_msg.data, i_data, i_numBytes);
// set up the response struct, note that for messages to the FSP
// the response size must match the request size
@@ -447,7 +454,7 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
TRACFBIN( g_trac_vpd, INFO_MRK"Sending firmware_request",
l_req_fw_msg,
hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
- sizeof(hostInterfaces::hbrt_fw_msg::generic_message) );
+ sizeof(hostInterfaces::hbrt_fw_msg::generic_msg) );
size_t rc = g_hostInterfaces->firmware_request(l_req_fw_msg_size,
l_req_fw_msg,
&l_resp_fw_msg_size,
@@ -457,13 +464,15 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
// Capture the err log id if any
// The return code (rc) may return OK, but there still may be an issue
// with the HWSV code on the FSP.
- if ((l_resp_fw_msg_size >= (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
- sizeof(l_resp_fw_msg->generic_message_resp))) &&
- (hostInterfaces::HBRT_FW_MSG_HBRT_FSP_RESP
- == l_resp_fw_msg->io_type) &&
- (0 != l_resp_fw_msg->generic_message_resp.errPlid) )
+ // Only checking for a PLID regardless of what the flag __onlyError is
+ // set to. I am not expecting any extra data and not sure what to do
+ // with it if I get it.
+ if ( (hostInterfaces::HBRT_FW_MSG_HBRT_FSP_RESP ==
+ l_resp_fw_msg->io_type) &&
+ (0 != l_resp_fw_msg->generic_msg.data >> 32) )
{
- l_userData2 = l_resp_fw_msg->generic_message_resp.errPlid;
+ // extract the plid from the first 32 bits
+ l_userData2 = l_resp_fw_msg->generic_msg.data >> 32;
}
// gather up the error data and create an err log out of it
@@ -471,10 +480,11 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
{
TRACFCOMP(g_trac_vpd,
ERR_MRK"firmware request: "
- "firmware request for FSP VPD write message rc 0x%X, "
- "target 0x%llX, VPD type %.8X, record %d, offset 0x%X",
- rc, get_huid(i_target), i_type, i_record.rec_num,
- i_record.offset );
+ "firmware request for FSP VPD write message rc: 0x%X, "
+ "HUID:0x%llX, plid:%.8X, VPD type:%.8X, "
+ "record:%d, offset:0x%X, ",
+ rc, get_huid(i_target), l_userData2,
+ i_type, i_record.rec_num, i_record.offset );
/*@
* @errortype
OpenPOWER on IntegriCloud