summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-08-13 11:40:50 -0600
committerSimon Glass <sjg@chromium.org>2022-08-20 18:07:32 -0600
commitd626e825f5d45ca543999340428a5a809024b0db (patch)
treeb2d03be426e039bee37c16b832e33c42ba72ba63 /tools/binman/ftest.py
parent9db9e932c79b653e81d5e11241b8f20e8fd61bdd (diff)
binman: Allow collection to use entries from other sections
At present the collections etype only works with entries in the same section. This can be limiting, since in some cases the data may be inside a subsection, e.g. if there are alignment constraints. Add a function to find the entries in an etype and have it search recursively. Make use of this for mkimage also. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 9b10fd8698d..737dbcc2466 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -5773,6 +5773,20 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
self.assertIn('Cannot use both imagename node and data-to-imagename',
str(exc.exception))
+ def testCollectionOther(self):
+ """Test a collection where the data comes from another section"""
+ data = self._DoReadFile('239_collection_other.dts')
+ self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA +
+ tools.get_bytes(0xff, 2) + U_BOOT_NODTB_DATA +
+ tools.get_bytes(0xfe, 3) + U_BOOT_DTB_DATA,
+ data)
+
+ def testMkimageCollection(self):
+ """Test using a collection referring to an entry in a mkimage entry"""
+ data = self._DoReadFile('240_mkimage_coll.dts')
+ expect = U_BOOT_SPL_DATA + U_BOOT_DATA
+ self.assertEqual(expect, data[:len(expect)])
+
if __name__ == "__main__":
unittest.main()