diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-22 10:05:17 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-06-07 08:42:05 +0200 |
commit | e30340886fcbac1d2c03fbea4ee41ffa9464fb11 (patch) | |
tree | d6aec9dde274cafbdce1c8beca4699c05fd17f98 /include/tee | |
parent | ab06d72a6ef8939831b8c0b1c412d9a11fc06889 (diff) | |
download | barebox-e30340886fcbac1d2c03fbea4ee41ffa9464fb11.tar.gz barebox-e30340886fcbac1d2c03fbea4ee41ffa9464fb11.tar.xz |
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 <s.hauer@pengutronix.de>
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/tee')
-rw-r--r-- | include/tee/optee.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/tee/optee.h b/include/tee/optee.h new file mode 100644 index 0000000000..8cfe06d889 --- /dev/null +++ b/include/tee/optee.h @@ -0,0 +1,30 @@ +/* + * OP-TEE related definitions + * + * (C) Copyright 2016 Linaro Limited + * Andrew F. Davis <andrew.davis@xxxxxxxxxx> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef _OPTEE_H +#define _OPTEE_H + +#define OPTEE_MAGIC 0x4554504f +#define OPTEE_VERSION 1 +#define OPTEE_ARCH_ARM32 0 +#define OPTEE_ARCH_ARM64 1 + +struct optee_header { + uint32_t magic; + uint8_t version; + uint8_t arch; + uint16_t flags; + uint32_t init_size; + uint32_t init_load_addr_hi; + uint32_t init_load_addr_lo; + uint32_t init_mem_usage; + uint32_t paged_size; +}; + +#endif /* _OPTEE_H */ |