summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2017-08-30 17:32:48 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-09-18 15:33:08 -0400
commit0ab063c088f59890c409b7d00e0bf6afcf07dc16 (patch)
treeaed9b66e9b0873d86e5a3ae6f26869123327d0cd /src/usr/testcore
parent7c816980c3829cce89f7a18a65dc70c1876ad813 (diff)
downloadtalos-hostboot-0ab063c088f59890c409b7d00e0bf6afcf07dc16.tar.gz
talos-hostboot-0ab063c088f59890c409b7d00e0bf6afcf07dc16.zip
Added code to send an Error Log to FSP via the firmware_request
Change-Id: I6ce94d9cbf62fa7d2afe53b83b6bc5588a39a5d6 RTC:178947 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45442 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> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r--src/usr/testcore/rtloader/loader.H69
1 files changed, 53 insertions, 16 deletions
diff --git a/src/usr/testcore/rtloader/loader.H b/src/usr/testcore/rtloader/loader.H
index 214411029..97efc782f 100644
--- a/src/usr/testcore/rtloader/loader.H
+++ b/src/usr/testcore/rtloader/loader.H
@@ -724,14 +724,8 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
hostInterfaces::hbrt_fw_msg* l_resp_fw_msg =
(hostInterfaces::hbrt_fw_msg*) o_resp;
- if (i_reqLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
- sizeof(l_req_fw_msg->req_hcode_update)))
- {
- retVal = -EINVAL;
- break;
- }
- if (*o_respLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
+ if (*o_respLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
sizeof(l_resp_fw_msg->resp_generic)))
{
retVal = -EINVAL;
@@ -741,6 +735,13 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
if (hostInterfaces::HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE
== l_req_fw_msg->io_type)
{
+ if (i_reqLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
+ sizeof(l_req_fw_msg->req_hcode_update)))
+ {
+ retVal = -EINVAL;
+ break;
+ }
+
TRACFCOMP(g_trac_hbrt, ENTER_MRK
"rt_firmware_request for HCODE SCOM update: "
"type:%d, chipId:0x%X, section:%d, "
@@ -751,6 +752,51 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
l_req_fw_msg->req_hcode_update.i_operation,
l_req_fw_msg->req_hcode_update.i_scomAddr,
l_req_fw_msg->req_hcode_update.i_scomData);
+
+ l_resp_fw_msg->io_type =
+ hostInterfaces::HBRT_FW_MSG_TYPE_RESP_GENERIC;
+
+ // dummy return value for testing
+ l_resp_fw_msg->resp_generic.o_status = 264;
+
+ TRACFCOMP(g_trac_hbrt, EXIT_MRK"rt_firmware_request");
+ retVal = 1; // just return 1 for testing
+ }
+ else if (hostInterfaces::HBRT_FW_MSG_TYPE_ERROR_LOG
+ == l_req_fw_msg->io_type)
+ {
+ if (i_reqLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
+ sizeof(l_req_fw_msg->error_log)))
+ {
+ retVal = -EINVAL;
+ break;
+ }
+
+ if (i_reqLen < (hostInterfaces::HBRT_FW_MSG_BASE_SIZE +
+ sizeof(l_req_fw_msg->error_log) +
+ l_req_fw_msg->error_log.i_errlSize - 1))
+ {
+ retVal = -EINVAL;
+ break;
+ }
+
+
+ TRACFCOMP(g_trac_hbrt, ENTER_MRK
+ "rt_firmware_request for error log: "
+ "type:%d, plid:0x%08x, size:%d, data:0x%02x",
+ l_req_fw_msg->io_type,
+ l_req_fw_msg->error_log.i_plid,
+ l_req_fw_msg->error_log.i_errlSize,
+ l_req_fw_msg->error_log.i_data);
+
+ l_resp_fw_msg->io_type =
+ hostInterfaces::HBRT_FW_MSG_TYPE_RESP_GENERIC;
+
+ // dummy return value for testing
+ l_resp_fw_msg->resp_generic.o_status = 20;
+
+ TRACFCOMP(g_trac_hbrt, EXIT_MRK"rt_firmware_request");
+ retVal = 0; // just return 0 for testing
}
else
{
@@ -758,15 +804,6 @@ class RuntimeLoaderTest : public CxxTest::TestSuite
"rt_firmware_request an unrecognized request: "
"type:%d", l_req_fw_msg->io_type);
}
-
- l_resp_fw_msg->io_type =
- hostInterfaces::HBRT_FW_MSG_TYPE_RESP_GENERIC;
- // dummy return value for testing
- l_resp_fw_msg->resp_generic.o_status = 264;
-
- TRACFCOMP(g_trac_hbrt, EXIT_MRK"rt_firmware_request");
- retVal = 1; // just return 1 for testing
-
} while (0) ;
return retVal;
}
OpenPOWER on IntegriCloud