[U-Boot] [PATCH 5/6] fdt: boot_get_fdt: android: compress handling (non-functional)

Eugeniu Rosca roscaeugeniu at gmail.com
Sun Mar 31 02:08:37 UTC 2019


Prepare for booting Android images which lack any DTB in the second
area using 'fdtaddr' environment variable as source/address of FDT.
No functional/behavioral change expected in this patch.

Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
---
 common/image-fdt.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 250f99aaaedd..8fea54335e99 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -457,14 +457,13 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
 		struct andr_img_hdr *hdr = buf;
 		ulong fdt_data;
 
-		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)
+		if (!android_image_get_second(hdr, &fdt_data, &fdt_len) &&
+		    !fdt_check_header((char *)fdt_data)) {
+			fdt_blob = (char *)fdt_data;
+			debug("## Using FDT in Android image second area\n");
+		} else {
 			goto no_fdt;
-
-		debug("## Using FDT found in Android image second area\n");
+		}
 #endif
 	} else {
 		debug("## No Flattened Device Tree\n");
-- 
2.21.0



More information about the U-Boot mailing list