common: android: update image end get for android v2

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4b2cddec072657d69b294dbddf300cf4d0471695
This commit is contained in:
Joseph Chen 2020-01-17 09:20:37 +08:00
parent 2fe84ae1c5
commit 01918c3fa9
1 changed files with 5 additions and 1 deletions

View File

@ -198,8 +198,12 @@ ulong android_image_get_end(const struct andr_img_hdr *hdr)
end += ALIGN(hdr->ramdisk_size, hdr->page_size);
end += ALIGN(hdr->second_size, hdr->page_size);
if (hdr->header_version >= 1)
if (hdr->header_version >= 2) {
end += ALIGN(hdr->recovery_dtbo_size, hdr->page_size);
end += ALIGN(hdr->dtb_size, hdr->page_size);
} else if (hdr->header_version >= 1) {
end += ALIGN(hdr->recovery_dtbo_size, hdr->page_size);
}
return end;
}