Reintroduce Cactus-MM and SPM-MM tests

The code has been taken from commit 99f4fd283b6f ("cactus: Use UART2
instead of UART0") and modified slightly to be integrated in the current
master.

There are three tests that are failing in the CI. They have been
disabled for the time being:

- mem_attr_changes_tests() in cactus_main() in the file
  spm/cactus_mm/cactus_mm_main.c.

- Two tests in the file tftf/tests/tests-spm-mm.xml.

Change-Id: I6332cbff1cefeb82b9447fae1b613879e65186a1
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/Makefile b/Makefile
index 0179bbf..a491bc4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -114,6 +114,7 @@
 include tftf/tests/tests.mk
 include fwu/ns_bl1u/ns_bl1u.mk
 include fwu/ns_bl2u/ns_bl2u.mk
+include spm/cactus_mm/cactus_mm.mk
 include spm/cactus/cactus.mk
 include spm/ivy/ivy.mk
 
@@ -222,6 +223,12 @@
 NS_BL2U_ASFLAGS		+= ${COMMON_ASFLAGS}
 NS_BL2U_LDFLAGS		+= ${COMMON_LDFLAGS}
 
+CACTUS_MM_SOURCES	+= ${LIBC_SRCS}
+CACTUS_MM_INCLUDES	+= ${PLAT_INCLUDES}
+CACTUS_MM_CFLAGS	+= ${COMMON_CFLAGS}
+CACTUS_MM_ASFLAGS	+= ${COMMON_ASFLAGS}
+CACTUS_MM_LDFLAGS	+= ${COMMON_LDFLAGS}
+
 CACTUS_SOURCES		+= ${LIBC_SRCS}
 CACTUS_INCLUDES		+= ${PLAT_INCLUDES}
 CACTUS_CFLAGS		+= ${COMMON_CFLAGS}
@@ -296,6 +303,11 @@
 endif
 
 ifneq (${ARCH}-${PLAT},aarch64-fvp)
+.PHONY: cactus_mm
+cactus_mm:
+	@echo "ERROR: $@ is supported only on AArch64 FVP."
+	@exit 1
+
 .PHONY: cactus
 cactus:
 	@echo "ERROR: $@ is supported only on AArch64 FVP."
@@ -430,6 +442,7 @@
 endif
 
 ifeq (${ARCH}-${PLAT},aarch64-fvp)
+  $(eval $(call MAKE_IMG,cactus_mm))
   $(eval $(call MAKE_IMG,cactus))
   $(eval $(call MAKE_IMG,ivy))
 endif
@@ -465,6 +478,7 @@
 	@echo "  ns_bl1u        Build the NS_BL1U image"
 	@echo "  ns_bl2u        Build the NS_BL2U image"
 	@echo "  cactus         Build the Cactus image (Test S-EL0 payload) and resource description."
+	@echo "  cactus_mm      Build the Cactus-MM image (Test S-EL0 payload)."
 	@echo "  ivy            Build the Ivy image (Test S-EL0 payload) and resource description."
 	@echo "  el3_payload    Build the EL3 test payload"
 	@echo "  checkcodebase  Check the coding style of the entire source tree"