summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-05-04 14:20:54 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-05-18 18:11:42 -0400
commit291b8a53d7d258227d58a361b7a847cb02675e92 (patch)
tree13da06d05d220f38d889242fb67266c91baf1f6c /src/usr/sbeio
parentce71d0bbd35d84c39537398d3c4ef7bb752a6fcf (diff)
downloadtalos-hostboot-291b8a53d7d258227d58a361b7a847cb02675e92.tar.gz
talos-hostboot-291b8a53d7d258227d58a361b7a847cb02675e92.zip
Full Path of SBE message passing Add HTMGT default path testing
Add a test that calls the default HTMGT processing path when HTMGT is configured. Change-Id: I6cde3e9fbf35370118e715c19fb4f63c2ee21edd RTC:173806 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40099 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: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio')
-rw-r--r--src/usr/sbeio/runtime/test/sbeiotestRt.H97
1 files changed, 94 insertions, 3 deletions
diff --git a/src/usr/sbeio/runtime/test/sbeiotestRt.H b/src/usr/sbeio/runtime/test/sbeiotestRt.H
index c11b92e77..f2425d104 100644
--- a/src/usr/sbeio/runtime/test/sbeiotestRt.H
+++ b/src/usr/sbeio/runtime/test/sbeiotestRt.H
@@ -161,9 +161,9 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
TS_INFO("SBE Communication area not available from "
"SBE_COMM_ADDR attribute");
uint64_t l_instance = proc->getAttr<ATTR_POSITION>();
- o_sbeCommAddr =
- g_hostInterfaces->get_reserved_mem("ibm,sbe-comm",
- l_instance);
+ o_sbeCommAddr = g_hostInterfaces->get_reserved_mem(
+ HBRT_RSVD_MEM__SBE_COMM,
+ l_instance);
if(NULL == o_sbeCommAddr)
{
rc = -1;
@@ -732,6 +732,97 @@ class SbeMessagePassingRtTest : public CxxTest::TestSuite
/**
* @brief testSbeMessagePassing Unit test for the
+ * SBE message passing default path.
+ */
+ void testSbeMessagePassingDefaultPath(void)
+ {
+#ifdef CONFIG_HTMGT
+ // Test entry
+ TRACFCOMP(g_trac_sbeio, ENTER_MRK "SbeMessagePassingRtTest::"
+ "testSbeMessagePassingDefaultPath");
+
+ sbeMessage_t l_request;
+ sbeMessage_t l_expected_response;
+ RT_TARG::rtChipId_t chipId = 0;
+ uint64_t l_sbeCommAddr = 0;
+ runtimeInterfaces_t *rt_intf = nullptr;
+
+ int rc = 0;
+
+ do
+ {
+ // Do initializations for SBE Message passing
+ rc = initSbeMessagePassing(l_request,
+ l_expected_response,
+ chipId,
+ l_sbeCommAddr,
+ &rt_intf);
+
+ // Get the response address in the SBE Communication area
+ sbeMessage_t *l_sbeCommAddr_rsp =
+ reinterpret_cast<sbeMessage_t*>(l_sbeCommAddr);
+
+ // Copy test request into SBE Communication area
+ memcpy(reinterpret_cast<void*>(l_sbeCommAddr),
+ reinterpret_cast<void*>(&l_request),
+ l_request.sbeHdr.msgSize);
+
+ // Call the SBE message passing code
+ TRACFCOMP(g_trac_sbeio, "SbeMessagePassingRtTest::"
+ "testSbeMessagePassingDefaultPath "
+ "calling sbe_message_passing");
+ rc = rt_intf->sbe_message_passing(chipId);
+ if(0 != rc)
+ {
+ TS_FAIL("Unexpected return during RT SBE message passing. "
+ "Testing default path for chipID: 0x%08X, rc: "
+ "0x%08x, but expected 0",
+ chipId, rc);
+ break;
+ }
+
+ // Compare test response from SBE Communication area
+ if(cmpSbeHdr(*l_sbeCommAddr_rsp, l_expected_response) ||
+ cmpCmdHdr(*l_sbeCommAddr_rsp, l_expected_response))
+ {
+ TRACFBIN( g_trac_sbeio,
+ "testSbeMessagePassingDefaultPath: expected rsp",
+ &l_expected_response,
+ l_expected_response.sbeHdr.msgSize);
+ TRACFBIN( g_trac_sbeio,
+ "testSbeMessagePassingDefaultPath: actual rsp",
+ l_sbeCommAddr_rsp,
+ l_sbeCommAddr_rsp->sbeHdr.msgSize);
+ TS_FAIL("Unexpected response from RT SBE message passing. "
+ "Testing default path for chipID: 0x%08X",
+ chipId);
+ break;
+ }
+
+ // Check setting of bits in CFAM register
+ rc = checkResetSbeMessagePassingCFAM(chipId);
+ if(0 != rc)
+ {
+ TS_FAIL("Unexpected error during RT SBE message passing. "
+ "chipID: 0x%08X, rc: 0x%08x, but expected 0 for "
+ "CFAM register checking",
+ chipId, rc);
+ break;
+ }
+ }while (0);
+
+ // Test exit
+ TRACFCOMP(g_trac_sbeio, EXIT_MRK "SbeMessagePassingRtTest::"
+ "testSbeMessagePassingDefaultPath");
+#else
+ TRACFCOMP(g_trac_sbeio, "SbeMessagePassingRtTest::"
+ "testSbeMessagePassingDefaultPath skipped "
+ "because HTMGT is not supported");
+#endif
+ }
+
+ /**
+ * @brief testSbeMessagePassing Unit test for the
* SBE message passing function.
*/
void testSbeMessagePassingFunction(void)
OpenPOWER on IntegriCloud