diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-06 21:35:18 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-30 14:25:41 -0700 |
commit | 6eb9932668fa6bd8c659484b2d18d8a73713208c (patch) | |
tree | 6c4b726aaceedc0f28c522457dc14438a86316e9 /tools/binman/etype/files.py | |
parent | 5af9ebc4bcbcca91b21257c18cb94c78e7356980 (diff) |
binman: Support alignment of files
When packing files it is sometimes useful to align the start of each file,
e.g. if the flash driver can only access 32-bit-aligned data. Provides a
new property to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/files.py')
-rw-r--r-- | tools/binman/etype/files.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/binman/etype/files.py b/tools/binman/etype/files.py index ce3832e3cd..1feebd0510 100644 --- a/tools/binman/etype/files.py +++ b/tools/binman/etype/files.py @@ -22,6 +22,7 @@ class Entry_files(Entry_section): - files-compress: Compression algorithm to use: none: No compression lz4: Use lz4 compression (via 'lz4' command-line utility) + - files-align: Align each file to the given alignment This entry reads a number of files and places each in a separate sub-entry within this entry. To access these you need to enable device-tree updates @@ -38,6 +39,7 @@ class Entry_files(Entry_section): self.Raise("Missing 'pattern' property") self._files_compress = fdt_util.GetString(self._node, 'files-compress', 'none') + self._files_align = fdt_util.GetInt(self._node, 'files-align'); self._require_matches = fdt_util.GetBool(self._node, 'require-matches') @@ -55,6 +57,8 @@ class Entry_files(Entry_section): state.AddString(subnode, 'type', 'blob') state.AddString(subnode, 'filename', fname) state.AddString(subnode, 'compress', self._files_compress) + if self._files_align: + state.AddInt(subnode, 'align', self._files_align) # Read entries again, now that we have some self._ReadEntries() |