diff options
author | Safae Ouajih <souajih@baylibre.com> | 2023-02-06 00:50:09 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-04-04 14:50:46 -0400 |
commit | bb5d692732ca02511f2f491af1e680c87373fd35 (patch) | |
tree | 763371b4f05562a3c51e6821ab25bb60e0b4b91a /boot/image-android.c | |
parent | 607b07554e23ff58d245f16765d831253a4210de (diff) | |
download | u-boot-bb5d692732ca02511f2f491af1e680c87373fd35.tar.gz u-boot-bb5d692732ca02511f2f491af1e680c87373fd35.tar.bz2 u-boot-bb5d692732ca02511f2f491af1e680c87373fd35.zip |
android: boot: content print is not supported for v3, v4 header version
Content print is not supported for version 3 and 4 of boot image header.
Thus, only print that content when v2 is used.
Update android_print_contents() to print an error message
when trying to print boot image header version 3 or 4 content.
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>
Diffstat (limited to 'boot/image-android.c')
-rw-r--r-- | boot/image-android.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/boot/image-android.c b/boot/image-android.c index 15a735e230..31a5d30162 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -477,6 +477,10 @@ bool android_image_get_dtb_by_index(ulong hdr_addr, u32 index, ulong *addr, */ void android_print_contents(const struct andr_boot_img_hdr_v0 *hdr) { + if (hdr->header_version >= 3) { + printf("Content print is not supported for boot image header version > 2"); + return; + } const char * const p = IMAGE_INDENT_STRING; /* os_version = ver << 11 | lvl */ u32 os_ver = hdr->os_version >> 11; @@ -509,7 +513,7 @@ void android_print_contents(const struct andr_boot_img_hdr_v0 *hdr) hdr->header_size); } - if (hdr->header_version >= 2) { + if (hdr->header_version == 2) { printf("%sdtb size: %x\n", p, hdr->dtb_size); printf("%sdtb addr: %llx\n", p, hdr->dtb_addr); } |