aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-01-09 20:13:39 -0700
committerSimon Glass <sjg@chromium.org>2022-01-25 12:36:10 -0700
commit8bc78b73fb873590238a1788db8783ab8f65e5a1 (patch)
tree95f74cbdcfc08182c4fe42fcdc59071525ac8758 /tools
parent206117afd137c88f0b0974088a9008bdf123eeb8 (diff)
downloadu-boot-8bc78b73fb873590238a1788db8783ab8f65e5a1.zip
u-boot-8bc78b73fb873590238a1788db8783ab8f65e5a1.tar.gz
u-boot-8bc78b73fb873590238a1788db8783ab8f65e5a1.tar.bz2
binman: Expand the external FIT test a little
At present this does not check that the external data is in the expected place. Use a non-zero offset for the external data and check it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/ftest.py17
-rw-r--r--tools/binman/test/162_fit_external.dts2
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index f4ff7b6..6a76473 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -3713,11 +3713,28 @@ class TestFunctional(unittest.TestCase):
data = self._DoReadFile('162_fit_external.dts')
fit_data = data[len(U_BOOT_DATA):-2] # _testing is 2 bytes
+ # Size of the external-data region as set up by mkimage
+ external_data_size = len(U_BOOT_DATA) + 2
+ expected_size = (len(U_BOOT_DATA) + 0x400 +
+ tools.Align(external_data_size, 4) +
+ len(U_BOOT_NODTB_DATA))
+
# The data should be outside the FIT
dtb = fdt.Fdt.FromData(fit_data)
dtb.Scan()
fnode = dtb.GetNode('/images/kernel')
self.assertNotIn('data', fnode.props)
+ self.assertEqual(len(U_BOOT_DATA),
+ fdt_util.fdt32_to_cpu(fnode.props['data-size'].value))
+ fit_pos = 0x400;
+ self.assertEqual(
+ fit_pos,
+ fdt_util.fdt32_to_cpu(fnode.props['data-position'].value))
+
+ self.assertEquals(expected_size, len(data))
+ actual_pos = len(U_BOOT_DATA) + fit_pos
+ self.assertEqual(U_BOOT_DATA + b'aa',
+ data[actual_pos:actual_pos + external_data_size])
def testSectionIgnoreHashSignature(self):
"""Test that sections ignore hash, signature nodes for its data"""
diff --git a/tools/binman/test/162_fit_external.dts b/tools/binman/test/162_fit_external.dts
index 19518e0..6f2a629 100644
--- a/tools/binman/test/162_fit_external.dts
+++ b/tools/binman/test/162_fit_external.dts
@@ -10,7 +10,7 @@
u-boot {
};
fit {
- fit,external-offset = <0>;
+ fit,external-offset = <0x400>;
description = "test-desc";
#address-cells = <1>;