aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-07-06 10:27:41 -0600
committerSimon Glass <sjg@chromium.org>2018-07-09 09:11:00 -0600
commit078ab1a2f5a9901f5f9983163d4f98b8d94bfda0 (patch)
tree469e20126f5566717b8a0cd35395b1c029e42139 /tools/binman/entry.py
parentecab89737a4eb58c043388b1ca1c0f1dfdaa3346 (diff)
downloadu-boot-078ab1a2f5a9901f5f9983163d4f98b8d94bfda0.zip
u-boot-078ab1a2f5a9901f5f9983163d4f98b8d94bfda0.tar.gz
u-boot-078ab1a2f5a9901f5f9983163d4f98b8d94bfda0.tar.bz2
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>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 62e65c9..6a173e6 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -130,6 +130,17 @@ class Entry(object):
self.align_end = fdt_util.GetInt(self._node, 'align-end')
self.pos_unset = fdt_util.GetBool(self._node, 'pos-unset')
+ def AddMissingProperties(self):
+ """Add new properties to the device tree as needed for this entry"""
+ for prop in ['pos', 'size']:
+ if not prop in self._node.props:
+ self._node.AddZeroProp(prop)
+
+ def SetCalculatedProperties(self):
+ """Set the value of device-tree properties calculated by binman"""
+ self._node.SetInt('pos', self.pos)
+ self._node.SetInt('size', self.size)
+
def ProcessFdt(self, fdt):
return True