summaryrefslogtreecommitdiff
path: root/tools/binman/image.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r--tools/binman/image.py30
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py
index 68126bc3e6..f237ae302d 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -42,7 +42,8 @@ class Image:
self._size = None
self._filename = '%s.bin' % self._name
if test:
- self._section = bsection.Section('main-section', self._node, True)
+ self._section = bsection.Section('main-section', None, self._node,
+ self, True)
else:
self._ReadNode()
@@ -52,7 +53,20 @@ class Image:
filename = fdt_util.GetString(self._node, 'filename')
if filename:
self._filename = filename
- self._section = bsection.Section('main-section', self._node)
+ self._section = bsection.Section('main-section', None, self._node, self)
+
+ def GetFdtSet(self):
+ """Get the set of device tree files used by this image"""
+ return self._section.GetFdtSet()
+
+ def ExpandEntries(self):
+ """Expand out any entries which have calculated sub-entries
+
+ Some entries are expanded out at runtime, e.g. 'files', which produces
+ a section containing a list of files. Process these entries so that
+ this information is added to the device tree.
+ """
+ self._section.ExpandEntries()
def AddMissingProperties(self):
"""Add properties that are not present in the device tree
@@ -66,6 +80,11 @@ class Image:
self._section.AddMissingProperties()
def ProcessFdt(self, fdt):
+ """Allow entries to adjust the device tree
+
+ Some entries need to adjust the device tree for their purposes. This
+ may involve adding or deleting properties.
+ """
return self._section.ProcessFdt(fdt)
def GetEntryContents(self):
@@ -120,10 +139,15 @@ class Image:
return self._section.GetEntries()
def WriteMap(self):
- """Write a map of the image to a .map file"""
+ """Write a map of the image to a .map file
+
+ Returns:
+ Filename of map file written
+ """
filename = '%s.map' % self._name
fname = tools.GetOutputFilename(filename)
with open(fname, 'w') as fd:
print('%8s %8s %8s %s' % ('ImagePos', 'Offset', 'Size', 'Name'),
file=fd)
self._section.WriteMap(fd, 0)
+ return fname