diff options
author | Safae Ouajih <souajih@baylibre.com> | 2023-02-06 00:50:17 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-04-04 14:50:47 -0400 |
commit | 636da2039aea4ea3a638b14da0a9ec258897a10c (patch) | |
tree | 80ee38cce7e2bc6649b7b433ed646baf4b59a5e0 /include/image.h | |
parent | bc6413bdd9a4a7ab8a62232aa4791cc26a0ef215 (diff) |
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>
Diffstat (limited to 'include/image.h')
-rw-r--r-- | include/image.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/image.h b/include/image.h index c4d9b1c5754..456197d6fda 100644 --- a/include/image.h +++ b/include/image.h @@ -1767,7 +1767,7 @@ struct andr_boot_img_hdr_v0; * Return: Zero, os start address and length on success, * otherwise on failure. */ -int android_image_get_kernel(const struct andr_boot_img_hdr_v0 *hdr, +int android_image_get_kernel(const void *hdr, const void *vendor_boot_img, int verify, ulong *os_data, ulong *os_len); @@ -1796,8 +1796,7 @@ int android_image_get_ramdisk(const void *hdr, const void *vendor_boot_img, * @second_len : Pointer to a ulong variable, will hold secondary bootloader length * Return: 0 if succeeded, -1 if secondary bootloader size is 0 */ -int android_image_get_second(const struct andr_boot_img_hdr_v0 *hdr, - ulong *second_data, ulong *second_len); +int android_image_get_second(const void *hdr, ulong *second_data, ulong *second_len); bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, u32 *size); /** @@ -1838,7 +1837,7 @@ ulong android_image_get_end(const struct andr_boot_img_hdr_v0 *hdr, * @vendor_boot_img : Pointer to vendor boot image header * Return: The kernel load address */ -ulong android_image_get_kload(const struct andr_boot_img_hdr_v0 *hdr, +ulong android_image_get_kload(const void *hdr, const void *vendor_boot_img); /** @@ -1850,7 +1849,7 @@ ulong android_image_get_kload(const struct andr_boot_img_hdr_v0 *hdr, * @vendor_boot_img : Pointer to vendor boot image header * Return: Kernel compression type */ -ulong android_image_get_kcomp(const struct andr_boot_img_hdr_v0 *hdr, +ulong android_image_get_kcomp(const void *hdr, const void *vendor_boot_img); /** @@ -1874,7 +1873,7 @@ bool android_image_print_dtb_contents(ulong hdr_addr); * @hdr: Pointer to boot image * Return: non-zero if the magic is correct, zero otherwise */ -bool is_android_boot_image_header(const struct andr_boot_img_hdr_v0 *hdr); +bool is_android_boot_image_header(const void *hdr); /** * is_android_vendor_boot_image_header() - Check the magic of vendor boot image @@ -1888,6 +1887,20 @@ bool is_android_boot_image_header(const struct andr_boot_img_hdr_v0 *hdr); bool is_android_vendor_boot_image_header(const void *vendor_boot_img); /** + * get_abootimg_addr() - Get Android boot image address + * + * Return: Android boot image address + */ +ulong get_abootimg_addr(void); + +/** + * get_avendor_bootimg_addr() - Get Android vendor boot image address + * + * Return: Android vendor boot image address + */ +ulong get_avendor_bootimg_addr(void); + +/** * board_fit_config_name_match() - Check for a matching board name * * This is used when SPL loads a FIT containing multiple device tree files |