aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/fmap.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-04-29 21:03:38 -0400
committerTom Rini <trini@konsulko.com>2021-04-29 21:03:38 -0400
commit8ddaf943589756442bba21e5be645cd47526d82b (patch)
tree5790a6435ce416342bc9747a55d2f23a8f141c2e /tools/binman/etype/fmap.py
parentf3a0d2c1af630cc09a34c2159aa2dfa12b831762 (diff)
parent5b700cdcff61426843405ca1df4b549237e8bbc2 (diff)
Merge tag 'dm-pull-29apr21' of https://source.denx.de/u-boot/custodians/u-boot-dm
buildman environment fix binman FMAP improvements minor test improvements and fixes minor dm improvements
Diffstat (limited to 'tools/binman/etype/fmap.py')
-rw-r--r--tools/binman/etype/fmap.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/binman/etype/fmap.py b/tools/binman/etype/fmap.py
index fe81c6f64a..cac99b60eb 100644
--- a/tools/binman/etype/fmap.py
+++ b/tools/binman/etype/fmap.py
@@ -28,8 +28,12 @@ class Entry_fmap(Entry):
When used, this entry will be populated with an FMAP which reflects the
entries in the current image. Note that any hierarchy is squashed, since
- FMAP does not support this. Also, CBFS entries appear as a single entry -
- the sub-entries are ignored.
+ FMAP does not support this. Sections are represented as an area appearing
+ before its contents, so that it is possible to reconstruct the hierarchy
+ from the FMAP by using the offset information. This convention does not
+ seem to be documented, but is used in Chromium OS.
+
+ CBFS entries appear as a single entry, i.e. the sub-entries are ignored.
"""
def __init__(self, section, etype, node):
super().__init__(section, etype, node)
@@ -45,6 +49,17 @@ class Entry_fmap(Entry):
tout.Debug("fmap: Add entry '%s' type '%s' (%s subentries)" %
(entry.GetPath(), entry.etype, ToHexSize(entries)))
if entries and entry.etype != 'cbfs':
+ # Create an area for the section, which encompasses all entries
+ # within it
+ if entry.image_pos is None:
+ pos = 0
+ else:
+ pos = entry.image_pos - entry.GetRootSkipAtStart()
+
+ # Drop @ symbols in name
+ name = entry.name.replace('@', '')
+ areas.append(
+ fmap_util.FmapArea(pos, entry.size or 0, name, 0))
for subentry in entries.values():
_AddEntries(areas, subentry)
else: