Integrate newlib into opteesp environment

Use newlib external component in opteesp targeted builds along the
necessary compiler and linker options. Also adding/modifying the source
files for startup, heap handling and trace features. The sp.ld.S file
is based on ta/arch/arm/ta.ld.S from optee_os
6be0dbcaa11394a2ad5a46ac77e2f76e31a41722.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: Ie9f3e8f0fb755bb88cc33feffda86fbbbf3c7fce
diff --git a/environments/opteesp/sp_entry.c b/environments/opteesp/sp_entry.c
new file mode 100644
index 0000000..6249407
--- /dev/null
+++ b/environments/opteesp/sp_entry.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, 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);
+}