feat(ff-a): create function helper to setup FF-A mailbox

Fix test dependencies issue when SPM test is used individually.
Provide an API function from SPM test suite to initialize the FF-A
mailbox and enable FF-A based message with SP.

Signed-off-by: Nabil Kahlouche <nabil.kahlouche@arm.com>
Change-Id: I246491907f1641c47937a9a1c91cfd4a9b8bfe20
diff --git a/tftf/tests/common/test_helpers.c b/tftf/tests/common/test_helpers.c
index b7eeb15..1a6ea64 100644
--- a/tftf/tests/common/test_helpers.c
+++ b/tftf/tests/common/test_helpers.c
@@ -256,3 +256,22 @@
 
 	return true;
 }
+
+/*
+ * Initializes the Mailbox for other SPM related tests that need to use
+ * RXTX buffers.
+ */
+bool mailbox_init(struct mailbox_buffers mb)
+{
+	smc_ret_values ret;
+
+	ffa_rxtx_unmap();
+	CONFIGURE_AND_MAP_MAILBOX(mb, PAGE_SIZE, ret);
+	if (ffa_func_id(ret) != FFA_SUCCESS_SMC32) {
+		ERROR("Failed to map RXTX buffers %x!\n", ffa_error_code(ret));
+		return false;
+	}
+	set_tftf_mailbox(&mb);
+	return true;
+}
+