aboutsummaryrefslogtreecommitdiff
path: root/cmd/mvebu
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-01-08 13:18:39 +0100
committerStefan Roese <sr@denx.de>2023-03-01 06:39:17 +0100
commiteb2c8f3805082955a95485911962b2baa8ab54ce (patch)
tree3fee748ce4407a106027ea271fe38c7e947f1405 /cmd/mvebu
parent353bdaecee9874b21d6feb3cabfe369194197b1e (diff)
downloadu-boot-eb2c8f3805082955a95485911962b2baa8ab54ce.zip
u-boot-eb2c8f3805082955a95485911962b2baa8ab54ce.tar.gz
u-boot-eb2c8f3805082955a95485911962b2baa8ab54ce.tar.bz2
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: 5a0653493307 ("cmd: mvebu/bubt: Check for A38x image data checksum") Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'cmd/mvebu')
-rw-r--r--cmd/mvebu/bubt.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index 1efbe2e..6bb84da 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -747,9 +747,6 @@ static int check_image_header(void)
offset *= 512;
}
- if (hdr->blockid == 0xAE) /* SDIO id */
- offset *= 512;
-
if (offset % 4 != 0 || size < 4 || size % 4 != 0) {
printf("Error: Bad A38x image blocksize.\n");
return -ENOEXEC;