summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-08 14:25:41 -0600
committerSimon Glass <sjg@chromium.org>2019-07-24 12:54:08 -0700
commit69f7cb31a083c697ef0a4180a30219d2258b3662 (patch)
tree939a4059b56f2fb5a91caf167412a984695b7ebe /tools/binman/ftest.py
parent52107ee4df878d26923a498b62beedbbaa5c1f7e (diff)
downloadu-boot-69f7cb31a083c697ef0a4180a30219d2258b3662.tar.gz
binman: Support FDT update for CBFS
It is useful to add the CBFS file information (offset, size, etc.) into the FDT so that the layout is complete. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 89e732fca3..999d8884ac 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -2160,6 +2160,31 @@ class TestFunctional(unittest.TestCase):
}
self.assertEqual(expected, props)
+ def testCbfsUpdateFdt(self):
+ """Test that we can update the device tree with CBFS offset/size info"""
+ self._CheckLz4()
+ data, _, _, out_dtb_fname = self._DoReadFileDtb('125_cbfs_update.dts',
+ update_dtb=True)
+ dtb = fdt.Fdt(out_dtb_fname)
+ dtb.Scan()
+ props = self._GetPropTree(dtb, ['offset', 'size', 'image-pos',
+ 'uncomp-size'])
+ del props['cbfs/u-boot:size']
+ self.assertEqual({
+ 'offset': 0,
+ 'size': len(data),
+ 'image-pos': 0,
+ 'cbfs:offset': 0,
+ 'cbfs:size': len(data),
+ 'cbfs:image-pos': 0,
+ 'cbfs/u-boot:offset': 0x38,
+ 'cbfs/u-boot:uncomp-size': len(U_BOOT_DATA),
+ 'cbfs/u-boot:image-pos': 0x38,
+ 'cbfs/u-boot-dtb:offset': 0xb8,
+ 'cbfs/u-boot-dtb:size': len(U_BOOT_DATA),
+ 'cbfs/u-boot-dtb:image-pos': 0xb8,
+ }, props)
+
if __name__ == "__main__":
unittest.main()