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/include/libc_init.h b/environments/opteesp/include/libc_init.h
new file mode 100644
index 0000000..232c3c0
--- /dev/null
+++ b/environments/opteesp/include/libc_init.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef LIBC_INIT_H_
+#define LIBC_INIT_H_
+
+void libc_init(void);
+
+#endif /* LIBC_INIT_H_ */
diff --git a/environments/opteesp/include/optee_sp_internal_api.h b/environments/opteesp/include/optee_sp_internal_api.h
new file mode 100644
index 0000000..d275caa
--- /dev/null
+++ b/environments/opteesp/include/optee_sp_internal_api.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef OPTEE_SP_INTERNAL_API_H_
+#define OPTEE_SP_INTERNAL_API_H_
+
+#include <stdint.h>
+
+/*
+ * The file describes the API between the OP-TEE and the SP.
+ * The SP code base should also contain a header file named
+ * "optee_sp_user_defines.h" for passing the following definitions to the SP dev
+ * kit:
+ * * OPTEE_SP_HEAP_SIZE: Heap size in bytes
+ * * OPTEE_SP_UUID: UUID of the SP as an sp_uuid structure
+ * * OPTEE_SP_STACK_SIZE: Stack size in bytes
+ * * OPTEE_SP_FLAGS: SP attributes (currently none available, set to zero)
+ */
+
+/*
+ * SP header types
+ */
+struct optee_sp_uuid {
+ uint32_t timeLow;
+ uint16_t timeMid;
+ uint16_t timeHiAndVersion;
+ uint8_t clockSeqAndNode[8];
+};
+
+struct optee_sp_head {
+ struct optee_sp_uuid uuid;
+ uint32_t stack_size;
+ uint32_t flags;
+ uint64_t reserved;
+};
+
+#endif /* OPTEE_SP_INTERNAL_API_H_ */