From 70fe2876352939194ccd9091379453a5ddb64ddb Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Thu, 23 Aug 2018 17:17:59 +0800 Subject: spl: add support to booting with OP-TEE OP-TEE is an open source trusted OS, in armv7, its loading and running are like this: loading: - SPL load both OP-TEE and U-Boot running: - SPL run into OP-TEE in secure mode; - OP-TEE run into U-Boot in non-secure mode; To make code simple, it would be fine to use IH_OS_TEE for the os tyle in TPL(just like IH_OS_LINUX is using both in SPL and U-Boot). Here is the diagram for SPL loading OP-TEE, IH_OS_TEE:(make u-boot.itb for SPL) Non-Secure Secure BootROM | v SPL | v --------- OP-TEE | v U-Boot | V Linux For other two king of OP-TEE loading/booting, see commit message: 45b55712d4 image: Add IH_OS_TEE for TEE chain-load boot More detail: https://github.com/OP-TEE/optee_os and search for 'boot arguments' for detail entry parameter in: core/arch/arm/kernel/generic_entry_a32.S Signed-off-by: Kever Yang Cc: Bryan O'Donoghue Reviewed-by: Philipp Tomsich --- common/spl/spl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/spl/spl.c') diff --git a/common/spl/spl.c b/common/spl/spl.c index 038f2b0e83..292e659c9a 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -536,6 +536,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2) spl_invoke_atf(&spl_image); break; #endif +#if CONFIG_IS_ENABLED(OPTEE) + case IH_OS_TEE: + debug("Jumping to U-Boot via OP-TEE\n"); + spl_optee_entry(NULL, NULL, spl_image.fdt_addr, + (void *)spl_image.entry_point); + break; +#endif #ifdef CONFIG_SPL_OS_BOOT case IH_OS_LINUX: debug("Jumping to Linux\n"); -- cgit v1.2.1