From e30340886fcbac1d2c03fbea4ee41ffa9464fb11 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 22 May 2019 10:05:17 +0200 Subject: ARM: Initial OP-TEE support This adds initial support for OP-TEE, see https://www.op-tee.org/ barebox starts in secure mode as usual. When booting a kernel the bootm code also loads the optee_os binary. Instead of jumping into the kernel barebox jumps into the optee_os binary and puts the kernel execution address into the lr register. OP-TEE then jumps into the kernel in nonsecure mode. The optee_os binary is passed with the -t option to bootm or with global.bootm.tee. Optionally OP-TEE can be compiled into barebox using the builtin firmware feature. Enable the Kconfig option and place or link your tee binary as optee.bin into the firmware directory. The amount of SDRAM which is kept free for OP-TEE is configurable. This patch was tested on a i.MX6 Nitrogen6x board. Signed-off-by: Sascha Hauer Signed-off-by: Rouven Czerwinski Signed-off-by: Sascha Hauer --- include/asm-generic/memory_layout.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/asm-generic') diff --git a/include/asm-generic/memory_layout.h b/include/asm-generic/memory_layout.h index 45e0ed8023..3f69664aa0 100644 --- a/include/asm-generic/memory_layout.h +++ b/include/asm-generic/memory_layout.h @@ -11,6 +11,12 @@ #define MALLOC_BASE CONFIG_MALLOC_BASE #endif +#ifdef CONFIG_BOOTM_OPTEE_SIZE +#define OPTEE_SIZE CONFIG_BOOTM_OPTEE_SIZE +#else +#define OPTEE_SIZE 0 +#endif + #define HEAD_TEXT_BASE MALLOC_BASE #define MALLOC_SIZE CONFIG_MALLOC_SIZE #define STACK_SIZE CONFIG_STACK_SIZE -- cgit v1.2.3