[U-Boot] [PATCH v3 1/3] rockchip: mkimage: add support for verify_header/print_header

sjg at google.com sjg at google.com
Mon Jun 5 21:31:37 UTC 2017


The rockchip image generation was previously missing the ability to
verify the generated header (and dump the image-type) without having
to resort to hexdump or od. Experience in our testing has showed it
to be very easy to get the rkspi and rksd images mixed up and the
lab... so we add the necessary support to have dumpimage tell us
what image type we're dealing with.

This change set adds the verify_header and print_header capability
to the rksd/rkspi image drivers (through shared code in rkcommon).

As of now, we only support images fully that are not RC4-encoded for
the SPL payload (i.e. header1 and payload). For RC4-encoded payloads,
the outer header (header0) is checked, but no detection of whether
this is a SD/MMC or SPI formatted payload takes place.

The output of dumpsys now prints the image type (spl_hdr), whether it
is a SD/MMC or SPI image, and the (padded) size of the image:
  $ ./tools/dumpimage -l ./spl.img
  Image Type:   Rockchip RK33 (SD/MMC) boot image
                               ^^^^^^ SD/MMC vs. SPI indication
                         ^^^^ spl_hdr indicated by the image
  Data Size:    79872 bytes

Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
Acked-by: Simon Glass <sjg at chromium.org>

---

Changes in v3: None
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"]

 tools/rkcommon.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/rkcommon.h |  19 +++++++++
 tools/rksd.c     |  29 +++-----------
 tools/rkspi.c    |  21 ++--------
 4 files changed, 146 insertions(+), 42 deletions(-)

Applied to u-boot-rockchip, thanks!


More information about the U-Boot mailing list