From 03d5ef3063febbd316cce06a19d5650707b02941 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:30 -0700 Subject: binman: test: Move pack/layout test files to test/pack/ Move about 50 test files related to basic layout, packing, alignment, sections, and image structure into a pack/ subdirectory. Drop the numeric prefixes from the filenames and update all references in ftest.py, entry_test.py, and binman_tests.rst Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- doc/develop/binman_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/binman_tests.rst b/doc/develop/binman_tests.rst index 5e44686b8ad..745ca259d44 100644 --- a/doc/develop/binman_tests.rst +++ b/doc/develop/binman_tests.rst @@ -331,7 +331,7 @@ Here is a simple test: def testSimple(self): """Test a simple binman with a single file""" - data = self._DoReadFile('005_simple.dts') + data = self._DoReadFile('pack/simple.dts') self.assertEqual(U_BOOT_DATA, data) This test tells Binman to build an image using the description. Then it checks -- cgit v1.2.3 From b405930c8b7de15b55fe9a843a85606506222f67 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:38 -0700 Subject: binman: test: Move ChromeOS test files to test/cros/ Move about 10 test files for ChromeOS entries (GBB, vblock, FMAP) into a cros/ subdirectory. Drop the numeric prefixes and update all references. Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- doc/develop/binman_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/binman_tests.rst b/doc/develop/binman_tests.rst index 745ca259d44..c7fa9ae6199 100644 --- a/doc/develop/binman_tests.rst +++ b/doc/develop/binman_tests.rst @@ -436,7 +436,7 @@ correct. You can to this with ``terminal.capture()``, for example: .. code-block:: python with terminal.capture() as (_, stderr): - self._DoTestFile('071_gbb.dts', force_missing_bintools='futility', + self._DoTestFile('cros/gbb.dts', force_missing_bintools='futility', entry_args=entry_args) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: futility") -- cgit v1.2.3 From 9c17d547c46866a168b2df38a2aa24d0f28e971e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:42 -0700 Subject: binman: test: Move vendor-specific test files to test/vendor/ Move about 20 test files for vendor-specific platform support (TI, NXP i.MX, Renesas R-Car, Rockchip, PowerPC MPC85xx) into a vendor/ subdirectory. Drop the numeric prefixes and update all references. Signed-off-by: Simon Glass --- doc/develop/binman_tests.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/develop') diff --git a/doc/develop/binman_tests.rst b/doc/develop/binman_tests.rst index c7fa9ae6199..3be7d43cd3f 100644 --- a/doc/develop/binman_tests.rst +++ b/doc/develop/binman_tests.rst @@ -457,7 +457,7 @@ can, which contains the new etype. Put it in a numbered file in ``tool/binman/test`` so that it comes last. All the numbers are unique and there are no gaps. -Example from ``tools/binman/test/339_nxp_imx8.dts``: +Example from ``tools/binman/test/vendor/nxp_imx8.dts``: .. code-block:: devicetree @@ -493,7 +493,7 @@ Then create your test by adding a new function at the end of ``ftest.py``: def testNxpImx8Image(self): """Test that binman can produce an iMX8 image""" - self._DoTestFile('339_nxp_imx8.dts') + self._DoTestFile('vendor/nxp_imx8.dts') This uses the test file that you created. It doesn't check anything, it just runs the image description through binman. @@ -517,7 +517,7 @@ The next step is to update it to actually check the output: def testNxpImx8Image(self): """Test that binman can produce an iMX8 image""" - data = self._DoReadFile('339_nxp_imx8.dts') + data = self._DoReadFile('vendor/nxp_imx8.dts') print('data', len(data)) The ``_DoReadFile()`` function is documented in the code. It returns the image @@ -573,7 +573,7 @@ In the above example, here are some possible steps: def testNxpImx8ImageMkimageMissing(self): """Test that binman can produce an iMX8 image""" with terminal.capture() as (_, stderr): - self._DoTestFile('339_nxp_imx8.dts', + self._DoTestFile('vendor/nxp_imx8.dts', force_missing_bintools='mkimage') err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage") @@ -610,7 +610,7 @@ In the above example, here are some possible steps: Entry_section.SetImagePos(self, image_pos) - The solution is to add an entry, e.g. in ``340_nxp_imx8_non_empty.dts``: + The solution is to add an entry, e.g. in ``vendor/nxp_imx8_non_empty.dts``: .. code-block:: devicetree @@ -641,7 +641,7 @@ In the above example, here are some possible steps: def testNxpImx8ImageNonEmpty(self): """Test that binman can produce an iMX8 image with something in it""" - data = self._DoReadFile('340_nxp_imx8_non_empty.dts') + data = self._DoReadFile('vendor/nxp_imx8_non_empty.dts') # check data here With that, the second red bit goes away, because the for() loop is now used. -- cgit v1.2.3 From 1b044493e5d90c07ea2a3158c0e0e6a966a27890 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:44 -0700 Subject: binman: test: Move remaining test files to test/entry/ Move the remaining 60 or so test files into an entry/ subdirectory. These cover general entry types and features: entry args, fill, text, env, compress, replace, template, collection, ELF, overlap, listing, sections, symlink, TEE OS, and other miscellaneous entries. Drop the numeric prefixes and update all references. Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- doc/develop/binman_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/binman_tests.rst b/doc/develop/binman_tests.rst index 3be7d43cd3f..74a2d0e8ef2 100644 --- a/doc/develop/binman_tests.rst +++ b/doc/develop/binman_tests.rst @@ -402,7 +402,7 @@ Another type of test is one which checks error-handling, for example: def testFillNoSize(self): """Test for an fill entry type with no size""" with self.assertRaises(ValueError) as e: - self._DoReadFile('070_fill_no_size.dts') + self._DoReadFile('entry/fill_no_size.dts') self.assertIn("'fill' entry is missing properties: size", str(e.exception)) -- cgit v1.2.3 From 4d17632b9a2866695a312e049f94aa386145bafa Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Mar 2026 11:12:51 -0700 Subject: binman: doc: Update binman_tests.rst for subdirectory layout Update the guidance for adding new tests to describe the subdirectory structure instead of the numbering scheme. Signed-off-by: Simon Glass --- doc/develop/binman_tests.rst | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'doc/develop') diff --git a/doc/develop/binman_tests.rst b/doc/develop/binman_tests.rst index 74a2d0e8ef2..40865912911 100644 --- a/doc/develop/binman_tests.rst +++ b/doc/develop/binman_tests.rst @@ -453,31 +453,15 @@ help with this, but your code will be different. Generally you are adding a test because you are adding a new entry type ('etype'). So start by creating the shortest and simplest image-description you -can, which contains the new etype. Put it in a numbered file in -``tool/binman/test`` so that it comes last. All the numbers are unique and there -are no gaps. +can, which contains the new etype. Put it under ``tools/binman/test`` in the +appropriate subdirectory (e.g. ``fit/`` for FIT image tests, ``vendor/`` for +vendor-specific tests, ``entry/`` for general entry types) with a descriptive +filename. Example from ``tools/binman/test/vendor/nxp_imx8.dts``: -.. code-block:: devicetree - - // SPDX-License-Identifier: GPL-2.0+ - - /dts-v1/; - - / { - #address-cells = <1>; - #size-cells = <1>; - - binman { - nxp-imx8mimage { - args; /* TODO: Needed by mkimage etype superclass */ - nxp,boot-from = "sd"; - nxp,rom-version = <1>; - nxp,loader-address = <0x10>; - }; - }; - }; +.. literalinclude:: ../../tools/binman/test/vendor/nxp_imx8.dts + :language: devicetree Note that you should use tabs in the file, not spaces. You can see that this has been cut down to the bare minimum, just enough to include the etype and the -- cgit v1.2.3 From 02673659e81391729792ebc1b816d974de3c9abf Mon Sep 17 00:00:00 2001 From: Kory Maincent Date: Mon, 23 Feb 2026 14:18:39 +0100 Subject: tools: Add support for fwumdata tool Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file. Signed-off-by: Kory Maincent Tested-by: Dario Binacchi Signed-off-by: Ilias Apalodimas --- doc/develop/uefi/fwu_updates.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/develop') diff --git a/doc/develop/uefi/fwu_updates.rst b/doc/develop/uefi/fwu_updates.rst index 84713581459..c592106f8a8 100644 --- a/doc/develop/uefi/fwu_updates.rst +++ b/doc/develop/uefi/fwu_updates.rst @@ -66,7 +66,9 @@ FWU Metadata U-Boot supports both versions(1 and 2) of the FWU metadata defined in the two revisions of the specification. Support can be enabled for either of the two versions through a config flag. The mkfwumdata tool -can generate metadata for both the supported versions. +can generate metadata for both the supported versions. On the target side, +the fwumdata tool can read and update FWU metadata located in memory, +similarly to how fw_printenv/fw_setenv works. Setting up the device for GPT partitioned storage ------------------------------------------------- -- cgit v1.2.3