aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-08-01 15:22:42 -0600
committerSimon Glass <sjg@chromium.org>2018-08-01 16:30:45 -0600
commitdbf6be9f7f3b650ae5248eb7e2c00e94b4da867c (patch)
tree4b2bb2ba21e04668b24117c72e62eaa5fa39d8a7 /tools/binman/entry.py
parent8122f3967f6eaab7134051d1d8c9b1bfc3babadb (diff)
downloadu-boot-dbf6be9f7f3b650ae5248eb7e2c00e94b4da867c.zip
u-boot-dbf6be9f7f3b650ae5248eb7e2c00e94b4da867c.tar.gz
u-boot-dbf6be9f7f3b650ae5248eb7e2c00e94b4da867c.tar.bz2
binman: Add a new 'image-pos' property
At present each entry has an offset within its parent section. This is useful for figuring out how entries relate to one another. However it is sometimes necessary to locate an entry within an image, regardless of which sections it is nested inside. Add a new 'image-pos' property to provide this information. Also add some documentation for the -u option binman provides, which updates the device tree with final entry information. Since the image position is a better symbol to use for the position of U-Boot as obtained by SPL, update the SPL symbols to use this instead of offset, which might be incorrect if hierarchical sections are used. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index cb693c9..8004918 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -64,6 +64,7 @@ class Entry(object):
self.pad_before = 0
self.pad_after = 0
self.offset_unset = False
+ self.image_pos = None
if read_node:
self.ReadNode()
@@ -133,7 +134,7 @@ class Entry(object):
def AddMissingProperties(self):
"""Add new properties to the device tree as needed for this entry"""
- for prop in ['offset', 'size']:
+ for prop in ['offset', 'size', 'image-pos']:
if not prop in self._node.props:
self._node.AddZeroProp(prop)
@@ -141,6 +142,7 @@ class Entry(object):
"""Set the value of device-tree properties calculated by binman"""
self._node.SetInt('offset', self.offset)
self._node.SetInt('size', self.size)
+ self._node.SetInt('image-pos', self.image_pos)
def ProcessFdt(self, fdt):
return True
@@ -265,6 +267,14 @@ class Entry(object):
self.offset = pos
self.size = size
+ def SetImagePos(self, image_pos):
+ """Set the position in the image
+
+ Args:
+ image_pos: Position of this entry in the image
+ """
+ self.image_pos = image_pos + self.offset
+
def ProcessContents(self):
pass