diff options
author | Simon Glass <sjg@chromium.org> | 2018-06-01 09:38:21 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-06-07 11:25:08 -0800 |
commit | c8d48efb2b373dc6893e7e9f2f6aaefe5d194719 (patch) | |
tree | 6f3b8315fc2e6fc02c1eede703a804162e7d044e /tools/binman/bsection.py | |
parent | 3b0c3821d6401106cc873a6c27a8ee31a8d466a4 (diff) | |
download | u-boot-c8d48efb2b373dc6893e7e9f2f6aaefe5d194719.tar.gz |
binman: Add support for adding a name prefix to entries
Sometimes we have several sections which repeat the same entries (e.g. for
a read-only and read-write version of the same section). It is useful to
be able to tell these entries apart by name.
Add a new 'name-prefix' property for sections, which causes all entries
within that section to have a given name prefix.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r-- | tools/binman/bsection.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py index e0960d4078..3f30f6e4fe 100644 --- a/tools/binman/bsection.py +++ b/tools/binman/bsection.py @@ -41,6 +41,8 @@ class Section(object): memory address (like 0xff800000) is the first entry position. This causes _skip_at_start to be set to the starting memory address. + _name_prefix: Prefix to add to the name of all entries within this + section _entries: OrderedDict() of entries """ def __init__(self, name, node, test=False): @@ -58,6 +60,7 @@ class Section(object): self._sort = False self._skip_at_start = 0 self._end_4gb = False + self._name_prefix = '' self._entries = OrderedDict() if not test: self._ReadNode() @@ -79,10 +82,13 @@ class Section(object): self._Raise("Section size must be provided when using end-at-4gb") if self._end_4gb: self._skip_at_start = 0x100000000 - self._size + self._name_prefix = fdt_util.GetString(self._node, 'name-prefix') def _ReadEntries(self): for node in self._node.subnodes: - self._entries[node.name] = Entry.Create(self, node) + entry = Entry.Create(self, node) + entry.SetPrefix(self._name_prefix) + self._entries[node.name] = entry def CheckSize(self): """Check that the section contents does not exceed its size, etc.""" |