All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script
@ 2023-01-07 21:07 Simon Glass
  2023-01-07 21:07 ` [PATCH v9 01/14] binman: Allow writing section contents to a file Simon Glass
                   ` (15 more replies)
  0 siblings, 16 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

At present rockchip 64-bit boards make use of a FIT-generator script
written in Python. The script supports splitting an ELF file into several
'loadable' nodes in the FIT. Binman does not current support this feature.

This series adds binman support for ELF splitting. This works by adding a
new 'fit,operation' property to the FIT subnodes, allowing this new way of
generating nodes.

It also provides support for optional entries, by allowing them to be
marked absent when the contents are obtained.

Some other fixes and improvements are needed along the way.

A new, common binman description is added for 64-bit boards which includes
the required u-boot.itb file.

The existing script is removed, so that only a few zynq boards are now
using a SPL_FIT_GENERATOR script:

   avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0
   xilinx_zynqmp_virt

Migration of those is hopefully in progress.

Note however that tools/k3_fit_atf.sh remains, used by a few boards that
enable CONFIG_TI_SECURE_DEVICE so this series is copied there too:

    am335x_hs_evm
    am335x_hs_evm_uart
    am43xx_hs_evm
    am57xx_hs_evm
    am57xx_hs_evm_usb
    am65x_hs_evm_a53
    am65x_hs_evm_r5
    dra7xx_hs_evm
    dra7xx_hs_evm_usb
    j721e_hs_evm_a72
    j721e_hs_evm_r5
    k2e_hs_evm
    k2g_hs_evm
    k2hk_hs_evm
    k2l_hs_evm

Ivan Mikhaylov has sent a patch to help with these, but I need to take a
look at the testing side. In any case they should really be using binman
for the image generation.

This series is available at u-boot-dm/fit-working

Changes in v9:
- Add new patch to use a reference for binman symbols docs
- Drop unnecessary import and fully qualified symbol
- Update msc_sm2s_imx8mp also

Changes in v8:
- Fix 'anb', 'provide' and 'second'  typos
- Don't silence the return code from tee_os.ObtainContents()
- Rename is_optee_bin()
- Improve various comments
- Move support for optional external blobs into this series
- Support optional FIT images
- Make OP-TEE image optional
- Specify an entry address for U-Boot

Changes in v7:
- Correct an rST formatting error
- Correct missing test coverage

Changes in v6:
- Add new patch to update entry docs
- Update op-tee to support new v1 binary header
- Add new patch to disable USE_SPL_FIT_GENERATOR by default
- Add new patch to allow a binman entry to be marked absent

Changes in v5:
- Update commit message to mention using parts of one image in another
- Rename from 'Include binman script in 64-bit boards'
- Drop duplicate #include in rk3368-u-boot.dtsi
- Keep the name as fit for puma
- Drop redundant check for CONFIG_ROCKCHIP_SPI_IMAGE
- Drop imply of BINMAN in Kconfig (rely on ARCH_ROCKCHIP instead)
- Rename blob to fit for puma and also SPI image

Changes in v3:
- Add an offset to the FIT description
- Add support for writing sections in binman
- Rebase to master

Changes in v2:
- Rename op-tee to tee-os
- Drop use of .itb2
- Drop patches previously applied
- Add various suggestions from Alper Nebi Yasak
- Add patches to refactor binman's FIT support

Simon Glass (14):
  binman: Allow writing section contents to a file
  binman: Tidy up comment in fit _gen_node
  binman: Update entry docs
  binman: Use a reference for binman symbols docs
  binman: Support optional entries
  binman: Add a way to check for a valid ELF file
  binman: Support new op-tee binary format
  binman: Support optional external blobs
  rockchip: evb-rk3288: Drop raw-image support
  rockchip: Use multiple-images for rk3399
  rockchip: Support building the all output files in binman
  rockchip: Convert all boards to use binman
  rockchip: Drop the FIT generator script
  treewide: Disable USE_SPL_FIT_GENERATOR by default

 Makefile                                      |  11 +-
 arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi   |   4 +-
 arch/arm/dts/rk3399-u-boot.dtsi               |   3 +-
 arch/arm/dts/rockchip-u-boot.dtsi             |  78 ++++-
 arch/arm/mach-rockchip/make_fit_atf.py        | 267 ------------------
 boot/Kconfig                                  |   6 +-
 configs/am335x_evm_defconfig                  |   1 -
 configs/am335x_hs_evm_defconfig               |   1 -
 configs/am335x_hs_evm_uart_defconfig          |   1 -
 configs/am43xx_evm_defconfig                  |   1 -
 configs/am43xx_evm_rtconly_defconfig          |   1 -
 configs/am43xx_evm_usbhost_boot_defconfig     |   1 -
 configs/am43xx_hs_evm_defconfig               |   1 -
 configs/am57xx_evm_defconfig                  |   1 -
 configs/am57xx_hs_evm_defconfig               |   1 -
 configs/am57xx_hs_evm_usb_defconfig           |   1 -
 configs/am65x_evm_a53_defconfig               |   1 -
 configs/am65x_evm_r5_defconfig                |   1 -
 configs/am65x_hs_evm_a53_defconfig            |   1 -
 configs/am65x_hs_evm_r5_defconfig             |   1 -
 ...edev_cc_v1_0_ultrazedev_som_v1_0_defconfig |   1 +
 configs/cgtqmx8_defconfig                     |   1 -
 configs/chromebook_link64_defconfig           |   1 -
 configs/dh_imx6_defconfig                     |   1 -
 configs/display5_defconfig                    |   1 -
 configs/display5_factory_defconfig            |   1 -
 configs/dra7xx_evm_defconfig                  |   1 -
 configs/dra7xx_hs_evm_defconfig               |   1 -
 configs/dra7xx_hs_evm_usb_defconfig           |   1 -
 configs/evb-ast2600_defconfig                 |   1 -
 configs/evb-rk3229_defconfig                  |   1 -
 configs/evb-rk3288_defconfig                  |   2 +-
 configs/gwventana_emmc_defconfig              |   1 -
 configs/gwventana_gw5904_defconfig            |   1 -
 configs/gwventana_nand_defconfig              |   1 -
 configs/imx6qdl_icore_mipi_defconfig          |   1 -
 configs/imx6qdl_icore_mmc_defconfig           |   1 -
 configs/imx6qdl_icore_rqs_defconfig           |   1 -
 configs/imx8mm-cl-iot-gate-optee_defconfig    |   1 -
 configs/imx8mm-cl-iot-gate_defconfig          |   1 -
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig  |   1 -
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig |   1 -
 configs/imx8mm-mx8menlo_defconfig             |   1 -
 configs/imx8mm_beacon_defconfig               |   1 -
 configs/imx8mm_data_modul_edm_sbc_defconfig   |   1 -
 configs/imx8mm_evk_defconfig                  |   1 -
 configs/imx8mm_evk_fspi_defconfig             |   1 -
 configs/imx8mm_venice_defconfig               |   1 -
 configs/imx8mn_beacon_2g_defconfig            |   1 -
 configs/imx8mn_beacon_defconfig               |   1 -
 configs/imx8mn_bsh_smm_s2_defconfig           |   1 -
 configs/imx8mn_bsh_smm_s2pro_defconfig        |   1 -
 configs/imx8mn_ddr4_evk_defconfig             |   1 -
 configs/imx8mn_evk_defconfig                  |   1 -
 configs/imx8mn_var_som_defconfig              |   1 -
 configs/imx8mn_venice_defconfig               |   1 -
 configs/imx8mp-icore-mx8mp-edimm2.2_defconfig |   1 -
 configs/imx8mp_dhcom_pdk2_defconfig           |   1 -
 configs/imx8mp_evk_defconfig                  |   1 -
 configs/imx8mp_rsb3720a1_4G_defconfig         |   1 -
 configs/imx8mp_rsb3720a1_6G_defconfig         |   1 -
 configs/imx8mp_venice_defconfig               |   1 -
 configs/imx8mq_cm_defconfig                   |   1 -
 configs/imx8mq_evk_defconfig                  |   1 -
 configs/imx8mq_phanbell_defconfig             |   1 -
 configs/imx8qm_rom7720_a1_4G_defconfig        |   1 -
 configs/iot2050_defconfig                     |   1 -
 configs/j7200_evm_a72_defconfig               |   1 -
 configs/j7200_evm_r5_defconfig                |   1 -
 configs/j7200_hs_evm_a72_defconfig            |   1 -
 configs/j7200_hs_evm_r5_defconfig             |   1 -
 configs/j721e_evm_a72_defconfig               |   1 -
 configs/j721e_evm_r5_defconfig                |   1 -
 configs/j721e_hs_evm_a72_defconfig            |   1 -
 configs/j721e_hs_evm_r5_defconfig             |   1 -
 configs/j721s2_evm_a72_defconfig              |   1 -
 configs/j721s2_evm_r5_defconfig               |   1 -
 configs/j721s2_hs_evm_a72_defconfig           |   1 -
 configs/j721s2_hs_evm_r5_defconfig            |   1 -
 configs/kontron-sl-mx6ul_defconfig            |   1 -
 configs/kontron-sl-mx8mm_defconfig            |   1 -
 configs/kontron_pitx_imx8m_defconfig          |   1 -
 configs/kontron_sl28_defconfig                |   1 -
 configs/librem5_defconfig                     |   1 -
 configs/ls1046ardb_qspi_spl_defconfig         |   1 -
 configs/mccmon6_nor_defconfig                 |   1 -
 configs/mccmon6_sd_defconfig                  |   1 -
 configs/msc_sm2s_imx8mp_defconfig             |   1 -
 configs/mx6sabreauto_defconfig                |   1 -
 configs/mx6sabresd_defconfig                  |   1 -
 configs/phycore-imx8mm_defconfig              |   1 -
 configs/phycore-imx8mp_defconfig              |   1 -
 configs/pico-imx6_defconfig                   |   1 -
 configs/pico-imx8mq_defconfig                 |   1 -
 configs/qemu-x86_64_defconfig                 |   1 -
 configs/sandbox_noinst_defconfig              |   1 -
 configs/sandbox_spl_defconfig                 |   1 -
 configs/sandbox_vpl_defconfig                 |   1 -
 configs/socfpga_agilex_atf_defconfig          |   1 -
 configs/socfpga_agilex_vab_defconfig          |   1 -
 configs/socfpga_arria10_defconfig             |   1 -
 configs/socfpga_chameleonv3_defconfig         |   1 -
 configs/socfpga_n5x_atf_defconfig             |   1 -
 configs/socfpga_n5x_vab_defconfig             |   1 -
 configs/socfpga_stratix10_atf_defconfig       |   1 -
 configs/stm32mp15_dhcom_basic_defconfig       |   1 -
 configs/stm32mp15_dhcor_basic_defconfig       |   1 -
 configs/verdin-imx8mm_defconfig               |   1 -
 configs/verdin-imx8mp_defconfig               |   1 -
 configs/wandboard_defconfig                   |   1 -
 configs/xilinx_zynq_virt_defconfig            |   1 -
 configs/xilinx_zynqmp_virt_defconfig          |   1 +
 tools/binman/binman.rst                       |  37 +++
 tools/binman/control.py                       |  12 +
 tools/binman/elf.py                           |  15 +
 tools/binman/elf_test.py                      |  10 +
 tools/binman/entries.rst                      | 224 ++++++++++++---
 tools/binman/entry.py                         |  47 ++-
 tools/binman/etype/_testing.py                |   3 +
 tools/binman/etype/blob.py                    |   2 +-
 tools/binman/etype/fit.py                     |  99 ++++---
 tools/binman/etype/mkimage.py                 |  28 +-
 tools/binman/etype/section.py                 |  42 ++-
 tools/binman/etype/tee_os.py                  |  76 ++++-
 tools/binman/etype/u_boot.py                  |   6 +-
 tools/binman/etype/u_boot_spl.py              |   4 +-
 tools/binman/etype/u_boot_spl_nodtb.py        |   4 +-
 tools/binman/etype/u_boot_tpl.py              |   4 +-
 tools/binman/etype/u_boot_tpl_nodtb.py        |   4 +-
 tools/binman/etype/u_boot_vpl.py              |   4 +-
 tools/binman/etype/u_boot_vpl_nodtb.py        |   6 +-
 tools/binman/ftest.py                         | 112 ++++++++
 tools/binman/image.py                         |   3 -
 tools/binman/test/261_section_fname.dts       |  29 ++
 tools/binman/test/262_absent.dts              |  20 ++
 tools/binman/test/263_tee_os_opt.dts          |  22 ++
 tools/binman/test/264_tee_os_opt_fit.dts      |  33 +++
 tools/binman/test/265_tee_os_opt_fit_bad.dts  |  40 +++
 tools/binman/test/266_blob_ext_opt.dts        |  21 ++
 139 files changed, 865 insertions(+), 518 deletions(-)
 delete mode 100755 arch/arm/mach-rockchip/make_fit_atf.py
 create mode 100644 tools/binman/test/261_section_fname.dts
 create mode 100644 tools/binman/test/262_absent.dts
 create mode 100644 tools/binman/test/263_tee_os_opt.dts
 create mode 100644 tools/binman/test/264_tee_os_opt_fit.dts
 create mode 100644 tools/binman/test/265_tee_os_opt_fit_bad.dts
 create mode 100644 tools/binman/test/266_blob_ext_opt.dts

-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v9 01/14] binman: Allow writing section contents to a file
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 02/14] binman: Tidy up comment in fit _gen_node Simon Glass
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

At present only the image (which is a section) has a filename. Move this
implementation to the entry_Section class so that any section can have a
filename. With this, the section data is written to a file.

This allows parts of an image to be written, along with the entire image.

Make a note that this can be used to include the contents of a section in
one image in another (later) image.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v5)

Changes in v5:
- Update commit message to mention using parts of one image in another

 tools/binman/binman.rst                 |  5 +++++
 tools/binman/etype/section.py           | 12 +++++++++-
 tools/binman/ftest.py                   | 14 ++++++++++++
 tools/binman/image.py                   |  3 ---
 tools/binman/test/261_section_fname.dts | 29 +++++++++++++++++++++++++
 5 files changed, 59 insertions(+), 4 deletions(-)
 create mode 100644 tools/binman/test/261_section_fname.dts

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 69e4b00239c..2899e1c7833 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -836,6 +836,11 @@ name-prefix:
     renamed to 'ro-u-boot' and 'rw-u-boot'. This can be useful to
     distinguish binaries with otherwise identical names.
 
+filename:
+    This allows the contents of the section to be written to a file in the
+    output directory. This can sometimes be useful to use the data in one
+    section in different image, since there is currently no way to share data
+    beteen images other than through files.
 
 Image Properties
 ----------------
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index da561e2bcc7..305155c8461 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -144,6 +144,10 @@ class Entry_section(Entry):
         be written at offset 4 in the image file, since the first 16 bytes are
         skipped when writing.
 
+    filename
+        filename to write the unpadded section contents to within the output
+        directory (None to skip this).
+
     Since a section is also an entry, it inherits all the properies of entries
     too.
 
@@ -163,6 +167,7 @@ class Entry_section(Entry):
         self._skip_at_start = None
         self._end_4gb = False
         self._ignore_missing = False
+        self._filename = None
 
     def ReadNode(self):
         """Read properties from the section node"""
@@ -183,6 +188,8 @@ class Entry_section(Entry):
                 self._skip_at_start = 0
         self._name_prefix = fdt_util.GetString(self._node, 'name-prefix')
         self.align_default = fdt_util.GetInt(self._node, 'align-default', 0)
+        self._filename = fdt_util.GetString(self._node, 'filename',
+                                            self._filename)
 
         self.ReadEntries()
 
@@ -348,7 +355,8 @@ class Entry_section(Entry):
         """Get the contents of an entry
 
         This builds the contents of the section, stores this as the contents of
-        the section and returns it
+        the section and returns it. If the section has a filename, the data is
+        written there also.
 
         Args:
             required: True if the data must be present, False if it is OK to
@@ -363,6 +371,8 @@ class Entry_section(Entry):
         if data is None:
             return None
         self.SetContents(data)
+        if self._filename:
+            tools.write_file(tools.get_output_filename(self._filename), data)
         return data
 
     def GetOffsets(self):
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 62ee86b9b75..c3cb32dca26 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6077,5 +6077,19 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
             'Cannot write symbols to an ELF file without Python elftools',
             str(exc.exception))
 
+    def testSectionFilename(self):
+        """Check writing of section contents to a file"""
+        data = self._DoReadFile('261_section_fname.dts')
+        expected = (b'&&' + U_BOOT_DATA + b'&&&' +
+                    tools.get_bytes(ord('!'), 7) +
+                    U_BOOT_DATA + tools.get_bytes(ord('&'), 12))
+        self.assertEqual(expected, data)
+
+        sect_fname = tools.get_output_filename('outfile.bin')
+        self.assertTrue(os.path.exists(sect_fname))
+        sect_data = tools.read_file(sect_fname)
+        self.assertEqual(U_BOOT_DATA, sect_data)
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/image.py b/tools/binman/image.py
index 6d4bff58436..b84dd21e22a 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -94,9 +94,6 @@ class Image(section.Entry_section):
 
     def ReadNode(self):
         super().ReadNode()
-        filename = fdt_util.GetString(self._node, 'filename')
-        if filename:
-            self._filename = filename
         self.allow_repack = fdt_util.GetBool(self._node, 'allow-repack')
         self._symlink = fdt_util.GetString(self._node, 'symlink')
 
diff --git a/tools/binman/test/261_section_fname.dts b/tools/binman/test/261_section_fname.dts
new file mode 100644
index 00000000000..790381e7301
--- /dev/null
+++ b/tools/binman/test/261_section_fname.dts
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		pad-byte = <0x26>;
+		size = <0x20>;
+		section@0 {
+			size = <0x10>;
+			pad-byte = <0x21>;
+			pad-before = <2>;
+			pad-after = <3>;
+
+			section {
+				filename = "outfile.bin";
+				u-boot {
+				};
+			};
+		};
+		section@1 {
+			u-boot {
+			};
+		};
+	};
+};
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 02/14] binman: Tidy up comment in fit _gen_node
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
  2023-01-07 21:07 ` [PATCH v9 01/14] binman: Allow writing section contents to a file Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 03/14] binman: Update entry docs Simon Glass
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Expand this comment to cover both cases that are supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/etype/fit.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index 7860e2aeea3..8ad4f3a8a83 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -579,11 +579,17 @@ class Entry_fit(Entry_section):
         def _gen_node(base_node, node, depth, in_images, entry):
             """Generate nodes from a template
 
-            This creates one node for each member of self._fdts using the
-            provided template. If a property value contains 'NAME' it is
-            replaced with the filename of the FDT. If a property value contains
-            SEQ it is replaced with the node sequence number, where 1 is the
-            first.
+            This creates one or more nodes depending on the fit,operation being
+            used.
+
+            For OP_GEN_FDT_NODES it creates one node for each member of
+            self._fdts using the provided template. If a property value contains
+            'NAME' it is replaced with the filename of the FDT. If a property
+            value contains SEQ it is replaced with the node sequence number,
+            where 1 is the first.
+
+            For OP_SPLIT_ELF it emits one node for each section in the ELF file.
+            If the file is missing, nothing is generated.
 
             Args:
                 base_node (Node): Base Node of the FIT (with 'description'
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 03/14] binman: Update entry docs
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
  2023-01-07 21:07 ` [PATCH v9 01/14] binman: Allow writing section contents to a file Simon Glass
  2023-01-07 21:07 ` [PATCH v9 02/14] binman: Tidy up comment in fit _gen_node Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 04/14] binman: Use a reference for binman symbols docs Simon Glass
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

These have got out of data recently. Regenerate them.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v7)

Changes in v7:
- Correct an rST formatting error

Changes in v6:
- Add new patch to update entry docs

 tools/binman/entries.rst      | 171 ++++++++++++++++++++++++++++++----
 tools/binman/etype/mkimage.py |  28 +++---
 2 files changed, 169 insertions(+), 30 deletions(-)

diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index 3dc32db8a54..b2ce7960d3b 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -216,9 +216,9 @@ This is a blob containing a device tree. The contents of the blob are
 obtained from the list of available device-tree files, managed by the
 'state' module.
 
-Additional Properties / Entry arguments:
-    - prepend: Header type to use:
-        length: 32-bit length header
+Additional attributes:
+    prepend: Header used (e.g. 'length')
+
 
 
 .. _etype_blob_ext:
@@ -1178,11 +1178,13 @@ Properties / Entry arguments:
     - multiple-data-files: boolean to tell binman to pass all files as
       datafiles to mkimage instead of creating a temporary file the result
       of datafiles concatenation
+    - filename: filename of output binary generated by mkimage
 
 The data passed to mkimage via the -d flag is collected from subnodes of the
 mkimage node, e.g.::
 
     mkimage {
+        filename = "imximage.bin";
         args = "-n test -T imximage";
 
         u-boot-spl {
@@ -1190,13 +1192,14 @@ mkimage node, e.g.::
     };
 
 This calls mkimage to create an imximage with `u-boot-spl.bin` as the data
-file, which mkimage being called like this::
+file, with mkimage being called like this::
 
     mkimage -d <data_file> -n test -T imximage <output_file>
 
 The output from mkimage then becomes part of the image produced by
-binman. If you need to put mulitple things in the data file, you can use
-a section, or just multiple subnodes like this::
+binman but also is written into `imximage.bin` file. If you need to put
+multiple things in the data file, you can use a section, or just multiple
+subnodes like this::
 
     mkimage {
         args = "-n test -T imximage";
@@ -1208,17 +1211,20 @@ a section, or just multiple subnodes like this::
         };
     };
 
+Note that binman places the contents (here SPL and TPL) into a single file
+and passes that to mkimage using the -d option.
+
 To pass all datafiles untouched to mkimage::
 
     mkimage {
-        args = "-n rk3399 -T rkspi";
-        multiple-data-files;
+            args = "-n rk3399 -T rkspi";
+            multiple-data-files;
 
-        u-boot-tpl {
-        };
+            u-boot-tpl {
+            };
 
-        u-boot-spl {
-        };
+            u-boot-spl {
+            };
     };
 
 This calls mkimage to create a Rockchip RK3399-specific first stage
@@ -1242,17 +1248,17 @@ the 'data-to-imagename' property::
 
     mkimage {
         args = "-T imximage";
-        data-to-imagename';
+        data-to-imagename;
 
         u-boot-spl {
         };
     };
 
 That will pass the data to mkimage both as the data file (with -d) and as
-the image name (with -n).
-
+the image name (with -n). In both cases, a filename is passed as the
+argument, with the actual data being in that file.
 
-If need to pass different data in with -n, then use an imagename subnode::
+If need to pass different data in with -n, then use an `imagename` subnode::
 
     mkimage {
         args = "-T imximage";
@@ -1271,6 +1277,7 @@ This will pass in u-boot-spl as the input data and the .cfgout file as the
 -n data.
 
 
+
 .. _etype_opensbi:
 
 Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
@@ -1478,6 +1485,10 @@ skip-at-start
     be written at offset 4 in the image file, since the first 16 bytes are
     skipped when writing.
 
+filename
+    filename to write the unpadded section contents to within the output
+    directory (None to skip this).
+
 Since a section is also an entry, it inherits all the properies of entries
 too.
 
@@ -2034,6 +2045,134 @@ Entry types that have a part to play in handling microcode:
 
 
 
+.. _etype_u_boot_vpl:
+
+Entry: u-boot-vpl: U-Boot VPL binary
+------------------------------------
+
+Properties / Entry arguments:
+    - filename: Filename of u-boot-vpl.bin (default 'vpl/u-boot-vpl.bin')
+
+This is the U-Boot VPL (Verifying Program Loader) binary. This is a small
+binary which loads before SPL, typically into on-chip SRAM. It is
+responsible for locating, loading and jumping to SPL, the next-stage
+loader. Note that VPL is not relocatable so must be loaded to the correct
+address in SRAM, or written to run from the correct address if direct
+flash execution is possible (e.g. on x86 devices).
+
+SPL can access binman symbols at runtime. See:
+
+    'Access to binman entry offsets at run time (symbols)'
+
+in the binman README for more information.
+
+The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
+binman uses that to look up symbols to write into the VPL binary.
+
+
+
+.. _etype_u_boot_vpl_bss_pad:
+
+Entry: u-boot-vpl-bss-pad: U-Boot VPL binary padded with a BSS region
+---------------------------------------------------------------------
+
+Properties / Entry arguments:
+    None
+
+This holds the padding added after the VPL binary to cover the BSS (Block
+Started by Symbol) region. This region holds the various variables used by
+VPL. It is set to 0 by VPL when it starts up. If you want to append data to
+the VPL image (such as a device tree file), you must pad out the BSS region
+to avoid the data overlapping with U-Boot variables. This entry is useful in
+that case. It automatically pads out the entry size to cover both the code,
+data and BSS.
+
+The contents of this entry will a certain number of zero bytes, determined
+by __bss_size
+
+The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
+binman uses that to look up the BSS address.
+
+
+
+.. _etype_u_boot_vpl_dtb:
+
+Entry: u-boot-vpl-dtb: U-Boot VPL device tree
+---------------------------------------------
+
+Properties / Entry arguments:
+    - filename: Filename of u-boot.dtb (default 'vpl/u-boot-vpl.dtb')
+
+This is the VPL device tree, containing configuration information for
+VPL. VPL needs this to know what devices are present and which drivers
+to activate.
+
+
+
+.. _etype_u_boot_vpl_elf:
+
+Entry: u-boot-vpl-elf: U-Boot VPL ELF image
+-------------------------------------------
+
+Properties / Entry arguments:
+    - filename: Filename of VPL u-boot (default 'vpl/u-boot-vpl')
+
+This is the U-Boot VPL ELF image. It does not include a device tree but can
+be relocated to any address for execution.
+
+
+
+.. _etype_u_boot_vpl_expanded:
+
+Entry: u-boot-vpl-expanded: U-Boot VPL flat binary broken out into its component parts
+--------------------------------------------------------------------------------------
+
+Properties / Entry arguments:
+    - vpl-dtb: Controls whether this entry is selected (set to 'y' or '1' to
+        select)
+
+This is a section containing the U-Boot binary, BSS padding if needed and a
+devicetree. Using this entry type automatically creates this section, with
+the following entries in it:
+
+   u-boot-vpl-nodtb
+   u-boot-vpl-bss-pad
+   u-boot-dtb
+
+Having the devicetree separate allows binman to update it in the final
+image, so that the entries positions are provided to the running U-Boot.
+
+This entry is selected based on the value of the 'vpl-dtb' entryarg. If
+this is non-empty (and not 'n' or '0') then this expanded entry is selected.
+
+
+
+.. _etype_u_boot_vpl_nodtb:
+
+Entry: u-boot-vpl-nodtb: VPL binary without device tree appended
+----------------------------------------------------------------
+
+Properties / Entry arguments:
+    - filename: Filename to include (default 'vpl/u-boot-vpl-nodtb.bin')
+
+This is the U-Boot VPL binary, It does not include a device tree blob at
+the end of it so may not be able to work without it, assuming VPL needs
+a device tree to operate on your platform. You can add a u_boot_vpl_dtb
+entry after this one, or use a u_boot_vpl entry instead, which normally
+expands to a section containing u-boot-vpl-dtb, u-boot-vpl-bss-pad and
+u-boot-vpl-dtb
+
+VPL can access binman symbols at runtime. See:
+
+    'Access to binman entry offsets at run time (symbols)'
+
+in the binman README for more information.
+
+The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
+binman uses that to look up symbols to write into the VPL binary.
+
+
+
 .. _etype_u_boot_with_ucode_ptr:
 
 Entry: u-boot-with-ucode-ptr: U-Boot with embedded microcode pointer
diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index c2288c48eef..cb264c3cad0 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -57,24 +57,24 @@ class Entry_mkimage(Entry):
     Note that binman places the contents (here SPL and TPL) into a single file
     and passes that to mkimage using the -d option.
 
-	To pass all datafiles untouched to mkimage::
+    To pass all datafiles untouched to mkimage::
 
-		mkimage {
-			args = "-n rk3399 -T rkspi";
-			multiple-data-files;
+        mkimage {
+                args = "-n rk3399 -T rkspi";
+                multiple-data-files;
 
-			u-boot-tpl {
-			};
+                u-boot-tpl {
+                };
 
-			u-boot-spl {
-			};
-		};
+                u-boot-spl {
+                };
+        };
 
-	This calls mkimage to create a Rockchip RK3399-specific first stage
-	bootloader, made of TPL+SPL. Since this first stage bootloader requires to
-	align the TPL and SPL but also some weird hacks that is handled by mkimage
-	directly, binman is told to not perform the concatenation of datafiles prior
-	to passing the data to mkimage.
+    This calls mkimage to create a Rockchip RK3399-specific first stage
+    bootloader, made of TPL+SPL. Since this first stage bootloader requires to
+    align the TPL and SPL but also some weird hacks that is handled by mkimage
+    directly, binman is told to not perform the concatenation of datafiles prior
+    to passing the data to mkimage.
 
     To use CONFIG options in the arguments, use a string list instead, as in
     this example which also produces four arguments::
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 04/14] binman: Use a reference for binman symbols docs
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (2 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 03/14] binman: Update entry docs Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 05/14] binman: Support optional entries Simon Glass
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Several etypes have this reference in their documentation. Now that we are
using rST, link to the section directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---

Changes in v9:
- Add new patch to use a reference for binman symbols docs

 tools/binman/binman.rst                |  1 +
 tools/binman/entries.rst               | 32 ++++++--------------------
 tools/binman/etype/u_boot.py           |  6 +----
 tools/binman/etype/u_boot_spl.py       |  4 +---
 tools/binman/etype/u_boot_spl_nodtb.py |  4 +---
 tools/binman/etype/u_boot_tpl.py       |  4 +---
 tools/binman/etype/u_boot_tpl_nodtb.py |  4 +---
 tools/binman/etype/u_boot_vpl.py       |  4 +---
 tools/binman/etype/u_boot_vpl_nodtb.py |  6 +----
 9 files changed, 15 insertions(+), 50 deletions(-)

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 2899e1c7833..ef3e5a6d19b 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -487,6 +487,7 @@ For x86 devices (with the end-at-4gb property) this base address is not added
 since it is assumed that images are XIP and the offsets already include the
 address.
 
+.. _binman_fdt:
 
 Access to binman entry offsets at run time (fdt)
 ------------------------------------------------
diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index b2ce7960d3b..5b9eb8b82c7 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -1578,11 +1578,7 @@ This is the U-Boot binary, containing relocation information to allow it
 to relocate itself at runtime. The binary typically includes a device tree
 blob at the end of it.
 
-U-Boot can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (fdt)'
-
-in the binman README for more information.
+U-Boot can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 Note that this entry is automatically replaced with u-boot-expanded unless
 --no-expanded is used or the node has a 'no-expanded' property.
@@ -1712,9 +1708,7 @@ not relocatable so must be loaded to the correct address in SRAM, or written
 to run from the correct address if direct flash execution is possible (e.g.
 on x86 devices).
 
-SPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
+SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 in the binman README for more information.
 
@@ -1817,9 +1811,7 @@ entry after this one, or use a u-boot-spl entry instead' which normally
 expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
 u-boot-spl-dtb
 
-SPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
+SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 in the binman README for more information.
 
@@ -1855,9 +1847,7 @@ loader. Note that SPL is not relocatable so must be loaded to the correct
 address in SRAM, or written to run from the correct address if direct
 flash execution is possible (e.g. on x86 devices).
 
-SPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
+SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 in the binman README for more information.
 
@@ -1972,9 +1962,7 @@ entry after this one, or use a u-boot-tpl entry instead, which normally
 expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
 u-boot-tpl-dtb
 
-TPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
+TPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 in the binman README for more information.
 
@@ -2060,9 +2048,7 @@ loader. Note that VPL is not relocatable so must be loaded to the correct
 address in SRAM, or written to run from the correct address if direct
 flash execution is possible (e.g. on x86 devices).
 
-SPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
+SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 in the binman README for more information.
 
@@ -2162,11 +2148,7 @@ entry after this one, or use a u_boot_vpl entry instead, which normally
 expands to a section containing u-boot-vpl-dtb, u-boot-vpl-bss-pad and
 u-boot-vpl-dtb
 
-VPL can access binman symbols at runtime. See:
-
-    'Access to binman entry offsets at run time (symbols)'
-
-in the binman README for more information.
+VPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
 The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
 binman uses that to look up symbols to write into the VPL binary.
diff --git a/tools/binman/etype/u_boot.py b/tools/binman/etype/u_boot.py
index e8d180a46dd..d5639eef2e4 100644
--- a/tools/binman/etype/u_boot.py
+++ b/tools/binman/etype/u_boot.py
@@ -18,11 +18,7 @@ class Entry_u_boot(Entry_blob):
     to relocate itself at runtime. The binary typically includes a device tree
     blob at the end of it.
 
-    U-Boot can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (fdt)'
-
-    in the binman README for more information.
+    U-Boot can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     Note that this entry is automatically replaced with u-boot-expanded unless
     --no-expanded is used or the node has a 'no-expanded' property.
diff --git a/tools/binman/etype/u_boot_spl.py b/tools/binman/etype/u_boot_spl.py
index d1aa3b4fdad..be1610569fc 100644
--- a/tools/binman/etype/u_boot_spl.py
+++ b/tools/binman/etype/u_boot_spl.py
@@ -21,9 +21,7 @@ class Entry_u_boot_spl(Entry_blob):
     to run from the correct address if direct flash execution is possible (e.g.
     on x86 devices).
 
-    SPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
+    SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     in the binman README for more information.
 
diff --git a/tools/binman/etype/u_boot_spl_nodtb.py b/tools/binman/etype/u_boot_spl_nodtb.py
index 50a126dc7ef..e7ec329c902 100644
--- a/tools/binman/etype/u_boot_spl_nodtb.py
+++ b/tools/binman/etype/u_boot_spl_nodtb.py
@@ -21,9 +21,7 @@ class Entry_u_boot_spl_nodtb(Entry_blob):
     expands to a section containing u-boot-spl-dtb, u-boot-spl-bss-pad and
     u-boot-spl-dtb
 
-    SPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
+    SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     in the binman README for more information.
 
diff --git a/tools/binman/etype/u_boot_tpl.py b/tools/binman/etype/u_boot_tpl.py
index 1883a2bd5f1..397b9f89531 100644
--- a/tools/binman/etype/u_boot_tpl.py
+++ b/tools/binman/etype/u_boot_tpl.py
@@ -21,9 +21,7 @@ class Entry_u_boot_tpl(Entry_blob):
     address in SRAM, or written to run from the correct address if direct
     flash execution is possible (e.g. on x86 devices).
 
-    SPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
+    SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     in the binman README for more information.
 
diff --git a/tools/binman/etype/u_boot_tpl_nodtb.py b/tools/binman/etype/u_boot_tpl_nodtb.py
index 7e08e58f1e5..9bb2b5dda30 100644
--- a/tools/binman/etype/u_boot_tpl_nodtb.py
+++ b/tools/binman/etype/u_boot_tpl_nodtb.py
@@ -21,9 +21,7 @@ class Entry_u_boot_tpl_nodtb(Entry_blob):
     expands to a section containing u-boot-tpl-dtb, u-boot-tpl-bss-pad and
     u-boot-tpl-dtb
 
-    TPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
+    TPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     in the binman README for more information.
 
diff --git a/tools/binman/etype/u_boot_vpl.py b/tools/binman/etype/u_boot_vpl.py
index 62e5969c6ec..31d7e8374e2 100644
--- a/tools/binman/etype/u_boot_vpl.py
+++ b/tools/binman/etype/u_boot_vpl.py
@@ -21,9 +21,7 @@ class Entry_u_boot_vpl(Entry_blob):
     address in SRAM, or written to run from the correct address if direct
     flash execution is possible (e.g. on x86 devices).
 
-    SPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
+    SPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     in the binman README for more information.
 
diff --git a/tools/binman/etype/u_boot_vpl_nodtb.py b/tools/binman/etype/u_boot_vpl_nodtb.py
index db3d8a91c9b..64c2767488d 100644
--- a/tools/binman/etype/u_boot_vpl_nodtb.py
+++ b/tools/binman/etype/u_boot_vpl_nodtb.py
@@ -21,11 +21,7 @@ class Entry_u_boot_vpl_nodtb(Entry_blob):
     expands to a section containing u-boot-vpl-dtb, u-boot-vpl-bss-pad and
     u-boot-vpl-dtb
 
-    VPL can access binman symbols at runtime. See:
-
-        'Access to binman entry offsets at run time (symbols)'
-
-    in the binman README for more information.
+    VPL can access binman symbols at runtime. See :ref:`binman_fdt`.
 
     The ELF file 'vpl/u-boot-vpl' must also be available for this to work, since
     binman uses that to look up symbols to write into the VPL binary.
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 05/14] binman: Support optional entries
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (3 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 04/14] binman: Use a reference for binman symbols docs Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 06/14] binman: Add a way to check for a valid ELF file Simon Glass
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Support entries which can be optional depending on their contents. This
allows special entry types which appear in the image only when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/binman.rst          | 22 ++++++++++++++++++++++
 tools/binman/control.py          |  1 +
 tools/binman/entry.py            |  9 +++++++++
 tools/binman/etype/_testing.py   |  3 +++
 tools/binman/etype/section.py    |  7 +++++++
 tools/binman/ftest.py            |  5 +++++
 tools/binman/test/262_absent.dts | 20 ++++++++++++++++++++
 7 files changed, 67 insertions(+)
 create mode 100644 tools/binman/test/262_absent.dts

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index ef3e5a6d19b..5e3961f2255 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -1013,6 +1013,28 @@ For the BSS case, a 'spl-bss-pad' entry arg controls whether it is present. All
 entry args are provided by the U-Boot Makefile.
 
 
+Optional entries
+----------------
+
+Some entries need to exist only if certain conditions are met. For example, an
+entry may want to appear in the image only if a file has a particular format.
+Obviously the entry must exist in the image description for it to be processed
+at all, so a way needs to be found to have the entry remove itself.
+
+To handle this, when entry.ObtainContents() is called, the entry can call
+entry.mark_absent() to mark itself as absent, passing a suitable message as the
+reason.
+
+Any absent entries are dropped immediately after ObtainContents() has been
+called on all entries.
+
+It is not possible for an entry to mark itself absent at any other point in the
+processing. It must happen in the ObtainContents() method.
+
+The effect is as if the entry had never been present at all, since the image
+is packed without it and it disappears from the list of entries.
+
+
 Compression
 -----------
 
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 964c6984f9b..07225381146 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -552,6 +552,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
         image.SetAllowMissing(allow_missing)
         image.SetAllowFakeBlob(allow_fake_blobs)
         image.GetEntryContents()
+        image.drop_absent()
     image.GetEntryOffsets()
 
     # We need to pack the entries to figure out where everything
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 1be31a05e00..637aece3705 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -91,6 +91,10 @@ class Entry(object):
             file, or is a binary file produced from an ELF file
         auto_write_symbols (bool): True to write ELF symbols into this entry's
             contents
+        absent (bool): True if this entry is absent. This can be controlled by
+            the entry itself, allowing it to vanish in certain circumstances.
+            An absent entry is removed during processing so that it does not
+            appear in the map
     """
     fake_dir = None
 
@@ -133,6 +137,7 @@ class Entry(object):
         self.comp_bintool = None
         self.elf_fname = None
         self.auto_write_symbols = auto_write_symbols
+        self.absent = False
 
     @staticmethod
     def FindEntryClass(etype, expanded):
@@ -1281,3 +1286,7 @@ features to produce new behaviours.
                 not_present.append(prop)
         if not_present:
             self.Raise(f"'{self.etype}' entry is missing properties: {' '.join(not_present)}")
+
+    def mark_absent(self, msg):
+        tout.info("Entry '%s' marked absent: %s" % (self._node.path, msg))
+        self.absent = True
diff --git a/tools/binman/etype/_testing.py b/tools/binman/etype/_testing.py
index 69600487814..1c1efb21a44 100644
--- a/tools/binman/etype/_testing.py
+++ b/tools/binman/etype/_testing.py
@@ -63,6 +63,7 @@ class Entry__testing(Entry):
                                                     'bad-update-contents-twice')
         self.return_contents_later = fdt_util.GetBool(self._node,
                                                      'return-contents-later')
+        self.set_to_absent = fdt_util.GetBool(self._node, 'set-to-absent')
 
         # Set to True when the entry is ready to process the FDT.
         self.process_fdt_ready = False
@@ -119,6 +120,8 @@ class Entry__testing(Entry):
         if self.require_bintool_for_contents:
             if self.bintool_for_contents is None:
                 self.Raise("Required bintool unusable in ObtainContents()")
+        if self.set_to_absent:
+            self.mark_absent('for testing purposes')
         return True
 
     def GetOffsets(self):
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index 305155c8461..dcb7a062047 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -672,6 +672,9 @@ class Entry_section(Entry):
 
     def GetEntryContents(self, skip_entry=None):
         """Call ObtainContents() for each entry in the section
+
+        Note that this may set entry.absent to True if the entry is not
+        actually needed
         """
         def _CheckDone(entry):
             if entry != skip_entry:
@@ -716,6 +719,10 @@ class Entry_section(Entry):
                        todo)
         return True
 
+    def drop_absent(self):
+        """Drop entries which are absent"""
+        self._entries = {n: e for n, e in self._entries.items() if not e.absent}
+
     def _SetEntryOffsetSize(self, name, offset, size):
         """Set the offset and size of an entry
 
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index c3cb32dca26..f47a745f1e1 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6090,6 +6090,11 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
         sect_data = tools.read_file(sect_fname)
         self.assertEqual(U_BOOT_DATA, sect_data)
 
+    def testAbsent(self):
+        """Check handling of absent entries"""
+        data = self._DoReadFile('262_absent.dts')
+        self.assertEqual(U_BOOT_DATA + U_BOOT_IMG_DATA, data)
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/262_absent.dts b/tools/binman/test/262_absent.dts
new file mode 100644
index 00000000000..2ab8766c878
--- /dev/null
+++ b/tools/binman/test/262_absent.dts
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot {
+		};
+
+		_testing {
+			set-to-absent;
+		};
+
+		u-boot-img {
+		};
+	};
+};
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 06/14] binman: Add a way to check for a valid ELF file
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (4 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 05/14] binman: Support optional entries Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 07/14] binman: Support new op-tee binary format Simon Glass
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Add a function which checks whether data is in ELF format or not. This
will be used by binman to check this for entries.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v9:
- Drop unnecessary import and fully qualified symbol

 tools/binman/elf.py      | 15 +++++++++++++++
 tools/binman/elf_test.py | 10 ++++++++++
 2 files changed, 25 insertions(+)

diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index fe50bf542c3..73f318b81d2 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -518,3 +518,18 @@ def read_loadable_segments(data):
             rend = start + segment['p_filesz']
             segments.append((i, segment['p_paddr'], data[start:rend]))
     return segments, entry
+
+def is_valid(data):
+    """Check if some binary data is a valid ELF file
+
+    Args:
+        data (bytes): Bytes to check
+
+    Returns:
+        bool: True if a valid Elf file, False if not
+    """
+    try:
+        DecodeElf(data, 0)
+        return True
+    except ELFError:
+        return False
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py
index 75b867c2be8..082a3e1d28c 100644
--- a/tools/binman/elf_test.py
+++ b/tools/binman/elf_test.py
@@ -348,6 +348,16 @@ class TestElf(unittest.TestCase):
         finally:
             elf.ELF_TOOLS = old_val
 
+    def test_is_valid(self):
+        """Test is_valid()"""
+        self.assertEqual(False, elf.is_valid(b''))
+        self.assertEqual(False, elf.is_valid(b'1234'))
+
+        fname = self.ElfTestFile('elf_sections')
+        data = tools.read_file(fname)
+        self.assertEqual(True, elf.is_valid(data))
+        self.assertEqual(False, elf.is_valid(data[4:]))
+
 
 if __name__ == '__main__':
     unittest.main()
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 07/14] binman: Support new op-tee binary format
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (5 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 06/14] binman: Add a way to check for a valid ELF file Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

OP-TEE has a format with a binary header that can be used instead of the
ELF file. With newer versions of OP-TEE this may be required on some
platforms.

Add support for this in binman. First, add a method to obtain the ELF
sections from an entry, then use that in the FIT support. We then end up
with the ability to support both types of OP-TEE files, depending on which
one is passed in with the entry argument (TEE=xxx in the U-Boot build).

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v8)

Changes in v8:
- Fix 'anb', 'provide' and 'second'  typos
- Don't silence the return code from tee_os.ObtainContents()
- Rename is_optee_bin()
- Improve various comments

Changes in v7:
- Correct missing test coverage

Changes in v6:
- Update op-tee to support new v1 binary header

 tools/binman/entries.rst                     | 37 ++++++++-
 tools/binman/entry.py                        | 13 +++
 tools/binman/etype/fit.py                    | 72 +++++++++--------
 tools/binman/etype/section.py                |  9 +++
 tools/binman/etype/tee_os.py                 | 76 +++++++++++++++++-
 tools/binman/ftest.py                        | 83 ++++++++++++++++++++
 tools/binman/test/263_tee_os_opt.dts         | 22 ++++++
 tools/binman/test/264_tee_os_opt_fit.dts     | 33 ++++++++
 tools/binman/test/265_tee_os_opt_fit_bad.dts | 40 ++++++++++
 9 files changed, 352 insertions(+), 33 deletions(-)
 create mode 100644 tools/binman/test/263_tee_os_opt.dts
 create mode 100644 tools/binman/test/264_tee_os_opt_fit.dts
 create mode 100644 tools/binman/test/265_tee_os_opt_fit_bad.dts

diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index 5b9eb8b82c7..f6cc8003853 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -1508,12 +1508,47 @@ Entry: tee-os: Entry containing an OP-TEE Trusted OS (TEE) blob
 
 Properties / Entry arguments:
     - tee-os-path: Filename of file to read into entry. This is typically
-        called tee-pager.bin
+        called tee.bin or tee.elf
 
 This entry holds the run-time firmware, typically started by U-Boot SPL.
 See the U-Boot README for your architecture or board for how to use it. See
 https://github.com/OP-TEE/optee_os for more information about OP-TEE.
 
+Note that if the file is in ELF format, it must go in a FIT. In that case,
+this entry will mark itself as absent, providing the data only through the
+read_elf_segments() method.
+
+Marking this entry as absent means that it if is used in the wrong context
+it can be automatically dropped. Thus it is possible to add an OP-TEE entry
+like this::
+
+    binman {
+        tee-os {
+        };
+    };
+
+and pass either an ELF or plain binary in with -a tee-os-path <filename>
+and have binman do the right thing:
+
+   - include the entry if tee.bin is provided and it does NOT have the v1
+     header
+   - drop it otherwise
+
+When used within a FIT, we can do::
+
+    binman {
+        fit {
+            tee-os {
+            };
+        };
+    };
+
+which will split the ELF into separate nodes for each segment, if an ELF
+file is provided (see :ref:`etype_fit`), or produce a single node if the
+OP-TEE binary v1 format is provided (see optee_doc_) .
+
+.. _optee_doc: https://optee.readthedocs.io/en/latest/architecture/core.html#partitioning-of-the-binary
+
 
 
 .. _etype_text:
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 637aece3705..de51d295891 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -1290,3 +1290,16 @@ features to produce new behaviours.
     def mark_absent(self, msg):
         tout.info("Entry '%s' marked absent: %s" % (self._node.path, msg))
         self.absent = True
+
+    def read_elf_segments(self):
+        """Read segments from an entry that can generate an ELF file
+
+        Returns:
+            tuple:
+                list of segments, each:
+                    int: Segment number (0 = first)
+                    int: Start address of segment in memory
+                    bytes: Contents of segment
+                int: entry address of ELF file
+        """
+        return None
diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index 8ad4f3a8a83..fea3adcc68d 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -540,41 +540,35 @@ class Entry_fit(Entry_section):
                     else:
                         self.Raise("Generator node requires 'fit,fdt-list' property")
 
-        def _gen_split_elf(base_node, node, elf_data, missing):
+        def _gen_split_elf(base_node, node, segments, entry_addr):
             """Add nodes for the ELF file, one per group of contiguous segments
 
             Args:
                 base_node (Node): Template node from the binman definition
                 node (Node): Node to replace (in the FIT being built)
-                data (bytes): ELF-format data to process (may be empty)
-                missing (bool): True if any of the data is missing
-
+                segments (list): list of segments, each:
+                    int: Segment number (0 = first)
+                    int: Start address of segment in memory
+                    bytes: Contents of segment
+                entry_addr (int): entry address of ELF file
             """
-            # If any pieces are missing, skip this. The missing entries will
-            # show an error
-            if not missing:
-                try:
-                    segments, entry = elf.read_loadable_segments(elf_data)
-                except ValueError as exc:
-                    self._raise_subnode(node,
-                                        f'Failed to read ELF file: {str(exc)}')
-                for (seq, start, data) in segments:
-                    node_name = node.name[1:].replace('SEQ', str(seq + 1))
-                    with fsw.add_node(node_name):
-                        loadables.append(node_name)
-                        for pname, prop in node.props.items():
-                            if not pname.startswith('fit,'):
-                                fsw.property(pname, prop.bytes)
-                            elif pname == 'fit,load':
-                                fsw.property_u32('load', start)
-                            elif pname == 'fit,entry':
-                                if seq == 0:
-                                    fsw.property_u32('entry', entry)
-                            elif pname == 'fit,data':
-                                fsw.property('data', bytes(data))
-                            elif pname != 'fit,operation':
-                                self._raise_subnode(
-                                    node, f"Unknown directive '{pname}'")
+            for (seq, start, data) in segments:
+                node_name = node.name[1:].replace('SEQ', str(seq + 1))
+                with fsw.add_node(node_name):
+                    loadables.append(node_name)
+                    for pname, prop in node.props.items():
+                        if not pname.startswith('fit,'):
+                            fsw.property(pname, prop.bytes)
+                        elif pname == 'fit,load':
+                            fsw.property_u32('load', start)
+                        elif pname == 'fit,entry':
+                            if seq == 0:
+                                fsw.property_u32('entry', entry_addr)
+                        elif pname == 'fit,data':
+                            fsw.property('data', bytes(data))
+                        elif pname != 'fit,operation':
+                            self._raise_subnode(
+                                node, f"Unknown directive '{pname}'")
 
         def _gen_node(base_node, node, depth, in_images, entry):
             """Generate nodes from a template
@@ -598,6 +592,8 @@ class Entry_fit(Entry_section):
                 depth (int): Current node depth (0 is the base 'fit' node)
                 in_images (bool): True if this is inside the 'images' node, so
                     that 'data' properties should be generated
+                entry (entry_Section): Entry for the section containing the
+                    contents of this node
             """
             oper = self._get_operation(base_node, node)
             if oper == OP_GEN_FDT_NODES:
@@ -609,10 +605,24 @@ class Entry_fit(Entry_section):
                 missing_list = []
                 entry.ObtainContents()
                 entry.Pack(0)
-                data = entry.GetData()
                 entry.CheckMissing(missing_list)
 
-                _gen_split_elf(base_node, node, data, bool(missing_list))
+                # If any pieces are missing, skip this. The missing entries will
+                # show an error
+                if not missing_list:
+                    segs = entry.read_elf_segments()
+                    if segs:
+                        segments, entry_addr = segs
+                    else:
+                        elf_data = entry.GetData()
+                        try:
+                            segments, entry_addr = (
+                                    elf.read_loadable_segments(elf_data))
+                        except ValueError as exc:
+                            self._raise_subnode(
+                                node, f'Failed to read ELF file: {str(exc)}')
+
+                    _gen_split_elf(base_node, node, segments, entry_addr)
 
         def _add_node(base_node, depth, node):
             """Add nodes to the output FIT
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index dcb7a062047..57bfee0b286 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -948,3 +948,12 @@ class Entry_section(Entry):
         super().AddBintools(btools)
         for entry in self._entries.values():
             entry.AddBintools(btools)
+
+    def read_elf_segments(self):
+        entries = self.GetEntries()
+
+        # If the section only has one entry, see if it can provide ELF segments
+        if len(entries) == 1:
+            for entry in entries.values():
+                return entry.read_elf_segments()
+        return None
diff --git a/tools/binman/etype/tee_os.py b/tools/binman/etype/tee_os.py
index 6ce4b672de4..5529727e833 100644
--- a/tools/binman/etype/tee_os.py
+++ b/tools/binman/etype/tee_os.py
@@ -4,19 +4,93 @@
 # Entry-type module for OP-TEE Trusted OS firmware blob
 #
 
+import struct
+
 from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
+from binman import elf
 
 class Entry_tee_os(Entry_blob_named_by_arg):
     """Entry containing an OP-TEE Trusted OS (TEE) blob
 
     Properties / Entry arguments:
         - tee-os-path: Filename of file to read into entry. This is typically
-            called tee-pager.bin
+            called tee.bin or tee.elf
 
     This entry holds the run-time firmware, typically started by U-Boot SPL.
     See the U-Boot README for your architecture or board for how to use it. See
     https://github.com/OP-TEE/optee_os for more information about OP-TEE.
+
+    Note that if the file is in ELF format, it must go in a FIT. In that case,
+    this entry will mark itself as absent, providing the data only through the
+    read_elf_segments() method.
+
+    Marking this entry as absent means that it if is used in the wrong context
+    it can be automatically dropped. Thus it is possible to add an OP-TEE entry
+    like this::
+
+        binman {
+            tee-os {
+            };
+        };
+
+    and pass either an ELF or plain binary in with -a tee-os-path <filename>
+    and have binman do the right thing:
+
+       - include the entry if tee.bin is provided and it does NOT have the v1
+         header
+       - drop it otherwise
+
+    When used within a FIT, we can do::
+
+        binman {
+            fit {
+                tee-os {
+                };
+            };
+        };
+
+    which will split the ELF into separate nodes for each segment, if an ELF
+    file is provided (see :ref:`etype_fit`), or produce a single node if the
+    OP-TEE binary v1 format is provided (see optee_doc_) .
+
+    .. _optee_doc: https://optee.readthedocs.io/en/latest/architecture/core.html#partitioning-of-the-binary
     """
     def __init__(self, section, etype, node):
         super().__init__(section, etype, node, 'tee-os')
         self.external = True
+
+    @staticmethod
+    def is_optee_bin_v1(data):
+        return len(data) >= 8 and data[0:5] == b'OPTE\x01'
+
+    def ObtainContents(self, fake_size=0):
+        result = super().ObtainContents(fake_size)
+        if not self.missing:
+            # If using the flat binary (without the OP-TEE header), then it is
+            # just included as a blob. But if it is an ELF or usees the v1
+            # binary header, then the FIT implementation will call
+            # read_elf_segments() to get the segment information
+            if elf.is_valid(self.data):
+                self.mark_absent('uses Elf format which must be in a FIT')
+            elif self.is_optee_bin_v1(self.data):
+                # The FIT implementation will call read_elf_segments() to get
+                # the segment information
+                self.mark_absent('uses v1 format which must be in a FIT')
+        return result
+
+    def read_elf_segments(self):
+        data = self.GetData()
+        if self.is_optee_bin_v1(data):
+            # OP-TEE v1 format (tee.bin)
+            init_sz, start_hi, start_lo, _, paged_sz = (
+                struct.unpack_from('<5I', data, 0x8))
+            if paged_sz != 0:
+                self.Raise("OP-TEE paged mode not supported")
+            e_entry = (start_hi << 32) + start_lo
+            p_addr = e_entry
+            p_data = data[0x1c:]
+            if len(p_data) != init_sz:
+                self.Raise("Invalid OP-TEE file: size mismatch (expected %#x, have %#x)" %
+                           (init_sz, len(p_data)))
+            return [[0, p_addr, p_data]], e_entry
+        return None
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index f47a745f1e1..f893050e706 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -112,6 +112,8 @@ REPACK_DTB_PROPS = ['orig-offset', 'orig-size']
 # Supported compression bintools
 COMP_BINTOOLS = ['bzip2', 'gzip', 'lz4', 'lzma_alone', 'lzop', 'xz', 'zstd']
 
+TEE_ADDR = 0x5678
+
 class TestFunctional(unittest.TestCase):
     """Functional tests for binman
 
@@ -219,6 +221,9 @@ class TestFunctional(unittest.TestCase):
         TestFunctional._MakeInputFile('tee.elf',
             tools.read_file(cls.ElfTestFile('elf_sections')))
 
+        # Newer OP_TEE file in v1 binary format
+        cls.make_tee_bin('tee.bin')
+
         cls.comp_bintools = {}
         for name in COMP_BINTOOLS:
             cls.comp_bintools[name] = bintool.Bintool.create(name)
@@ -644,6 +649,14 @@ class TestFunctional(unittest.TestCase):
     def ElfTestFile(cls, fname):
         return os.path.join(cls._elf_testdir, fname)
 
+    @classmethod
+    def make_tee_bin(cls, fname, paged_sz=0, extra_data=b''):
+        init_sz, start_hi, start_lo, dummy = (len(U_BOOT_DATA), 0, TEE_ADDR, 0)
+        data = b'OPTE\x01xxx' + struct.pack('<5I', init_sz, start_hi, start_lo,
+                                            dummy, paged_sz) + U_BOOT_DATA
+        data += extra_data
+        TestFunctional._MakeInputFile(fname, data)
+
     def AssertInList(self, grep_list, target):
         """Assert that at least one of a list of things is in a target
 
@@ -6095,6 +6108,76 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
         data = self._DoReadFile('262_absent.dts')
         self.assertEqual(U_BOOT_DATA + U_BOOT_IMG_DATA, data)
 
+    def testPackTeeOsOptional(self):
+        """Test that an image with an optional TEE binary can be created"""
+        entry_args = {
+            'tee-os-path': 'tee.elf',
+        }
+        data = self._DoReadFileDtb('263_tee_os_opt.dts',
+                                   entry_args=entry_args)[0]
+        self.assertEqual(U_BOOT_DATA + U_BOOT_IMG_DATA, data)
+
+    def checkFitTee(self, dts, tee_fname):
+        """Check that a tee-os entry works and returns data
+
+        Args:
+            dts (str): Device tree filename to use
+            tee_fname (str): filename containing tee-os
+
+        Returns:
+            bytes: Image contents
+        """
+        if not elf.ELF_TOOLS:
+            self.skipTest('Python elftools not available')
+        entry_args = {
+            'of-list': 'test-fdt1 test-fdt2',
+            'default-dt': 'test-fdt2',
+            'tee-os-path': tee_fname,
+        }
+        test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR)
+        data = self._DoReadFileDtb(dts, entry_args=entry_args,
+                                   extra_indirs=[test_subdir])[0]
+        return data
+
+    def testFitTeeOsOptionalFit(self):
+        """Test an image with a FIT with an optional OP-TEE binary"""
+        data = self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bin')
+
+        # There should be only one node, holding the data set up in SetUpClass()
+        # for tee.bin
+        dtb = fdt.Fdt.FromData(data)
+        dtb.Scan()
+        node = dtb.GetNode('/images/tee-1')
+        self.assertEqual(TEE_ADDR,
+                         fdt_util.fdt32_to_cpu(node.props['load'].value))
+        self.assertEqual(TEE_ADDR,
+                         fdt_util.fdt32_to_cpu(node.props['entry'].value))
+        self.assertEqual(U_BOOT_DATA, node.props['data'].bytes)
+
+    def testFitTeeOsOptionalFitBad(self):
+        """Test an image with a FIT with an optional OP-TEE binary"""
+        with self.assertRaises(ValueError) as exc:
+            self.checkFitTee('265_tee_os_opt_fit_bad.dts', 'tee.bin')
+        self.assertIn(
+            "Node '/binman/fit': subnode 'images/@tee-SEQ': Failed to read ELF file: Magic number does not match",
+            str(exc.exception))
+
+    def testFitTeeOsBad(self):
+        """Test an OP-TEE binary with wrong formats"""
+        self.make_tee_bin('tee.bad1', 123)
+        with self.assertRaises(ValueError) as exc:
+            self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bad1')
+        self.assertIn(
+            "Node '/binman/fit/images/@tee-SEQ/tee-os': OP-TEE paged mode not supported",
+            str(exc.exception))
+
+        self.make_tee_bin('tee.bad2', 0, b'extra data')
+        with self.assertRaises(ValueError) as exc:
+            self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bad2')
+        self.assertIn(
+            "Node '/binman/fit/images/@tee-SEQ/tee-os': Invalid OP-TEE file: size mismatch (expected 0x4, have 0xe)",
+            str(exc.exception))
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/263_tee_os_opt.dts b/tools/binman/test/263_tee_os_opt.dts
new file mode 100644
index 00000000000..2e4ec24ac2c
--- /dev/null
+++ b/tools/binman/test/263_tee_os_opt.dts
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		u-boot {
+		};
+		tee-os {
+			/*
+			 * this results in nothing being added since only the
+			 * .bin format is supported by this etype, unless it is
+			 * part of a FIT
+			 */
+		};
+		u-boot-img {
+		};
+	};
+};
diff --git a/tools/binman/test/264_tee_os_opt_fit.dts b/tools/binman/test/264_tee_os_opt_fit.dts
new file mode 100644
index 00000000000..ae44b433edf
--- /dev/null
+++ b/tools/binman/test/264_tee_os_opt_fit.dts
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		fit {
+			description = "test-desc";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
+
+			images {
+				@tee-SEQ {
+					fit,operation = "split-elf";
+					description = "TEE";
+					type = "tee";
+					arch = "arm64";
+					os = "tee";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					tee-os {
+					};
+				};
+			};
+		};
+	};
+};
diff --git a/tools/binman/test/265_tee_os_opt_fit_bad.dts b/tools/binman/test/265_tee_os_opt_fit_bad.dts
new file mode 100644
index 00000000000..7fa363cc199
--- /dev/null
+++ b/tools/binman/test/265_tee_os_opt_fit_bad.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		fit {
+			description = "test-desc";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
+
+			images {
+				@tee-SEQ {
+					fit,operation = "split-elf";
+					description = "TEE";
+					type = "tee";
+					arch = "arm64";
+					os = "tee";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					tee-os {
+					};
+
+					/*
+					 * mess up the ELF data by adding
+					 * another bit of data at the end
+					 */
+					u-boot {
+					};
+				};
+			};
+		};
+	};
+};
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 08/14] binman: Support optional external blobs
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (6 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 07/14] binman: Support new op-tee binary format Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 09/14] rockchip: evb-rk3288: Drop raw-image support Simon Glass
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Some blobs are actually not necessary for the board to work correctly. Add
a property to allow this to be indicated. Missing optional blobs do not
cause a build failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v8)

Changes in v8:
- Move support for optional external blobs into this series
- Support optional FIT images

 tools/binman/binman.rst                |  9 +++++++++
 tools/binman/control.py                | 11 +++++++++++
 tools/binman/entry.py                  | 25 +++++++++++++++++++++----
 tools/binman/etype/blob.py             |  2 +-
 tools/binman/etype/fit.py              | 11 ++++++-----
 tools/binman/etype/section.py          | 14 +++++++++++++-
 tools/binman/ftest.py                  | 10 ++++++++++
 tools/binman/test/266_blob_ext_opt.dts | 21 +++++++++++++++++++++
 8 files changed, 92 insertions(+), 11 deletions(-)
 create mode 100644 tools/binman/test/266_blob_ext_opt.dts

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 5e3961f2255..bfe300a39c1 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -690,6 +690,15 @@ no-expanded:
     `no-expanded` property disables this just for a single entry. Put the
     `no-expanded` boolean property in the node to select this behaviour.
 
+optional:
+    External blobs are normally required to be present for the image to be
+    built (but see `External blobs`_). This properly allows an entry to be
+    optional, so that when it is cannot be found, this problem is ignored and
+    an empty file is used for this blob. This should be used only when the blob
+    is entirely optional and is not needed for correct operation of the image.
+    Note that missing, optional blobs do not produce a non-zero exit code from
+    binman, although it does show a warning about the missing external blob.
+
 The attributes supported for images and sections are described below. Several
 are similar to those for entries.
 
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 07225381146..e64740094f6 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -594,12 +594,14 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
     image.BuildImage()
     if write_map:
         image.WriteMap()
+
     missing_list = []
     image.CheckMissing(missing_list)
     if missing_list:
         tout.warning("Image '%s' is missing external blobs and is non-functional: %s" %
                      (image.name, ' '.join([e.name for e in missing_list])))
         _ShowHelpForMissingBlobs(missing_list)
+
     faked_list = []
     image.CheckFakedBlobs(faked_list)
     if faked_list:
@@ -607,6 +609,15 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
             "Image '%s' has faked external blobs and is non-functional: %s" %
             (image.name, ' '.join([os.path.basename(e.GetDefaultFilename())
                                    for e in faked_list])))
+
+    optional_list = []
+    image.CheckOptional(optional_list)
+    if optional_list:
+        tout.warning(
+            "Image '%s' is missing external blobs but is still functional: %s" %
+            (image.name, ' '.join([e.name for e in optional_list])))
+        _ShowHelpForMissingBlobs(optional_list)
+
     missing_bintool_list = []
     image.check_missing_bintools(missing_bintool_list)
     if missing_bintool_list:
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index de51d295891..d73f3013405 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -73,7 +73,9 @@ class Entry(object):
         compress: Compression algoithm used (e.g. 'lz4'), 'none' if none
         orig_offset: Original offset value read from node
         orig_size: Original size value read from node
-        missing: True if this entry is missing its contents
+        missing: True if this entry is missing its contents. Note that if it is
+            optional, this entry will not appear in the list generated by
+            entry.CheckMissing() since it is considered OK for it to be missing.
         allow_missing: Allow children of this entry to be missing (used by
             subclasses such as Entry_section)
         allow_fake: Allow creating a dummy fake file if the blob file is not
@@ -95,6 +97,7 @@ class Entry(object):
             the entry itself, allowing it to vanish in certain circumstances.
             An absent entry is removed during processing so that it does not
             appear in the map
+        optional (bool): True if this entry contains an optional external blob
     """
     fake_dir = None
 
@@ -138,6 +141,7 @@ class Entry(object):
         self.elf_fname = None
         self.auto_write_symbols = auto_write_symbols
         self.absent = False
+        self.optional = False
 
     @staticmethod
     def FindEntryClass(etype, expanded):
@@ -289,6 +293,7 @@ class Entry(object):
         self.offset_unset = fdt_util.GetBool(self._node, 'offset-unset')
         self.extend_size = fdt_util.GetBool(self._node, 'extend-size')
         self.missing_msg = fdt_util.GetString(self._node, 'missing-msg')
+        self.optional = fdt_util.GetBool(self._node, 'optional')
 
         # This is only supported by blobs and sections at present
         self.compress = fdt_util.GetString(self._node, 'compress', 'none')
@@ -1039,14 +1044,15 @@ features to produce new behaviours.
         self.allow_fake = allow_fake
 
     def CheckMissing(self, missing_list):
-        """Check if any entries in this section have missing external blobs
+        """Check if the entry has missing external blobs
 
-        If there are missing blobs, the entries are added to the list
+        If there are missing (non-optional) blobs, the entries are added to the
+        list
 
         Args:
             missing_list: List of Entry objects to be added to
         """
-        if self.missing:
+        if self.missing and not self.optional:
             missing_list.append(self)
 
     def check_fake_fname(self, fname, size=0):
@@ -1085,6 +1091,17 @@ features to produce new behaviours.
         # This is meaningless for anything other than blobs
         pass
 
+    def CheckOptional(self, optional_list):
+        """Check if the entry has missing but optional external blobs
+
+        If there are missing (optional) blobs, the entries are added to the list
+
+        Args:
+            optional_list (list): List of Entry objects to be added to
+        """
+        if self.missing and self.optional:
+            optional_list.append(self)
+
     def GetAllowMissing(self):
         """Get whether a section allows missing external blobs
 
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index a50a8068901..70dea7158ee 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -39,7 +39,7 @@ class Entry_blob(Entry):
     def ObtainContents(self, fake_size=0):
         self._filename = self.GetDefaultFilename()
         self._pathname = tools.get_input_filename(self._filename,
-            self.external and self.section.GetAllowMissing())
+            self.external and (self.optional or self.section.GetAllowMissing()))
         # Allow the file to be missing
         if not self._pathname:
             self._pathname, faked = self.check_fake_fname(self._filename,
diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index fea3adcc68d..f0e3fd1a092 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -392,8 +392,8 @@ class Entry_fit(Entry_section):
 
         _add_entries(self._node, 0, self._node)
 
-        # Keep a copy of all entries, including generator entries, since these
-        # removed from self._entries later.
+        # Keep a copy of all entries, including generator entries, since those
+        # are removed from self._entries later.
         self._priv_entries = dict(self._entries)
 
     def BuildSectionData(self, required):
@@ -602,14 +602,15 @@ class Entry_fit(Entry_section):
                 # Entry_section.ObtainContents() either returns True or
                 # raises an exception.
                 data = None
-                missing_list = []
+                missing_opt_list = []
                 entry.ObtainContents()
                 entry.Pack(0)
-                entry.CheckMissing(missing_list)
+                entry.CheckMissing(missing_opt_list)
+                entry.CheckOptional(missing_opt_list)
 
                 # If any pieces are missing, skip this. The missing entries will
                 # show an error
-                if not missing_list:
+                if not missing_opt_list:
                     segs = entry.read_elf_segments()
                     if segs:
                         segments, entry_addr = segs
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index 57bfee0b286..44dafaf7262 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -863,7 +863,8 @@ class Entry_section(Entry):
     def CheckMissing(self, missing_list):
         """Check if any entries in this section have missing external blobs
 
-        If there are missing blobs, the entries are added to the list
+        If there are missing (non-optional) blobs, the entries are added to the
+        list
 
         Args:
             missing_list: List of Entry objects to be added to
@@ -882,6 +883,17 @@ class Entry_section(Entry):
         for entry in self._entries.values():
             entry.CheckFakedBlobs(faked_blobs_list)
 
+    def CheckOptional(self, optional_list):
+        """Check the section for missing but optional external blobs
+
+        If there are missing (optional) blobs, the entries are added to the list
+
+        Args:
+            optional_list (list): List of Entry objects to be added to
+        """
+        for entry in self._entries.values():
+            entry.CheckOptional(optional_list)
+
     def check_missing_bintools(self, missing_list):
         """Check if any entries in this section have missing bintools
 
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index f893050e706..330e8e1ccb4 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6178,6 +6178,16 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
             "Node '/binman/fit/images/@tee-SEQ/tee-os': Invalid OP-TEE file: size mismatch (expected 0x4, have 0xe)",
             str(exc.exception))
 
+    def testExtblobOptional(self):
+        """Test an image with an external blob that is optional"""
+        with test_util.capture_sys_output() as (stdout, stderr):
+            data = self._DoReadFile('266_blob_ext_opt.dts')
+        self.assertEqual(REFCODE_DATA, data)
+        err = stderr.getvalue()
+        self.assertRegex(
+            err,
+            "Image '.*' is missing external blobs but is still functional: missing")
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/266_blob_ext_opt.dts b/tools/binman/test/266_blob_ext_opt.dts
new file mode 100644
index 00000000000..717153152ce
--- /dev/null
+++ b/tools/binman/test/266_blob_ext_opt.dts
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		ok {
+			type = "blob-ext";
+			filename = "refcode.bin";
+		};
+
+		missing {
+			type = "blob-ext";
+			filename = "missing.bin";
+			optional;
+		};
+	};
+};
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 09/14] rockchip: evb-rk3288: Drop raw-image support
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (7 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 10/14] rockchip: Use multiple-images for rk3399 Simon Glass
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

This boards uses SPL_FIT so does not need to support loading a raw image.
Drop it to avoid binman trying to insert a symbol which has no value.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 configs/evb-rk3288_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 8f8d34c7038..6d3bb5a2944 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -29,6 +29,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_NO_BSS_LIMIT=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK=0xff718000
 CONFIG_SPL_STACK_R=y
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 10/14] rockchip: Use multiple-images for rk3399
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (8 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 09/14] rockchip: evb-rk3288: Drop raw-image support Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 11/14] rockchip: Support building the all output files in binman Simon Glass
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Enable multiple-images so we can generate more than one image. Also
add a comment for the end of the #if block.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v5)

Changes in v5:
- Rename from 'Include binman script in 64-bit boards'
- Drop duplicate #include in rk3368-u-boot.dtsi
- Keep the name as fit for puma
- Drop redundant check for CONFIG_ROCKCHIP_SPI_IMAGE
- Drop imply of BINMAN in Kconfig (rely on ARCH_ROCKCHIP instead)

 arch/arm/dts/rk3399-u-boot.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 3c1a15fe51b..8a0b1803f34 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -62,6 +62,7 @@
 
 #if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM)
 &binman {
+	multiple-images;
 	rom {
 		filename = "u-boot.rom";
 		size = <0x400000>;
@@ -82,7 +83,7 @@
 		};
 	};
 };
-#endif
+#endif /* CONFIG_ROCKCHIP_SPI_IMAGE && CONFIG_HAS_ROM */
 
 &cru {
 	u-boot,dm-pre-reloc;
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 11/14] rockchip: Support building the all output files in binman
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (9 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 10/14] rockchip: Use multiple-images for rk3399 Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Add the required binman images to replace the Makefile rules which are
currently used. This includes subsuming:

   - tpl/u-boot-tpl-rockchip.bin if TPL is enabled
   - idbloader.img if either or both of SPL and TPL are enabled
   - u-boot.itb if SPL_FIT is enabled
   - u-boot-rockchip.bin if SPL is used, either using u-boot.itb when
     SPL_FIT is enabled or u-boot.img when it isn't

Note that the intermediate files are dropped with binman, since it
producing everything in one pass. This means that
tpl/u-boot-tpl-rockchip.bin is not created, for example.

Note that for some 32-bit rk3288 boards, rockchip-optee.dtsi is included.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v8)

Changes in v8:
- Make OP-TEE image optional
- Specify an entry address for U-Boot

Changes in v5:
- Rename blob to fit for puma and also SPI image

Changes in v3:
- Add an offset to the FIT description

Changes in v2:
- Rename op-tee to tee-os
- Drop use of .itb2

 arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi |  4 +-
 arch/arm/dts/rockchip-u-boot.dtsi           | 78 +++++++++++++++++++--
 2 files changed, 74 insertions(+), 8 deletions(-)

diff --git a/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi b/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi
index d2349ae90e2..088861dbf6d 100644
--- a/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi
@@ -46,14 +46,14 @@
 
 &binman {
 	simple-bin {
-		blob {
+		fit {
 			offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>;
 		};
 	};
 
 #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
 	simple-bin-spi {
-		blob {
+		fit {
 			/* same as u-boot,spl-payload-offset */
 			offset = <0x80000>;
 		};
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index fa094b00392..234fc5df433 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -30,14 +30,79 @@
 			};
 		};
 
-#ifdef CONFIG_ARM64
-		blob {
+#if defined(CONFIG_SPL_FIT) && defined(CONFIG_ARM64)
+		fit: fit {
+			description = "FIT image for U-Boot with bl31 (TF-A)";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
 			filename = "u-boot.itb";
+			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+			offset = <CONFIG_SPL_PAD_TO>;
+			images {
+				u-boot {
+					description = "U-Boot (64-bit)";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_TEXT_BASE>;
+					entry = <CONFIG_TEXT_BASE>;
+					u-boot-nodtb {
+					};
+				};
+
+				@atf-SEQ {
+					fit,operation = "split-elf";
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					os = "arm-trusted-firmware";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					atf-bl31 {
+					};
+				};
+				@tee-SEQ {
+					fit,operation = "split-elf";
+					description = "TEE";
+					type = "tee";
+					arch = "arm64";
+					os = "tee";
+					compression = "none";
+					fit,load;
+					fit,entry;
+					fit,data;
+
+					tee-os {
+						optional;
+					};
+				};
+
+				@fdt-SEQ {
+					description = "fdt-NAME";
+					compression = "none";
+					type = "flat_dt";
+				};
+			};
+
+			configurations {
+				default = "@config-DEFAULT-SEQ";
+				@config-SEQ {
+					description = "NAME.dtb";
+					fdt = "fdt-SEQ";
+					firmware = "u-boot";
+					fit,loadables;
+				};
+			};
+		};
 #else
 		u-boot-img {
-#endif
 			offset = <CONFIG_SPL_PAD_TO>;
 		};
+#endif
 	};
 
 #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
@@ -59,7 +124,8 @@
 		};
 
 #ifdef CONFIG_ARM64
-		blob {
+		fit {
+			type = "blob";
 			filename = "u-boot.itb";
 #else
 		u-boot-img {
@@ -68,6 +134,6 @@
 			offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>;
 		};
 	};
-#endif
+#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
 };
-#endif
+#endif /* CONFIG_SPL */
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 12/14] rockchip: Convert all boards to use binman
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (10 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 11/14] rockchip: Support building the all output files in binman Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 13/14] rockchip: Drop the FIT generator script Simon Glass
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Instead of the bash script, use binman to generate the FIT for arm64.

For 32-bit boards, use binman for all images, dropping the intermediate
files.

With this change, only Zynq is now using SPL_FIT_GENERATOR so update the
Kconfig rule accordingly.

Clean up the Makefile to the extent possible. Unfortunately, two boards
do not use SPL_FRAMEWORK so don't enable the u-boot.img rule:

   evb-rk3036
   kylin-rk3036

So a small remnant remains.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 Makefile     | 8 +-------
 boot/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 5610f7b4924..a9e89927372 100644
--- a/Makefile
+++ b/Makefile
@@ -1006,14 +1006,9 @@ ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy)
 INPUTS-y += init_sp_bss_offset_check
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-# Binman image dependencies
-ifeq ($(CONFIG_ARM64),y)
-INPUTS-y += u-boot.itb
-else
+ifeq ($(CONFIG_ARCH_ROCKCHIP)_$(CONFIG_SPL_FRAMEWORK),y_)
 INPUTS-y += u-boot.img
 endif
-endif
 
 INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \
 	$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
@@ -1477,7 +1472,6 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
 u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
 	$(call if_changed,pad_cat)
 
-
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
 
diff --git a/boot/Kconfig b/boot/Kconfig
index 65613a01491..7708d83e7d1 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -282,7 +282,7 @@ config SPL_FIT_SOURCE
 config USE_SPL_FIT_GENERATOR
 	bool "Use a script to generate the .its script"
 	depends on SPL_FIT
-	default y if !ARCH_SUNXI && !RISCV
+	default y if SPL_FIT && ARCH_ZYNQMP
 
 config SPL_FIT_GENERATOR
 	string ".its file generator script for U-Boot FIT image"
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 13/14] rockchip: Drop the FIT generator script
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (11 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-07 21:07 ` [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default Simon Glass
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

This is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 Makefile                               |   3 -
 arch/arm/mach-rockchip/make_fit_atf.py | 267 -------------------------
 boot/Kconfig                           |   1 -
 3 files changed, 271 deletions(-)
 delete mode 100755 arch/arm/mach-rockchip/make_fit_atf.py

diff --git a/Makefile b/Makefile
index a9e89927372..75a599b2c43 100644
--- a/Makefile
+++ b/Makefile
@@ -1365,9 +1365,6 @@ $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
 else
 ifneq ($(CONFIG_USE_SPL_FIT_GENERATOR),)
 U_BOOT_ITS := u-boot.its
-ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py")
-U_BOOT_ITS_DEPS += u-boot
-endif
 $(U_BOOT_ITS): $(U_BOOT_ITS_DEPS) FORCE
 	$(srctree)/$(CONFIG_SPL_FIT_GENERATOR) \
 	$(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@
diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
deleted file mode 100755
index 08cfe9f51e9..00000000000
--- a/arch/arm/mach-rockchip/make_fit_atf.py
+++ /dev/null
@@ -1,267 +0,0 @@
-#!/usr/bin/env python3
-"""
-# SPDX-License-Identifier: GPL-2.0+
-#
-# A script to generate FIT image source for rockchip boards
-# with ARM Trusted Firmware
-# and multiple device trees (given on the command line)
-#
-# usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
-"""
-
-import os
-import sys
-import getopt
-import logging
-import struct
-
-DT_HEADER = """
-/*
- * This is a generated file.
- */
-/dts-v1/;
-
-/ {
-	description = "FIT image for U-Boot with bl31 (TF-A)";
-	#address-cells = <1>;
-
-	images {
-"""
-
-DT_UBOOT = """
-		uboot {
-			description = "U-Boot (64-bit)";
-			data = /incbin/("u-boot-nodtb.bin");
-			type = "standalone";
-			os = "U-Boot";
-			arch = "arm64";
-			compression = "none";
-			load = <0x%08x>;
-		};
-
-"""
-
-DT_IMAGES_NODE_END = """	};
-
-"""
-
-DT_END = "};"
-
-def append_bl31_node(file, atf_index, phy_addr, elf_entry):
-    # Append BL31 DT node to input FIT dts file.
-    data = 'bl31_0x%08x.bin' % phy_addr
-    file.write('\t\tatf_%d {\n' % atf_index)
-    file.write('\t\t\tdescription = \"ARM Trusted Firmware\";\n')
-    file.write('\t\t\tdata = /incbin/("%s");\n' % data)
-    file.write('\t\t\ttype = "firmware";\n')
-    file.write('\t\t\tarch = "arm64";\n')
-    file.write('\t\t\tos = "arm-trusted-firmware";\n')
-    file.write('\t\t\tcompression = "none";\n')
-    file.write('\t\t\tload = <0x%08x>;\n' % phy_addr)
-    if atf_index == 1:
-        file.write('\t\t\tentry = <0x%08x>;\n' % elf_entry)
-    file.write('\t\t};\n')
-    file.write('\n')
-
-def append_tee_node(file, atf_index, phy_addr, elf_entry):
-    # Append TEE DT node to input FIT dts file.
-    data = 'tee_0x%08x.bin' % phy_addr
-    file.write('\t\tatf_%d {\n' % atf_index)
-    file.write('\t\t\tdescription = \"TEE\";\n')
-    file.write('\t\t\tdata = /incbin/("%s");\n' % data)
-    file.write('\t\t\ttype = "tee";\n')
-    file.write('\t\t\tarch = "arm64";\n')
-    file.write('\t\t\tos = "tee";\n')
-    file.write('\t\t\tcompression = "none";\n')
-    file.write('\t\t\tload = <0x%08x>;\n' % phy_addr)
-    file.write('\t\t\tentry = <0x%08x>;\n' % elf_entry)
-    file.write('\t\t};\n')
-    file.write('\n')
-
-def append_fdt_node(file, dtbs):
-    # Append FDT nodes.
-    cnt = 1
-    for dtb in dtbs:
-        dtname = os.path.basename(dtb)
-        file.write('\t\tfdt_%d {\n' % cnt)
-        file.write('\t\t\tdescription = "%s";\n' % dtname)
-        file.write('\t\t\tdata = /incbin/("%s");\n' % dtb)
-        file.write('\t\t\ttype = "flat_dt";\n')
-        file.write('\t\t\tcompression = "none";\n')
-        file.write('\t\t};\n')
-        file.write('\n')
-        cnt = cnt + 1
-
-def append_conf_section(file, cnt, dtname, segments):
-    file.write('\t\tconfig_%d {\n' % cnt)
-    file.write('\t\t\tdescription = "%s";\n' % dtname)
-    file.write('\t\t\tfirmware = "atf_1";\n')
-    file.write('\t\t\tloadables = "uboot"')
-    if segments > 1:
-        file.write(',')
-    for i in range(1, segments):
-        file.write('"atf_%d"' % (i + 1))
-        if i != (segments - 1):
-            file.write(',')
-        else:
-            file.write(';\n')
-    if segments <= 1:
-        file.write(';\n')
-    file.write('\t\t\tfdt = "fdt_%d";\n' % cnt)
-    file.write('\t\t};\n')
-    file.write('\n')
-
-def append_conf_node(file, dtbs, segments):
-    # Append configeration nodes.
-    cnt = 1
-    file.write('\tconfigurations {\n')
-    file.write('\t\tdefault = "config_1";\n')
-    for dtb in dtbs:
-        dtname = os.path.basename(dtb)
-        append_conf_section(file, cnt, dtname, segments)
-        cnt = cnt + 1
-    file.write('\t};\n')
-    file.write('\n')
-
-def generate_atf_fit_dts_uboot(fit_file, uboot_file_name):
-    segments = unpack_elf(uboot_file_name)
-    if len(segments) != 1:
-        raise ValueError("Invalid u-boot ELF image '%s'" % uboot_file_name)
-    index, entry, p_paddr, data = segments[0]
-    fit_file.write(DT_UBOOT % p_paddr)
-
-def generate_atf_fit_dts_bl31(fit_file, bl31_file_name, tee_file_name, dtbs_file_name):
-    segments = unpack_elf(bl31_file_name)
-    for index, entry, paddr, data in segments:
-        append_bl31_node(fit_file, index + 1, paddr, entry)
-    num_segments = len(segments)
-
-    if tee_file_name:
-        tee_segments = unpack_tee_file(tee_file_name)
-        for index, entry, paddr, data in tee_segments:
-            append_tee_node(fit_file, num_segments + index + 1, paddr, entry)
-        num_segments = num_segments + len(tee_segments)
-
-    append_fdt_node(fit_file, dtbs_file_name)
-    fit_file.write(DT_IMAGES_NODE_END)
-    append_conf_node(fit_file, dtbs_file_name, num_segments)
-
-def generate_atf_fit_dts(fit_file_name, bl31_file_name, tee_file_name, uboot_file_name, dtbs_file_name):
-    # Generate FIT script for ATF image.
-    if fit_file_name != sys.stdout:
-        fit_file = open(fit_file_name, "wb")
-    else:
-        fit_file = sys.stdout
-
-    fit_file.write(DT_HEADER)
-    generate_atf_fit_dts_uboot(fit_file, uboot_file_name)
-    generate_atf_fit_dts_bl31(fit_file, bl31_file_name, tee_file_name, dtbs_file_name)
-    fit_file.write(DT_END)
-
-    if fit_file_name != sys.stdout:
-        fit_file.close()
-
-def generate_atf_binary(bl31_file_name):
-    for index, entry, paddr, data in unpack_elf(bl31_file_name):
-        file_name = 'bl31_0x%08x.bin' % paddr
-        with open(file_name, "wb") as atf:
-            atf.write(data)
-
-def generate_tee_binary(tee_file_name):
-    if tee_file_name:
-        for index, entry, paddr, data in unpack_tee_file(tee_file_name):
-            file_name = 'tee_0x%08x.bin' % paddr
-            with open(file_name, "wb") as atf:
-                atf.write(data)
-
-def unpack_elf(filename):
-    with open(filename, 'rb') as file:
-        elf = file.read()
-    if elf[0:7] != b'\x7fELF\x02\x01\x01' or elf[18:20] != b'\xb7\x00':
-        raise ValueError("Invalid arm64 ELF file '%s'" % filename)
-
-    e_entry, e_phoff = struct.unpack_from('<2Q', elf, 0x18)
-    e_phentsize, e_phnum = struct.unpack_from('<2H', elf, 0x36)
-    segments = []
-
-    for index in range(e_phnum):
-        offset = e_phoff + e_phentsize * index
-        p_type, p_flags, p_offset = struct.unpack_from('<LLQ', elf, offset)
-        if p_type == 1: # PT_LOAD
-            p_paddr, p_filesz = struct.unpack_from('<2Q', elf, offset + 0x18)
-            if p_filesz > 0:
-                p_data = elf[p_offset:p_offset + p_filesz]
-                segments.append((index, e_entry, p_paddr, p_data))
-    return segments
-
-def unpack_tee_file(filename):
-    if filename.endswith('.elf'):
-        return unpack_elf(filename)
-    with open(filename, 'rb') as file:
-        bin = file.read()
-    segments = []
-    if bin[0:5] == b'OPTE\x01':
-        # OP-TEE v1 format (tee.bin)
-        init_sz, start_hi, start_lo, _, paged_sz = struct.unpack_from('<5I',
-                                                                      bin,
-                                                                      0x8)
-        if paged_sz != 0:
-            raise ValueError("OP-TEE paged mode not supported")
-        e_entry = (start_hi << 32) + start_lo
-        p_addr = e_entry
-        p_data = bin[0x1c:]
-        if len(p_data) != init_sz:
-            raise ValueError("Invalid file '%s': size mismatch "
-                             "(expected %d, have %d)" % (filename, init_sz,
-                                                         len(p_data)))
-        segments.append((0, e_entry, p_addr, p_data))
-    else:
-        raise ValueError("Unknown format for TEE file '%s'" % filename)
-    return segments
-
-def main():
-    uboot_elf = "./u-boot"
-    fit_its = sys.stdout
-    if "BL31" in os.environ:
-        bl31_elf=os.getenv("BL31");
-    elif os.path.isfile("./bl31.elf"):
-        bl31_elf = "./bl31.elf"
-    else:
-        os.system("echo 'int main(){}' > bl31.c")
-        os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf")
-        bl31_elf = "./bl31.elf"
-        logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
-        logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional')
-        logging.warning(' Please read Building section in doc/README.rockchip')
-
-    if "TEE" in os.environ:
-        tee_file = os.getenv("TEE")
-    elif os.path.isfile("./tee.bin"):
-        tee_file = "./tee.bin"
-    elif os.path.isfile("./tee.elf"):
-        tee_file = "./tee.elf"
-    else:
-        tee_file = ""
-
-    opts, args = getopt.getopt(sys.argv[1:], "o:u:b:t:h")
-    for opt, val in opts:
-        if opt == "-o":
-            fit_its = val
-        elif opt == "-u":
-            uboot_elf = val
-        elif opt == "-b":
-            bl31_elf = val
-        elif opt == "-t":
-            tee_file = val
-        elif opt == "-h":
-            print(__doc__)
-            sys.exit(2)
-
-    dtbs = args
-
-    generate_atf_fit_dts(fit_its, bl31_elf, tee_file, uboot_elf, dtbs)
-    generate_atf_binary(bl31_elf)
-    generate_tee_binary(tee_file)
-
-if __name__ == "__main__":
-    main()
diff --git a/boot/Kconfig b/boot/Kconfig
index 7708d83e7d1..55f06761ef8 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -287,7 +287,6 @@ config USE_SPL_FIT_GENERATOR
 config SPL_FIT_GENERATOR
 	string ".its file generator script for U-Boot FIT image"
 	depends on USE_SPL_FIT_GENERATOR
-	default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && ARCH_ROCKCHIP
 	default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP
 	help
 	  Specifies a (platform specific) script file to generate the FIT
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (12 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 13/14] rockchip: Drop the FIT generator script Simon Glass
@ 2023-01-07 21:07 ` Simon Glass
  2023-01-08 13:41   ` Tom Rini
  2023-01-19  2:11 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
  2023-01-19  2:11 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass
  15 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2023-01-07 21:07 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

This option is deprecated and only used by two boards. Enable it for just
those two boards, so others don't accidentally enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v9:
- Update msc_sm2s_imx8mp also

Changes in v6:
- Add new patch to disable USE_SPL_FIT_GENERATOR by default
- Add new patch to allow a binman entry to be marked absent

Changes in v3:
- Add support for writing sections in binman
- Rebase to master

Changes in v2:
- Drop patches previously applied
- Add various suggestions from Alper Nebi Yasak
- Add patches to refactor binman's FIT support

 boot/Kconfig                                                 | 5 +++--
 configs/am335x_evm_defconfig                                 | 1 -
 configs/am335x_hs_evm_defconfig                              | 1 -
 configs/am335x_hs_evm_uart_defconfig                         | 1 -
 configs/am43xx_evm_defconfig                                 | 1 -
 configs/am43xx_evm_rtconly_defconfig                         | 1 -
 configs/am43xx_evm_usbhost_boot_defconfig                    | 1 -
 configs/am43xx_hs_evm_defconfig                              | 1 -
 configs/am57xx_evm_defconfig                                 | 1 -
 configs/am57xx_hs_evm_defconfig                              | 1 -
 configs/am57xx_hs_evm_usb_defconfig                          | 1 -
 configs/am65x_evm_a53_defconfig                              | 1 -
 configs/am65x_evm_r5_defconfig                               | 1 -
 configs/am65x_hs_evm_a53_defconfig                           | 1 -
 configs/am65x_hs_evm_r5_defconfig                            | 1 -
 .../avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig   | 1 +
 configs/cgtqmx8_defconfig                                    | 1 -
 configs/chromebook_link64_defconfig                          | 1 -
 configs/dh_imx6_defconfig                                    | 1 -
 configs/display5_defconfig                                   | 1 -
 configs/display5_factory_defconfig                           | 1 -
 configs/dra7xx_evm_defconfig                                 | 1 -
 configs/dra7xx_hs_evm_defconfig                              | 1 -
 configs/dra7xx_hs_evm_usb_defconfig                          | 1 -
 configs/evb-ast2600_defconfig                                | 1 -
 configs/evb-rk3229_defconfig                                 | 1 -
 configs/evb-rk3288_defconfig                                 | 1 -
 configs/gwventana_emmc_defconfig                             | 1 -
 configs/gwventana_gw5904_defconfig                           | 1 -
 configs/gwventana_nand_defconfig                             | 1 -
 configs/imx6qdl_icore_mipi_defconfig                         | 1 -
 configs/imx6qdl_icore_mmc_defconfig                          | 1 -
 configs/imx6qdl_icore_rqs_defconfig                          | 1 -
 configs/imx8mm-cl-iot-gate-optee_defconfig                   | 1 -
 configs/imx8mm-cl-iot-gate_defconfig                         | 1 -
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig                 | 1 -
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig                | 1 -
 configs/imx8mm-mx8menlo_defconfig                            | 1 -
 configs/imx8mm_beacon_defconfig                              | 1 -
 configs/imx8mm_data_modul_edm_sbc_defconfig                  | 1 -
 configs/imx8mm_evk_defconfig                                 | 1 -
 configs/imx8mm_evk_fspi_defconfig                            | 1 -
 configs/imx8mm_venice_defconfig                              | 1 -
 configs/imx8mn_beacon_2g_defconfig                           | 1 -
 configs/imx8mn_beacon_defconfig                              | 1 -
 configs/imx8mn_bsh_smm_s2_defconfig                          | 1 -
 configs/imx8mn_bsh_smm_s2pro_defconfig                       | 1 -
 configs/imx8mn_ddr4_evk_defconfig                            | 1 -
 configs/imx8mn_evk_defconfig                                 | 1 -
 configs/imx8mn_var_som_defconfig                             | 1 -
 configs/imx8mn_venice_defconfig                              | 1 -
 configs/imx8mp-icore-mx8mp-edimm2.2_defconfig                | 1 -
 configs/imx8mp_dhcom_pdk2_defconfig                          | 1 -
 configs/imx8mp_evk_defconfig                                 | 1 -
 configs/imx8mp_rsb3720a1_4G_defconfig                        | 1 -
 configs/imx8mp_rsb3720a1_6G_defconfig                        | 1 -
 configs/imx8mp_venice_defconfig                              | 1 -
 configs/imx8mq_cm_defconfig                                  | 1 -
 configs/imx8mq_evk_defconfig                                 | 1 -
 configs/imx8mq_phanbell_defconfig                            | 1 -
 configs/imx8qm_rom7720_a1_4G_defconfig                       | 1 -
 configs/iot2050_defconfig                                    | 1 -
 configs/j7200_evm_a72_defconfig                              | 1 -
 configs/j7200_evm_r5_defconfig                               | 1 -
 configs/j7200_hs_evm_a72_defconfig                           | 1 -
 configs/j7200_hs_evm_r5_defconfig                            | 1 -
 configs/j721e_evm_a72_defconfig                              | 1 -
 configs/j721e_evm_r5_defconfig                               | 1 -
 configs/j721e_hs_evm_a72_defconfig                           | 1 -
 configs/j721e_hs_evm_r5_defconfig                            | 1 -
 configs/j721s2_evm_a72_defconfig                             | 1 -
 configs/j721s2_evm_r5_defconfig                              | 1 -
 configs/j721s2_hs_evm_a72_defconfig                          | 1 -
 configs/j721s2_hs_evm_r5_defconfig                           | 1 -
 configs/kontron-sl-mx6ul_defconfig                           | 1 -
 configs/kontron-sl-mx8mm_defconfig                           | 1 -
 configs/kontron_pitx_imx8m_defconfig                         | 1 -
 configs/kontron_sl28_defconfig                               | 1 -
 configs/librem5_defconfig                                    | 1 -
 configs/ls1046ardb_qspi_spl_defconfig                        | 1 -
 configs/mccmon6_nor_defconfig                                | 1 -
 configs/mccmon6_sd_defconfig                                 | 1 -
 configs/msc_sm2s_imx8mp_defconfig                            | 1 -
 configs/mx6sabreauto_defconfig                               | 1 -
 configs/mx6sabresd_defconfig                                 | 1 -
 configs/phycore-imx8mm_defconfig                             | 1 -
 configs/phycore-imx8mp_defconfig                             | 1 -
 configs/pico-imx6_defconfig                                  | 1 -
 configs/pico-imx8mq_defconfig                                | 1 -
 configs/qemu-x86_64_defconfig                                | 1 -
 configs/sandbox_noinst_defconfig                             | 1 -
 configs/sandbox_spl_defconfig                                | 1 -
 configs/sandbox_vpl_defconfig                                | 1 -
 configs/socfpga_agilex_atf_defconfig                         | 1 -
 configs/socfpga_agilex_vab_defconfig                         | 1 -
 configs/socfpga_arria10_defconfig                            | 1 -
 configs/socfpga_chameleonv3_defconfig                        | 1 -
 configs/socfpga_n5x_atf_defconfig                            | 1 -
 configs/socfpga_n5x_vab_defconfig                            | 1 -
 configs/socfpga_stratix10_atf_defconfig                      | 1 -
 configs/stm32mp15_dhcom_basic_defconfig                      | 1 -
 configs/stm32mp15_dhcor_basic_defconfig                      | 1 -
 configs/verdin-imx8mm_defconfig                              | 1 -
 configs/verdin-imx8mp_defconfig                              | 1 -
 configs/wandboard_defconfig                                  | 1 -
 configs/xilinx_zynq_virt_defconfig                           | 1 -
 configs/xilinx_zynqmp_virt_defconfig                         | 1 +
 107 files changed, 5 insertions(+), 106 deletions(-)

diff --git a/boot/Kconfig b/boot/Kconfig
index 55f06761ef8..7ab0dd14211 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
 config USE_SPL_FIT_GENERATOR
 	bool "Use a script to generate the .its script"
 	depends on SPL_FIT
-	default y if SPL_FIT && ARCH_ZYNQMP
+	help
+	  This is deprecated. Please do not use it. Use binman instead.
 
 config SPL_FIT_GENERATOR
 	string ".its file generator script for U-Boot FIT image"
 	depends on USE_SPL_FIT_GENERATOR
-	default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP
+	default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if ARCH_ZYNQMP
 	help
 	  Specifies a (platform specific) script file to generate the FIT
 	  source file used to build the U-Boot FIT image file. This gets
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 78e63c91750..f1995da8169 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -14,7 +14,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
 CONFIG_TIMESTAMP=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run init_console; run finduuid; run distro_bootcmd"
 CONFIG_LOGLEVEL=3
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
index 5dc9ba98fde..72609da3150 100644
--- a/configs/am335x_hs_evm_defconfig
+++ b/configs/am335x_hs_evm_defconfig
@@ -13,7 +13,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
 CONFIG_TIMESTAMP=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run init_console; run finduuid; run distro_bootcmd"
 CONFIG_LOGLEVEL=3
diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig
index 68513c1b6a9..22562d4c63d 100644
--- a/configs/am335x_hs_evm_uart_defconfig
+++ b/configs/am335x_hs_evm_uart_defconfig
@@ -16,7 +16,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
 CONFIG_TIMESTAMP=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run init_console; run finduuid; run distro_bootcmd"
 CONFIG_LOGLEVEL=3
diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig
index 2faf1322f9e..cb8a7e39ad3 100644
--- a/configs/am43xx_evm_defconfig
+++ b/configs/am43xx_evm_defconfig
@@ -13,7 +13,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4033ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_MISC_INIT_R is not set
diff --git a/configs/am43xx_evm_rtconly_defconfig b/configs/am43xx_evm_rtconly_defconfig
index 4241070930f..ae82fe30686 100644
--- a/configs/am43xx_evm_rtconly_defconfig
+++ b/configs/am43xx_evm_rtconly_defconfig
@@ -13,7 +13,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4033ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_MISC_INIT_R is not set
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig b/configs/am43xx_evm_usbhost_boot_defconfig
index 91270d032bf..6a08a1c792a 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -12,7 +12,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4033ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_MISC_INIT_R is not set
diff --git a/configs/am43xx_hs_evm_defconfig b/configs/am43xx_hs_evm_defconfig
index b6b74af735e..1af4914faa4 100644
--- a/configs/am43xx_hs_evm_defconfig
+++ b/configs/am43xx_hs_evm_defconfig
@@ -18,7 +18,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4033ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig
index 03f799506e1..59273281144 100644
--- a/configs/am57xx_evm_defconfig
+++ b/configs/am57xx_evm_defconfig
@@ -18,7 +18,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
diff --git a/configs/am57xx_hs_evm_defconfig b/configs/am57xx_hs_evm_defconfig
index 86bcfe85ae3..21fabc0d77c 100644
--- a/configs/am57xx_hs_evm_defconfig
+++ b/configs/am57xx_hs_evm_defconfig
@@ -21,7 +21,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037ff00
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig
index eedbfd0d865..c2386a536cc 100644
--- a/configs/am57xx_hs_evm_usb_defconfig
+++ b/configs/am57xx_hs_evm_usb_defconfig
@@ -23,7 +23,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037ff00
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig
index fe3346f2150..84ca386eafd 100644
--- a/configs/am65x_evm_a53_defconfig
+++ b/configs/am65x_evm_a53_defconfig
@@ -30,7 +30,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
diff --git a/configs/am65x_evm_r5_defconfig b/configs/am65x_evm_r5_defconfig
index 45f50b6ae8e..64e1416162b 100644
--- a/configs/am65x_evm_r5_defconfig
+++ b/configs/am65x_evm_r5_defconfig
@@ -28,7 +28,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41c7effc
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
diff --git a/configs/am65x_hs_evm_a53_defconfig b/configs/am65x_hs_evm_a53_defconfig
index 79182a77f30..94beb9ed67c 100644
--- a/configs/am65x_hs_evm_a53_defconfig
+++ b/configs/am65x_hs_evm_a53_defconfig
@@ -30,7 +30,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7
diff --git a/configs/am65x_hs_evm_r5_defconfig b/configs/am65x_hs_evm_r5_defconfig
index cbd702c3eda..9b463044211 100644
--- a/configs/am65x_hs_evm_r5_defconfig
+++ b/configs/am65x_hs_evm_r5_defconfig
@@ -27,7 +27,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41c7effc
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0x58000
diff --git a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
index 0a3d710a8b1..7cc2b3453f5 100644
--- a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
+++ b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
@@ -20,6 +20,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
+CONFIG_USE_SPL_FIT_GENERATOR=y
 CONFIG_BOOTDELAY=0
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_CLOCKS=y
diff --git a/configs/cgtqmx8_defconfig b/configs/cgtqmx8_defconfig
index 019701010ac..d5924b7f6d3 100644
--- a/configs/cgtqmx8_defconfig
+++ b/configs/cgtqmx8_defconfig
@@ -22,7 +22,6 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig
index 64ebef4b500..8c75d654290 100644
--- a/configs/chromebook_link64_defconfig
+++ b/configs/chromebook_link64_defconfig
@@ -20,7 +20,6 @@ CONFIG_HAVE_VGA_BIOS=y
 CONFIG_X86_OFFSET_U_BOOT=0xffa00000
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SHOW_BOOT_PROGRESS=y
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 04a5447e34d..62c446f86a9 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -33,7 +33,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index c46a0a0b699..a05d6bf6206 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -33,7 +33,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_STANDALONE_LOAD_ADDR=0x10001000
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig
index cacdf33d53e..0ef41b65f5d 100644
--- a/configs/display5_factory_defconfig
+++ b/configs/display5_factory_defconfig
@@ -30,7 +30,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_STANDALONE_LOAD_ADDR=0x10001000
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/dra7xx_evm_defconfig b/configs/dra7xx_evm_defconfig
index 41df92f3d28..732fda8d4ed 100644
--- a/configs/dra7xx_evm_defconfig
+++ b/configs/dra7xx_evm_defconfig
@@ -20,7 +20,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037fef0
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
diff --git a/configs/dra7xx_hs_evm_defconfig b/configs/dra7xx_hs_evm_defconfig
index 7392b730853..2f9b96a5a63 100644
--- a/configs/dra7xx_hs_evm_defconfig
+++ b/configs/dra7xx_hs_evm_defconfig
@@ -23,7 +23,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037fef0
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
diff --git a/configs/dra7xx_hs_evm_usb_defconfig b/configs/dra7xx_hs_evm_usb_defconfig
index 1bda6db7a36..1eeda2b527d 100644
--- a/configs/dra7xx_hs_evm_usb_defconfig
+++ b/configs/dra7xx_hs_evm_usb_defconfig
@@ -24,7 +24,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4037fef0
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig
index 2fac79bbd72..11f3d57a8f4 100644
--- a/configs/evb-ast2600_defconfig
+++ b/configs/evb-ast2600_defconfig
@@ -28,7 +28,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS4,115200n8 root=/dev/ram rw"
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig
index 8b4da5b3e7d..4e718c19d24 100644
--- a/configs/evb-rk3229_defconfig
+++ b/configs/evb-rk3229_defconfig
@@ -22,7 +22,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x61100000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 6d3bb5a2944..e3f3225f6ff 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MONITOR_LEN=614400
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb"
 CONFIG_SILENT_CONSOLE=y
diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 5308a8e3e97..032dcfe343c 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -29,7 +29,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/gwventana_gw5904_defconfig b/configs/gwventana_gw5904_defconfig
index 37fc1e51430..0c64b5f40a9 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -29,7 +29,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index f33625b2ca0..194faa5607d 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -29,7 +29,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/imx6qdl_icore_mipi_defconfig b/configs/imx6qdl_icore_mipi_defconfig
index 90eb153c45f..5045f60400a 100644
--- a/configs/imx6qdl_icore_mipi_defconfig
+++ b/configs/imx6qdl_icore_mipi_defconfig
@@ -28,7 +28,6 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig
index f5a7e969786..2831eb7d4e8 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -31,7 +31,6 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig
index ee2c597bcb2..b9383ed55b4 100644
--- a/configs/imx6qdl_icore_rqs_defconfig
+++ b/configs/imx6qdl_icore_rqs_defconfig
@@ -25,7 +25,6 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/imx8mm-cl-iot-gate-optee_defconfig b/configs/imx8mm-cl-iot-gate-optee_defconfig
index 80b801f9fed..586cb40f14b 100644
--- a/configs/imx8mm-cl-iot-gate-optee_defconfig
+++ b/configs/imx8mm-cl-iot-gate-optee_defconfig
@@ -22,7 +22,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mm-cl-iot-gate_defconfig b/configs/imx8mm-cl-iot-gate_defconfig
index e8e9d23c2eb..d26b083c6e9 100644
--- a/configs/imx8mm-cl-iot-gate_defconfig
+++ b/configs/imx8mm-cl-iot-gate_defconfig
@@ -24,7 +24,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mm-icore-mx8mm-ctouch2_defconfig b/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
index 846efa52f8c..56e9038d296 100644
--- a/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
+++ b/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mm-icore-mx8mm-ctouch2.dtb"
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig b/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
index 2814d3b3cb9..b54c01f9acb 100644
--- a/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
+++ b/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mm-icore-mx8mm-edimm2.2.dtb"
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mm-mx8menlo_defconfig b/configs/imx8mm-mx8menlo_defconfig
index f1e48bba965..da6c7add3f7 100644
--- a/configs/imx8mm-mx8menlo_defconfig
+++ b/configs/imx8mm-mx8menlo_defconfig
@@ -28,7 +28,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTCOMMAND="mmc partconf 0 distro_bootpart && load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} boot/fitImage && source ${loadaddr}:bootscr-boot.cmd ; reset"
 CONFIG_DEFAULT_FDT_FILE="imx8mm-mx8menlo.dtb"
diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
index 93f66310975..178c62a40fc 100644
--- a/configs/imx8mm_beacon_defconfig
+++ b/configs/imx8mm_beacon_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; fi;"
diff --git a/configs/imx8mm_data_modul_edm_sbc_defconfig b/configs/imx8mm_data_modul_edm_sbc_defconfig
index 3ccd26817ba..d9bd907761f 100644
--- a/configs/imx8mm_data_modul_edm_sbc_defconfig
+++ b/configs/imx8mm_data_modul_edm_sbc_defconfig
@@ -30,7 +30,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x44000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 5d1f30a660b..bea790182bd 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/configs/imx8mm_evk_fspi_defconfig b/configs/imx8mm_evk_fspi_defconfig
index 7c43dcf05cd..8e733df2955 100644
--- a/configs/imx8mm_evk_fspi_defconfig
+++ b/configs/imx8mm_evk_fspi_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x25000
diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig
index 65031ab64db..2041cb47cd7 100644
--- a/configs/imx8mm_venice_defconfig
+++ b/configs/imx8mm_venice_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig
index ba6856eafb0..5dd94e7423a 100644
--- a/configs/imx8mn_beacon_2g_defconfig
+++ b/configs/imx8mn_beacon_2g_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi"
diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig
index c73f7d7082b..ee815767803 100644
--- a/configs/imx8mn_beacon_defconfig
+++ b/configs/imx8mn_beacon_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi"
diff --git a/configs/imx8mn_bsh_smm_s2_defconfig b/configs/imx8mn_bsh_smm_s2_defconfig
index 47f4e15e5d6..454ca46aec1 100644
--- a/configs/imx8mn_bsh_smm_s2_defconfig
+++ b/configs/imx8mn_bsh_smm_s2_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-bsh-smm-s2.dtb"
 CONFIG_ARCH_MISC_INIT=y
diff --git a/configs/imx8mn_bsh_smm_s2pro_defconfig b/configs/imx8mn_bsh_smm_s2pro_defconfig
index 5092ec1206d..0384e781e28 100644
--- a/configs/imx8mn_bsh_smm_s2pro_defconfig
+++ b/configs/imx8mn_bsh_smm_s2pro_defconfig
@@ -24,7 +24,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-bsh-smm-s2pro.dtb"
 CONFIG_ARCH_MISC_INIT=y
diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig
index e238122d25a..bc5a92c3a3e 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mn-ddr4-evk.dtb"
 CONFIG_ARCH_MISC_INIT=y
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index 777b01a0f23..941d1666e46 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mn-evk.dtb"
 CONFIG_ARCH_MISC_INIT=y
diff --git a/configs/imx8mn_var_som_defconfig b/configs/imx8mn_var_som_defconfig
index 560b445a9cd..ac5ed963f60 100644
--- a/configs/imx8mn_var_som_defconfig
+++ b/configs/imx8mn_var_som_defconfig
@@ -25,7 +25,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-var-som-symphony.dtb"
 CONFIG_ARCH_MISC_INIT=y
diff --git a/configs/imx8mn_venice_defconfig b/configs/imx8mn_venice_defconfig
index d785915fa2e..86db0da2c1e 100644
--- a/configs/imx8mn_venice_defconfig
+++ b/configs/imx8mn_venice_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/imx8mp-icore-mx8mp-edimm2.2_defconfig b/configs/imx8mp-icore-mx8mp-edimm2.2_defconfig
index e3588473d59..051bd7f7984 100644
--- a/configs/imx8mp-icore-mx8mp-edimm2.2_defconfig
+++ b/configs/imx8mp-icore-mx8mp-edimm2.2_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-icore-mx8mp-edimm2.2.dtb"
 CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx8mp_dhcom_pdk2_defconfig b/configs/imx8mp_dhcom_pdk2_defconfig
index ecc28c89ef7..af97ed4836d 100644
--- a/configs/imx8mp_dhcom_pdk2_defconfig
+++ b/configs/imx8mp_dhcom_pdk2_defconfig
@@ -35,7 +35,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x44000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 10802eb9619..a7e397af201 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx8mp_rsb3720a1_4G_defconfig b/configs/imx8mp_rsb3720a1_4G_defconfig
index 5e29320b267..b23a74c45c3 100644
--- a/configs/imx8mp_rsb3720a1_4G_defconfig
+++ b/configs/imx8mp_rsb3720a1_4G_defconfig
@@ -29,7 +29,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-rsb3720-a1.dtb"
diff --git a/configs/imx8mp_rsb3720a1_6G_defconfig b/configs/imx8mp_rsb3720a1_6G_defconfig
index 11c3e1ffefd..40c28b43f11 100644
--- a/configs/imx8mp_rsb3720a1_6G_defconfig
+++ b/configs/imx8mp_rsb3720a1_6G_defconfig
@@ -29,7 +29,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-rsb3720-a1.dtb"
diff --git a/configs/imx8mp_venice_defconfig b/configs/imx8mp_venice_defconfig
index 220b2a2cff1..90c8164b618 100644
--- a/configs/imx8mp_venice_defconfig
+++ b/configs/imx8mp_venice_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/imx8mq_cm_defconfig b/configs/imx8mq_cm_defconfig
index ad42237a0cc..385a6b19bd4 100644
--- a/configs/imx8mq_cm_defconfig
+++ b/configs/imx8mq_cm_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x1f000
diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig
index 79a27dedb37..b02aa6a49eb 100644
--- a/configs/imx8mq_evk_defconfig
+++ b/configs/imx8mq_evk_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/imx8mq_phanbell_defconfig b/configs/imx8mq_phanbell_defconfig
index 7169e4d3f93..9e7cfabc413 100644
--- a/configs/imx8mq_phanbell_defconfig
+++ b/configs/imx8mq_phanbell_defconfig
@@ -25,7 +25,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SD_BOOT=y
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/imx8qm_rom7720_a1_4G_defconfig b/configs/imx8qm_rom7720_a1_4G_defconfig
index 7819bef8638..e74e35f32e1 100644
--- a/configs/imx8qm_rom7720_a1_4G_defconfig
+++ b/configs/imx8qm_rom7720_a1_4G_defconfig
@@ -22,7 +22,6 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi"
diff --git a/configs/iot2050_defconfig b/configs/iot2050_defconfig
index 4ae85f391b7..f83283ec220 100644
--- a/configs/iot2050_defconfig
+++ b/configs/iot2050_defconfig
@@ -27,7 +27,6 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80100000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
index 053f29b11f5..2ab4b059383 100644
--- a/configs/j7200_evm_a72_defconfig
+++ b/configs/j7200_evm_a72_defconfig
@@ -30,7 +30,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j7200_evm_r5_defconfig b/configs/j7200_evm_r5_defconfig
index dc6c1b6935d..f7a530e100d 100644
--- a/configs/j7200_evm_r5_defconfig
+++ b/configs/j7200_evm_r5_defconfig
@@ -27,7 +27,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0xc0000
diff --git a/configs/j7200_hs_evm_a72_defconfig b/configs/j7200_hs_evm_a72_defconfig
index 782a42b7465..7b8586e4015 100644
--- a/configs/j7200_hs_evm_a72_defconfig
+++ b/configs/j7200_hs_evm_a72_defconfig
@@ -31,7 +31,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j7200_hs_evm_r5_defconfig b/configs/j7200_hs_evm_r5_defconfig
index 73979f4cc32..ac8f875f942 100644
--- a/configs/j7200_hs_evm_r5_defconfig
+++ b/configs/j7200_hs_evm_r5_defconfig
@@ -27,7 +27,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_MAX_SIZE=0xc0000
diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 5efaff26d22..b486d3d6933 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -28,7 +28,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j721e_evm_r5_defconfig b/configs/j721e_evm_r5_defconfig
index 9d333e49056..ecde16aa518 100644
--- a/configs/j721e_evm_r5_defconfig
+++ b/configs/j721e_evm_r5_defconfig
@@ -27,7 +27,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/j721e_hs_evm_a72_defconfig b/configs/j721e_hs_evm_a72_defconfig
index ec66b18740e..f9fb8f29f90 100644
--- a/configs/j721e_hs_evm_a72_defconfig
+++ b/configs/j721e_hs_evm_a72_defconfig
@@ -29,7 +29,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_fit_${boot}; run get_overlay_${boot}; run run_fit"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j721e_hs_evm_r5_defconfig b/configs/j721e_hs_evm_r5_defconfig
index e496ec85af1..9756d298b38 100644
--- a/configs/j721e_hs_evm_r5_defconfig
+++ b/configs/j721e_hs_evm_r5_defconfig
@@ -27,7 +27,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41cf5bfc
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
index 99a0eee12d9..7ce0f7e9efd 100644
--- a/configs/j721s2_evm_a72_defconfig
+++ b/configs/j721s2_evm_a72_defconfig
@@ -30,7 +30,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig
index cd250169980..39018249dba 100644
--- a/configs/j721s2_evm_r5_defconfig
+++ b/configs/j721s2_evm_r5_defconfig
@@ -29,7 +29,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41c76000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
diff --git a/configs/j721s2_hs_evm_a72_defconfig b/configs/j721s2_hs_evm_a72_defconfig
index 9fc90737da8..af8e9b9c5cf 100644
--- a/configs/j721s2_hs_evm_a72_defconfig
+++ b/configs/j721s2_hs_evm_a72_defconfig
@@ -31,7 +31,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7
diff --git a/configs/j721s2_hs_evm_r5_defconfig b/configs/j721s2_hs_evm_r5_defconfig
index d9988fc17fc..84430fe0585 100644
--- a/configs/j721s2_hs_evm_r5_defconfig
+++ b/configs/j721s2_hs_evm_r5_defconfig
@@ -29,7 +29,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x41c76000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
diff --git a/configs/kontron-sl-mx6ul_defconfig b/configs/kontron-sl-mx6ul_defconfig
index 02b963e7c33..ef9e218b810 100644
--- a/configs/kontron-sl-mx6ul_defconfig
+++ b/configs/kontron-sl-mx6ul_defconfig
@@ -25,7 +25,6 @@ CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_TYPES=y
diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig
index 4b54813415d..35dc7f48f07 100644
--- a/configs/kontron-sl-mx8mm_defconfig
+++ b/configs/kontron-sl-mx8mm_defconfig
@@ -28,7 +28,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOARD_TYPES=y
 CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/kontron_pitx_imx8m_defconfig b/configs/kontron_pitx_imx8m_defconfig
index 898a0b45e85..5976c292139 100644
--- a/configs/kontron_pitx_imx8m_defconfig
+++ b/configs/kontron_pitx_imx8m_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig
index 9b90ed478cc..2aa36d6698e 100644
--- a/configs/kontron_sl28_defconfig
+++ b/configs/kontron_sl28_defconfig
@@ -33,7 +33,6 @@ CONFIG_SYS_MONITOR_LEN=1048576
 CONFIG_MP=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
diff --git a/configs/librem5_defconfig b/configs/librem5_defconfig
index 8be8421db3a..8bebd17e4bd 100644
--- a/configs/librem5_defconfig
+++ b/configs/librem5_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTDELAY=0
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig
index 560362695ff..a138f616746 100644
--- a/configs/ls1046ardb_qspi_spl_defconfig
+++ b/configs/ls1046ardb_qspi_spl_defconfig
@@ -35,7 +35,6 @@ CONFIG_SYS_MONITOR_LEN=1048576
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_RAMBOOT_PBL=y
 CONFIG_SYS_FSL_PBL_PBI="board/freescale/ls1046ardb/ls1046ardb_qspi_pbi.cfg"
diff --git a/configs/mccmon6_nor_defconfig b/configs/mccmon6_nor_defconfig
index 1e6cec01213..18eed39a574 100644
--- a/configs/mccmon6_nor_defconfig
+++ b/configs/mccmon6_nor_defconfig
@@ -20,7 +20,6 @@ CONFIG_ENV_ADDR=0x8040000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
diff --git a/configs/mccmon6_sd_defconfig b/configs/mccmon6_sd_defconfig
index 20b6e03bdfd..43e2a0b13dd 100644
--- a/configs/mccmon6_sd_defconfig
+++ b/configs/mccmon6_sd_defconfig
@@ -22,7 +22,6 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
diff --git a/configs/msc_sm2s_imx8mp_defconfig b/configs/msc_sm2s_imx8mp_defconfig
index 66ecd7d98b2..22f5ef16b50 100644
--- a/configs/msc_sm2s_imx8mp_defconfig
+++ b/configs/msc_sm2s_imx8mp_defconfig
@@ -24,7 +24,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-msc-sm2s.dtb"
 CONFIG_SPL_MAX_SIZE=0x26000
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 8e94a84409d..5b2a3a2a397 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run findfdt;mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi"
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 9472e032c81..cb2f34f00a0 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -25,7 +25,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run findfdt;mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi"
diff --git a/configs/phycore-imx8mm_defconfig b/configs/phycore-imx8mm_defconfig
index fab2550536f..5a60fb1530f 100644
--- a/configs/phycore-imx8mm_defconfig
+++ b/configs/phycore-imx8mm_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadimage; then run mmcboot; else run netboot; fi; fi;"
diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig
index 82e4f1ed970..d26b5728f48 100644
--- a/configs/phycore-imx8mp_defconfig
+++ b/configs/phycore-imx8mp_defconfig
@@ -23,7 +23,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadimage; then run mmcboot; else run netboot; fi; fi;"
diff --git a/configs/pico-imx6_defconfig b/configs/pico-imx6_defconfig
index a6ed013f8b6..3f1b07bf9e8 100644
--- a/configs/pico-imx6_defconfig
+++ b/configs/pico-imx6_defconfig
@@ -24,7 +24,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTCOMMAND="run default_boot"
 CONFIG_DEFAULT_FDT_FILE="ask"
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
diff --git a/configs/pico-imx8mq_defconfig b/configs/pico-imx8mq_defconfig
index 1b49eb2ed99..73c681b4e85 100644
--- a/configs/pico-imx8mq_defconfig
+++ b/configs/pico-imx8mq_defconfig
@@ -25,7 +25,6 @@ CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi"
diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index 9f1cb2675de..a63a2fd26d7 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -19,7 +19,6 @@ CONFIG_X86_OFFSET_U_BOOT=0xfff00000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_SYS_MONITOR_BASE=0x01110000
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
diff --git a/configs/sandbox_noinst_defconfig b/configs/sandbox_noinst_defconfig
index a12235559bf..b961fc82367 100644
--- a/configs/sandbox_noinst_defconfig
+++ b/configs/sandbox_noinst_defconfig
@@ -20,7 +20,6 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 4d70466fa9d..e583897a565 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -20,7 +20,6 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig
index c94b059a978..f3856c03638 100644
--- a/configs/sandbox_vpl_defconfig
+++ b/configs/sandbox_vpl_defconfig
@@ -27,7 +27,6 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
diff --git a/configs/socfpga_agilex_atf_defconfig b/configs/socfpga_agilex_atf_defconfig
index 9269eccf17a..52807bb1ac4 100644
--- a/configs/socfpga_agilex_atf_defconfig
+++ b/configs/socfpga_agilex_atf_defconfig
@@ -22,7 +22,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon"
diff --git a/configs/socfpga_agilex_vab_defconfig b/configs/socfpga_agilex_vab_defconfig
index da4545effff..87fd1c5ccd7 100644
--- a/configs/socfpga_agilex_vab_defconfig
+++ b/configs/socfpga_agilex_vab_defconfig
@@ -23,7 +23,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon"
diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig
index 4e2dc0c9857..d94d7f0188d 100644
--- a/configs/socfpga_arria10_defconfig
+++ b/configs/socfpga_arria10_defconfig
@@ -17,7 +17,6 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xffe2b000
 CONFIG_FIT=y
 CONFIG_TIMESTAMP=y
 CONFIG_SPL_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200"
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/socfpga_chameleonv3_defconfig b/configs/socfpga_chameleonv3_defconfig
index 00c4cf30089..4bbce3591da 100644
--- a/configs/socfpga_chameleonv3_defconfig
+++ b/configs/socfpga_chameleonv3_defconfig
@@ -11,7 +11,6 @@ CONFIG_SPL_FS_FAT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_SYS_SPL_MALLOC=y
diff --git a/configs/socfpga_n5x_atf_defconfig b/configs/socfpga_n5x_atf_defconfig
index 4d856d535a3..64aa5328538 100644
--- a/configs/socfpga_n5x_atf_defconfig
+++ b/configs/socfpga_n5x_atf_defconfig
@@ -21,7 +21,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
diff --git a/configs/socfpga_n5x_vab_defconfig b/configs/socfpga_n5x_vab_defconfig
index a6714b265e1..bc59a0f44bd 100644
--- a/configs/socfpga_n5x_vab_defconfig
+++ b/configs/socfpga_n5x_vab_defconfig
@@ -22,7 +22,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
diff --git a/configs/socfpga_stratix10_atf_defconfig b/configs/socfpga_stratix10_atf_defconfig
index e0e6b2d0461..3c46fdfc997 100644
--- a/configs/socfpga_stratix10_atf_defconfig
+++ b/configs/socfpga_stratix10_atf_defconfig
@@ -22,7 +22,6 @@ CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon"
diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig
index 7db562c542e..3cc1783ae39 100644
--- a/configs/stm32mp15_dhcom_basic_defconfig
+++ b/configs/stm32mp15_dhcom_basic_defconfig
@@ -29,7 +29,6 @@ CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
 CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its"
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=1
 CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig
index c94f03569f1..777bd9316de 100644
--- a/configs/stm32mp15_dhcor_basic_defconfig
+++ b/configs/stm32mp15_dhcor_basic_defconfig
@@ -27,7 +27,6 @@ CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
 CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its"
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=1
 CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 62f85883cb2..faaddad3ff3 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -26,7 +26,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTDELAY=1
 CONFIG_USE_PREBOOT=y
diff --git a/configs/verdin-imx8mp_defconfig b/configs/verdin-imx8mp_defconfig
index 153c7c15197..cfb77d9214e 100644
--- a/configs/verdin-imx8mp_defconfig
+++ b/configs/verdin-imx8mp_defconfig
@@ -32,7 +32,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTDELAY=1
 CONFIG_USE_PREBOOT=y
diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig
index a6baff1e24c..e418e4d2074 100644
--- a/configs/wandboard_defconfig
+++ b/configs/wandboard_defconfig
@@ -27,7 +27,6 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
index 610d9de2a63..04587e27458 100644
--- a/configs/xilinx_zynq_virt_defconfig
+++ b/configs/xilinx_zynq_virt_defconfig
@@ -24,7 +24,6 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_USE_PREBOOT=y
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index ab2a5426518..bb51e0735bd 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -25,6 +25,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
+CONFIG_USE_SPL_FIT_GENERATOR=y
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run scsi_init;usb start"
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-07 21:07 ` [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default Simon Glass
@ 2023-01-08 13:41   ` Tom Rini
  2023-01-08 15:48     ` Simon Glass
  0 siblings, 1 reply; 35+ messages in thread
From: Tom Rini @ 2023-01-08 13:41 UTC (permalink / raw)
  To: Simon Glass, Michal Simek, Luca Ceresoli
  Cc: U-Boot Mailing List, Roger Quadros, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:

> This option is deprecated and only used by two boards. Enable it for just
> those two boards, so others don't accidentally enable it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
[snip]
> diff --git a/boot/Kconfig b/boot/Kconfig
> index 55f06761ef8..7ab0dd14211 100644
> --- a/boot/Kconfig
> +++ b/boot/Kconfig
> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>  config USE_SPL_FIT_GENERATOR
>  	bool "Use a script to generate the .its script"
>  	depends on SPL_FIT
> -	default y if SPL_FIT && ARCH_ZYNQMP
> +	help
> +	  This is deprecated. Please do not use it. Use binman instead.

Lets remove the text around bool so it can't be enabled, and move to
select'ing it from the two boards that need it. Michal, Luca, what's
needed to move your two platforms
(avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
of this very legacy option, given that other xilinx platforms have
already migrated to binman ?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 13:41   ` Tom Rini
@ 2023-01-08 15:48     ` Simon Glass
  2023-01-08 16:06       ` Tom Rini
  0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2023-01-08 15:48 UTC (permalink / raw)
  To: Tom Rini
  Cc: Michal Simek, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Tom,

On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
>
> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>
> > This option is deprecated and only used by two boards. Enable it for just
> > those two boards, so others don't accidentally enable it.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> [snip]
> > diff --git a/boot/Kconfig b/boot/Kconfig
> > index 55f06761ef8..7ab0dd14211 100644
> > --- a/boot/Kconfig
> > +++ b/boot/Kconfig
> > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> >  config USE_SPL_FIT_GENERATOR
> >       bool "Use a script to generate the .its script"
> >       depends on SPL_FIT
> > -     default y if SPL_FIT && ARCH_ZYNQMP
> > +     help
> > +       This is deprecated. Please do not use it. Use binman instead.
>
> Lets remove the text around bool so it can't be enabled, and move to
> select'ing it from the two boards that need it. Michal, Luca, what's
> needed to move your two platforms
> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> of this very legacy option, given that other xilinx platforms have
> already migrated to binman ?

That's a good idea, but these two boards do not have TARGET Kconfig
options so it is not possible without adding some Kconfig specific to
those boards, then defining it in the defconfig files.

We already have the legacy warning.

Regards,
Simon

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 15:48     ` Simon Glass
@ 2023-01-08 16:06       ` Tom Rini
  2023-01-08 16:20         ` Simon Glass
  0 siblings, 1 reply; 35+ messages in thread
From: Tom Rini @ 2023-01-08 16:06 UTC (permalink / raw)
  To: Simon Glass, Michal Simek, Luca Ceresoli
  Cc: U-Boot Mailing List, Roger Quadros, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]

On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> >
> > > This option is deprecated and only used by two boards. Enable it for just
> > > those two boards, so others don't accidentally enable it.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > [snip]
> > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > index 55f06761ef8..7ab0dd14211 100644
> > > --- a/boot/Kconfig
> > > +++ b/boot/Kconfig
> > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > >  config USE_SPL_FIT_GENERATOR
> > >       bool "Use a script to generate the .its script"
> > >       depends on SPL_FIT
> > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > +     help
> > > +       This is deprecated. Please do not use it. Use binman instead.
> >
> > Lets remove the text around bool so it can't be enabled, and move to
> > select'ing it from the two boards that need it. Michal, Luca, what's
> > needed to move your two platforms
> > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > of this very legacy option, given that other xilinx platforms have
> > already migrated to binman ?
> 
> That's a good idea, but these two boards do not have TARGET Kconfig
> options so it is not possible without adding some Kconfig specific to
> those boards, then defining it in the defconfig files.
> 
> We already have the legacy warning.

Yes, but I swear these are new legacy users as when we started trying to
kill off this option it was just a few i.MX platforms lagging behind.

Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
Michal or Luca will speak up soon and migrate these over quickly so we
can just nuke this.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 16:06       ` Tom Rini
@ 2023-01-08 16:20         ` Simon Glass
  2023-01-08 16:24           ` Tom Rini
  0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2023-01-08 16:20 UTC (permalink / raw)
  To: Tom Rini
  Cc: Michal Simek, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Tom,

On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > Hi Tom,
> >
> > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > >
> > > > This option is deprecated and only used by two boards. Enable it for just
> > > > those two boards, so others don't accidentally enable it.
> > > >
> > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > [snip]
> > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > index 55f06761ef8..7ab0dd14211 100644
> > > > --- a/boot/Kconfig
> > > > +++ b/boot/Kconfig
> > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > >  config USE_SPL_FIT_GENERATOR
> > > >       bool "Use a script to generate the .its script"
> > > >       depends on SPL_FIT
> > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > +     help
> > > > +       This is deprecated. Please do not use it. Use binman instead.
> > >
> > > Lets remove the text around bool so it can't be enabled, and move to
> > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > needed to move your two platforms
> > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > of this very legacy option, given that other xilinx platforms have
> > > already migrated to binman ?
> >
> > That's a good idea, but these two boards do not have TARGET Kconfig
> > options so it is not possible without adding some Kconfig specific to
> > those boards, then defining it in the defconfig files.
> >
> > We already have the legacy warning.
>
> Yes, but I swear these are new legacy users as when we started trying to
> kill off this option it was just a few i.MX platforms lagging behind.
>
> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> Michal or Luca will speak up soon and migrate these over quickly so we
> can just nuke this.

Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
boards since they don't appear in CI. Then they can convert them when
ready.

That way we can drop the option now, if that is your goal.

Regards,
Simon

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 16:20         ` Simon Glass
@ 2023-01-08 16:24           ` Tom Rini
  2023-01-08 19:36             ` Simon Glass
  0 siblings, 1 reply; 35+ messages in thread
From: Tom Rini @ 2023-01-08 16:24 UTC (permalink / raw)
  To: Simon Glass, Michal Simek, Luca Ceresoli
  Cc: U-Boot Mailing List, Roger Quadros, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 2857 bytes --]

On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > >
> > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > those two boards, so others don't accidentally enable it.
> > > > >
> > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > [snip]
> > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > --- a/boot/Kconfig
> > > > > +++ b/boot/Kconfig
> > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > >  config USE_SPL_FIT_GENERATOR
> > > > >       bool "Use a script to generate the .its script"
> > > > >       depends on SPL_FIT
> > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > +     help
> > > > > +       This is deprecated. Please do not use it. Use binman instead.
> > > >
> > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > needed to move your two platforms
> > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > of this very legacy option, given that other xilinx platforms have
> > > > already migrated to binman ?
> > >
> > > That's a good idea, but these two boards do not have TARGET Kconfig
> > > options so it is not possible without adding some Kconfig specific to
> > > those boards, then defining it in the defconfig files.
> > >
> > > We already have the legacy warning.
> >
> > Yes, but I swear these are new legacy users as when we started trying to
> > kill off this option it was just a few i.MX platforms lagging behind.
> >
> > Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> > on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> > Michal or Luca will speak up soon and migrate these over quickly so we
> > can just nuke this.
> 
> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> boards since they don't appear in CI. Then they can convert them when
> ready.
> 
> That way we can drop the option now, if that is your goal.

I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
don't want to break platforms outright, and since it's Sunday right now
afterall, we should let Michal and Luca a chance to catch up and chime
in. I hope it's either going to be a quick conversion or expose
something missing and needed in binman, as to why these still haven't
been converted.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 16:24           ` Tom Rini
@ 2023-01-08 19:36             ` Simon Glass
  2023-01-09  8:56               ` Luca Ceresoli
                                 ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-08 19:36 UTC (permalink / raw)
  To: Tom Rini
  Cc: Michal Simek, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Tom,

On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> > Hi Tom,
> >
> > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > >
> > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > those two boards, so others don't accidentally enable it.
> > > > > >
> > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > > [snip]
> > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > --- a/boot/Kconfig
> > > > > > +++ b/boot/Kconfig
> > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > >  config USE_SPL_FIT_GENERATOR
> > > > > >       bool "Use a script to generate the .its script"
> > > > > >       depends on SPL_FIT
> > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > +     help
> > > > > > +       This is deprecated. Please do not use it. Use binman instead.
> > > > >
> > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > needed to move your two platforms
> > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > of this very legacy option, given that other xilinx platforms have
> > > > > already migrated to binman ?
> > > >
> > > > That's a good idea, but these two boards do not have TARGET Kconfig
> > > > options so it is not possible without adding some Kconfig specific to
> > > > those boards, then defining it in the defconfig files.
> > > >
> > > > We already have the legacy warning.
> > >
> > > Yes, but I swear these are new legacy users as when we started trying to
> > > kill off this option it was just a few i.MX platforms lagging behind.
> > >
> > > Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> > > on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> > > Michal or Luca will speak up soon and migrate these over quickly so we
> > > can just nuke this.
> >
> > Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> > boards since they don't appear in CI. Then they can convert them when
> > ready.
> >
> > That way we can drop the option now, if that is your goal.
>
> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> don't want to break platforms outright, and since it's Sunday right now
> afterall, we should let Michal and Luca a chance to catch up and chime
> in. I hope it's either going to be a quick conversion or expose
> something missing and needed in binman, as to why these still haven't
> been converted.
>

OK let's hold off on this patch for now. It is just a clean-up anyway.

Regards,
Simon

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 19:36             ` Simon Glass
@ 2023-01-09  8:56               ` Luca Ceresoli
  2023-01-09 14:13                 ` Tom Rini
  2023-01-09 11:07               ` Michal Simek
  2023-01-09 18:55               ` Tom Rini
  2 siblings, 1 reply; 35+ messages in thread
From: Luca Ceresoli @ 2023-01-09  8:56 UTC (permalink / raw)
  To: Simon Glass, Tom Rini, Michal Simek
  Cc: U-Boot Mailing List, Roger Quadros, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes

Hello Tom, Simon, Michal,

On Sun, 8 Jan 2023 12:36:15 -0700
Simon Glass <sjg@chromium.org> wrote:

> Hi Tom,
> 
> On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:  
> > > Hi Tom,
> > >
> > > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:  
> > > >
> > > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:  
> > > > > Hi Tom,
> > > > >
> > > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:  
> > > > > >
> > > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > > >  
> > > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > > those two boards, so others don't accidentally enable it.
> > > > > > >
> > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>  
> > > > > > [snip]  
> > > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > > --- a/boot/Kconfig
> > > > > > > +++ b/boot/Kconfig
> > > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > > >  config USE_SPL_FIT_GENERATOR
> > > > > > >       bool "Use a script to generate the .its script"
> > > > > > >       depends on SPL_FIT
> > > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > > +     help
> > > > > > > +       This is deprecated. Please do not use it. Use binman instead.  
> > > > > >
> > > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > > needed to move your two platforms
> > > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > > of this very legacy option, given that other xilinx platforms have
> > > > > > already migrated to binman ?  

Unfortunately I lost access to that board, and since the vendor does
not appear interested in supporting it I think the best options would
be to either remove the defconfig or to keep legacy support.

Which one would you prefer?

Regards,
-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 19:36             ` Simon Glass
  2023-01-09  8:56               ` Luca Ceresoli
@ 2023-01-09 11:07               ` Michal Simek
  2023-01-09 14:12                 ` Tom Rini
  2023-01-09 15:34                 ` Simon Glass
  2023-01-09 18:55               ` Tom Rini
  2 siblings, 2 replies; 35+ messages in thread
From: Michal Simek @ 2023-01-09 11:07 UTC (permalink / raw)
  To: Simon Glass, Tom Rini
  Cc: Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi,

On 1/8/23 20:36, Simon Glass wrote:
> Hi Tom,
> 
> On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
>>
>> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
>>> Hi Tom,
>>>
>>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
>>>>
>>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
>>>>> Hi Tom,
>>>>>
>>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
>>>>>>
>>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>>>>>>
>>>>>>> This option is deprecated and only used by two boards. Enable it for just
>>>>>>> those two boards, so others don't accidentally enable it.
>>>>>>>
>>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>>> [snip]
>>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
>>>>>>> index 55f06761ef8..7ab0dd14211 100644
>>>>>>> --- a/boot/Kconfig
>>>>>>> +++ b/boot/Kconfig
>>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>>>>>>>   config USE_SPL_FIT_GENERATOR
>>>>>>>        bool "Use a script to generate the .its script"
>>>>>>>        depends on SPL_FIT
>>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
>>>>>>> +     help
>>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
>>>>>>
>>>>>> Lets remove the text around bool so it can't be enabled, and move to
>>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
>>>>>> needed to move your two platforms
>>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
>>>>>> of this very legacy option, given that other xilinx platforms have
>>>>>> already migrated to binman ?
>>>>>
>>>>> That's a good idea, but these two boards do not have TARGET Kconfig
>>>>> options so it is not possible without adding some Kconfig specific to
>>>>> those boards, then defining it in the defconfig files.
>>>>>
>>>>> We already have the legacy warning.
>>>>
>>>> Yes, but I swear these are new legacy users as when we started trying to
>>>> kill off this option it was just a few i.MX platforms lagging behind.
>>>>
>>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
>>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
>>>> Michal or Luca will speak up soon and migrate these over quickly so we
>>>> can just nuke this.
>>>
>>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
>>> boards since they don't appear in CI. Then they can convert them when
>>> ready.
>>>
>>> That way we can drop the option now, if that is your goal.
>>
>> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
>> don't want to break platforms outright, and since it's Sunday right now
>> afterall, we should let Michal and Luca a chance to catch up and chime
>> in. I hope it's either going to be a quick conversion or expose
>> something missing and needed in binman, as to why these still haven't
>> been converted.
>>
> 
> OK let's hold off on this patch for now. It is just a clean-up anyway.

First of all. ZynqMP is not wired in CI simply because we are missing some bits 
and pieces in upstream qemu to run it. If we can wire it with Xilinx version we 
can do it. I have asked to fix it our qemu team but they have never done it.

In U-Boot SPL flow this script is used all the time. I use it all the time when 
I build work on ZynqMP. Also buildroot is using it.

In connection to binman. I have looked at it 2/3 times in past. The biggest 
issue which I have with it is that DT node presence in DT which goes to the system.

Here is example

[u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
[u-boot](binman)$ make -j8 >/dev/null
[u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
	binman {
		binman = "/binman";
		u_boot_rom = "/binman/u-boot-rom";

where binmap is the part of target DT.

It has side effects.
1. DT is bigger
2. It contains information how firmware was packed which is just additional 
information which don't need to be shared.
3. binman node as is placed in not documented in dt binding to be able to pass 
dtb check.

I can call binman externally but that would mean additional build step which 
everybody wants to avoid.
Can we update Makefile and add Kconfig option to pass configuration dtb file 
instead of u-boot.dtb by default?

Something like:

diff --git a/Makefile b/Makefile
index 75a599b2c437..4d8d67c7d938 100644
--- a/Makefile
+++ b/Makefile
@@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if 
$(BINMAN_DEBUG),-D) \
                 $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
                  --toolpath $(objtree)/tools \
                 $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
-               build -u -d u-boot.dtb -O . -m \
+               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
                 $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
                 -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                 -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \

Then by default u-boot.dtb can be used or platforms can use different file.
Then I would add zynqmp-binman.dts with configurations which can replace 
existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
What do you think?

BTW: Is there a way to generate also capsules from binman?

Thanks,
Michal

^ permalink raw reply related	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 11:07               ` Michal Simek
@ 2023-01-09 14:12                 ` Tom Rini
  2023-01-09 14:37                   ` Michal Simek
  2023-01-09 15:34                 ` Simon Glass
  1 sibling, 1 reply; 35+ messages in thread
From: Tom Rini @ 2023-01-09 14:12 UTC (permalink / raw)
  To: Michal Simek
  Cc: Simon Glass, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 6469 bytes --]

On Mon, Jan 09, 2023 at 12:07:05PM +0100, Michal Simek wrote:
> Hi,
> 
> On 1/8/23 20:36, Simon Glass wrote:
> > Hi Tom,
> > 
> > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> > > 
> > > On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> > > > Hi Tom,
> > > > 
> > > > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > 
> > > > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > > > > > Hi Tom,
> > > > > > 
> > > > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > 
> > > > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > > > > 
> > > > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > > > those two boards, so others don't accidentally enable it.
> > > > > > > > 
> > > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > > > > [snip]
> > > > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > > > --- a/boot/Kconfig
> > > > > > > > +++ b/boot/Kconfig
> > > > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > > > >   config USE_SPL_FIT_GENERATOR
> > > > > > > >        bool "Use a script to generate the .its script"
> > > > > > > >        depends on SPL_FIT
> > > > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > > > +     help
> > > > > > > > +       This is deprecated. Please do not use it. Use binman instead.
> > > > > > > 
> > > > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > > > needed to move your two platforms
> > > > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > > > of this very legacy option, given that other xilinx platforms have
> > > > > > > already migrated to binman ?
> > > > > > 
> > > > > > That's a good idea, but these two boards do not have TARGET Kconfig
> > > > > > options so it is not possible without adding some Kconfig specific to
> > > > > > those boards, then defining it in the defconfig files.
> > > > > > 
> > > > > > We already have the legacy warning.
> > > > > 
> > > > > Yes, but I swear these are new legacy users as when we started trying to
> > > > > kill off this option it was just a few i.MX platforms lagging behind.
> > > > > 
> > > > > Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> > > > > on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> > > > > Michal or Luca will speak up soon and migrate these over quickly so we
> > > > > can just nuke this.
> > > > 
> > > > Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> > > > boards since they don't appear in CI. Then they can convert them when
> > > > ready.
> > > > 
> > > > That way we can drop the option now, if that is your goal.
> > > 
> > > I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> > > don't want to break platforms outright, and since it's Sunday right now
> > > afterall, we should let Michal and Luca a chance to catch up and chime
> > > in. I hope it's either going to be a quick conversion or expose
> > > something missing and needed in binman, as to why these still haven't
> > > been converted.
> > > 
> > 
> > OK let's hold off on this patch for now. It is just a clean-up anyway.
> 
> First of all. ZynqMP is not wired in CI simply because we are missing some
> bits and pieces in upstream qemu to run it. If we can wire it with Xilinx
> version we can do it. I have asked to fix it our qemu team but they have
> never done it.

Ah yes, I remember you saying that now. I guess it comes down to how
hard it would be to patch that support in to 6.1.0 (or, move us up to a
newer release and patch on top of that) in tools/docker/Dockerfile. We
special-case the nokia_rx51 support in QEMU because it's so old, so I'd
rather avoid that for another platform if we can.

> In U-Boot SPL flow this script is used all the time. I use it all the time
> when I build work on ZynqMP. Also buildroot is using it.
> 
> In connection to binman. I have looked at it 2/3 times in past. The biggest
> issue which I have with it is that DT node presence in DT which goes to the
> system.
> 
> Here is example
> 
> [u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
> [u-boot](binman)$ make -j8 >/dev/null
> [u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
> 	binman {
> 		binman = "/binman";
> 		u_boot_rom = "/binman/u-boot-rom";
> 
> where binmap is the part of target DT.
> 
> It has side effects.
> 1. DT is bigger
> 2. It contains information how firmware was packed which is just additional
> information which don't need to be shared.
> 3. binman node as is placed in not documented in dt binding to be able to
> pass dtb check.
> 
> I can call binman externally but that would mean additional build step which
> everybody wants to avoid.
> Can we update Makefile and add Kconfig option to pass configuration dtb file
> instead of u-boot.dtb by default?
> 
> Something like:
> 
> diff --git a/Makefile b/Makefile
> index 75a599b2c437..4d8d67c7d938 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if
> $(BINMAN_DEBUG),-D) \
>                 $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
>                  --toolpath $(objtree)/tools \
>                 $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
> -               build -u -d u-boot.dtb -O . -m \
> +               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
>                 $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
>                 -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
>                 -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
> 
> Then by default u-boot.dtb can be used or platforms can use different file.
> Then I would add zynqmp-binman.dts with configurations which can replace
> existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
> What do you think?
> 
> BTW: Is there a way to generate also capsules from binman?

This is the kind of feedback I think we've been needing here, and I'll
leave it to Simon to address, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09  8:56               ` Luca Ceresoli
@ 2023-01-09 14:13                 ` Tom Rini
  2023-01-09 14:29                   ` Michal Simek
  0 siblings, 1 reply; 35+ messages in thread
From: Tom Rini @ 2023-01-09 14:13 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Simon Glass, Michal Simek, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 2462 bytes --]

On Mon, Jan 09, 2023 at 09:56:30AM +0100, Luca Ceresoli wrote:
> Hello Tom, Simon, Michal,
> 
> On Sun, 8 Jan 2023 12:36:15 -0700
> Simon Glass <sjg@chromium.org> wrote:
> 
> > Hi Tom,
> > 
> > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:  
> > > > Hi Tom,
> > > >
> > > > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:  
> > > > >
> > > > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:  
> > > > > > Hi Tom,
> > > > > >
> > > > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:  
> > > > > > >
> > > > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > > > >  
> > > > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > > > those two boards, so others don't accidentally enable it.
> > > > > > > >
> > > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>  
> > > > > > > [snip]  
> > > > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > > > --- a/boot/Kconfig
> > > > > > > > +++ b/boot/Kconfig
> > > > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > > > >  config USE_SPL_FIT_GENERATOR
> > > > > > > >       bool "Use a script to generate the .its script"
> > > > > > > >       depends on SPL_FIT
> > > > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > > > +     help
> > > > > > > > +       This is deprecated. Please do not use it. Use binman instead.  
> > > > > > >
> > > > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > > > needed to move your two platforms
> > > > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > > > of this very legacy option, given that other xilinx platforms have
> > > > > > > already migrated to binman ?  
> 
> Unfortunately I lost access to that board, and since the vendor does
> not appear interested in supporting it I think the best options would
> be to either remove the defconfig or to keep legacy support.
> 
> Which one would you prefer?

If the vendor doesn't want to support it, and no one can test it, it
should get dropped I think. Michal, do you have anything to add here?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 14:13                 ` Tom Rini
@ 2023-01-09 14:29                   ` Michal Simek
  0 siblings, 0 replies; 35+ messages in thread
From: Michal Simek @ 2023-01-09 14:29 UTC (permalink / raw)
  To: Tom Rini, Luca Ceresoli
  Cc: Simon Glass, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes



On 1/9/23 15:13, Tom Rini wrote:
> On Mon, Jan 09, 2023 at 09:56:30AM +0100, Luca Ceresoli wrote:
>> Hello Tom, Simon, Michal,
>>
>> On Sun, 8 Jan 2023 12:36:15 -0700
>> Simon Glass <sjg@chromium.org> wrote:
>>
>>> Hi Tom,
>>>
>>> On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
>>>>
>>>> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
>>>>> Hi Tom,
>>>>>
>>>>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
>>>>>>
>>>>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
>>>>>>> Hi Tom,
>>>>>>>
>>>>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
>>>>>>>>
>>>>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>>>>>>>>   
>>>>>>>>> This option is deprecated and only used by two boards. Enable it for just
>>>>>>>>> those two boards, so others don't accidentally enable it.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>>>>> [snip]
>>>>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
>>>>>>>>> index 55f06761ef8..7ab0dd14211 100644
>>>>>>>>> --- a/boot/Kconfig
>>>>>>>>> +++ b/boot/Kconfig
>>>>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>>>>>>>>>   config USE_SPL_FIT_GENERATOR
>>>>>>>>>        bool "Use a script to generate the .its script"
>>>>>>>>>        depends on SPL_FIT
>>>>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
>>>>>>>>> +     help
>>>>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
>>>>>>>>
>>>>>>>> Lets remove the text around bool so it can't be enabled, and move to
>>>>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
>>>>>>>> needed to move your two platforms
>>>>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
>>>>>>>> of this very legacy option, given that other xilinx platforms have
>>>>>>>> already migrated to binman ?
>>
>> Unfortunately I lost access to that board, and since the vendor does
>> not appear interested in supporting it I think the best options would
>> be to either remove the defconfig or to keep legacy support.
>>
>> Which one would you prefer?
> 
> If the vendor doesn't want to support it, and no one can test it, it
> should get dropped I think. Michal, do you have anything to add here?
> 

I don't have access to this board too.

I don't think there is a need to have separate defconfig for it and that board 
should be already covered by xilinx_zynqmp_virt_defconfig.
It means we can just remove defconfig and keep dts and psu_init* in the tree and 
I believe it will work fine as before.

Or of course remove it completely if none is wiling to support it.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 14:12                 ` Tom Rini
@ 2023-01-09 14:37                   ` Michal Simek
  2023-01-09 15:05                     ` Tom Rini
  0 siblings, 1 reply; 35+ messages in thread
From: Michal Simek @ 2023-01-09 14:37 UTC (permalink / raw)
  To: Tom Rini
  Cc: Simon Glass, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes



On 1/9/23 15:12, Tom Rini wrote:
> On Mon, Jan 09, 2023 at 12:07:05PM +0100, Michal Simek wrote:
>> Hi,
>>
>> On 1/8/23 20:36, Simon Glass wrote:
>>> Hi Tom,
>>>
>>> On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
>>>>
>>>> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
>>>>> Hi Tom,
>>>>>
>>>>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
>>>>>>
>>>>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
>>>>>>> Hi Tom,
>>>>>>>
>>>>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
>>>>>>>>
>>>>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>>>>>>>>
>>>>>>>>> This option is deprecated and only used by two boards. Enable it for just
>>>>>>>>> those two boards, so others don't accidentally enable it.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>>>>> [snip]
>>>>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
>>>>>>>>> index 55f06761ef8..7ab0dd14211 100644
>>>>>>>>> --- a/boot/Kconfig
>>>>>>>>> +++ b/boot/Kconfig
>>>>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>>>>>>>>>    config USE_SPL_FIT_GENERATOR
>>>>>>>>>         bool "Use a script to generate the .its script"
>>>>>>>>>         depends on SPL_FIT
>>>>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
>>>>>>>>> +     help
>>>>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
>>>>>>>>
>>>>>>>> Lets remove the text around bool so it can't be enabled, and move to
>>>>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
>>>>>>>> needed to move your two platforms
>>>>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
>>>>>>>> of this very legacy option, given that other xilinx platforms have
>>>>>>>> already migrated to binman ?
>>>>>>>
>>>>>>> That's a good idea, but these two boards do not have TARGET Kconfig
>>>>>>> options so it is not possible without adding some Kconfig specific to
>>>>>>> those boards, then defining it in the defconfig files.
>>>>>>>
>>>>>>> We already have the legacy warning.
>>>>>>
>>>>>> Yes, but I swear these are new legacy users as when we started trying to
>>>>>> kill off this option it was just a few i.MX platforms lagging behind.
>>>>>>
>>>>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
>>>>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
>>>>>> Michal or Luca will speak up soon and migrate these over quickly so we
>>>>>> can just nuke this.
>>>>>
>>>>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
>>>>> boards since they don't appear in CI. Then they can convert them when
>>>>> ready.
>>>>>
>>>>> That way we can drop the option now, if that is your goal.
>>>>
>>>> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
>>>> don't want to break platforms outright, and since it's Sunday right now
>>>> afterall, we should let Michal and Luca a chance to catch up and chime
>>>> in. I hope it's either going to be a quick conversion or expose
>>>> something missing and needed in binman, as to why these still haven't
>>>> been converted.
>>>>
>>>
>>> OK let's hold off on this patch for now. It is just a clean-up anyway.
>>
>> First of all. ZynqMP is not wired in CI simply because we are missing some
>> bits and pieces in upstream qemu to run it. If we can wire it with Xilinx
>> version we can do it. I have asked to fix it our qemu team but they have
>> never done it.
> 
> Ah yes, I remember you saying that now. I guess it comes down to how
> hard it would be to patch that support in to 6.1.0 (or, move us up to a
> newer release and patch on top of that) in tools/docker/Dockerfile. We
> special-case the nokia_rx51 support in QEMU because it's so old, so I'd
> rather avoid that for another platform if we can.

Issue is with firmware interface which is going over mailbox to microblaze unit 
which runs power management firmware. It means it not single qemu instance which 
Xilinx uses. There are 2. One microblaze and second ARM and IIRC communication 
is done via socket.
I don't think this will get to Qemu anytime soon.
But on the other hand in past we normally run arm core without any firmware on 
Microblaze. We would have to disable communication between ARM and Microblaze 
and work with fixed clock. After it we should be able to run zynqmp under CI.
I have already asked my colleagues to fix drivers which can't work with 
ZYNQMP_FIRMWARE off. Also I have seen one missing Kconfig dependency.

And then next step would be to identify some registers which Qemu doesn't model 
but u-boot is reading. I don't think they are modeled now.

IIRC we still have internal task to get ZynqMP CI in our tracking system that's 
why we will get there at some point.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 14:37                   ` Michal Simek
@ 2023-01-09 15:05                     ` Tom Rini
  0 siblings, 0 replies; 35+ messages in thread
From: Tom Rini @ 2023-01-09 15:05 UTC (permalink / raw)
  To: Michal Simek
  Cc: Simon Glass, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 5712 bytes --]

On Mon, Jan 09, 2023 at 03:37:20PM +0100, Michal Simek wrote:
> 
> 
> On 1/9/23 15:12, Tom Rini wrote:
> > On Mon, Jan 09, 2023 at 12:07:05PM +0100, Michal Simek wrote:
> > > Hi,
> > > 
> > > On 1/8/23 20:36, Simon Glass wrote:
> > > > Hi Tom,
> > > > 
> > > > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> > > > > 
> > > > > On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> > > > > > Hi Tom,
> > > > > > 
> > > > > > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > 
> > > > > > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > > > > > > > Hi Tom,
> > > > > > > > 
> > > > > > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > > > > > > > > 
> > > > > > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > > > > > > 
> > > > > > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > > > > > those two boards, so others don't accidentally enable it.
> > > > > > > > > > 
> > > > > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > > > > > > [snip]
> > > > > > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > > > > > --- a/boot/Kconfig
> > > > > > > > > > +++ b/boot/Kconfig
> > > > > > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > > > > > >    config USE_SPL_FIT_GENERATOR
> > > > > > > > > >         bool "Use a script to generate the .its script"
> > > > > > > > > >         depends on SPL_FIT
> > > > > > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > > > > > +     help
> > > > > > > > > > +       This is deprecated. Please do not use it. Use binman instead.
> > > > > > > > > 
> > > > > > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > > > > > needed to move your two platforms
> > > > > > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > > > > > of this very legacy option, given that other xilinx platforms have
> > > > > > > > > already migrated to binman ?
> > > > > > > > 
> > > > > > > > That's a good idea, but these two boards do not have TARGET Kconfig
> > > > > > > > options so it is not possible without adding some Kconfig specific to
> > > > > > > > those boards, then defining it in the defconfig files.
> > > > > > > > 
> > > > > > > > We already have the legacy warning.
> > > > > > > 
> > > > > > > Yes, but I swear these are new legacy users as when we started trying to
> > > > > > > kill off this option it was just a few i.MX platforms lagging behind.
> > > > > > > 
> > > > > > > Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> > > > > > > on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> > > > > > > Michal or Luca will speak up soon and migrate these over quickly so we
> > > > > > > can just nuke this.
> > > > > > 
> > > > > > Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> > > > > > boards since they don't appear in CI. Then they can convert them when
> > > > > > ready.
> > > > > > 
> > > > > > That way we can drop the option now, if that is your goal.
> > > > > 
> > > > > I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> > > > > don't want to break platforms outright, and since it's Sunday right now
> > > > > afterall, we should let Michal and Luca a chance to catch up and chime
> > > > > in. I hope it's either going to be a quick conversion or expose
> > > > > something missing and needed in binman, as to why these still haven't
> > > > > been converted.
> > > > > 
> > > > 
> > > > OK let's hold off on this patch for now. It is just a clean-up anyway.
> > > 
> > > First of all. ZynqMP is not wired in CI simply because we are missing some
> > > bits and pieces in upstream qemu to run it. If we can wire it with Xilinx
> > > version we can do it. I have asked to fix it our qemu team but they have
> > > never done it.
> > 
> > Ah yes, I remember you saying that now. I guess it comes down to how
> > hard it would be to patch that support in to 6.1.0 (or, move us up to a
> > newer release and patch on top of that) in tools/docker/Dockerfile. We
> > special-case the nokia_rx51 support in QEMU because it's so old, so I'd
> > rather avoid that for another platform if we can.
> 
> Issue is with firmware interface which is going over mailbox to microblaze
> unit which runs power management firmware. It means it not single qemu
> instance which Xilinx uses. There are 2. One microblaze and second ARM and
> IIRC communication is done via socket.
> I don't think this will get to Qemu anytime soon.
> But on the other hand in past we normally run arm core without any firmware
> on Microblaze. We would have to disable communication between ARM and
> Microblaze and work with fixed clock. After it we should be able to run
> zynqmp under CI.
> I have already asked my colleagues to fix drivers which can't work with
> ZYNQMP_FIRMWARE off. Also I have seen one missing Kconfig dependency.
> 
> And then next step would be to identify some registers which Qemu doesn't
> model but u-boot is reading. I don't think they are modeled now.
> 
> IIRC we still have internal task to get ZynqMP CI in our tracking system
> that's why we will get there at some point.

OK, I'll be hopeful things get resolved at least internally sometime
soon, more CI is always better.  Thanks for explaining.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 11:07               ` Michal Simek
  2023-01-09 14:12                 ` Tom Rini
@ 2023-01-09 15:34                 ` Simon Glass
  2023-01-10 15:16                   ` Michal Simek
  1 sibling, 1 reply; 35+ messages in thread
From: Simon Glass @ 2023-01-09 15:34 UTC (permalink / raw)
  To: Michal Simek
  Cc: Tom Rini, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Michal,

On Mon, 9 Jan 2023 at 04:07, Michal Simek <michal.simek@amd.com> wrote:
>
> Hi,
>
> On 1/8/23 20:36, Simon Glass wrote:
> > Hi Tom,
> >
> > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> >>
> >> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> >>> Hi Tom,
> >>>
> >>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> >>>>
> >>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> >>>>> Hi Tom,
> >>>>>
> >>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> >>>>>>
> >>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> >>>>>>
> >>>>>>> This option is deprecated and only used by two boards. Enable it
for just
> >>>>>>> those two boards, so others don't accidentally enable it.
> >>>>>>>
> >>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
> >>>>>> [snip]
> >>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
> >>>>>>> index 55f06761ef8..7ab0dd14211 100644
> >>>>>>> --- a/boot/Kconfig
> >>>>>>> +++ b/boot/Kconfig
> >>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> >>>>>>>   config USE_SPL_FIT_GENERATOR
> >>>>>>>        bool "Use a script to generate the .its script"
> >>>>>>>        depends on SPL_FIT
> >>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
> >>>>>>> +     help
> >>>>>>> +       This is deprecated. Please do not use it. Use binman
instead.
> >>>>>>
> >>>>>> Lets remove the text around bool so it can't be enabled, and move
to
> >>>>>> select'ing it from the two boards that need it. Michal, Luca,
what's
> >>>>>> needed to move your two platforms
> >>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and
xilinx_zynqmp_virt off
> >>>>>> of this very legacy option, given that other xilinx platforms have
> >>>>>> already migrated to binman ?
> >>>>>
> >>>>> That's a good idea, but these two boards do not have TARGET Kconfig
> >>>>> options so it is not possible without adding some Kconfig specific
to
> >>>>> those boards, then defining it in the defconfig files.
> >>>>>
> >>>>> We already have the legacy warning.
> >>>>
> >>>> Yes, but I swear these are new legacy users as when we started
trying to
> >>>> kill off this option it was just a few i.MX platforms lagging behind.
> >>>>
> >>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR
depend
> >>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or
maybe
> >>>> Michal or Luca will speak up soon and migrate these over quickly so
we
> >>>> can just nuke this.
> >>>
> >>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> >>> boards since they don't appear in CI. Then they can convert them when
> >>> ready.
> >>>
> >>> That way we can drop the option now, if that is your goal.
> >>
> >> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> >> don't want to break platforms outright, and since it's Sunday right now
> >> afterall, we should let Michal and Luca a chance to catch up and chime
> >> in. I hope it's either going to be a quick conversion or expose
> >> something missing and needed in binman, as to why these still haven't
> >> been converted.
> >>
> >
> > OK let's hold off on this patch for now. It is just a clean-up anyway.
>
> First of all. ZynqMP is not wired in CI simply because we are missing
some bits
> and pieces in upstream qemu to run it. If we can wire it with Xilinx
version we
> can do it. I have asked to fix it our qemu team but they have never done
it.
>
> In U-Boot SPL flow this script is used all the time. I use it all the
time when
> I build work on ZynqMP. Also buildroot is using it.
>
> In connection to binman. I have looked at it 2/3 times in past. The
biggest
> issue which I have with it is that DT node presence in DT which goes to
the system.
>
> Here is example
>
> [u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
> [u-boot](binman)$ make -j8 >/dev/null
> [u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
>         binman {
>                 binman = "/binman";
>                 u_boot_rom = "/binman/u-boot-rom";
>
> where binmap is the part of target DT.

Thanks for the info.

>
> It has side effects.
> 1. DT is bigger

From my experience the size increase typically is less than 2% which does
not seem significant.

> 2. It contains information how firmware was packed which is just
additional
> information which don't need to be shared.

That depends on the application. For firmware update and debugging it is
sometime necessary to see where everything is. While I understand the EFI
model of hiding everything away I believe that a better future for the
industry is to have the OS and firmware work together more.

> 3. binman node as is placed in not documented in dt binding to be able to
pass
> dtb check.

This is the root cause of all of the device tree woes. There was a small
amount of slow progress at the end of last year but now it has gone quiet.
I don't know what to do about this other than prod and wait, since Linux
controls the bindings. Perhaps this is something that could be worked out
f2f, I'm not sure. For now I will keep prodding and see what can be done.
But the initial target is the DM tags, with binman bindings somewhere down
the trackz although they may actually be easier.

It is easy enough to use fdtgrep to strip out the binman {} node if it is
not wanted. I will take a look at a feature for that, but I have a bit of a
backlog,with so many things up in the air, pending patches, etc.

>
> I can call binman externally but that would mean additional build step
which
> everybody wants to avoid.
> Can we update Makefile and add Kconfig option to pass configuration dtb
file
> instead of u-boot.dtb by default?
>
> Something like:
>
> diff --git a/Makefile b/Makefile
> index 75a599b2c437..4d8d67c7d938 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if
> $(BINMAN_DEBUG),-D) \
>                  $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
>                   --toolpath $(objtree)/tools \
>                  $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
> -               build -u -d u-boot.dtb -O . -m \
> +               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
>                  $(if $(BINMAN_ALLOW_MISSING),--allow-missing
--ignore-missing) \
>                  -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
>                  -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
>
> Then by default u-boot.dtb can be used or platforms can use different
file.
> Then I would add zynqmp-binman.dts with configurations which can replace
> existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
> What do you think?

I'm sure you could do that locally, but I'd prefer to get the bindings
sorted out so that binman nodes can go in there, along with a Kconfig
option to enable/disable them. The more we bifurcate things, the more
complicated everything is.

For now, can you live with the binman nodes? What problem does it cause?

>
> BTW: Is there a way to generate also capsules from binman?

Is that an EFI capsule? If so, I haven't seen any work on that yet.

Regards,
Simon

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-08 19:36             ` Simon Glass
  2023-01-09  8:56               ` Luca Ceresoli
  2023-01-09 11:07               ` Michal Simek
@ 2023-01-09 18:55               ` Tom Rini
  2 siblings, 0 replies; 35+ messages in thread
From: Tom Rini @ 2023-01-09 18:55 UTC (permalink / raw)
  To: Simon Glass
  Cc: Michal Simek, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 3633 bytes --]

On Sun, Jan 08, 2023 at 12:36:15PM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> > > > > >
> > > > > > > This option is deprecated and only used by two boards. Enable it for just
> > > > > > > those two boards, so others don't accidentally enable it.
> > > > > > >
> > > > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > > > > [snip]
> > > > > > > diff --git a/boot/Kconfig b/boot/Kconfig
> > > > > > > index 55f06761ef8..7ab0dd14211 100644
> > > > > > > --- a/boot/Kconfig
> > > > > > > +++ b/boot/Kconfig
> > > > > > > @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> > > > > > >  config USE_SPL_FIT_GENERATOR
> > > > > > >       bool "Use a script to generate the .its script"
> > > > > > >       depends on SPL_FIT
> > > > > > > -     default y if SPL_FIT && ARCH_ZYNQMP
> > > > > > > +     help
> > > > > > > +       This is deprecated. Please do not use it. Use binman instead.
> > > > > >
> > > > > > Lets remove the text around bool so it can't be enabled, and move to
> > > > > > select'ing it from the two boards that need it. Michal, Luca, what's
> > > > > > needed to move your two platforms
> > > > > > (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> > > > > > of this very legacy option, given that other xilinx platforms have
> > > > > > already migrated to binman ?
> > > > >
> > > > > That's a good idea, but these two boards do not have TARGET Kconfig
> > > > > options so it is not possible without adding some Kconfig specific to
> > > > > those boards, then defining it in the defconfig files.
> > > > >
> > > > > We already have the legacy warning.
> > > >
> > > > Yes, but I swear these are new legacy users as when we started trying to
> > > > kill off this option it was just a few i.MX platforms lagging behind.
> > > >
> > > > Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> > > > on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> > > > Michal or Luca will speak up soon and migrate these over quickly so we
> > > > can just nuke this.
> > >
> > > Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> > > boards since they don't appear in CI. Then they can convert them when
> > > ready.
> > >
> > > That way we can drop the option now, if that is your goal.
> >
> > I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> > don't want to break platforms outright, and since it's Sunday right now
> > afterall, we should let Michal and Luca a chance to catch up and chime
> > in. I hope it's either going to be a quick conversion or expose
> > something missing and needed in binman, as to why these still haven't
> > been converted.
> >
> 
> OK let's hold off on this patch for now. It is just a clean-up anyway.

In light of the feedback, for this series, lets just make the generator
option depend on ARCH_ZYNQMP as well and leave it default y. This should
prevent any new users from showing up while the feedback Michal has
provided gets addressed and leave this series with one less blocker at
least.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-09 15:34                 ` Simon Glass
@ 2023-01-10 15:16                   ` Michal Simek
  2023-01-15 16:31                     ` Simon Glass
  0 siblings, 1 reply; 35+ messages in thread
From: Michal Simek @ 2023-01-10 15:16 UTC (permalink / raw)
  To: Simon Glass
  Cc: Tom Rini, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Simon,

On 1/9/23 16:34, Simon Glass wrote:
> Hi Michal,
> 
> On Mon, 9 Jan 2023 at 04:07, Michal Simek <michal.simek@amd.com 
> <mailto:michal.simek@amd.com>> wrote:
>  >
>  > Hi,
>  >
>  > On 1/8/23 20:36, Simon Glass wrote:
>  > > Hi Tom,
>  > >
>  > > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com 
> <mailto:trini@konsulko.com>> wrote:
>  > >>
>  > >> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
>  > >>> Hi Tom,
>  > >>>
>  > >>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com 
> <mailto:trini@konsulko.com>> wrote:
>  > >>>>
>  > >>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
>  > >>>>> Hi Tom,
>  > >>>>>
>  > >>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com 
> <mailto:trini@konsulko.com>> wrote:
>  > >>>>>>
>  > >>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>  > >>>>>>
>  > >>>>>>> This option is deprecated and only used by two boards. Enable it for just
>  > >>>>>>> those two boards, so others don't accidentally enable it.
>  > >>>>>>>
>  > >>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>>
>  > >>>>>> [snip]
>  > >>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
>  > >>>>>>> index 55f06761ef8..7ab0dd14211 100644
>  > >>>>>>> --- a/boot/Kconfig
>  > >>>>>>> +++ b/boot/Kconfig
>  > >>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>  > >>>>>>>   config USE_SPL_FIT_GENERATOR
>  > >>>>>>>        bool "Use a script to generate the .its script"
>  > >>>>>>>        depends on SPL_FIT
>  > >>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
>  > >>>>>>> +     help
>  > >>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
>  > >>>>>>
>  > >>>>>> Lets remove the text around bool so it can't be enabled, and move to
>  > >>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
>  > >>>>>> needed to move your two platforms
>  > >>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
>  > >>>>>> of this very legacy option, given that other xilinx platforms have
>  > >>>>>> already migrated to binman ?
>  > >>>>>
>  > >>>>> That's a good idea, but these two boards do not have TARGET Kconfig
>  > >>>>> options so it is not possible without adding some Kconfig specific to
>  > >>>>> those boards, then defining it in the defconfig files.
>  > >>>>>
>  > >>>>> We already have the legacy warning.
>  > >>>>
>  > >>>> Yes, but I swear these are new legacy users as when we started trying to
>  > >>>> kill off this option it was just a few i.MX platforms lagging behind.
>  > >>>>
>  > >>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
>  > >>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
>  > >>>> Michal or Luca will speak up soon and migrate these over quickly so we
>  > >>>> can just nuke this.
>  > >>>
>  > >>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
>  > >>> boards since they don't appear in CI. Then they can convert them when
>  > >>> ready.
>  > >>>
>  > >>> That way we can drop the option now, if that is your goal.
>  > >>
>  > >> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
>  > >> don't want to break platforms outright, and since it's Sunday right now
>  > >> afterall, we should let Michal and Luca a chance to catch up and chime
>  > >> in. I hope it's either going to be a quick conversion or expose
>  > >> something missing and needed in binman, as to why these still haven't
>  > >> been converted.
>  > >>
>  > >
>  > > OK let's hold off on this patch for now. It is just a clean-up anyway.
>  >
>  > First of all. ZynqMP is not wired in CI simply because we are missing some bits
>  > and pieces in upstream qemu to run it. If we can wire it with Xilinx version we
>  > can do it. I have asked to fix it our qemu team but they have never done it.
>  >
>  > In U-Boot SPL flow this script is used all the time. I use it all the time when
>  > I build work on ZynqMP. Also buildroot is using it.
>  >
>  > In connection to binman. I have looked at it 2/3 times in past. The biggest
>  > issue which I have with it is that DT node presence in DT which goes to the 
> system.
>  >
>  > Here is example
>  >
>  > [u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
>  > [u-boot](binman)$ make -j8 >/dev/null
>  > [u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
>  >         binman {
>  >                 binman = "/binman";
>  >                 u_boot_rom = "/binman/u-boot-rom";
>  >
>  > where binmap is the part of target DT.
> 
> Thanks for the info.
> 
>  >
>  > It has side effects.
>  > 1. DT is bigger
> 
>  From my experience the size increase typically is less than 2% which does not 
> seem significant.

It depends how many images you want to build and how many you want to describe.
Also in SOM program we are packing multiple DTS to the fit dtb image. It means 
at the end it will be few kB for almost nothing.

> 
>  > 2. It contains information how firmware was packed which is just additional
>  > information which don't need to be shared.
> 
> That depends on the application. For firmware update and debugging it is 
> sometime necessary to see where everything is. While I understand the EFI model 
> of hiding everything away I believe that a better future for the industry is to 
> have the OS and firmware work together more.

of course. But I expect if we start to add it it is just question of time when 
we get request to remove it.
And when I was playing with it xilinx boards are pretty much boards for testing 
not any final product (I can ignore some exceptions). It means how I see binman 
we could generate multiple images to cover all configurations which we are 
testing and which should work together.

Based on environment variable arch/arm/mach-zynqmp/mkimage_fit_atf.sh generates
u-boot.itb in different ways.

u-boot + DTB
u-boot + DTB + TFA
u-boot + DTB + TFA + TEE

where DTB can be fit image with multiple DTBs in it (for DTB reselection)
or multiple DTBs flag via configuration nodes.

And also images for flash which corresponds with configured offsets.

We are also building u-boot based on TEXT_BASE but placing it to different DDR 
location to make sure that it relocates properly. Or running in directly from 
memory above 4GB. When binman is adopted I would like to add description for 
these combinations there too.

> 
>  > 3. binman node as is placed in not documented in dt binding to be able to pass
>  > dtb check.
> 
> This is the root cause of all of the device tree woes. There was a small amount 
> of slow progress at the end of last year but now it has gone quiet. I don't know 
> what to do about this other than prod and wait, since Linux controls the 
> bindings. Perhaps this is something that could be worked out f2f, I'm not sure. 
> For now I will keep prodding and see what can be done. But the initial target is 
> the DM tags, with binman bindings somewhere down the trackz although they may 
> actually be easier.

yes that's why I want to make sure that things what we do are going in a 
direction that our DTs can be all checked without any violation. And adding 
binman node to DT is not helping in this effort. Even adding it to *u-boot.dtsi 
file which stays only in U-Boot is fine for Linux. SR 2.0 IIRC is going to check 
DT which is provided by firmware itself which is in this case DT from U-Boot 
with binman node in it.

> 
> It is easy enough to use fdtgrep to strip out the binman {} node if it is not 
> wanted. I will take a look at a feature for that, but I have a bit of a 
> backlog,with so many things up in the air, pending patches, etc.

I am aware about using fdtgrep for SPL but not against DT used for u-boot 
proper. I am fine if there is any way to remove it from DT.

> 
>  >
>  > I can call binman externally but that would mean additional build step which
>  > everybody wants to avoid.
>  > Can we update Makefile and add Kconfig option to pass configuration dtb file
>  > instead of u-boot.dtb by default?
>  >
>  > Something like:
>  >
>  > diff --git a/Makefile b/Makefile
>  > index 75a599b2c437..4d8d67c7d938 100644
>  > --- a/Makefile
>  > +++ b/Makefile
>  > @@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if
>  > $(BINMAN_DEBUG),-D) \
>  >                  $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
>  >                   --toolpath $(objtree)/tools \
>  >                  $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
>  > -               build -u -d u-boot.dtb -O . -m \
>  > +               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
>  >                  $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
>  >                  -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
>  >                  -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
>  >
>  > Then by default u-boot.dtb can be used or platforms can use different file.
>  > Then I would add zynqmp-binman.dts with configurations which can replace
>  > existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
>  > What do you think?
> 
> I'm sure you could do that locally, but I'd prefer to get the bindings sorted 
> out so that binman nodes can go in there, along with a Kconfig option to 
> enable/disable them. The more we bifurcate things, the more complicated 
> everything is.

I expect if you move binman to options {}; maybe options { u-boot{};}; node Rob 
won't have any issue with it. But of course that's needs to be discussed with him.

> 
> For now, can you live with the binman nodes? What problem does it cause?

Current script is used only in SPL flow which is not actually officially 
supported AMD/XILINX flow. It means there won't be any issue on AMD/XILINX side 
if we simply remove the script but likely we will break users which are using 
SPL flow. And they are definitely there.
All these users will start to see binman nodes and to be fair none will likely 
spot it anytime soon because if boot is working why you should look at it.

But as I said above when I start to use it I want to use it for all image 
generations that by one make I get all combinations for testing.
It means DT in SD boot mode will also contain information about QSPI image and 
also other combinations which were built.
It will create just confusion which I want to avoid as much as possible.

Can you live with passing external binman DTB via Kconfig option till fdtgrep 
option is working?


>  >
>  > BTW: Is there a way to generate also capsules from binman?
> 
> Is that an EFI capsule? If so, I haven't seen any work on that yet.
> 

yes EFI capsule. This is pretty much what I generate by external script after 
u-boot compilation.

pushd spl
/mnt/disk/u-boot/tools/mkeficapsule -g "de6066e8-0256-4fad-8238-e406e274c4cf" 
boot.bin --index 1 ../capsule1.bin
popd
/mnt/disk/u-boot/tools/mkeficapsule -g "cf9ecfd4-938b-41c5-8551-1f883ab7dc18" 
u-boot.itb --index 2 capsule2.bin


Also is there a way to get address from ELF but place BIN from that image 
instead (or convert it to BIN)?
I added support for this to avoid situations that image is placed to incorrect 
location. I do use it in case of TF-A which can run out of OCM or DDR that don't 
need to change configuration based on actual file.

Is there also a way to call fdtoverlay to compose DTB + DTBO together to create 
images? Linux kernel does it as the part of make but we are missing this feature 
in U-Boot but binman could actually help in this.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-10 15:16                   ` Michal Simek
@ 2023-01-15 16:31                     ` Simon Glass
  2023-01-16 10:25                       ` Michal Simek
  0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2023-01-15 16:31 UTC (permalink / raw)
  To: Michal Simek
  Cc: Tom Rini, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Michal,

On Tue, 10 Jan 2023 at 08:16, Michal Simek <michal.simek@amd.com> wrote:
>
> Hi Simon,
>
> On 1/9/23 16:34, Simon Glass wrote:
> > Hi Michal,
> >
> > On Mon, 9 Jan 2023 at 04:07, Michal Simek <michal.simek@amd.com
> > <mailto:michal.simek@amd.com>> wrote:
> >  >
> >  > Hi,
> >  >
> >  > On 1/8/23 20:36, Simon Glass wrote:
> >  > > Hi Tom,
> >  > >
> >  > > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com
> > <mailto:trini@konsulko.com>> wrote:
> >  > >>
> >  > >> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
> >  > >>> Hi Tom,
> >  > >>>
> >  > >>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com
> > <mailto:trini@konsulko.com>> wrote:
> >  > >>>>
> >  > >>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
> >  > >>>>> Hi Tom,
> >  > >>>>>
> >  > >>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com
> > <mailto:trini@konsulko.com>> wrote:
> >  > >>>>>>
> >  > >>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
> >  > >>>>>>
> >  > >>>>>>> This option is deprecated and only used by two boards. Enable it for just
> >  > >>>>>>> those two boards, so others don't accidentally enable it.
> >  > >>>>>>>
> >  > >>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>>
> >  > >>>>>> [snip]
> >  > >>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
> >  > >>>>>>> index 55f06761ef8..7ab0dd14211 100644
> >  > >>>>>>> --- a/boot/Kconfig
> >  > >>>>>>> +++ b/boot/Kconfig
> >  > >>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
> >  > >>>>>>>   config USE_SPL_FIT_GENERATOR
> >  > >>>>>>>        bool "Use a script to generate the .its script"
> >  > >>>>>>>        depends on SPL_FIT
> >  > >>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
> >  > >>>>>>> +     help
> >  > >>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
> >  > >>>>>>
> >  > >>>>>> Lets remove the text around bool so it can't be enabled, and move to
> >  > >>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
> >  > >>>>>> needed to move your two platforms
> >  > >>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
> >  > >>>>>> of this very legacy option, given that other xilinx platforms have
> >  > >>>>>> already migrated to binman ?
> >  > >>>>>
> >  > >>>>> That's a good idea, but these two boards do not have TARGET Kconfig
> >  > >>>>> options so it is not possible without adding some Kconfig specific to
> >  > >>>>> those boards, then defining it in the defconfig files.
> >  > >>>>>
> >  > >>>>> We already have the legacy warning.
> >  > >>>>
> >  > >>>> Yes, but I swear these are new legacy users as when we started trying to
> >  > >>>> kill off this option it was just a few i.MX platforms lagging behind.
> >  > >>>>
> >  > >>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
> >  > >>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
> >  > >>>> Michal or Luca will speak up soon and migrate these over quickly so we
> >  > >>>> can just nuke this.
> >  > >>>
> >  > >>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
> >  > >>> boards since they don't appear in CI. Then they can convert them when
> >  > >>> ready.
> >  > >>>
> >  > >>> That way we can drop the option now, if that is your goal.
> >  > >>
> >  > >> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
> >  > >> don't want to break platforms outright, and since it's Sunday right now
> >  > >> afterall, we should let Michal and Luca a chance to catch up and chime
> >  > >> in. I hope it's either going to be a quick conversion or expose
> >  > >> something missing and needed in binman, as to why these still haven't
> >  > >> been converted.
> >  > >>
> >  > >
> >  > > OK let's hold off on this patch for now. It is just a clean-up anyway.
> >  >
> >  > First of all. ZynqMP is not wired in CI simply because we are missing some bits
> >  > and pieces in upstream qemu to run it. If we can wire it with Xilinx version we
> >  > can do it. I have asked to fix it our qemu team but they have never done it.
> >  >
> >  > In U-Boot SPL flow this script is used all the time. I use it all the time when
> >  > I build work on ZynqMP. Also buildroot is using it.
> >  >
> >  > In connection to binman. I have looked at it 2/3 times in past. The biggest
> >  > issue which I have with it is that DT node presence in DT which goes to the
> > system.
> >  >
> >  > Here is example
> >  >
> >  > [u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
> >  > [u-boot](binman)$ make -j8 >/dev/null
> >  > [u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
> >  >         binman {
> >  >                 binman = "/binman";
> >  >                 u_boot_rom = "/binman/u-boot-rom";
> >  >
> >  > where binmap is the part of target DT.
> >
> > Thanks for the info.
> >
> >  >
> >  > It has side effects.
> >  > 1. DT is bigger
> >
> >  From my experience the size increase typically is less than 2% which does not
> > seem significant.
>
> It depends how many images you want to build and how many you want to describe.
> Also in SOM program we are packing multiple DTS to the fit dtb image. It means
> at the end it will be few kB for almost nothing.

If we want to solve that problem we should use overlays or some other
way of avoiding the madness of repeating the same material a dozen
times :-)

>
> >
> >  > 2. It contains information how firmware was packed which is just additional
> >  > information which don't need to be shared.
> >
> > That depends on the application. For firmware update and debugging it is
> > sometime necessary to see where everything is. While I understand the EFI model
> > of hiding everything away I believe that a better future for the industry is to
> > have the OS and firmware work together more.
>
> of course. But I expect if we start to add it it is just question of time when
> we get request to remove it.
> And when I was playing with it xilinx boards are pretty much boards for testing
> not any final product (I can ignore some exceptions). It means how I see binman
> we could generate multiple images to cover all configurations which we are
> testing and which should work together.
>
> Based on environment variable arch/arm/mach-zynqmp/mkimage_fit_atf.sh generates
> u-boot.itb in different ways.
>
> u-boot + DTB
> u-boot + DTB + TFA
> u-boot + DTB + TFA + TEE
>
> where DTB can be fit image with multiple DTBs in it (for DTB reselection)
> or multiple DTBs flag via configuration nodes.

This series does allow TEE to be omitted, but not TFA since that makes
the board fail to boot, doesn't it?

>
> And also images for flash which corresponds with configured offsets.
>
> We are also building u-boot based on TEXT_BASE but placing it to different DDR
> location to make sure that it relocates properly. Or running in directly from
> memory above 4GB. When binman is adopted I would like to add description for
> these combinations there too.

You should be able to do that easily enough. My suggestion is to have
it build both types of multiple-DTB images and give them different
names (I don't fully understand the different types).

>
> >
> >  > 3. binman node as is placed in not documented in dt binding to be able to pass
> >  > dtb check.
> >
> > This is the root cause of all of the device tree woes. There was a small amount
> > of slow progress at the end of last year but now it has gone quiet. I don't know
> > what to do about this other than prod and wait, since Linux controls the
> > bindings. Perhaps this is something that could be worked out f2f, I'm not sure.
> > For now I will keep prodding and see what can be done. But the initial target is
> > the DM tags, with binman bindings somewhere down the trackz although they may
> > actually be easier.
>
> yes that's why I want to make sure that things what we do are going in a
> direction that our DTs can be all checked without any violation. And adding
> binman node to DT is not helping in this effort. Even adding it to *u-boot.dtsi
> file which stays only in U-Boot is fine for Linux. SR 2.0 IIRC is going to check
> DT which is provided by firmware itself which is in this case DT from U-Boot
> with binman node in it.

Well then I hope that ARM / Linaro will become more supportive of
getting these bindings upstream. It is not for want of trying, but the
process is quite slow. Perhaps that will help speed it up?

Note that I don't want U-Boot to have things in the DT that are not in
the bindings.

>
> >
> > It is easy enough to use fdtgrep to strip out the binman {} node if it is not
> > wanted. I will take a look at a feature for that, but I have a bit of a
> > backlog,with so many things up in the air, pending patches, etc.
>
> I am aware about using fdtgrep for SPL but not against DT used for u-boot
> proper. I am fine if there is any way to remove it from DT.

You can try fdtgrep to do that, but please understand that the goal
here is a unified DT across firmware and kernel, not different
projects using different bindings.

>
> >
> >  >
> >  > I can call binman externally but that would mean additional build step which
> >  > everybody wants to avoid.
> >  > Can we update Makefile and add Kconfig option to pass configuration dtb file
> >  > instead of u-boot.dtb by default?
> >  >
> >  > Something like:
> >  >
> >  > diff --git a/Makefile b/Makefile
> >  > index 75a599b2c437..4d8d67c7d938 100644
> >  > --- a/Makefile
> >  > +++ b/Makefile
> >  > @@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if
> >  > $(BINMAN_DEBUG),-D) \
> >  >                  $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
> >  >                   --toolpath $(objtree)/tools \
> >  >                  $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
> >  > -               build -u -d u-boot.dtb -O . -m \
> >  > +               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
> >  >                  $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
> >  >                  -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
> >  >                  -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
> >  >
> >  > Then by default u-boot.dtb can be used or platforms can use different file.
> >  > Then I would add zynqmp-binman.dts with configurations which can replace
> >  > existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
> >  > What do you think?
> >
> > I'm sure you could do that locally, but I'd prefer to get the bindings sorted
> > out so that binman nodes can go in there, along with a Kconfig option to
> > enable/disable them. The more we bifurcate things, the more complicated
> > everything is.
>
> I expect if you move binman to options {}; maybe options { u-boot{};}; node Rob
> won't have any issue with it. But of course that's needs to be discussed with him.
>
> >
> > For now, can you live with the binman nodes? What problem does it cause?
>
> Current script is used only in SPL flow which is not actually officially
> supported AMD/XILINX flow. It means there won't be any issue on AMD/XILINX side
> if we simply remove the script but likely we will break users which are using
> SPL flow. And they are definitely there.
> All these users will start to see binman nodes and to be fair none will likely
> spot it anytime soon because if boot is working why you should look at it.

Note that the binman node is dropped from SPL. It only appears in U-Boot proper.

>
> But as I said above when I start to use it I want to use it for all image
> generations that by one make I get all combinations for testing.
> It means DT in SD boot mode will also contain information about QSPI image and
> also other combinations which were built.
> It will create just confusion which I want to avoid as much as possible.

Yes that's true. In fact, we need a way to select the correct image.
At present that is done using the fdtmap, but that sits in its own
area and does not adjust the device tree in the .dtb

Honestly, this all needs a bit of a look once we make some progress on
the bindings.

>
> Can you live with passing external binman DTB via Kconfig option till fdtgrep
> option is working?

If you want to add that as an option it seems OK to me, or at least I
cannot see any problems it would cause. You could even use an env var
if that is easier. But the upstream board should really build
everything, as we are doing on rockchip.

>
>
> >  >
> >  > BTW: Is there a way to generate also capsules from binman?
> >
> > Is that an EFI capsule? If so, I haven't seen any work on that yet.
> >
>
> yes EFI capsule. This is pretty much what I generate by external script after
> u-boot compilation.
>
> pushd spl
> /mnt/disk/u-boot/tools/mkeficapsule -g "de6066e8-0256-4fad-8238-e406e274c4cf"
> boot.bin --index 1 ../capsule1.bin
> popd
> /mnt/disk/u-boot/tools/mkeficapsule -g "cf9ecfd4-938b-41c5-8551-1f883ab7dc18"
> u-boot.itb --index 2 capsule2.bin

OK. I suppose it is easy enough although I'm not sure where those
UUIDs come from.

>
>
> Also is there a way to get address from ELF but place BIN from that image
> instead (or convert it to BIN)?
> I added support for this to avoid situations that image is placed to incorrect
> location. I do use it in case of TF-A which can run out of OCM or DDR that don't
> need to change configuration based on actual file.

I suppose you mean to run objdump on the elf, or perhaps extract the
segments and put them in a binary? It is not supported, but could be
added.

>
> Is there also a way to call fdtoverlay to compose DTB + DTBO together to create
> images? Linux kernel does it as the part of make but we are missing this feature
> in U-Boot but binman could actually help in this.

Again, I'm sure it could be added. Perhaps you could start a new
thread on new features that would be useful, as I think this thread
has got a bit off topic?

Regards,
Simon

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default
  2023-01-15 16:31                     ` Simon Glass
@ 2023-01-16 10:25                       ` Michal Simek
  0 siblings, 0 replies; 35+ messages in thread
From: Michal Simek @ 2023-01-16 10:25 UTC (permalink / raw)
  To: Simon Glass
  Cc: Tom Rini, Luca Ceresoli, U-Boot Mailing List, Roger Quadros,
	Alper Nebi Yasak, Peter Geis, Jerome Forissier, huang lin,
	Jeffy Chen, Kever Yang, Philipp Tomsich, Ivan Mikhaylov,
	Quentin Schulz, Philippe Reynes

Hi Simon,

On 1/15/23 17:31, Simon Glass wrote:
> Hi Michal,
> 
> On Tue, 10 Jan 2023 at 08:16, Michal Simek <michal.simek@amd.com> wrote:
>>
>> Hi Simon,
>>
>> On 1/9/23 16:34, Simon Glass wrote:
>>> Hi Michal,
>>>
>>> On Mon, 9 Jan 2023 at 04:07, Michal Simek <michal.simek@amd.com
>>> <mailto:michal.simek@amd.com>> wrote:
>>>   >
>>>   > Hi,
>>>   >
>>>   > On 1/8/23 20:36, Simon Glass wrote:
>>>   > > Hi Tom,
>>>   > >
>>>   > > On Sun, 8 Jan 2023 at 09:24, Tom Rini <trini@konsulko.com
>>> <mailto:trini@konsulko.com>> wrote:
>>>   > >>
>>>   > >> On Sun, Jan 08, 2023 at 09:20:09AM -0700, Simon Glass wrote:
>>>   > >>> Hi Tom,
>>>   > >>>
>>>   > >>> On Sun, 8 Jan 2023 at 09:06, Tom Rini <trini@konsulko.com
>>> <mailto:trini@konsulko.com>> wrote:
>>>   > >>>>
>>>   > >>>> On Sun, Jan 08, 2023 at 08:48:37AM -0700, Simon Glass wrote:
>>>   > >>>>> Hi Tom,
>>>   > >>>>>
>>>   > >>>>> On Sun, 8 Jan 2023 at 06:41, Tom Rini <trini@konsulko.com
>>> <mailto:trini@konsulko.com>> wrote:
>>>   > >>>>>>
>>>   > >>>>>> On Sat, Jan 07, 2023 at 02:07:21PM -0700, Simon Glass wrote:
>>>   > >>>>>>
>>>   > >>>>>>> This option is deprecated and only used by two boards. Enable it for just
>>>   > >>>>>>> those two boards, so others don't accidentally enable it.
>>>   > >>>>>>>
>>>   > >>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>>
>>>   > >>>>>> [snip]
>>>   > >>>>>>> diff --git a/boot/Kconfig b/boot/Kconfig
>>>   > >>>>>>> index 55f06761ef8..7ab0dd14211 100644
>>>   > >>>>>>> --- a/boot/Kconfig
>>>   > >>>>>>> +++ b/boot/Kconfig
>>>   > >>>>>>> @@ -282,12 +282,13 @@ config SPL_FIT_SOURCE
>>>   > >>>>>>>   config USE_SPL_FIT_GENERATOR
>>>   > >>>>>>>        bool "Use a script to generate the .its script"
>>>   > >>>>>>>        depends on SPL_FIT
>>>   > >>>>>>> -     default y if SPL_FIT && ARCH_ZYNQMP
>>>   > >>>>>>> +     help
>>>   > >>>>>>> +       This is deprecated. Please do not use it. Use binman instead.
>>>   > >>>>>>
>>>   > >>>>>> Lets remove the text around bool so it can't be enabled, and move to
>>>   > >>>>>> select'ing it from the two boards that need it. Michal, Luca, what's
>>>   > >>>>>> needed to move your two platforms
>>>   > >>>>>> (avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0 and xilinx_zynqmp_virt off
>>>   > >>>>>> of this very legacy option, given that other xilinx platforms have
>>>   > >>>>>> already migrated to binman ?
>>>   > >>>>>
>>>   > >>>>> That's a good idea, but these two boards do not have TARGET Kconfig
>>>   > >>>>> options so it is not possible without adding some Kconfig specific to
>>>   > >>>>> those boards, then defining it in the defconfig files.
>>>   > >>>>>
>>>   > >>>>> We already have the legacy warning.
>>>   > >>>>
>>>   > >>>> Yes, but I swear these are new legacy users as when we started trying to
>>>   > >>>> kill off this option it was just a few i.MX platforms lagging behind.
>>>   > >>>>
>>>   > >>>> Maybe make ARCH_ZYNQMP select DEPRECATED, USE_SPL_FIT_GENERATOR depend
>>>   > >>>> on DEPRECATED and add "DERECATED" to the end of the text line?  Or maybe
>>>   > >>>> Michal or Luca will speak up soon and migrate these over quickly so we
>>>   > >>>> can just nuke this.
>>>   > >>>
>>>   > >>> Isn't that just more tortuous? I can disable SPL_LOAD_FIT on these two
>>>   > >>> boards since they don't appear in CI. Then they can convert them when
>>>   > >>> ready.
>>>   > >>>
>>>   > >>> That way we can drop the option now, if that is your goal.
>>>   > >>
>>>   > >> I thought xilinx_zynqmp_virt was in CI, but I see I'm mistaken. I still
>>>   > >> don't want to break platforms outright, and since it's Sunday right now
>>>   > >> afterall, we should let Michal and Luca a chance to catch up and chime
>>>   > >> in. I hope it's either going to be a quick conversion or expose
>>>   > >> something missing and needed in binman, as to why these still haven't
>>>   > >> been converted.
>>>   > >>
>>>   > >
>>>   > > OK let's hold off on this patch for now. It is just a clean-up anyway.
>>>   >
>>>   > First of all. ZynqMP is not wired in CI simply because we are missing some bits
>>>   > and pieces in upstream qemu to run it. If we can wire it with Xilinx version we
>>>   > can do it. I have asked to fix it our qemu team but they have never done it.
>>>   >
>>>   > In U-Boot SPL flow this script is used all the time. I use it all the time when
>>>   > I build work on ZynqMP. Also buildroot is using it.
>>>   >
>>>   > In connection to binman. I have looked at it 2/3 times in past. The biggest
>>>   > issue which I have with it is that DT node presence in DT which goes to the
>>> system.
>>>   >
>>>   > Here is example
>>>   >
>>>   > [u-boot](binman)$ make kontron_sl28_defconfig >/dev/null
>>>   > [u-boot](binman)$ make -j8 >/dev/null
>>>   > [u-boot](binman)$ dtc -I dtb -O dts dts/dt.dtb 2>/dev/null | grep binman
>>>   >         binman {
>>>   >                 binman = "/binman";
>>>   >                 u_boot_rom = "/binman/u-boot-rom";
>>>   >
>>>   > where binmap is the part of target DT.
>>>
>>> Thanks for the info.
>>>
>>>   >
>>>   > It has side effects.
>>>   > 1. DT is bigger
>>>
>>>   From my experience the size increase typically is less than 2% which does not
>>> seem significant.
>>
>> It depends how many images you want to build and how many you want to describe.
>> Also in SOM program we are packing multiple DTS to the fit dtb image. It means
>> at the end it will be few kB for almost nothing.
> 
> If we want to solve that problem we should use overlays or some other
> way of avoiding the madness of repeating the same material a dozen
> times :-)

We have internal task to take a look at dt overlay support when dtb reselect is 
used to also work with dt overlays.


>>
>>>
>>>   > 2. It contains information how firmware was packed which is just additional
>>>   > information which don't need to be shared.
>>>
>>> That depends on the application. For firmware update and debugging it is
>>> sometime necessary to see where everything is. While I understand the EFI model
>>> of hiding everything away I believe that a better future for the industry is to
>>> have the OS and firmware work together more.
>>
>> of course. But I expect if we start to add it it is just question of time when
>> we get request to remove it.
>> And when I was playing with it xilinx boards are pretty much boards for testing
>> not any final product (I can ignore some exceptions). It means how I see binman
>> we could generate multiple images to cover all configurations which we are
>> testing and which should work together.
>>
>> Based on environment variable arch/arm/mach-zynqmp/mkimage_fit_atf.sh generates
>> u-boot.itb in different ways.
>>
>> u-boot + DTB
>> u-boot + DTB + TFA
>> u-boot + DTB + TFA + TEE
>>
>> where DTB can be fit image with multiple DTBs in it (for DTB reselection)
>> or multiple DTBs flag via configuration nodes.
> 
> This series does allow TEE to be omitted, but not TFA since that makes
> the board fail to boot, doesn't it?

Not our configurations. Default configuration is to use TF-A at EL3 and U-Boot 
in EL2-NS. But we also use U-Boot in EL3. All mini u-boot configurations are 
working like this by default.
But also full U-Boot can start in EL3 without any issue.
EL1-NS which is also supported by U-Boot can be also configured but I didn't see 
so far even request for testing it. But it should just work.
Definitely from testing perspective it is something what should be tested.


>>
>> And also images for flash which corresponds with configured offsets.
>>
>> We are also building u-boot based on TEXT_BASE but placing it to different DDR
>> location to make sure that it relocates properly. Or running in directly from
>> memory above 4GB. When binman is adopted I would like to add description for
>> these combinations there too.
> 
> You should be able to do that easily enough. My suggestion is to have
> it build both types of multiple-DTB images and give them different
> names (I don't fully understand the different types).

It is more or less about option to be able to setup loading address for 
multiple-DTB option you use which works fine in standard usage.

>>
>>>
>>>   > 3. binman node as is placed in not documented in dt binding to be able to pass
>>>   > dtb check.
>>>
>>> This is the root cause of all of the device tree woes. There was a small amount
>>> of slow progress at the end of last year but now it has gone quiet. I don't know
>>> what to do about this other than prod and wait, since Linux controls the
>>> bindings. Perhaps this is something that could be worked out f2f, I'm not sure.
>>> For now I will keep prodding and see what can be done. But the initial target is
>>> the DM tags, with binman bindings somewhere down the trackz although they may
>>> actually be easier.
>>
>> yes that's why I want to make sure that things what we do are going in a
>> direction that our DTs can be all checked without any violation. And adding
>> binman node to DT is not helping in this effort. Even adding it to *u-boot.dtsi
>> file which stays only in U-Boot is fine for Linux. SR 2.0 IIRC is going to check
>> DT which is provided by firmware itself which is in this case DT from U-Boot
>> with binman node in it.
> 
> Well then I hope that ARM / Linaro will become more supportive of
> getting these bindings upstream. It is not for want of trying, but the
> process is quite slow. Perhaps that will help speed it up?
> 
> Note that I don't want U-Boot to have things in the DT that are not in
> the bindings.

Hopefully I will have more time for it this year. Let's see if Linaro can help 
with this. I wanted them to do it for EFI A/B capsule update based on raw mode. 
But the latest version is not sent to mailing list yet.


>>
>>>
>>> It is easy enough to use fdtgrep to strip out the binman {} node if it is not
>>> wanted. I will take a look at a feature for that, but I have a bit of a
>>> backlog,with so many things up in the air, pending patches, etc.
>>
>> I am aware about using fdtgrep for SPL but not against DT used for u-boot
>> proper. I am fine if there is any way to remove it from DT.
> 
> You can try fdtgrep to do that, but please understand that the goal
> here is a unified DT across firmware and kernel, not different
> projects using different bindings.

I get it but it is still long way to go.

>>
>>>
>>>   >
>>>   > I can call binman externally but that would mean additional build step which
>>>   > everybody wants to avoid.
>>>   > Can we update Makefile and add Kconfig option to pass configuration dtb file
>>>   > instead of u-boot.dtb by default?
>>>   >
>>>   > Something like:
>>>   >
>>>   > diff --git a/Makefile b/Makefile
>>>   > index 75a599b2c437..4d8d67c7d938 100644
>>>   > --- a/Makefile
>>>   > +++ b/Makefile
>>>   > @@ -1322,7 +1322,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if
>>>   > $(BINMAN_DEBUG),-D) \
>>>   >                  $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
>>>   >                   --toolpath $(objtree)/tools \
>>>   >                  $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
>>>   > -               build -u -d u-boot.dtb -O . -m \
>>>   > +               build -u -d $(CONFIG_BINMAN_CONFIG_DTB) -O . -m \
>>>   >                  $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
>>>   >                  -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
>>>   >                  -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
>>>   >
>>>   > Then by default u-boot.dtb can be used or platforms can use different file.
>>>   > Then I would add zynqmp-binman.dts with configurations which can replace
>>>   > existing arch/arm/mach-zynqmp/mkimage_fit_atf.sh script.
>>>   > What do you think?
>>>
>>> I'm sure you could do that locally, but I'd prefer to get the bindings sorted
>>> out so that binman nodes can go in there, along with a Kconfig option to
>>> enable/disable them. The more we bifurcate things, the more complicated
>>> everything is.
>>
>> I expect if you move binman to options {}; maybe options { u-boot{};}; node Rob
>> won't have any issue with it. But of course that's needs to be discussed with him.
>>
>>>
>>> For now, can you live with the binman nodes? What problem does it cause?
>>
>> Current script is used only in SPL flow which is not actually officially
>> supported AMD/XILINX flow. It means there won't be any issue on AMD/XILINX side
>> if we simply remove the script but likely we will break users which are using
>> SPL flow. And they are definitely there.
>> All these users will start to see binman nodes and to be fair none will likely
>> spot it anytime soon because if boot is working why you should look at it.
> 
> Note that the binman node is dropped from SPL. It only appears in U-Boot proper.

I know.

>>
>> But as I said above when I start to use it I want to use it for all image
>> generations that by one make I get all combinations for testing.
>> It means DT in SD boot mode will also contain information about QSPI image and
>> also other combinations which were built.
>> It will create just confusion which I want to avoid as much as possible.
> 
> Yes that's true. In fact, we need a way to select the correct image.
> At present that is done using the fdtmap, but that sits in its own
> area and does not adjust the device tree in the .dtb
> 
> Honestly, this all needs a bit of a look once we make some progress on
> the bindings.

I played with binman multiple times in past but never really send support for it 
for our SOCs. I am definitely not aware about all features which you have added 
over years there. But I want to make sure that


>>
>> Can you live with passing external binman DTB via Kconfig option till fdtgrep
>> option is working?
> 
> If you want to add that as an option it seems OK to me, or at least I
> cannot see any problems it would cause. You could even use an env var
> if that is easier. But the upstream board should really build
> everything, as we are doing on rockchip.

The problem with env variable is that users who uses defconfig would have to set 
it up. It means all yocto meta layers needs to be updated. With Kconfig I can 
simply update defconfig and that's it. No impact on others.


>>
>>
>>>   >
>>>   > BTW: Is there a way to generate also capsules from binman?
>>>
>>> Is that an EFI capsule? If so, I haven't seen any work on that yet.
>>>
>>
>> yes EFI capsule. This is pretty much what I generate by external script after
>> u-boot compilation.
>>
>> pushd spl
>> /mnt/disk/u-boot/tools/mkeficapsule -g "de6066e8-0256-4fad-8238-e406e274c4cf"
>> boot.bin --index 1 ../capsule1.bin
>> popd
>> /mnt/disk/u-boot/tools/mkeficapsule -g "cf9ecfd4-938b-41c5-8551-1f883ab7dc18"
>> u-boot.itb --index 2 capsule2.bin
> 
> OK. I suppose it is easy enough although I'm not sure where those
> UUIDs come from.

There are macros for it in the code and also one structure is defined with it.

  21 /* GUIDs for capsule updatable firmware images */
  22 #define XILINX_BOOT_IMAGE_GUID \
  23         EFI_GUID(0xde6066e8, 0x0256, 0x4fad, 0x82, 0x38, \
  24                  0xe4, 0x06, 0xe2, 0x74, 0xc4, 0xcf)
  25
  26 #define XILINX_UBOOT_IMAGE_GUID \
  27         EFI_GUID(0xcf9ecfd4, 0x938b, 0x41c5, 0x85, 0x51, \
  28                  0x1f, 0x88, 0x3a, 0xb7, 0xdc, 0x18)


  35 #if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
  36 struct efi_fw_image fw_images[] = {
  37 #if defined(XILINX_BOOT_IMAGE_GUID)
  38         {
  39                 .image_type_id = XILINX_BOOT_IMAGE_GUID,
  40                 .fw_name = u"XILINX-BOOT",
  41                 .image_index = 1,
  42         },
  43 #endif
  44 #if defined(XILINX_UBOOT_IMAGE_GUID)
  45         {
  46                 .image_type_id = XILINX_UBOOT_IMAGE_GUID,
  47                 .fw_name = u"XILINX-UBOOT",
  48                 .image_index = 2,
  49         },
  50 #endif
  51 };


>>
>>
>> Also is there a way to get address from ELF but place BIN from that image
>> instead (or convert it to BIN)?
>> I added support for this to avoid situations that image is placed to incorrect
>> location. I do use it in case of TF-A which can run out of OCM or DDR that don't
>> need to change configuration based on actual file.
> 
> I suppose you mean to run objdump on the elf, or perhaps extract the
> segments and put them in a binary? It is not supported, but could be
> added.

Just objcopy -O binary on the elf and fill load and entry address based on 
addresses from elf.


>>
>> Is there also a way to call fdtoverlay to compose DTB + DTBO together to create
>> images? Linux kernel does it as the part of make but we are missing this feature
>> in U-Boot but binman could actually help in this.
> 
> Again, I'm sure it could be added. Perhaps you could start a new
> thread on new features that would be useful, as I think this thread
> has got a bit off topic?

I will prepare some patches and start to convert cases one by one to reach the 
state where we can remove that external script.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 12/14] rockchip: Convert all boards to use binman
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (13 preceding siblings ...)
  2023-01-07 21:07 ` [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default Simon Glass
@ 2023-01-19  2:11 ` Simon Glass
  2023-01-19  2:11 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-19  2:11 UTC (permalink / raw)
  To: Simon Glass
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes,
	U-Boot Mailing List

Instead of the bash script, use binman to generate the FIT for arm64.

For 32-bit boards, use binman for all images, dropping the intermediate
files.

With this change, only Zynq is now using SPL_FIT_GENERATOR so update the
Kconfig rule accordingly.

Clean up the Makefile to the extent possible. Unfortunately, two boards
do not use SPL_FRAMEWORK so don't enable the u-boot.img rule:

   evb-rk3036
   kylin-rk3036

So a small remnant remains.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 Makefile     | 8 +-------
 boot/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v9 08/14] binman: Support optional external blobs
  2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
                   ` (14 preceding siblings ...)
  2023-01-19  2:11 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
@ 2023-01-19  2:11 ` Simon Glass
  15 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2023-01-19  2:11 UTC (permalink / raw)
  To: Simon Glass
  Cc: Roger Quadros, Tom Rini, Alper Nebi Yasak, Peter Geis,
	Jerome Forissier, huang lin, Jeffy Chen, Kever Yang,
	Philipp Tomsich, Ivan Mikhaylov, Quentin Schulz, Philippe Reynes,
	U-Boot Mailing List

Some blobs are actually not necessary for the board to work correctly. Add
a property to allow this to be indicated. Missing optional blobs do not
cause a build failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v8)

Changes in v8:
- Move support for optional external blobs into this series
- Support optional FIT images

 tools/binman/binman.rst                |  9 +++++++++
 tools/binman/control.py                | 11 +++++++++++
 tools/binman/entry.py                  | 25 +++++++++++++++++++++----
 tools/binman/etype/blob.py             |  2 +-
 tools/binman/etype/fit.py              | 11 ++++++-----
 tools/binman/etype/section.py          | 14 +++++++++++++-
 tools/binman/ftest.py                  | 10 ++++++++++
 tools/binman/test/266_blob_ext_opt.dts | 21 +++++++++++++++++++++
 8 files changed, 92 insertions(+), 11 deletions(-)
 create mode 100644 tools/binman/test/266_blob_ext_opt.dts

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2023-01-19  2:14 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 21:07 [PATCH v9 00/14] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
2023-01-07 21:07 ` [PATCH v9 01/14] binman: Allow writing section contents to a file Simon Glass
2023-01-07 21:07 ` [PATCH v9 02/14] binman: Tidy up comment in fit _gen_node Simon Glass
2023-01-07 21:07 ` [PATCH v9 03/14] binman: Update entry docs Simon Glass
2023-01-07 21:07 ` [PATCH v9 04/14] binman: Use a reference for binman symbols docs Simon Glass
2023-01-07 21:07 ` [PATCH v9 05/14] binman: Support optional entries Simon Glass
2023-01-07 21:07 ` [PATCH v9 06/14] binman: Add a way to check for a valid ELF file Simon Glass
2023-01-07 21:07 ` [PATCH v9 07/14] binman: Support new op-tee binary format Simon Glass
2023-01-07 21:07 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass
2023-01-07 21:07 ` [PATCH v9 09/14] rockchip: evb-rk3288: Drop raw-image support Simon Glass
2023-01-07 21:07 ` [PATCH v9 10/14] rockchip: Use multiple-images for rk3399 Simon Glass
2023-01-07 21:07 ` [PATCH v9 11/14] rockchip: Support building the all output files in binman Simon Glass
2023-01-07 21:07 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
2023-01-07 21:07 ` [PATCH v9 13/14] rockchip: Drop the FIT generator script Simon Glass
2023-01-07 21:07 ` [PATCH v9 14/14] treewide: Disable USE_SPL_FIT_GENERATOR by default Simon Glass
2023-01-08 13:41   ` Tom Rini
2023-01-08 15:48     ` Simon Glass
2023-01-08 16:06       ` Tom Rini
2023-01-08 16:20         ` Simon Glass
2023-01-08 16:24           ` Tom Rini
2023-01-08 19:36             ` Simon Glass
2023-01-09  8:56               ` Luca Ceresoli
2023-01-09 14:13                 ` Tom Rini
2023-01-09 14:29                   ` Michal Simek
2023-01-09 11:07               ` Michal Simek
2023-01-09 14:12                 ` Tom Rini
2023-01-09 14:37                   ` Michal Simek
2023-01-09 15:05                     ` Tom Rini
2023-01-09 15:34                 ` Simon Glass
2023-01-10 15:16                   ` Michal Simek
2023-01-15 16:31                     ` Simon Glass
2023-01-16 10:25                       ` Michal Simek
2023-01-09 18:55               ` Tom Rini
2023-01-19  2:11 ` [PATCH v9 12/14] rockchip: Convert all boards to use binman Simon Glass
2023-01-19  2:11 ` [PATCH v9 08/14] binman: Support optional external blobs Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.