Commit 18b8f2c49e9b0620caf5b661986c01c575e29b9b

Authored by Eugeniu Rosca
Committed by Simon Glass
1 parent 80281829a6

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>

Showing 1 changed file with 8 additions and 9 deletions Side-by-side Diff

... ... @@ -461,17 +461,16 @@
461 461 struct andr_img_hdr *hdr = buf;
462 462 ulong fdt_data, fdt_len;
463 463  
464   - if (android_image_get_second(hdr, &fdt_data, &fdt_len) != 0)
465   - goto no_fdt;
  464 + if (!android_image_get_second(hdr, &fdt_data, &fdt_len) &&
  465 + !fdt_check_header((char *)fdt_data)) {
  466 + fdt_blob = (char *)fdt_data;
  467 + if (fdt_totalsize(fdt_blob) != fdt_len)
  468 + goto error;
466 469  
467   - fdt_blob = (char *)fdt_data;
468   - if (fdt_check_header(fdt_blob) != 0)
  470 + debug("## Using FDT in Android image second area\n");
  471 + } else {
469 472 goto no_fdt;
470   -
471   - if (fdt_totalsize(fdt_blob) != fdt_len)
472   - goto error;
473   -
474   - debug("## Using FDT found in Android image second area\n");
  473 + }
475 474 #endif
476 475 } else {
477 476 debug("## No Flattened Device Tree\n");