binman: Add support for a cros_ec image
Add an entry type which can hold a Chrome OS EC.
To make this work a new entry type is created, which supports getting a
blob filename from the command line.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index bd4de4e..5428ee6 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -46,6 +46,8 @@
TEXT_DATA = 'text'
TEXT_DATA2 = 'text2'
TEXT_DATA3 = 'text3'
+CROS_EC_RW_DATA = 'ecrw'
+
class TestFunctional(unittest.TestCase):
"""Functional tests for binman
@@ -92,6 +94,7 @@
TestFunctional._MakeInputFile('cmc.bin', CMC_DATA)
TestFunctional._MakeInputFile('vbt.bin', VBT_DATA)
TestFunctional._MakeInputFile('mrc.bin', MRC_DATA)
+ TestFunctional._MakeInputFile('ecrw.bin', CROS_EC_RW_DATA)
self._output_setup = False
# ELF file with a '_dt_ucode_base_size' symbol
@@ -1224,6 +1227,14 @@
fmap_util.FMAP_AREA_LEN * 3, fentries[2].size)
self.assertEqual('FMAP', fentries[2].name)
+ def testBlobNamedByArg(self):
+ """Test we can add a blob with the filename coming from an entry arg"""
+ entry_args = {
+ 'cros-ec-rw-path': 'ecrw.bin',
+ }
+ data, _, _, _ = self._DoReadFileDtb('68_blob_named_by_arg.dts',
+ entry_args=entry_args)
+
if __name__ == "__main__":
unittest.main()