diff options
author | Roman Stratiienko <r.stratiienko@gmail.com> | 2024-05-23 07:06:07 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-06-07 16:20:33 -0600 |
commit | 17b1656dcd07136d83082b23118c20b2042d73e0 (patch) | |
tree | 534bbadcdf31f8beaa30d7ef8a4ef38fb867f704 /boot | |
parent | da3447d09fa045c6919370a0ac24693efe317901 (diff) | |
download | u-boot-17b1656dcd07136d83082b23118c20b2042d73e0.tar.gz |
abootimg: Add init_boot image support
Quote from [1]:
"For devices launching with Android 13, the generic ramdisk is removed
from the boot image and placed in a separate init_boot image.
This change leaves the boot image with only the GKI kernel."
While at it, update wrong error handling message when vendor_boot
cannot be loaded.
[1]: https://source.android.com/docs/core/architecture/partitions/generic-boot
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/image-board.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/boot/image-board.c b/boot/image-board.c index b7884b8c5dc..f2124013046 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -406,13 +406,20 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) { int ret; if (IS_ENABLED(CONFIG_CMD_ABOOTIMG)) { - void *boot_img = map_sysmem(get_abootimg_addr(), 0); + ulong boot_img = get_abootimg_addr(); + ulong init_boot_img = get_ainit_bootimg_addr(); void *vendor_boot_img = map_sysmem(get_avendor_bootimg_addr(), 0); + void *ramdisk_img; - ret = android_image_get_ramdisk(boot_img, vendor_boot_img, + if (init_boot_img == -1) + ramdisk_img = map_sysmem(boot_img, 0); + else + ramdisk_img = map_sysmem(init_boot_img, 0); + + ret = android_image_get_ramdisk(ramdisk_img, vendor_boot_img, rd_datap, rd_lenp); unmap_sysmem(vendor_boot_img); - unmap_sysmem(boot_img); + unmap_sysmem(ramdisk_img); } else { void *ptr = map_sysmem(images->os.start, 0); |