binman: Add a SetCalculatedProperties() method
Once binman has packed the image, the position and size of each entry is
known. It is then possible for binman to update the device tree with these
positions. Since placeholder values have been added, this does not affect
the size of the device tree and therefore the packing does not need to be
performed again.
Add a new SetCalculatedProperties method to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 5325a6a..eafabf0 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -144,6 +144,8 @@
# without changing the device-tree size, thus ensuring that our
# entry positions remain the same.
for image in images.values():
+ if options.update_fdt:
+ image.AddMissingProperties()
image.ProcessFdt(dtb)
dtb.Pack()
@@ -159,6 +161,8 @@
image.PackEntries()
image.CheckSize()
image.CheckEntries()
+ if options.update_fdt:
+ image.SetCalculatedProperties()
image.ProcessEntryContents()
image.WriteSymbols()
image.BuildImage()