diff options
author | Tom Rini <trini@konsulko.com> | 2019-02-10 08:04:53 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-10 08:04:53 -0500 |
commit | 2e8560797fc69a34c330a875da4f5d2992452f1e (patch) | |
tree | fadec67e667ef3d72d62cef98aa3b3b19b2dd4a5 /common/image-fdt.c | |
parent | 97276a91db8e98f081a40ddf9dc8f81d4032a756 (diff) | |
parent | 4a1fa524e95a1c81674d8a368035b522fd4a99d6 (diff) |
Merge branch '2019-02-08-master-imports'
- bcm6345 watchdog, bcm63158/bcm963158 initial support.
- Various TI platform resyncs and improvements.
- FDT support in Android-format images.
- stm32mp1 improvements.
Diffstat (limited to 'common/image-fdt.c')
-rw-r--r-- | common/image-fdt.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/image-fdt.c b/common/image-fdt.c index 5988808f18..94089b2215 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -268,6 +268,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, ulong load, load_end; ulong image_start, image_data, image_end; #endif + ulong img_addr; ulong fdt_addr; char *fdt_blob = NULL; void *buf; @@ -283,6 +284,9 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, *of_flat_tree = NULL; *of_size = 0; + img_addr = simple_strtoul(argv[0], NULL, 16); + buf = map_sysmem(img_addr, 0); + if (argc > 2) select = argv[2]; if (select || genimg_has_config(images)) { @@ -453,6 +457,23 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, debug("## No Flattened Device Tree\n"); goto no_fdt; } +#ifdef CONFIG_ANDROID_BOOT_IMAGE + } else if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) { + struct andr_img_hdr *hdr = buf; + ulong fdt_data, fdt_len; + + if (android_image_get_second(hdr, &fdt_data, &fdt_len) != 0) + goto no_fdt; + + fdt_blob = (char *)fdt_data; + if (fdt_check_header(fdt_blob) != 0) + goto no_fdt; + + if (fdt_totalsize(fdt_blob) != fdt_len) + goto error; + + debug("## Using FDT found in Android image second area\n"); +#endif } else { debug("## No Flattened Device Tree\n"); goto no_fdt; |