diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-21 18:24:33 +1300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-27 16:26:48 +1300 |
commit | 5ff9fedc9bc02e01d73d57e9c7d7eac9fd6320d4 (patch) | |
tree | 0fc99fe53f99d7f97011a990ddf452454ad7b15b /tools/binman/etype | |
parent | 631f752de5b8dccbf9a0d4824213e9e6e0d96167 (diff) |
binman: Support default alignment for sections
Sometimes it is useful to specify the default alignment for all entries
in a section, such as when word-alignment is necessary, for example. It
is tedious and error-prone to specify this individually for each section.
Add a property to control this for a section.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype')
-rw-r--r-- | tools/binman/etype/cbfs.py | 1 | ||||
-rw-r--r-- | tools/binman/etype/mkimage.py | 1 | ||||
-rw-r--r-- | tools/binman/etype/section.py | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index 1daddeb822..44db7b9bb2 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -169,6 +169,7 @@ class Entry_cbfs(Entry): super().__init__(section, etype, node) self._cbfs_arg = fdt_util.GetString(node, 'cbfs-arch', 'x86') + self.align_default = None self._cbfs_entries = OrderedDict() self._ReadSubnodes() self.reader = None diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index e9f82729ab..e49977522e 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -36,6 +36,7 @@ class Entry_mkimage(Entry): super().__init__(section, etype, node) self._args = fdt_util.GetString(self._node, 'args').split(' ') self._mkimage_entries = OrderedDict() + self.align_default = None self._ReadSubnodes() def ObtainContents(self): diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index d4a097b94b..c3bac026c1 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -36,6 +36,8 @@ class Entry_section(Entry): file, since the first 16 bytes are skipped when writing. name-prefix: Adds a prefix to the name of every entry in the section when writing out the map + align_default: Default alignment for this section, if no alignment is + given in the entry Properties: allow_missing: True if this section permits external blobs to be @@ -76,6 +78,7 @@ class Entry_section(Entry): if self._skip_at_start is None: self._skip_at_start = 0 self._name_prefix = fdt_util.GetString(self._node, 'name-prefix') + self.align_default = fdt_util.GetInt(self._node, 'align-default', 0) filename = fdt_util.GetString(self._node, 'filename') if filename: self._filename = filename |