summaryrefslogtreecommitdiff
path: root/tools/binman/bsection.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/bsection.py
parent8122f3967f6eaab7134051d1d8c9b1bfc3babadb (diff)
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/bsection.py')
-rw-r--r--tools/binman/bsection.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py
index 1604b9915e..08c6f0cda8 100644
--- a/tools/binman/bsection.py
+++ b/tools/binman/bsection.py
@@ -96,7 +96,7 @@ class Section(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)
for entry in self._entries.values():
@@ -105,6 +105,7 @@ class Section(object):
def SetCalculatedProperties(self):
self._node.SetInt('offset', self._offset)
self._node.SetInt('size', self._size)
+ self._node.SetInt('image-pos', self._image_pos)
for entry in self._entries.values():
entry.SetCalculatedProperties()
@@ -260,6 +261,11 @@ class Section(object):
offset = entry.offset + entry.size
prev_name = entry.GetPath()
+ def SetImagePos(self, image_pos):
+ self._image_pos = image_pos
+ for entry in self._entries.values():
+ entry.SetImagePos(image_pos)
+
def ProcessEntryContents(self):
"""Call the ProcessContents() method for each entry
@@ -341,6 +347,8 @@ class Section(object):
raise ValueError(err)
if prop_name == 'offset':
return entry.offset
+ elif prop_name == 'image_pos':
+ return entry.image_pos
else:
raise ValueError("%s: No such property '%s'" % (msg, prop_name))