tools: mkimage: Add Allwinner TOC0 support
authorSamuel Holland <samuel@sholland.org>
Fri, 18 Mar 2022 05:00:43 +0000 (00:00 -0500)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 4 Apr 2022 22:24:17 +0000 (23:24 +0100)
commite9e87ec47c756b1ee2b0a6680488d60adb2079a9
tree529b28bd135900937ed59c63454a8b9d67ec6dbe
parent8c621f4c3b794973a0dd76623cab6069d89fb3d7
tools: mkimage: Add Allwinner TOC0 support

Most Allwinner sunxi SoCs have separate boot ROMs in non-secure and
secure mode. The "non-secure" or "normal" boot ROM (NBROM) uses the
existing sunxi_egon image type. The secure boot ROM (SBROM) uses a
completely different image type, known as TOC0.

A TOC0 image is composed of a header and two or more items. One item
is the firmware binary. The others form a chain linking the firmware
signature to the root-of-trust public key (ROTPK), which has its hash
burned in the SoC's eFuses. Signatures are made using RSA-2048 + SHA256.

The pseudo-ASN.1 structure is manually assembled; this is done to work
around bugs/quirks in the boot ROM, which vary between SoCs. This TOC0
implementation has been verified to work with the A50, A64, H5, H6,
and H616 SBROMs, and it may work with other SoCs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
MAINTAINERS
boot/image.c
include/image.h
include/sunxi_image.h
tools/Makefile
tools/sunxi_toc0.c [new file with mode: 0644]