mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
android: boot: support boot image header version 3 and 4
Enable the support for boot image header version 3 and 4 using abootimg command. In order to use version 3 or 4: 1- Vendor boot image address should be given to abootimg cmd. abootimg addr $1 $vendor_boot_load_addr 2- "ramdisk_addr_r" env variable (ramdisk address) should be set to host the ramdisk : generic ramdisk + vendor ramdisk Replace "struct andr_boot_img_hdr_v0*" by "void *" in some functions since v3 and v4 are now supported as well. Signed-off-by: Safae Ouajih <souajih@baylibre.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
bc6413bdd9
commit
636da2039a
6 changed files with 99 additions and 23 deletions
|
@ -426,10 +426,22 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a
|
|||
break;
|
||||
case IMAGE_FORMAT_ANDROID:
|
||||
if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
|
||||
void *ptr = map_sysmem(images->os.start, 0);
|
||||
int ret;
|
||||
ret = android_image_get_ramdisk(ptr, NULL, rd_datap, rd_lenp);
|
||||
unmap_sysmem(ptr);
|
||||
if (IS_ENABLED(CONFIG_CMD_ABOOTIMG)) {
|
||||
void *boot_img = map_sysmem(get_abootimg_addr(), 0);
|
||||
void *vendor_boot_img = map_sysmem(get_avendor_bootimg_addr(), 0);
|
||||
|
||||
ret = android_image_get_ramdisk(boot_img, vendor_boot_img,
|
||||
rd_datap, rd_lenp);
|
||||
unmap_sysmem(vendor_boot_img);
|
||||
unmap_sysmem(boot_img);
|
||||
} else {
|
||||
void *ptr = map_sysmem(images->os.start, 0);
|
||||
|
||||
ret = android_image_get_ramdisk(ptr, NULL, rd_datap, rd_lenp);
|
||||
unmap_sysmem(ptr);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
done = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue