summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2020-01-28 06:38:20 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-01-30 06:22:28 +0100
commit4b7c346be3b9ced3166a6290d8c2a5fac691d3f2 (patch)
treec81ce1ca8d38cbfc9096c4bd7caf5be6b0304e08 /include
parent7e73f9a3b89dcabb5737e2989ede1f7558dff9f1 (diff)
downloadbarebox-4b7c346be3b9ced3166a6290d8c2a5fac691d3f2.tar.gz
barebox-4b7c346be3b9ced3166a6290d8c2a5fac691d3f2.tar.xz
ARM: add optee early loading function
Add a OP-TEE early loading function which expects a pointer to a valid tee binary and the device tree. OP-TEE will then be started and barebox will continue to run in normal mode. The function start_optee_early should be used in a boards lowlevel.c file. Ensure that barebox has been relocated and a proper c environment has been setup beforehand. Depending on the OP-TEE configuration, the fdt will be modified. If the internal barebox device tree is passed, OP-TEE will overwrite barebox PBL memory during this modification. Copy the fdt to a save memory location beforehand to avoid a corruption of barebox PBL memory. This also moves the OP-TEE Kconfig symbols into a separate menu. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/memory_layout.h4
-rw-r--r--include/tee/optee.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/include/asm-generic/memory_layout.h b/include/asm-generic/memory_layout.h
index 3f69664aa0..0d7ce3fe02 100644
--- a/include/asm-generic/memory_layout.h
+++ b/include/asm-generic/memory_layout.h
@@ -11,8 +11,8 @@
#define MALLOC_BASE CONFIG_MALLOC_BASE
#endif
-#ifdef CONFIG_BOOTM_OPTEE_SIZE
-#define OPTEE_SIZE CONFIG_BOOTM_OPTEE_SIZE
+#ifdef CONFIG_OPTEE_SIZE
+#define OPTEE_SIZE CONFIG_OPTEE_SIZE
#else
#define OPTEE_SIZE 0
#endif
diff --git a/include/tee/optee.h b/include/tee/optee.h
index 9fb27fcec0..fa124236ba 100644
--- a/include/tee/optee.h
+++ b/include/tee/optee.h
@@ -32,4 +32,10 @@ struct optee_header {
int optee_verify_header (struct optee_header *hdr);
+#ifdef __PBL__
+
+int start_optee_early(void* fdt, void* tee);
+
+#endif /* __PBL__ */
+
#endif /* _OPTEE_H */