summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio/runtime
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-03-13 15:02:33 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-04-14 12:40:46 -0400
commitd379388635df2705525dc1664f33ade86665874d (patch)
tree89096a868cf3704f34e94e0b5ec86e78561bcaf5 /src/usr/sbeio/runtime
parenta51371c0acfb4b3bb04d3a6058d9664abb696dde (diff)
downloadblackbird-hostboot-d379388635df2705525dc1664f33ade86665874d.tar.gz
blackbird-hostboot-d379388635df2705525dc1664f33ade86665874d.zip
SBE message passing interface - process SBE message write response
Add prossessing to check the response that was written to the SBE Communication buffer for the processed Pass-through command. Change-Id: I2a898af8209159a28bcde172d6d85c99feaf82ad RTC: 170762 Depends-on: I220a864a072bcc60cc873cde243a28cc899e2722 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37871 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio/runtime')
-rw-r--r--src/usr/sbeio/runtime/rt_sbeio.C93
1 files changed, 91 insertions, 2 deletions
diff --git a/src/usr/sbeio/runtime/rt_sbeio.C b/src/usr/sbeio/runtime/rt_sbeio.C
index 910326b92..590d00755 100644
--- a/src/usr/sbeio/runtime/rt_sbeio.C
+++ b/src/usr/sbeio/runtime/rt_sbeio.C
@@ -331,6 +331,17 @@ namespace RT_SBEIO
l_command,
i_request.sbeHdr.seqId);
+ // Check data offset
+ if(o_response.cmdHdr.dataOffset > sizeof(cmdHeader_t))
+ {
+ TRACFCOMP(g_trac_sbeio, "process_sbe_msg: process command "
+ "adjusting response data offset");
+
+ // Change offset to show response payload is being put
+ // immediately after command header
+ o_response.cmdHdr.dataOffset = sizeof(cmdHeader_t);
+ }
+
// Call function to process command
errl = g_processCmdMap[l_command](i_proc,
i_request.cmdHdr.dataSize,
@@ -407,6 +418,77 @@ namespace RT_SBEIO
//------------------------------------------------------------------------
+ /**
+ * @brief SBE message passing check pass-through command response
+ *
+ * @details This is a call that will check a pass-through command
+ * response that was written to the SBE Communication buffer
+ * against certain fields from the local copy of the command.
+ *
+ * @param[in] i_proc HB processor target
+ * @param[in] i_sbeMessage Pass-through command response in sbe-comm
+ * @param[in] i_request Copied pass-through command request
+ *
+ * @returns 0 on success, or return code if the command failed
+ */
+ int process_sbe_msg_check_response(TargetHandle_t i_proc,
+ sbeMessage_t& i_sbeMessage,
+ sbeMessage_t& i_request)
+ {
+ errlHndl_t errl = nullptr;
+ int rc = 0;
+
+ if((i_sbeMessage.sbeHdr.version != i_request.sbeHdr.version) ||
+ (i_sbeMessage.sbeHdr.seqId != i_request.sbeHdr.seqId) ||
+ (i_sbeMessage.cmdHdr.version != i_request.cmdHdr.version) ||
+ (i_sbeMessage.cmdHdr.command != i_request.cmdHdr.command))
+ {
+ TRACFCOMP(g_trac_sbeio, ERR_MRK"process_sbe_msg: check "
+ "response, response field was altered");
+
+ rc = -301;
+
+ /*@
+ * @errortype
+ * @moduleid SBEIO::SBEIO_RUNTIME
+ * @reasoncode SBEIO::SBEIO_RT_RSP_FIELD_ALTERED
+ * @userdata1[0:31] Processor HUID
+ * @userdata1[32:63] Request Command
+ * @userdata2 Sequence ID
+ *
+ * @devdesc SBEIO RT Check Pass-through command response field
+ * was altered.
+ * @custdesc Firmware error communicating with boot device
+ */
+ errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ SBEIO::SBEIO_RUNTIME,
+ SBEIO::SBEIO_RT_RSP_FIELD_ALTERED,
+ TWO_UINT32_TO_UINT64(
+ get_huid(i_proc),
+ i_request.cmdHdr.command),
+ i_request.sbeHdr.seqId);
+
+ errl->addFFDC( SBE_COMP_ID,
+ &(i_request),
+ sizeof(sbeHeader_t) + sizeof(cmdHeader_t),
+ 0, // Version
+ ERRL_UDT_NOFORMAT, // parser ignores data
+ false ); // merge
+ errl->addFFDC( SBE_COMP_ID,
+ &(i_sbeMessage),
+ sizeof(sbeHeader_t) + sizeof(cmdHeader_t),
+ 0, // Version
+ ERRL_UDT_NOFORMAT, // parser ignores data
+ false ); // merge
+ errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
+ HWAS::SRCI_PRIORITY_HIGH);
+ errl->collectTrace(SBEIO_COMP_NAME);
+ errlCommit(errl, SBE_COMP_ID);
+ }
+
+ return rc;
+ }
+
//------------------------------------------------------------------------
int process_sbe_msg(uint32_t i_procChipId)
@@ -502,8 +584,15 @@ namespace RT_SBEIO
break;
}
- /* TODO RTC 170762 process SBE message write response */
- TRACFCOMP(g_trac_sbeio, "process_sbe_msg: write response");
+ // Process SBE message check response
+ TRACFCOMP(g_trac_sbeio, "process_sbe_msg: check response");
+ rc = process_sbe_msg_check_response(l_proc,
+ *l_sbeMessage,
+ l_request);
+ if(rc != 0)
+ {
+ break;
+ }
/* TODO RTC 170763 assert CFAM register ??? */
TRACFCOMP(g_trac_sbeio, "process_sbe_msg: assert CFAM register");
OpenPOWER on IntegriCloud