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/optee_sp_header.c b/environments/opteesp/optee_sp_header.c
new file mode 100644
index 0000000..25056da
--- /dev/null
+++ b/environments/opteesp/optee_sp_header.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ */
+
+#include <compiler.h>
+#include "optee_sp_internal_api.h"
+#include "optee_sp_user_defines.h"
+
+#ifndef OPTEE_SP_UUID
+#error "OPTEE_SP_UUID is not defined in SP"
+#endif
+
+#ifndef OPTEE_SP_STACK_SIZE
+#error "OPTEE_SP_STACK_SIZE is not defined in SP"
+#endif
+
+#ifndef OPTEE_SP_FLAGS
+#error "OPTEE_SP_FLAGS is not defined in SP"
+#endif
+
+const struct optee_sp_head sp_head __section(".sp_head") = {
+ .uuid = OPTEE_SP_UUID,
+ .stack_size = OPTEE_SP_STACK_SIZE,
+ .flags = OPTEE_SP_FLAGS,
+ .reserved = UINT64_MAX
+};