tools: kwbimage/kwboot: Check ext field for non-zero value
authorPali Rohár <pali@kernel.org>
Wed, 12 Jan 2022 17:20:52 +0000 (18:20 +0100)
committerStefan Roese <sr@denx.de>
Fri, 14 Jan 2022 10:39:16 +0000 (11:39 +0100)
commit44691034e18d3b242f911abeb20566d418995710
treefbc357be5654d12c9c568485c5710f4c93300f36
parent1a0e52f50a2085c46bf3bc5116f820a3cb655a2c
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>
tools/kwbimage.c
tools/kwbimage.h
tools/kwboot.c