Browse Source

libfdt: Add support for disabling ordering check/fixup

Add a way to remove this check and the reordering code, which is
unnecessary if the dtb is known to be correctly ordered.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200220214557.176528-8-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Simon Glass 5 years ago committed by David Gibson
parent
commit
f270f45fd5
  1. 3
      libfdt/fdt_rw.c

3
libfdt/fdt_rw.c

@ -435,7 +435,8 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize) @@ -435,7 +435,8 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
return struct_size;
}

if (!fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
if (can_assume(LIBFDT_ORDER) |
!fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
/* no further work necessary */
err = fdt_move(fdt, buf, bufsize);
if (err)

Loading…
Cancel
Save