summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/runtime/generic_hbrt_fsp_message.H4
-rw-r--r--src/usr/vpd/runtime/rt_vpd.C31
2 files changed, 27 insertions, 8 deletions
diff --git a/src/include/runtime/generic_hbrt_fsp_message.H b/src/include/runtime/generic_hbrt_fsp_message.H
index 6fa9ae9cb..b34a98d26 100644
--- a/src/include/runtime/generic_hbrt_fsp_message.H
+++ b/src/include/runtime/generic_hbrt_fsp_message.H
@@ -158,4 +158,8 @@ struct GenericFspMboxMessage_t
};
} PACKED ;
+// Handy macro that computes the size of the message minus the data portion
+#define GENERIC_FSP_MBOX_MESSAGE_BASE_SIZE \
+ (sizeof(GenericFspMboxMessage_t)-sizeof(GenericFspMboxMessage_t::data))
+
#endif // __RUNTIME__GENERIC_HBRT_FSP_MESSAGE_H
diff --git a/src/usr/vpd/runtime/rt_vpd.C b/src/usr/vpd/runtime/rt_vpd.C
index dba37f1c2..fc60ece9c 100644
--- a/src/usr/vpd/runtime/rt_vpd.C
+++ b/src/usr/vpd/runtime/rt_vpd.C
@@ -430,22 +430,25 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
// Get an accurate size of memory needed to transport
// the data for the firmware_request request struct
- uint32_t l_req_data_size = sizeof(GenericFspMboxMessage_t) +
- i_numBytes -
- sizeof(GenericFspMboxMessage_t::data);
+ uint32_t l_fsp_req_size = GENERIC_FSP_MBOX_MESSAGE_BASE_SIZE;
+ // add on the 2 header words that are used in the IPL-time
+ // version of the VPD write message (see vpd.H)
+ l_fsp_req_size += sizeof(VpdWriteMsg_t) + sizeof(uint64_t);
+ // add on the extra_data portion of the message
+ l_fsp_req_size += i_numBytes;
// The request data size must be at a minimum the size of the
// FSP generic message (sizeof(GenericFspMboxMessage_t))
- if (l_req_data_size < sizeof(GenericFspMboxMessage_t))
+ if (l_fsp_req_size < sizeof(GenericFspMboxMessage_t))
{
- l_req_data_size = sizeof(GenericFspMboxMessage_t);
+ l_fsp_req_size = sizeof(GenericFspMboxMessage_t);
}
// Calculate the TOTAL size of hostInterfaces::hbrt_fw_msg which
// means only adding hostInterfaces::HBRT_FW_MSG_BASE_SIZE to
// the previous calculated data size
uint64_t l_req_fw_msg_size = hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
- l_req_data_size;
+ l_fsp_req_size;
// Create the firmware_request request struct to send data
l_req_fw_msg =
@@ -456,11 +459,23 @@ errlHndl_t sendMboxWriteMsg ( size_t i_numBytes,
// Populate the firmware_request request struct with given data
l_req_fw_msg->io_type = hostInterfaces::HBRT_FW_MSG_HBRT_FSP_REQ;
- l_req_fw_msg->generic_msg.dataSize = l_req_data_size;
+ l_req_fw_msg->generic_msg.dataSize = l_fsp_req_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 = GenericFspMboxMessage_t::REQUEST;
- memcpy(&l_req_fw_msg->generic_msg.data, i_data, i_numBytes);
+
+ // the full message looks like this
+ struct VpdWriteMsgHBRT_t
+ {
+ VpdWriteMsg_t vpdInfo;
+ uint64_t vpdBytes;
+ uint8_t vpdData; //of vpdBytes size
+ };
+ VpdWriteMsgHBRT_t* l_msg = reinterpret_cast<VpdWriteMsgHBRT_t*>
+ (&(l_req_fw_msg->generic_msg.data));
+ l_msg->vpdInfo = i_record;
+ l_msg->vpdBytes = i_numBytes;
+ memcpy( &(l_msg->vpdData), i_data, i_numBytes );
// Create the firmware_request response struct to receive data
// NOTE: For messages to the FSP the response size must match
OpenPOWER on IntegriCloud