aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-01 09:38:20 -0600
committerSimon Glass <sjg@chromium.org>2018-06-07 11:25:08 -0800
commit3b0c3821d6401106cc873a6c27a8ee31a8d466a4 (patch)
tree6cbc5ada5ea4b901002c756635b077767c27268c /tools/binman/entry.py
parent7ae5f315b34454d1a993e7e96e94d26da6e28e6c (diff)
downloadu-boot-3b0c3821d6401106cc873a6c27a8ee31a8d466a4.zip
u-boot-3b0c3821d6401106cc873a6c27a8ee31a8d466a4.tar.gz
u-boot-3b0c3821d6401106cc873a6c27a8ee31a8d466a4.tar.bz2
binman: Add support for outputing a map file
It is useful to be able to see a list of regions in each image produced by binman. Add a -m option to output this information in a '.map' file alongside the image file. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 8b46fbb..3811d33 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -4,6 +4,8 @@
# Base class for all entries
#
+from __future__ import print_function
+
# importlib was introduced in Python 2.7 but there was a report of it not
# working in 2.7.12, so we work around this:
# http://lists.denx.de/pipermail/u-boot/2016-October/269729.html
@@ -50,6 +52,7 @@ class Entry(object):
self.section = section
self.etype = etype
self._node = node
+ self.name = node and node.name or 'none'
self.pos = None
self.size = None
self.contents_size = 0
@@ -229,3 +232,13 @@ class Entry(object):
this function and raise if there is a problem.
"""
pass
+
+ def WriteMap(self, fd, indent):
+ """Write a map of the entry to a .map file
+
+ Args:
+ fd: File to write the map to
+ indent: Curent indent level of map (0=none, 1=one level, etc.)
+ """
+ print('%s%08x %08x %s' % (' ' * indent, self.pos, self.size,
+ self.name), file=fd)