aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-06 21:35:18 -0700
committerSimon Glass <sjg@chromium.org>2021-01-30 14:25:41 -0700
commit6eb9932668fa6bd8c659484b2d18d8a73713208c (patch)
tree6c4b726aaceedc0f28c522457dc14438a86316e9 /tools/binman/ftest.py
parent5af9ebc4bcbcca91b21257c18cb94c78e7356980 (diff)
downloadu-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.zip
u-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.tar.gz
u-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.tar.bz2
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/ftest.py')
-rw-r--r--tools/binman/ftest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 7f7827b..b31a730 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -4218,6 +4218,14 @@ class TestFunctional(unittest.TestCase):
self.assertEqual(orig_image.GetEntries().keys(),
image.GetEntries().keys())
+ def testFilesAlign(self):
+ """Test alignment with files"""
+ data = self._DoReadFile('190_files_align.dts')
+
+ # The first string is 15 bytes so will align to 16
+ expect = FILES_DATA[:15] + b'\0' + FILES_DATA[15:]
+ self.assertEqual(expect, data)
+
if __name__ == "__main__":
unittest.main()