summaryrefslogtreecommitdiff
path: root/tools/binman/control.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-22 21:43:57 -0600
committerSimon Glass <sjg@chromium.org>2023-08-02 12:05:57 -0600
commitd4d97661d255571118b6fdee0cf082a75f29af29 (patch)
tree98c7f6ba5cc84a5c9e139b0d5ca858222d07cadc /tools/binman/control.py
parentaf41b24ebac86f25145f39f4eec4467d4c501bed (diff)
binman: Support templates containing phandles
This provides support for phandles to be copied over from templates. This is not quite safe, since if the template is instantiated twice (i.e. in two different nodes), then duplicate phandles will be found. This will result in an error. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/control.py')
-rw-r--r--tools/binman/control.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index da33c88883e..c6d3205b8c2 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -575,6 +575,10 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded):
_RemoveTemplates(node)
dtb.Sync(True)
+
+ # Rescan the dtb to pick up the new phandles
+ dtb.Scan()
+ node = _FindBinmanNode(dtb)
fname = tools.get_output_filename('u-boot.dtb.tmpl2')
tools.write_file(fname, dtb.GetContents())