mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
rockchip: mkimage: add support for verify_header/print_header
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@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
37ffae7c5b
commit
2fb371ff64
@@ -55,6 +55,25 @@ int rkcommon_get_spl_size(struct image_tool_params *params);
|
||||
int rkcommon_set_header(void *buf, uint file_size,
|
||||
struct image_tool_params *params);
|
||||
|
||||
/**
|
||||
* rkcommon_verify_header() - verify the header for a Rockchip boot image
|
||||
*
|
||||
* @buf: Pointer to the image file
|
||||
* @file_size: Size of entire bootable image file (incl. all padding)
|
||||
* @return 0 if OK
|
||||
*/
|
||||
int rkcommon_verify_header(unsigned char *buf, int size,
|
||||
struct image_tool_params *params);
|
||||
|
||||
/**
|
||||
* rkcommon_print_header() - print the header for a Rockchip boot image
|
||||
*
|
||||
* This prints the header, spl_name and whether this is a SD/MMC or SPI image.
|
||||
*
|
||||
* @buf: Pointer to the image (can be a read-only file-mapping)
|
||||
*/
|
||||
void rkcommon_print_header(const void *buf);
|
||||
|
||||
/**
|
||||
* rkcommon_need_rc4_spl() - check if rc4 encoded spl is required
|
||||
*
|
||||
|
Reference in New Issue
Block a user