[RFC PATCH 0/1] tools: mkimage: Add Allwinner TOC1 support

Samuel Holland samuel at sholland.org
Fri Oct 15 06:08:09 CEST 2021


The SPL port for the Allwinner D1 RISC-V SoC will probably take a while
longer than porting U-Boot proper, as none of the relevant drivers are
set up for DM in SPL. In the meantime, we are using[1][2] a fork[3] of
Allwinner's boot0 loader, which they also call "spl" in their BSP. boot0
uses this TOC1 image format.

The vendor tools for generating TOC1 images require a binary config file
generated by their FEX compiler. Instead of trying to support that, I
made up a simple human-readable config file format. I didn't see any
existing platform-agnostic parser for multi-image containers in mkimage.

I am sending this as RFC because it is only of temporary/limited use.
It only works with one specific fork of boot0 which was modified to
"behave" (the the original vendor version monkey-patches a custom header
inside the U-Boot image during boot). So it will be obsolete once U-Boot
SPL is ported. And it is Yet Another Image Format. On the other hand, it
does work, and it is currently being used.

[1]: https://linux-sunxi.org/Allwinner_Nezha#U-Boot
[2]: https://fedoraproject.org/wiki/Architectures/RISC-V/Allwinner
[3]: https://github.com/smaeul/sun20i_d1_spl


Samuel Holland (1):
  tools: mkimage: Add Allwinner TOC1 support

 common/image.c        |   1 +
 include/image.h       |   1 +
 include/sunxi_image.h |  26 ++++
 tools/Makefile        |   1 +
 tools/sunxi_toc1.c    | 318 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 347 insertions(+)
 create mode 100644 tools/sunxi_toc1.c

-- 
2.32.0



More information about the U-Boot mailing list