Removing RME tests from Aarch32 domain

Resolving issue where tests are improperly invoked for
Aarch32 and adding feature test to parallel testing of
RME and SPM together.

Signed-off-by: Mark Dykes <mark.dykes@arm.com>
Change-Id: I169e3f097461f08d10c0684250a69e7e1636ff96
diff --git a/tftf/tests/runtime_services/realm_payload/realm_payload_spm_test.c b/tftf/tests/runtime_services/realm_payload/realm_payload_spm_test.c
index 594dda6..e552ecb 100644
--- a/tftf/tests/runtime_services/realm_payload/realm_payload_spm_test.c
+++ b/tftf/tests/runtime_services/realm_payload/realm_payload_spm_test.c
@@ -15,6 +15,7 @@
 #include <plat_topology.h>
 #include <runtime_services/realm_payload/realm_payload_test.h>
 
+#ifdef __aarch64__
 static test_result_t realm_multi_cpu_payload_del_undel(void);
 
 #define ECHO_VAL1 U(0xa0a0a0a0)
@@ -212,6 +213,7 @@
 
 	return ret;
 }
+#endif
 
 /*
  * Test function to dispatch a number of SPM and RMI tests to the platform
@@ -220,6 +222,12 @@
  */
 test_result_t test_ffa_secondary_core_direct_realm_msg(void)
 {
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
+	if (get_armv9_2_feat_rme_support() == 0U) {
+		return TEST_RESULT_SKIPPED;
+	}
+
 	unsigned int lead_mpid = read_mpidr_el1() & MPID_MASK;
 	unsigned int cpu_node, mpidr;
 	int32_t ret;
@@ -340,8 +348,10 @@
 	 **********************************************************************/
 
 	return TEST_RESULT_SUCCESS;
+#endif
 }
 
+#ifdef __aarch64__
 /*
  * Multi CPU testing of delegate and undelegate of granules
  * The granules are first randomly initialized to either realm or non secure
@@ -373,3 +383,4 @@
 	}
 	return TEST_RESULT_SUCCESS;
 }
+#endif
diff --git a/tftf/tests/runtime_services/realm_payload/realm_payload_test.c b/tftf/tests/runtime_services/realm_payload/realm_payload_test.c
index ce5ff07..d1063f4 100644
--- a/tftf/tests/runtime_services/realm_payload/realm_payload_test.c
+++ b/tftf/tests/runtime_services/realm_payload/realm_payload_test.c
@@ -11,13 +11,16 @@
 #include <power_management.h>
 #include <platform.h>
 #include <runtime_services/realm_payload/realm_payload_test.h>
+#include <test_helpers.h>
 
+#ifdef __aarch64__
 static test_result_t realm_multi_cpu_payload_test(void);
 static test_result_t realm_multi_cpu_payload_del_undel(void);
 
 /* Buffer to delegate and undelegate */
 static char bufferdelegate[NUM_GRANULES * GRANULE_SIZE * PLATFORM_CORE_COUNT] __aligned(GRANULE_SIZE);
 static char bufferstate[NUM_GRANULES * PLATFORM_CORE_COUNT];
+#endif
 
 /*
  * Overall test for realm payload in three sections:
@@ -36,6 +39,7 @@
  * twice and then testing a misaligned address
  */
 
+#ifdef __aarch64__
 test_result_t init_buffer_del(void)
 {
 	u_register_t retrmm;
@@ -54,14 +58,15 @@
 	}
 	return TEST_RESULT_SUCCESS;
 }
-
+#endif
 
 /*
  * Single CPU version check function
  */
 test_result_t realm_version_single_cpu(void)
 {
-
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
 	u_register_t retrmm;
 
 	if (get_armv9_2_feat_rme_support() == 0U) {
@@ -75,6 +80,7 @@
 			RMI_ABI_VERSION_GET_MINOR(retrmm));
 
 	return TEST_RESULT_SUCCESS;
+#endif
 }
 
 /*
@@ -82,7 +88,8 @@
  */
 test_result_t realm_version_multi_cpu(void)
 {
-
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
 	u_register_t lead_mpid, target_mpid;
 	int cpu_node;
 	long long ret;
@@ -127,6 +134,7 @@
 	}
 
 	return ret;
+#endif
 }
 
 /*
@@ -134,7 +142,8 @@
  */
 test_result_t realm_delegate_undelegate(void)
 {
-
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
 	u_register_t retrmm;
 
 	if (get_armv9_2_feat_rme_support() == 0U) {
@@ -155,8 +164,10 @@
 			(uintptr_t)bufferdelegate);
 
 	return TEST_RESULT_SUCCESS;
+#endif
 }
 
+#ifdef __aarch64__
 static test_result_t realm_multi_cpu_payload_test(void)
 {
 	u_register_t retrmm = realm_version();
@@ -167,6 +178,7 @@
 
 	return TEST_RESULT_SUCCESS;
 }
+#endif
 
 /*
  * Select all CPU's to randomly delegate/undelegate
@@ -174,6 +186,8 @@
  */
 test_result_t realm_delundel_multi_cpu(void)
 {
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
 	u_register_t lead_mpid, target_mpid;
 	int cpu_node;
 	long long ret;
@@ -221,6 +235,7 @@
 
 	ret = TEST_RESULT_SUCCESS;
 	return ret;
+#endif
 }
 
 /*
@@ -230,6 +245,7 @@
  * assigns NUM_GRANULES to each CPU for delegation or undelgation
  * depending upon the initial state
  */
+#ifdef __aarch64__
 static test_result_t realm_multi_cpu_payload_del_undel(void)
 {
 	u_register_t retrmm;
@@ -254,6 +270,7 @@
 	}
 	return TEST_RESULT_SUCCESS;
 }
+#endif
 
 /*Fail testing of delegation process. The first is an error expected
  * for processing the same granule twice and the second is submission of
@@ -262,6 +279,8 @@
 
 test_result_t realm_fail_del(void)
 {
+	SKIP_TEST_IF_AARCH32();
+#ifdef __aarch64__
 	u_register_t retrmm;
 
 	retrmm = realm_granule_delegate((u_register_t)&bufferdelegate[0]);
@@ -282,4 +301,5 @@
 	}
 
 	return TEST_RESULT_SUCCESS;
+#endif
 }