summaryrefslogtreecommitdiff
path: root/drivers/fastboot
diff options
context:
space:
mode:
authorSafae Ouajih <souajih@baylibre.com>2023-02-06 00:50:16 +0100
committerTom Rini <trini@konsulko.com>2023-04-04 14:50:47 -0400
commitbc6413bdd9a4a7ab8a62232aa4791cc26a0ef215 (patch)
tree6680d56e68ab1673d7836b92cfffc4d4c5a0a29b /drivers/fastboot
parent2d0da1972ded075ba783f3ea705662349e77fa61 (diff)
downloadu-boot-bc6413bdd9a4a7ab8a62232aa4791cc26a0ef215.tar.gz
u-boot-bc6413bdd9a4a7ab8a62232aa4791cc26a0ef215.tar.bz2
u-boot-bc6413bdd9a4a7ab8a62232aa4791cc26a0ef215.zip
drivers: fastboot: zImage flashing is not supported for v3, v4
With vendor boot image introduced in version 3 and 4 of boot image header, boot information is located in both boot image and vendor boot image. Flashing zImage is not supported for version 3 and 4 since this requires updating vendor boot image and/or generating a new image. Print an error message when the boot image header version is greater than 2. Signed-off-by: Safae Ouajih <souajih@baylibre.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Diffstat (limited to 'drivers/fastboot')
-rw-r--r--drivers/fastboot/fb_mmc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index 29c18cb82a..9d25c40202 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -370,6 +370,14 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
return -1;
}
+ /* Check if boot image header version is 2 or less */
+ if (hdr->header_version > 2) {
+ pr_err("zImage flashing supported only for boot images v2 and less\n");
+ fastboot_fail("zImage flashing supported only for boot images v2 and less",
+ response);
+ return -EOPNOTSUPP;
+ }
+
/* Check if boot image has second stage in it (we don't support it) */
if (hdr->second_size > 0) {
pr_err("moving second stage is not supported yet\n");