feat(handoff): add basic firmware handoff tests

Add tests to sanity check information shared between BL31 and NS world
using the firmware handoff framework.

Change-Id: I9d00292db7732157d0815e6159438c0db08551ad
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
diff --git a/tftf/framework/aarch64/entrypoint.S b/tftf/framework/aarch64/entrypoint.S
index 6aa5645..7937b88 100644
--- a/tftf/framework/aarch64/entrypoint.S
+++ b/tftf/framework/aarch64/entrypoint.S
@@ -18,11 +18,13 @@
  */
 func tftf_entrypoint
 	/* --------------------------------------------------------------------
-	 * Save arguments x0, x1 from the previous Boot loader
+	 * Save arguments x0-x3 from the previous bootloader.
 	 * --------------------------------------------------------------------
 	 */
 	mov	x20, x0
 	mov	x21, x1
+	mov	x22, x2
+	mov	x23, x3
 
 	bl	arch_init
 
@@ -79,13 +81,15 @@
 	bl	platform_set_stack
 
 	/* --------------------------------------------------------------------
-	 * Save fw_config and hw_config addresses passed in x0, x1 from the
-	 * previous boot loader
+	 * Save the fw_config or transfer list and hw_config addresses passed
+	 * in registers x0 to x3 from the previous bootloader.
 	 * --------------------------------------------------------------------
 	 */
 	mov	x0, x20
 	mov	x1, x21
-	bl	save_fw_hw_configs
+	mov	x2, x22
+	mov	x3, x23
+	bl	save_handoff_params
 
 	/* --------------------------------------------------------------------
 	 * tftf_cold_boot_main() will perform the remaining architectural and
@@ -204,10 +208,22 @@
 	ret
 endfunc arch_init
 
-/* Set fw_config and hw_config addresses passed in x0, x1 */
-func save_fw_hw_configs
+
+/* ----------------------------------------------------------------------------
+ * Save fw_config or transfer list and hw_config addresses passed in registers
+ * x0 to x3 from the previous bootloader.
+ * ----------------------------------------------------------------------------
+ */
+func save_handoff_params
+#if TRANSFER_LIST
+	adrp	x4, ns_tl
+	str	x3, [x4, :lo12:ns_tl]
+	str	x1, [x4, :lo12:tl_signature]
+	str	x0, [x4, :lo12:hw_config_base]
+#else
 	adrp	x2, fw_config_base
 	str	x0, [x2, :lo12:fw_config_base]
 	str	x1, [x2, :lo12:hw_config_base]
+#endif
 	ret
-endfunc save_fw_hw_configs
+endfunc save_handoff_params
diff --git a/tftf/framework/framework.mk b/tftf/framework/framework.mk
index ef59502..f57572c 100644
--- a/tftf/framework/framework.mk
+++ b/tftf/framework/framework.mk
@@ -65,6 +65,7 @@
 	lib/smc/${ARCH}/smc.c						\
 	lib/trng/trng.c							\
         lib/errata_abi/errata_abi.c                                     \
+	lib/transfer_list/transfer_list.c				\
 	lib/trusted_os/trusted_os.c					\
 	lib/utils/mp_printf.c						\
 	lib/utils/uuid.c						\
diff --git a/tftf/framework/main.c b/tftf/framework/main.c
index a203bd2..0701e28 100644
--- a/tftf/framework/main.c
+++ b/tftf/framework/main.c
@@ -24,6 +24,9 @@
 #include <tftf.h>
 #include <tftf_lib.h>
 #include <timer.h>
+#if TRANSFER_LIST
+#include <transfer_list.h>
+#endif
 
 #define MIN_RETRY_TO_POWER_ON_LEAD_CPU       10
 
@@ -44,7 +47,12 @@
 static unsigned int test_is_rebooting;
 
 /* Parameters arg0 and arg1 passed from BL31 */
+#if TRANSFER_LIST
+u_register_t ns_tl;
+u_register_t tl_signature;
+#else
 u_register_t fw_config_base;
+#endif
 u_register_t hw_config_base;
 
 static inline const test_suite_t *current_testsuite(void)