tftf: SPCI Beta1 add direct messaging test
This patch strips out former SPCI Alpha sample test code. Removing SPRT
references will be done in another coming patch. Version check is adapted
to SPCI Beta1. Version is now returned in x2.
The first test is a direct messaging test using SPCI_MSG_SEND_DIRECT_REQ
targetting a bare-metal cactus SP. TFTF expects a response from the SP
returning with SPCI_MSG_SEND_DIRECT_RESP.
Note: this patch also provides an initial SPCI_RUN interface. This API
may not be used in the mid-term because VM to SP communication is supposed
to be done only through direct messaging. Though the SPM boot-up for now
is only launching the first SP in the list of declared SP in SPMC manifest.
In order to make 2nd-VM ready, TFTF has to "boot-up" the SP through a single
SPCI_RUN invocation till it reaches SPCI_MSG_WAIT in the SP. Once SPM
implements boot up through all SPs, this SPCI_RUN invocation will no longer
be required.
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I141abd3e348409b3d34a911d0552570f49e85846
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index a90fd71..5c0f090 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -147,14 +147,19 @@
do { \
smc_args version_smc = { SPCI_VERSION }; \
smc_ret_values smc_ret = tftf_smc(&version_smc); \
- uint32_t version = smc_ret.ret0; \
+ uint32_t version = smc_ret.ret2; \
\
- if (version == SMC_UNKNOWN) { \
+ if (smc_ret.ret0 != SPCI_SUCCESS_SMC32) { \
tftf_testcase_printf("SPM not detected.\n"); \
return TEST_RESULT_SKIPPED; \
} \
+ \
+ if ((version & SPCI_VERSION_BIT31_MASK) != 0) { \
+ tftf_testcase_printf("SPCI_VERSION bad response.\n"); \
+ return TEST_RESULT_SKIPPED; \
+ } \
\
- if (version < SPCI_VERSION_FORM(major, minor)) { \
+ if (version < MAKE_SPCI_VERSION(major, minor)) { \
tftf_testcase_printf("SPCI_VERSION returned %d.%d\n" \
"The required version is %d.%d\n", \
version >> SPCI_VERSION_MAJOR_SHIFT,\