summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSafae Ouajih <[email protected]>2023-02-06 00:50:03 +0100
committerTom Rini <[email protected]>2023-04-04 14:50:46 -0400
commitd71a732af45e2d3acef92649f4f7986a83175cf4 (patch)
tree6f2b0f2fc33bfcc8fd56f5fd87f447c3bb5c570e /drivers
parent698c2bd364ce4122a0d0db82b5a8d842186b2fa4 (diff)
android: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0
Android introduced boot header version 3 or 4. The header structure change with version 3 and 4 to support the new updates such as: - Introducing Vendor boot image: with a vendor ramdisk - Bootconfig feature (v4) Change andr_img_hdr struct name to maintain support for version v0, v1 and v2 while introducing version 3 and 4. Signed-off-by: Safae Ouajih <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/fastboot/fb_mmc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index a06c590234f..68677c55ce1 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -287,7 +287,7 @@ static void fb_mmc_boot_ops(struct blk_desc *dev_desc, void *buffer,
*/
static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
struct disk_partition *info,
- struct andr_img_hdr *hdr,
+ struct andr_boot_img_hdr_v0 *hdr,
char *response)
{
ulong sector_size; /* boot partition sector size */
@@ -296,7 +296,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
/* Calculate boot image sectors count */
sector_size = info->blksz;
- hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size);
+ hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_boot_img_hdr_v0), sector_size);
if (hdr_sectors == 0) {
pr_err("invalid number of boot sectors: 0\n");
fastboot_fail("invalid number of boot sectors: 0", response);
@@ -338,7 +338,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
char *response)
{
uintptr_t hdr_addr; /* boot image header address */
- struct andr_img_hdr *hdr; /* boot image header */
+ struct andr_boot_img_hdr_v0 *hdr; /* boot image header */
lbaint_t hdr_sectors; /* boot image header sectors */
u8 *ramdisk_buffer;
u32 ramdisk_sector_start;
@@ -361,7 +361,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
/* Put boot image header in fastboot buffer after downloaded zImage */
hdr_addr = (uintptr_t)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
- hdr = (struct andr_img_hdr *)hdr_addr;
+ hdr = (struct andr_boot_img_hdr_v0 *)hdr_addr;
/* Read boot image header */
hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr, response);