]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: mvebu/bubt: Fix parsing SDIO kwbimage
authorPali Rohár <pali@kernel.org>
Sun, 8 Jan 2023 12:18:39 +0000 (13:18 +0100)
committerStefan Roese <sr@denx.de>
Wed, 1 Mar 2023 05:39:17 +0000 (06:39 +0100)
commit3f83e69c34e46cfa9d70a89aef607ba8ff9c448a
tree3fee748ce4407a106027ea271fe38c7e947f1405
parent0da8d4c575c82231ba8950950b2bd7cf9cabd93d
cmd: mvebu/bubt: Fix parsing SDIO kwbimage

Despite the official specification, Marvell BootROM does not interpret
srcaddr from SDIO image as offset in number of sectors (like for SATA
image), but as offset in bytes (like for all other images except SATA).

To ensure that we do not store invalid SDIO image to the boot location
(read by the Marvell BootROM), we need to check that image is valid
and srcaddr is intepreted in bytes, in the same way as it is done by
Marvell BootROM.

This fixes rejecting valid and accepting invalid SDIO images by bubt command.

Fixes: 433dcd954580 ("cmd: mvebu/bubt: Check for A38x image data checksum")
Signed-off-by: Pali Rohár <pali@kernel.org>
cmd/mvebu/bubt.c