U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi"
@ 2026-05-25 23:51 Marek Vasut
  2026-05-25 23:51 ` [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Marek Vasut @ 2026-05-25 23:51 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

Boot from FSPI requires additional 448 Byte long header, with U-Boot SPL
starting at offset 0x1000. Currently, both i.MX8MM and i.MX8MN attempt
to generate this header using fspi_conf_block with filename pointing at
CONFIG_FSPI_CONF_FILE file. This does not work, for two reasons.

First, the CONFIG_FSPI_CONF_FILE is generated by mkimage -T imx8mimage
and may not be available yet when the fspi_conf_block is evaluated. That
leads to a race condition where highly parallel builds fail to find the
CONFIG_FSPI_CONF_FILE, which is usually called fspi_header.bin, on first
build attempt.

Second, binman gets confused and patches incorrect offset of DDR PHY
firmware blobs into U-Boot SPL, the offset is incremented by exactly
0x1000 which is the size of fspi_conf_block.

Fix both problems at once, make imx8mimage handle the generated FSPI
header and prepend it in front of the imx8mimage processed data. This
way, the race condition is solved, because the data generated by the
imx8mimage are surely combined only after mkimage -T imx8mimage ran.
The binman offset calculation is also solved, because there is no
fspi_conf_block node in the DT anymore.

Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Alexander Koch <akoch@initse.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
V2: - Move test into vendor/nxp_imx8m_fspi.dts
    - Fix up path handling in both etype and test
---
 tools/binman/etype/nxp_imx8mimage.py        | 11 ++++++++++-
 tools/binman/ftest.py                       |  9 +++++++++
 tools/binman/test/vendor/nxp_imx8m_fspi.dts | 18 ++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi.dts

diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
index 8ad177b3b65..008d2f914db 100644
--- a/tools/binman/etype/nxp_imx8mimage.py
+++ b/tools/binman/etype/nxp_imx8mimage.py
@@ -7,6 +7,8 @@
 # configuration file and input data.
 #
 
+import os
+
 from collections import OrderedDict
 
 from binman.entry import Entry
@@ -33,6 +35,7 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
     def ReadNode(self):
         super().ReadNode()
         self.boot_from = fdt_util.GetString(self._node, 'nxp,boot-from')
+        self.fspi_header = fdt_util.GetString(self._node, 'nxp,fspi-header-filename')
         self.loader_address = fdt_util.GetInt(self._node, 'nxp,loader-address')
         self.rom_version = fdt_util.GetInt(self._node, 'nxp,rom-version')
         self.ReadEntries()
@@ -52,7 +55,13 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
         args = ['-d', input_fname, '-n', cfg_fname, '-T', 'imx8mimage',
                 output_fname]
         if self.mkimage.run_cmd(*args) is not None:
-            return tools.read_file(output_fname)
+            outdata = tools.read_file(output_fname)
+            if self.boot_from == 'fspi' and self.fspi_header:
+                spidata = tools.read_file(os.path.join(tools.get_output_dir(), self.fspi_header))
+                if len(spidata) < 0x1000:
+                    spidata += tools.get_bytes(0, 0x1000 - len(spidata))
+                outdata = spidata + outdata
+            return outdata
         else:
             # Bintool is missing; just use the input data as the output
             self.record_missing_bintool(self.mkimage)
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 9a3811c1732..d85ecffdc21 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -8099,6 +8099,15 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
             result = cst.fetch(bintool.FETCH_BUILD)
             self.assertEqual(('cst', None), result)
 
+    def testNxpImx8MFSPI(self):
+        """Test that binman can produce an iMX8m FSPI image"""
+        testdir = tempfile.mkdtemp(prefix='binman.')
+        image_path = os.path.join(testdir, 'fspi_header.bin')
+        with open(image_path, 'w') as f:
+            f.write(bytes([0x87]).decode('latin1') * 448)
+        with terminal.capture():
+            self._DoTestFile('vendor/nxp_imx8m_fspi.dts', output_dir=testdir)
+
     def testNxpHeaderDdrfw(self):
         """Test that binman can add a header to DDR PHY firmware images"""
         data = self._DoReadFile('vendor/nxp_ddrfw_imx95.dts')
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi.dts b/tools/binman/test/vendor/nxp_imx8m_fspi.dts
new file mode 100644
index 00000000000..6b04eca757c
--- /dev/null
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		nxp-imx8mimage {
+			args;	/* TODO: Needed by mkimage etype superclass */
+			nxp,boot-from = "fspi";
+			nxp,fspi-header-filename = "fspi_header.bin";
+			nxp,rom-version = <2>;
+			nxp,loader-address = <0x10>;
+		};
+	};
+};
-- 
2.53.0


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

* [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage
  2026-05-25 23:51 [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Marek Vasut
@ 2026-05-25 23:51 ` Marek Vasut
  2026-06-03 16:45   ` Simon Glass
  2026-05-25 23:51 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2026-05-25 23:51 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

The binman imx8mimage now correctly handles generated fspi_header.bin
in its imx8mimage etype. Make use of this, remove fspi_conf_block in
favor of generated fspi_header.bin, and configure imx8mimage accordingly.

Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Alexander Koch <akoch@initse.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
V2: No change
---
 arch/arm/dts/imx8mm-u-boot.dtsi | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index d891e8062fe..ab135fc8a47 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -50,14 +50,6 @@
 	section {
 		pad-byte = <0x00>;
 
-#ifdef CONFIG_FSPI_CONF_HEADER
-		fspi_conf_block {
-			filename = CONFIG_FSPI_CONF_FILE;
-			type = "blob-ext";
-			size = <0x1000>;
-		};
-#endif
-
 #ifdef CONFIG_IMX_HAB
 		nxp-imx8mcst@0 {
 			filename = "u-boot-spl-mkimage.signed.bin";
@@ -68,7 +60,12 @@
 
 			binman_imx_spl: nxp-imx8mimage {
 				filename = "u-boot-spl-mkimage.bin";
+#ifdef CONFIG_FSPI_CONF_HEADER
+				nxp,boot-from = "fspi";
+				nxp,fspi-header-filename = CONFIG_FSPI_CONF_FILE;
+#else
 				nxp,boot-from = "sd";
+#endif
 				nxp,rom-version = <1>;
 				nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
 				args;	/* Needed by mkimage etype superclass */
-- 
2.53.0


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

* [PATCH v2 3/3] arm64: dts: imx8mn: Generate FSPI header using binman imx8mimage
  2026-05-25 23:51 [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Marek Vasut
  2026-05-25 23:51 ` [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage Marek Vasut
@ 2026-05-25 23:51 ` Marek Vasut
  2026-06-03 16:45   ` Simon Glass
  2026-05-28 12:43 ` [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Fabio Estevam
  2026-05-29 22:03 ` Simon Glass
  3 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2026-05-25 23:51 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

The binman imx8mimage now correctly handles generated fspi_header.bin
in its imx8mimage etype. Make use of this, remove fspi_conf_block in
favor of generated fspi_header.bin, and configure imx8mimage accordingly.

Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Alexander Koch <akoch@initse.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
V2: No change
---
 arch/arm/dts/imx8mn-u-boot.dtsi | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi
index 29eecd6d70d..8993605af3c 100644
--- a/arch/arm/dts/imx8mn-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-u-boot.dtsi
@@ -104,14 +104,6 @@
 	section {
 		pad-byte = <0x00>;
 
-#ifdef CONFIG_FSPI_CONF_HEADER
-		fspi_conf_block {
-			filename = CONFIG_FSPI_CONF_FILE;
-			type = "blob-ext";
-			offset = <0x400>;
-		};
-#endif
-
 #ifdef CONFIG_IMX_HAB
 		nxp-imx8mcst@0 {
 			filename = "u-boot-spl-mkimage.signed.bin";
@@ -122,7 +114,12 @@
 
 			binman_imx_spl: nxp-imx8mimage {
 				filename = "u-boot-spl-mkimage.bin";
+#ifdef CONFIG_FSPI_CONF_HEADER
+				nxp,boot-from = "fspi";
+				nxp,fspi-header-filename = CONFIG_FSPI_CONF_FILE;
+#else
 				nxp,boot-from = "sd";
+#endif
 				nxp,rom-version = <2>;
 				nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
 				args;	/* Needed by mkimage etype superclass */
-- 
2.53.0


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

* Re: [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi"
  2026-05-25 23:51 [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Marek Vasut
  2026-05-25 23:51 ` [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage Marek Vasut
  2026-05-25 23:51 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
@ 2026-05-28 12:43 ` Fabio Estevam
  2026-05-29 10:53   ` Marek Vasut
  2026-05-29 22:03 ` Simon Glass
  3 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2026-05-28 12:43 UTC (permalink / raw)
  To: Marek Vasut
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch, Peng Fan,
	Simon Glass, Tom Rini

Hi Marek,

On Mon, May 25, 2026 at 8:52 PM Marek Vasut <marex@nabladev.com> wrote:
>
> Boot from FSPI requires additional 448 Byte long header, with U-Boot SPL
> starting at offset 0x1000. Currently, both i.MX8MM and i.MX8MN attempt
> to generate this header using fspi_conf_block with filename pointing at
> CONFIG_FSPI_CONF_FILE file. This does not work, for two reasons.
>
> First, the CONFIG_FSPI_CONF_FILE is generated by mkimage -T imx8mimage
> and may not be available yet when the fspi_conf_block is evaluated. That
> leads to a race condition where highly parallel builds fail to find the
> CONFIG_FSPI_CONF_FILE, which is usually called fspi_header.bin, on first
> build attempt.
>
> Second, binman gets confused and patches incorrect offset of DDR PHY
> firmware blobs into U-Boot SPL, the offset is incremented by exactly
> 0x1000 which is the size of fspi_conf_block.
>
> Fix both problems at once, make imx8mimage handle the generated FSPI
> header and prepend it in front of the imx8mimage processed data. This
> way, the race condition is solved, because the data generated by the
> imx8mimage are surely combined only after mkimage -T imx8mimage ran.
> The binman offset calculation is also solved, because there is no
> fspi_conf_block node in the DT anymore.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>

Is this series 2026.07 material, or can it wait until 2026.10?

Alexander, if possible, please test this series and reply with your
Tested-by tag.

Thanks

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

* Re: [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi"
  2026-05-28 12:43 ` [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Fabio Estevam
@ 2026-05-29 10:53   ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2026-05-29 10:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch, Peng Fan,
	Simon Glass, Tom Rini

On 5/28/26 2:43 PM, Fabio Estevam wrote:
> Hi Marek,
> 
> On Mon, May 25, 2026 at 8:52 PM Marek Vasut <marex@nabladev.com> wrote:
>>
>> Boot from FSPI requires additional 448 Byte long header, with U-Boot SPL
>> starting at offset 0x1000. Currently, both i.MX8MM and i.MX8MN attempt
>> to generate this header using fspi_conf_block with filename pointing at
>> CONFIG_FSPI_CONF_FILE file. This does not work, for two reasons.
>>
>> First, the CONFIG_FSPI_CONF_FILE is generated by mkimage -T imx8mimage
>> and may not be available yet when the fspi_conf_block is evaluated. That
>> leads to a race condition where highly parallel builds fail to find the
>> CONFIG_FSPI_CONF_FILE, which is usually called fspi_header.bin, on first
>> build attempt.
>>
>> Second, binman gets confused and patches incorrect offset of DDR PHY
>> firmware blobs into U-Boot SPL, the offset is incremented by exactly
>> 0x1000 which is the size of fspi_conf_block.
>>
>> Fix both problems at once, make imx8mimage handle the generated FSPI
>> header and prepend it in front of the imx8mimage processed data. This
>> way, the race condition is solved, because the data generated by the
>> imx8mimage are surely combined only after mkimage -T imx8mimage ran.
>> The binman offset calculation is also solved, because there is no
>> fspi_conf_block node in the DT anymore.
>>
>> Signed-off-by: Marek Vasut <marex@nabladev.com>
> 
> Is this series 2026.07 material, or can it wait until 2026.10?
> 
> Alexander, if possible, please test this series and reply with your
> Tested-by tag.
This should have been 2024.07 material, but I had no hardware to debug 
this on, so 2026.07 will do.

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

* Re: [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi"
  2026-05-25 23:51 [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Marek Vasut
                   ` (2 preceding siblings ...)
  2026-05-28 12:43 ` [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Fabio Estevam
@ 2026-05-29 22:03 ` Simon Glass
  2026-05-30 17:12   ` Marek Vasut
  3 siblings, 1 reply; 9+ messages in thread
From: Simon Glass @ 2026-05-29 22:03 UTC (permalink / raw)
  To: marex
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

Hi Marek,

On 2026-05-25T23:51:02, Marek Vasut <marex@nabladev.com> wrote:
> binman: imx8mimage: Handle nxp,boot-from = 'fspi'
>
> Boot from FSPI requires additional 448 Byte long header, with U-Boot SPL
> starting at offset 0x1000. Currently, both i.MX8MM and i.MX8MN attempt
> to generate this header using fspi_conf_block with filename pointing at
> CONFIG_FSPI_CONF_FILE file. This does not work, for two reasons.
>
> First, the CONFIG_FSPI_CONF_FILE is generated by mkimage -T imx8mimage
> and may not be available yet when the fspi_conf_block is evaluated. That
> leads to a race condition where highly parallel builds fail to find the
> CONFIG_FSPI_CONF_FILE, which is usually called fspi_header.bin, on first
> build attempt.
>
> Second, binman gets confused and patches incorrect offset of DDR PHY
> firmware blobs into U-Boot SPL, the offset is incremented by exactly
> 0x1000 which is the size of fspi_conf_block.
>
> Fix both problems at once, make imx8mimage handle the generated FSPI
> header and prepend it in front of the imx8mimage processed data. This
> way, the race condition is solved, because the data generated by the
> [...]
>
> tools/binman/etype/nxp_imx8mimage.py        | 11 ++++++++++-
>  tools/binman/ftest.py                       |  9 +++++++++
>  tools/binman/test/vendor/nxp_imx8m_fspi.dts | 18 ++++++++++++++++++
>  3 files changed, 37 insertions(+), 1 deletion(-)

> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -33,6 +35,7 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
>      def ReadNode(self):
>          super().ReadNode()
>          self.boot_from = fdt_util.GetString(self._node, 'nxp,boot-from')
> +        self.fspi_header = fdt_util.GetString(self._node, 'nxp,fspi-header-filename')
>          self.loader_address = fdt_util.GetInt(self._node, 'nxp,loader-address')
>          self.rom_version = fdt_util.GetInt(self._node, 'nxp,rom-version')

Please update the class docstring to document
nxp,fspi-header-filename: what it is, that it only applies when
nxp,boot-from = 'fspi', and that the file is read relative to the
binman output directory. Binman has no separate entries.rst, so the
docstring is the documentation.

> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -52,7 +55,13 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
>          if self.mkimage.run_cmd(*args) is not None:
> -            return tools.read_file(output_fname)
> +            outdata = tools.read_file(output_fname)
> +            if self.boot_from == 'fspi' and self.fspi_header:
> +                spidata = tools.read_file(os.path.join(tools.get_output_dir(), self.fspi_header))
> +                if len(spidata) < 0x1000:
> +                    spidata += tools.get_bytes(0, 0x1000 - len(spidata))
> +                outdata = spidata + outdata

What happens if the header file is larger than 0x1000? The current
code silently concatenates and shifts everything downstream - exactly
the offset bug the commit message says we are trying to avoid. Please
raise a clear error when len(spidata) > 0x1000.

Also, if boot_from == 'fspi' but nxp,fspi-header-filename is unset,
the code silently produces an image with no FSPI header. A debug log
line noting the header is being skipped would help later.

> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> @@ -8099,6 +8099,15 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
> +    def testNxpImx8MFSPI(self):
> +        """Test that binman can produce an iMX8m FSPI image"""
> +        testdir = tempfile.mkdtemp(prefix='binman.')
> +        image_path = os.path.join(testdir, 'fspi_header.bin')
> +        with open(image_path, 'w') as f:
> +            f.write(bytes([0x87]).decode('latin1') * 448)
> +        with terminal.capture():
> +            self._DoTestFile('vendor/nxp_imx8m_fspi.dts', output_dir=testdir)

This only checks that binman does not crash. Please read back the
produced image and assert that the first 448 bytes are 0x87, that
bytes 0x1c0..0x1000 are zero, and that the mkimage output follows at
0x1000 - otherwise the regression we are guarding against would not be
caught.

Also, you should write files using tools.write_file() and and write
tools.get_bytes(0x87, 448) rather than the decode('latin1') trick.

Regards,
Simon

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

* Re: [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi"
  2026-05-29 22:03 ` Simon Glass
@ 2026-05-30 17:12   ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2026-05-30 17:12 UTC (permalink / raw)
  To: Simon Glass
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Tom Rini

On 5/30/26 12:03 AM, Simon Glass wrote:
> Hi Marek,
> 
> On 2026-05-25T23:51:02, Marek Vasut <marex@nabladev.com> wrote:
>> binman: imx8mimage: Handle nxp,boot-from = 'fspi'
>>
>> Boot from FSPI requires additional 448 Byte long header, with U-Boot SPL
>> starting at offset 0x1000. Currently, both i.MX8MM and i.MX8MN attempt
>> to generate this header using fspi_conf_block with filename pointing at
>> CONFIG_FSPI_CONF_FILE file. This does not work, for two reasons.
>>
>> First, the CONFIG_FSPI_CONF_FILE is generated by mkimage -T imx8mimage
>> and may not be available yet when the fspi_conf_block is evaluated. That
>> leads to a race condition where highly parallel builds fail to find the
>> CONFIG_FSPI_CONF_FILE, which is usually called fspi_header.bin, on first
>> build attempt.
>>
>> Second, binman gets confused and patches incorrect offset of DDR PHY
>> firmware blobs into U-Boot SPL, the offset is incremented by exactly
>> 0x1000 which is the size of fspi_conf_block.
>>
>> Fix both problems at once, make imx8mimage handle the generated FSPI
>> header and prepend it in front of the imx8mimage processed data. This
>> way, the race condition is solved, because the data generated by the
>> [...]
>>
>> tools/binman/etype/nxp_imx8mimage.py        | 11 ++++++++++-
>>   tools/binman/ftest.py                       |  9 +++++++++
>>   tools/binman/test/vendor/nxp_imx8m_fspi.dts | 18 ++++++++++++++++++
>>   3 files changed, 37 insertions(+), 1 deletion(-)
> 
>> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
>> @@ -33,6 +35,7 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
>>       def ReadNode(self):
>>           super().ReadNode()
>>           self.boot_from = fdt_util.GetString(self._node, 'nxp,boot-from')
>> +        self.fspi_header = fdt_util.GetString(self._node, 'nxp,fspi-header-filename')
>>           self.loader_address = fdt_util.GetInt(self._node, 'nxp,loader-address')
>>           self.rom_version = fdt_util.GetInt(self._node, 'nxp,rom-version')
> 
> Please update the class docstring to document
> nxp,fspi-header-filename: what it is, that it only applies when
> nxp,boot-from = 'fspi', and that the file is read relative to the
> binman output directory. Binman has no separate entries.rst, so the
> docstring is the documentation.
All feedback should be addressed in V3, thanks.

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

* Re: [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage
  2026-05-25 23:51 ` [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage Marek Vasut
@ 2026-06-03 16:45   ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2026-06-03 16:45 UTC (permalink / raw)
  To: marex
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

On 2026-05-25T23:51:02, Marek Vasut <marex@nabladev.com> wrote:
> arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage
>
> The binman imx8mimage now correctly handles generated fspi_header.bin
> in its imx8mimage etype. Make use of this, remove fspi_conf_block in
> favor of generated fspi_header.bin, and configure imx8mimage accordingly.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>
>
> arch/arm/dts/imx8mm-u-boot.dtsi | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)

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

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

* Re: [PATCH v2 3/3] arm64: dts: imx8mn: Generate FSPI header using binman imx8mimage
  2026-05-25 23:51 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
@ 2026-06-03 16:45   ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2026-06-03 16:45 UTC (permalink / raw)
  To: marex
  Cc: u-boot, NXP i.MX U-Boot Team, Adam Ford, Alexander Koch,
	Fabio Estevam, Peng Fan, Simon Glass, Tom Rini

On 2026-05-25T23:51:02, Marek Vasut <marex@nabladev.com> wrote:
> arm64: dts: imx8mn: Generate FSPI header using binman imx8mimage
>
> The binman imx8mimage now correctly handles generated fspi_header.bin
> in its imx8mimage etype. Make use of this, remove fspi_conf_block in
> favor of generated fspi_header.bin, and configure imx8mimage accordingly.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>
>
> arch/arm/dts/imx8mn-u-boot.dtsi | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)

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

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

end of thread, other threads:[~2026-06-03 16:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25 23:51 [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Marek Vasut
2026-05-25 23:51 ` [PATCH v2 2/3] arm64: dts: imx8mm: Generate FSPI header using binman imx8mimage Marek Vasut
2026-06-03 16:45   ` Simon Glass
2026-05-25 23:51 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
2026-06-03 16:45   ` Simon Glass
2026-05-28 12:43 ` [PATCH v2 1/3] binman: imx8mimage: Handle nxp,boot-from = "fspi" Fabio Estevam
2026-05-29 10:53   ` Marek Vasut
2026-05-29 22:03 ` Simon Glass
2026-05-30 17:12   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox