Create generic FF-A SP environment
Currently the boot method of SPs is SPMC specific. Each SPMC uses a
different binary format and different boot method. An SPMC agonistic
binary format and boot method has been defined, to remove
fragmentation. This is called "generic FF-A SP" here. All SPMC
implementations developed or contributed by Arm will add support for
this format. This change adds a new environment to capture the SPMC
independent binary format and boot method specifics.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I60b6a7103ee2a8188b0676a0ded5fe2a8bdf9cf9
diff --git a/environments/sp/sp_entry.c b/environments/sp/sp_entry.c
new file mode 100644
index 0000000..0a709c2
--- /dev/null
+++ b/environments/sp/sp_entry.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include "compiler.h"
+#include "libc_init.h"
+#include "sp_api.h"
+
+/*
+ * According to the FF-A specification an optional initialization descriptor can
+ * be passed to the SP in w0/x0-w3/x3 registers (a0-a3 parameters). As the exact
+ * register is implementation defined the first four registers are forwarded to
+ * the user code.
+ */
+void __noreturn _sp_entry(uintptr_t a0, uintptr_t a1,
+ uintptr_t a2, uintptr_t a3);
+void __noreturn _sp_entry(uintptr_t a0, uintptr_t a1,
+ uintptr_t a2, uintptr_t a3)
+{
+ (void)a1;
+ (void)a2;
+ (void)a3;
+
+ libc_init();
+
+ sp_main((struct ffa_init_info *)a0);
+}