1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-03 09:42:22 +02:00

binman: Add support for fixed-offset files in CBFS

A feature of CBFS is that it allows files to be positioned at particular
offset (as with binman in general). This is useful to support
execute-in-place (XIP) code, since this may not be relocatable.

Add a new cbfs-offset property to control this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2019-07-08 13:18:56 -06:00
parent 7c173ced64
commit e073d4e14f
6 changed files with 276 additions and 34 deletions

View File

@@ -2012,5 +2012,28 @@ class TestFunctional(unittest.TestCase):
self.assertIn('Could not complete processing of contents',
str(e.exception))
def testCbfsOffset(self):
"""Test a CBFS with files at particular offsets
Like all CFBS tests, this is just checking the logic that calls
cbfs_util. See cbfs_util_test for fully tests (e.g. test_cbfs_offset()).
"""
data = self._DoReadFile('114_cbfs_offset.dts')
size = 0x200
cbfs = cbfs_util.CbfsReader(data)
self.assertEqual(size, cbfs.rom_size)
self.assertIn('u-boot', cbfs.files)
cfile = cbfs.files['u-boot']
self.assertEqual(U_BOOT_DATA, cfile.data)
self.assertEqual(0x40, cfile.cbfs_offset)
self.assertIn('u-boot-dtb', cbfs.files)
cfile2 = cbfs.files['u-boot-dtb']
self.assertEqual(U_BOOT_DTB_DATA, cfile2.data)
self.assertEqual(0x140, cfile2.cbfs_offset)
if __name__ == "__main__":
unittest.main()