diff options
author | Pali Rohár <pali@kernel.org> | 2022-01-12 20:20:52 +0300 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-01-14 13:39:16 +0300 |
commit | 44691034e18d3b242f911abeb20566d418995710 (patch) | |
tree | fbc357be5654d12c9c568485c5710f4c93300f36 /tools/kwbimage.c | |
parent | 1a0e52f50a2085c46bf3bc5116f820a3cb655a2c (diff) | |
download | u-boot-44691034e18d3b242f911abeb20566d418995710.tar.xz |
tools: kwbimage/kwboot: Check ext field for non-zero value
Despite the official specification, BootROM does not look at the lowest bit
of ext field but rather checks if ext field is non-zero.
Moreover original Marvell doimage tool puts into the mhdr->ext field the
number of extended headers, so basically it sets ext filed to non-zero
value if some extended header is present.
Fix U-Boot dumpimage and kwboot tools to parse correctly also kwbimage
files created by Marvell doimage tool, in the same way as the BootROM is
doing it when booting these images.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwbimage.c')
-rw-r--r-- | tools/kwbimage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c index de7e9acf7f..92d163b605 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -1948,7 +1948,7 @@ static int kwbimage_verify_header(unsigned char *ptr, int image_size, if (kwbimage_version(ptr) == 0) { struct main_hdr_v0 *mhdr = (struct main_hdr_v0 *)ptr; - if (mhdr->ext & 0x1) { + if (mhdr->ext) { struct ext_hdr_v0 *ext_hdr = (void *)(mhdr + 1); csum = image_checksum8(ext_hdr, sizeof(*ext_hdr) - 1); |