binman: Add a temporary hack for duplicate phandles
Three boards use a phandle in a FIT generator and the maintainer is
away. For now, add a hack to allow this.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py
index 9632ec1..39c61c2 100644
--- a/tools/binman/cmdline.py
+++ b/tools/binman/cmdline.py
@@ -126,6 +126,8 @@
help='Comma-separated list of bintools to consider missing (for testing)')
build_parser.add_argument('-i', '--image', type=str, action='append',
help='Image filename to build (if not specified, build all)')
+ build_parser.add_argument('--ignore-dup-phandles', action='store_true',
+ help='Temporary option to ignore duplicate phandles')
build_parser.add_argument('-I', '--indir', action='append',
help='Add a path to the list of directories to use for input files')
build_parser.add_argument('-m', '--map', action='store_true',
diff --git a/tools/binman/control.py b/tools/binman/control.py
index c6d3205..4594895 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -22,6 +22,7 @@
from binman import cbfs_util
from binman import elf
from binman import entry
+from dtoc import fdt
from dtoc import fdt_util
from u_boot_pylib import command
from u_boot_pylib import tools
@@ -816,6 +817,10 @@
cbfs_util.VERBOSE = args.verbosity > 2
state.use_fake_dtb = args.fake_dtb
+ # Temporary hack
+ if args.ignore_dup_phandles: # pragma: no cover
+ fdt.IGNORE_DUP_PHANDLES = True
+
# Normally we replace the 'u-boot' etype with 'u-boot-expanded', etc.
# When running tests this can be disabled using this flag. When not
# updating the FDT in image, it is not needed by binman, but we use it