test(spm): run ffa_tests on ivy

Move cactus_test_ffa.c to a common directory for SPs so the
ivy partition can also run the same tests.

We also create a sp_platform_def.h file which contains various
plaform defines required for the tests. This header is defined
in both cactus and ivy directories and then fvp and tc0
subdirectories within those. The appropriate header for the sp
and platform being built is then included in the build scripts.

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: If65d099d43cd930ef730539b5ad1596e686f788a
diff --git a/spm/ivy/ivy.mk b/spm/ivy/ivy.mk
index e996a7c..0c0039d 100644
--- a/spm/ivy/ivy.mk
+++ b/spm/ivy/ivy.mk
@@ -30,11 +30,13 @@
 	-Iinclude/lib/${ARCH}				\
 	-Iinclude/lib/utils				\
 	-Iinclude/lib/xlat_tables			\
+	-Iinclude/plat/common				\
 	-Iinclude/runtime_services			\
 	-Iinclude/runtime_services/secure_el0_payloads	\
-	-Ispm/ivy/app				\
+	-Ispm/ivy/app					\
 	-Ispm/ivy/shim					\
-	-Ispm/common
+	-Ispm/common					\
+	-Ispm/common/sp_tests/
 
 IVY_SOURCES	:=					\
 	$(addprefix spm/ivy/app/,			\
@@ -46,6 +48,9 @@
 		sp_helpers.c				\
 		spm_helpers.c				\
 	)						\
+	$(addprefix spm/common/sp_tests/,		\
+		sp_test_ffa.c				\
+	)
 
 ifeq ($(IVY_SHIM),1)
 IVY_SOURCES	+=					\
@@ -57,11 +62,12 @@
 endif
 
 # TODO: Remove dependency on TFTF files.
-IVY_SOURCES	+=					\
-	tftf/framework/debug.c				\
-	tftf/framework/${ARCH}/asm_debug.S		\
+IVY_SOURCES	+=							\
+	tftf/framework/debug.c						\
+	tftf/framework/${ARCH}/asm_debug.S				\
 	tftf/tests/runtime_services/secure_service/${ARCH}/ffa_arch_helpers.S \
-	tftf/tests/runtime_services/secure_service/ffa_helpers.c
+	tftf/tests/runtime_services/secure_service/ffa_helpers.c 	\
+	tftf/tests/runtime_services/secure_service/spm_common.c
 
 IVY_SOURCES	+= 	drivers/arm/pl011/${ARCH}/pl011_console.S	\
 			lib/${ARCH}/cache_helpers.S			\