[U-Boot] [PATCH v3 0/3] rockchip: mkimage: refactor rksd/rkspi padding calculation and add dumpimage support

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Tue May 30 21:32:07 UTC 2017


We support booting both from SD/MMC images and SPI images on the
RK3399-Q7 for different use-cases (e.g. external boot in development
from the SD card, internal boot from MMC or SPI depending on whether
the SPI flash is populated on any given configuration option).

In getting the SPI image support ready for production, we found a
few areas that warranted improvements:
- we had broken SPI bootstrap earlier in the changes introducting
  boot0-style images for the RK3399 (this needed fixing)
- in fixing the broken SPI padding calculation, it became apparent
  that it's best to refactor and document things before we make
  the same mistake again in the future
- with both SD/MMC and SPI images being used for various purposes
  by various people, the wrong image style was inadvertendly used
  in some tests... so we support for 'dumpimage' (i.e. verify_header
  and print_header) had to be added to quickly check the image
  type being handled

With v3, we pad the images to 2KB again, as this is required by the
BootROM (see https://lists.denx.de/pipermail/u-boot/2017-May/293268.html).

Changes in v3:
- (added patch) forces the alignment/padding to 2KB for SD images, as
  this would otherwise break the back-to-bootrom functionality
- added in v3

Changes in v2:
- (in rkcommon_verify_header): changed to use a standard error
  (i.e. from errno.h) to convey 'header0 signature does not match'
  [squash of: "rockchip: mkimage: don't mix standard errors and FDT"]

Philipp Tomsich (3):
  rockchip: mkimage: add support for verify_header/print_header
  rockchip: mkimage: force 2KB alignment for init_size
  rockchip: mkimage: set init_boot_size to avoid confusing the boot ROM

 tools/rkcommon.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 tools/rkcommon.h |  20 +++++++++
 tools/rksd.c     |  35 ++++-----------
 tools/rkspi.c    |  23 ++--------
 4 files changed, 158 insertions(+), 50 deletions(-)

-- 
1.9.1



More information about the U-Boot mailing list