android: boot: kcomp: support andr_image_data

andr_image_data structure is used as a global representation of
boot image header structure. Introduce this new structure to
support all boot header versions : v0,v1.v2.v3.v4 and to support
v3 and v4 while maitaining support for v0,v1,v2.
The need of using andr_image_data comes from the change of header
structure in both version 3 and 4.

Rework android_image_get_kcomp()  to support this new struct.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
Safae Ouajih
2023-04-04 14:50:46 -04:00
committed by Tom Rini
parent fbb645e7d9
commit f48efa0edb
3 changed files with 113 additions and 1 deletions
+27
View File
@@ -317,4 +317,31 @@ struct andr_boot_img_hdr_v0 {
* contained outside boot and vendor boot partitions), otherwise
* jump to kernel_addr
*/
/* Private struct */
struct andr_image_data {
ulong kernel_ptr; /* kernel address */
u32 kernel_size; /* size in bytes */
u32 ramdisk_size; /* size in bytes */
u32 boot_ramdisk_size; /* size in bytes */
ulong second_ptr; /* secondary bootloader address */
u32 second_size; /* secondary bootloader size */
ulong dtb_ptr; /* address of dtb image */
u32 dtb_size; /* size of dtb image */
ulong recovery_dtbo_ptr; /* size in bytes for recovery DTBO/ACPIO image */
u32 recovery_dtbo_size; /* offset to recovery dtbo/acpio in boot image */
const char *kcmdline; /* boot kernel cmdline */
const char *kcmdline_extra; /* vendor-boot extra kernel cmdline */
const char *image_name; /* asciiz product name */
u32 kernel_addr; /* physical load addr */
ulong ramdisk_addr; /* physical load addr */
ulong ramdisk_ptr; /* ramdisk address */
ulong dtb_load_addr; /* physical load address for DTB image */
ulong tags_addr; /* physical addr for kernel tags */
u32 header_version; /* version of the boot image header */
u32 boot_img_total_size; /* boot image size */
};
#endif