summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/pm/runtime/test
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2017-07-17 20:33:21 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-11 16:32:57 -0400
commitf3423e48a1fec89b8d9f7a0f20977013f2330dd9 (patch)
tree1638235944e89551cdde4fb67abe6353a9b12378 /src/usr/isteps/pm/runtime/test
parentf872a41a9d1551903f3f1caf94852e92576cd019 (diff)
downloadtalos-hostboot-f3423e48a1fec89b8d9f7a0f20977013f2330dd9.tar.gz
talos-hostboot-f3423e48a1fec89b8d9f7a0f20977013f2330dd9.zip
Changed method firmware_request so it can be used by OPAL
Change-Id: I5ebdc6d61b7891f1c975490820a57259b35a6fdf RTC:175856 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43283 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/isteps/pm/runtime/test')
-rw-r--r--src/usr/isteps/pm/runtime/test/firmwareRequestTest.H94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/usr/isteps/pm/runtime/test/firmwareRequestTest.H b/src/usr/isteps/pm/runtime/test/firmwareRequestTest.H
new file mode 100644
index 000000000..2ac57ddd5
--- /dev/null
+++ b/src/usr/isteps/pm/runtime/test/firmwareRequestTest.H
@@ -0,0 +1,94 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/pm/runtime/test/firmwareRequestTest.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#include <cxxtest/TestSuite.H>
+#include <runtime/interface.h>
+
+extern trace_desc_t* g_trac_pnor;
+
+class FirmwareRequestTest : public CxxTest::TestSuite
+{
+ public:
+ /**
+ * @brief: testFirmwareRequest
+ * tests that the firmware_request is being accessed properly
+ */
+ void testFirmwareRequest (void)
+ {
+ TRACFCOMP(g_trac_pnor, ENTER_MRK
+ "FirmwareRequestTest::testFirmwareRequest" );
+
+ if (g_hostInterfaces == NULL ||
+ g_hostInterfaces->firmware_request == NULL)
+ {
+ TS_FAIL("FirmwareRequestTest::testFirmwareRequest: "
+ "Hypervisor firmware_request interface not linked");
+ }
+ else
+ {
+ hostInterfaces::hbrt_fw_msg l_req_fw_msg;
+ l_req_fw_msg.io_type =
+ hostInterfaces::HBRT_FW_MSG_TYPE_REQ_HCODE_UPDATE;
+ l_req_fw_msg.req_hcode_update.i_chipId = 0;
+ l_req_fw_msg.req_hcode_update.i_section = 0;
+ l_req_fw_msg.req_hcode_update.i_operation = 0;
+ l_req_fw_msg.req_hcode_update.i_scomAddr = 0;
+ l_req_fw_msg.req_hcode_update.i_scomData = 0;
+
+
+ hostInterfaces::hbrt_fw_msg l_resp_fw_msg;
+ uint64_t l_resp_fw_msg_size = sizeof(l_resp_fw_msg);
+ int rc = g_hostInterfaces->firmware_request(sizeof(l_resp_fw_msg),
+ &l_req_fw_msg, &l_resp_fw_msg_size, &l_resp_fw_msg);
+
+ TRACFCOMP(g_trac_pnor, "FirmwareRequestTest::testFirmwareRequest: "
+ "rc:%d, type:%d, resp:%d",
+ rc, l_resp_fw_msg.io_type,
+ l_resp_fw_msg.resp_generic.o_status);
+
+ if (rc != 1)
+ {
+ TS_FAIL("FirmwareRequestTest::testFirmwareRequest: "
+ "firware_request failed - returned wrong value");
+ }
+
+ if (l_resp_fw_msg.io_type !=
+ hostInterfaces::HBRT_FW_MSG_TYPE_RESP_GENERIC)
+ {
+ TS_FAIL("FirmwareRequestTest::testFirmwareRequest: "
+ "firware_request failed - received incorrect msg_type");
+ }
+
+ if (l_resp_fw_msg.resp_generic.o_status != 264)
+ {
+ TS_FAIL("FirmwareRequestTest::testFirmwareRequest: "
+ "firware_request failed - received incorrect resp");
+ }
+
+ TRACFCOMP(g_trac_pnor, EXIT_MRK
+ "FirmwareRequestTest::testFirmwareRequest");
+ }
+ }
+};
OpenPOWER on IntegriCloud