summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugeniu Rosca <erosca@de.adit-jv.com>2019-04-01 12:45:36 +0200
committerSimon Glass <sjg@chromium.org>2019-04-23 20:26:43 -0600
commit18b8f2c49e9b0620caf5b661986c01c575e29b9b (patch)
treeb833eef15192e033a3edd863b5c343cf9b6c92bb /common
parent80281829a6ac9d5040e710f42ab48604af07d53b (diff)
downloadu-boot-18b8f2c49e9b0620caf5b661986c01c575e29b9b.tar.gz
u-boot-18b8f2c49e9b0620caf5b661986c01c575e29b9b.tar.bz2
u-boot-18b8f2c49e9b0620caf5b661986c01c575e29b9b.zip
fdt: boot_get_fdt: android: compress handling (non-functional)
Prepare for booting Android images which lack any DTB in the second area by using 'fdtaddr' environment variable as source/address of FDT. No functional/behavioral change expected in this patch. Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/image-fdt.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 68bcab85ba..a5d8b41d02 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -461,17 +461,16 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
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;
+ if (!android_image_get_second(hdr, &fdt_data, &fdt_len) &&
+ !fdt_check_header((char *)fdt_data)) {
+ fdt_blob = (char *)fdt_data;
+ if (fdt_totalsize(fdt_blob) != fdt_len)
+ goto error;
- fdt_blob = (char *)fdt_data;
- if (fdt_check_header(fdt_blob) != 0)
+ debug("## Using FDT in Android image second area\n");
+ } else {
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");