Skip to content

Add new OPTEE bootm support to u-boot

Peng Fan u-boot 1 version New

Get series with b4
b4 am 20180115040016.GA14281@shlinux2

Versions newest first

  1. v1 Latest0 of 9 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 9 patches the cover letter announces are in this archive.

Reviews trailers per patch

PatchPeng Fan
SeriesT-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/9] Add new OPTEE bootm support to u-boot

Hi Bryan,

Quoted 53 lines · Bryan O'Donoghue

This series adds a new OPTEE bootable image type to u-boot, which is directly bootable with the bootm command.

There is already a TEE image type but, in this case the TEE firmware is loaded into RAM, jumped into and then back out of. This image type is a directly bootable image as described here :
http://mrvan.github.io/optee-imx6ul

Instead of reusing the Linux bootable image type instead a new image type is defined, which allows us to perform additional image verification, prior to handing off control via bootm.

OPTEE images get linked to a specific address at compile time and must be loaded to this address too. This series extends out mkimage with a new image type that allows the OPTEE binary link location to be validated against CONFIG_OPTEE_TZDRAM_BASE and CONFIG_OPTEE_TZDRAM_SIZE respectively prior to proceeding through the bootm phase.

Once applied you can generate a bootable OPTEE image like this

mkimage -A arm -T optee -C none -d ./out/arm-plat-imx/core/tee.bin uTee.optee

That image can then be booted directly by bootm. bootm will verify the header contents of the OPTEE binary against the DRAM area carved out in u-boot. If the defined DRAM area does not match the link address specified we refuse to boot.

Kever - I'd like to suggest that your OPTEE SPL image takes a different image type IH_TYPE_OPTEE_SPL ? to indicate the different behavior your image type has versus a directly bootable bootm image.

Bryan O'Donoghue (9):
optee: Add lib entries for sharing OPTEE code across ports
optee: Add CONFIG_OPTEE_TZDRAM_SIZE
optee: Make OPTEE_TZDRAM_BASE a mandatory define
optee: Add optee_image_get_entry_point()
optee: Add optee_image_get_load_addr()
tools: mkimage: add optee image type
optee: Add optee_verify_bootm_image()
optee: Improve error printout
bootm: optee: Add mechanism to validate an OPTEE image before boot

common/bootm.c        | 11 +++++++-
common/image.c        |  1 +
include/image.h       |  1 +
include/tee/optee.h   | 41 ++++++++++++++++++++++++++++++
lib/Kconfig           |  1 +
lib/Makefile          |  1 +
lib/optee/Kconfig     | 16 ++++++++++++
lib/optee/Makefile    |  7 ++++++
lib/optee/optee.c     | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
tools/default_image.c | 25 ++++++++++++++-----
10 files changed, 166 insertions(+), 7 deletions(-)
Quoted 3 lines

create mode 100644 lib/optee/Kconfig
create mode 100644 lib/optee/Makefile
create mode 100644 lib/optee/optee.c

Thanks for patchset. I gave a test on i.MX7D-SDB and it works well.

Quoted 8 lines
Signature · 7 lines
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot