test(spm): use ffa_helpers for ivy partition

Allow the ivy partition to use the ffa_helpers functions.

To achieve this we create a common struct for ff-a calls that is
used for both parameters and returns, this aligns with the Hafnium
implementation. We can then use preprocessor macros to pick either
SMC or SVC as the conduit depending on the exception level the SP
is running at.

Change-Id: Ic9525baabcf40d15545b6f6d504cf954373f08f9
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index c808df1..40cc96f 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -8,6 +8,7 @@
 #define TEST_HELPERS_H__
 
 #include <arch_features.h>
+#include <ffa_helpers.h>
 #include <ffa_svc.h>
 #include <events.h>
 #include <plat_topology.h>
@@ -182,16 +183,16 @@
 
 #define SKIP_TEST_IF_FFA_VERSION_LESS_THAN(major, minor)			\
 	do {									\
-		smc_ret_values smc_ret = ffa_version(				\
+		struct ffa_value ret = ffa_version(				\
 					MAKE_FFA_VERSION(major, minor));	\
-		uint32_t version = smc_ret.ret0;				\
+		uint32_t version = ret.fid;					\
 										\
 		if (version == FFA_ERROR_NOT_SUPPORTED) {			\
 			tftf_testcase_printf("FFA_VERSION not supported.\n");	\
 			return TEST_RESULT_SKIPPED;				\
 		}								\
 										\
-		if ((version & FFA_VERSION_BIT31_MASK) != 0U) {				\
+		if ((version & FFA_VERSION_BIT31_MASK) != 0U) {			\
 			tftf_testcase_printf("FFA_VERSION bad response: %x\n",	\
 					version);				\
 			return TEST_RESULT_FAIL;				\
@@ -222,13 +223,13 @@
 
 #define SKIP_TEST_IF_FFA_ENDPOINT_NOT_DEPLOYED(mb, ffa_uuid)			\
 	do {									\
-		smc_ret_values smc_ret = ffa_partition_info_get(ffa_uuid);	\
+		struct ffa_value sc_ret = ffa_partition_info_get(ffa_uuid);	\
 		ffa_rx_release();						\
-		if (ffa_func_id(smc_ret) == FFA_ERROR && 			\
-		    ffa_error_code(smc_ret) == FFA_ERROR_INVALID_PARAMETER) {	\
+		if (ffa_func_id(sc_ret) == FFA_ERROR && 			\
+		    ffa_error_code(sc_ret) == FFA_ERROR_INVALID_PARAMETER) {	\
 			tftf_testcase_printf("FFA endpoint not deployed!\n");	\
 			return TEST_RESULT_SKIPPED;				\
-		} else if (smc_ret.ret0 != FFA_SUCCESS_SMC32) {			\
+		} else if (ffa_func_id(sc_ret) != FFA_SUCCESS_SMC32) {		\
 			ERROR("ffa_partition_info_get failed!\n");		\
 			return TEST_RESULT_FAIL;				\
 		}								\