Skip to content
Snippets Groups Projects

android: support boot header version 3 and 4

Closed Safae Ouajih requested to merge souajih/v4_ti into integ/ti-u-boot-2021.01
1 unresolved thread
2 files
+ 15
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 13
2
@@ -24,6 +24,7 @@ static void android_boot_image_v3_v4_parse_hdr(const struct andr_boot_img_hdr_v3
data->kcmdline = (const char *)hdr->cmdline;
data->header_version = hdr->header_version;
data->ramdisk_ptr = env_get_ulong("ramdisk_addr_r", 16, 0);
/*
* The header takes a full page, the remaining components are aligned
@@ -325,10 +326,12 @@ ulong android_image_get_kcomp(const struct andr_boot_img_hdr_v0_v1_v2 *hdr,
return IH_COMP_NONE;
}
int android_image_get_ramdisk(const struct andr_boot_img_hdr_v0_v1_v2 *hdr,
const void *vendor_boot_img, ulong *rd_data, ulong *rd_len)
int android_image_get_ramdisk(const void *hdr, const void *vendor_boot_img,
ulong *rd_data, ulong *rd_len)
{
struct andr_image_data img_data = {0};
ulong ramdisk_ptr;
if (!android_image_get_data(hdr, vendor_boot_img, &img_data))
return -EINVAL;
if (!img_data.ramdisk_size) {
@@ -336,6 +339,14 @@ int android_image_get_ramdisk(const struct andr_boot_img_hdr_v0_v1_v2 *hdr,
return -1;
}
if (img_data.header_version > 2) {
ramdisk_ptr = img_data.ramdisk_ptr;
memcpy((void *)(ramdisk_ptr), (void *)img_data.vendor_ramdisk_ptr,
img_data.vendor_ramdisk_size);
memcpy((void *)(ramdisk_ptr + img_data.vendor_ramdisk_size),
(void *)img_data.ramdisk_ptr, img_data.boot_ramdisk_size);
}
printf("RAM disk load addr 0x%08lx size %u KiB\n",
img_data.ramdisk_ptr, DIV_ROUND_UP(img_data.ramdisk_size, 1024));
Loading