* [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage
@ 2026-06-30 8:40 Marek Vasut
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Marek Vasut @ 2026-06-30 8:40 UTC (permalink / raw)
To: u-boot
Cc: Marek Vasut, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
Stop depending on the current mkimage method of generating the FSPI
header, instead generate the FSPI header within binman itself. This
is more flexible, as the FSPI header properties can be configured
from within the board-specific DT instead of being hard-coded in
mkimage at build time.
Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@nabladev.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Wojciech Dubowik <Wojciech.Dubowik@mt.com>
Cc: Yannic Moog <y.moog@phytec.de>
Cc: u-boot@lists.denx.de
---
V2: - Drop import os
- Update class documentation, document defaults
---
tools/binman/etype/nxp_imx8mimage.py | 97 +++++++++++++++++--
tools/binman/ftest.py | 23 ++---
tools/binman/test/vendor/nxp_imx8m_fspi.dts | 1 -
.../nxp_imx8m_fspi_fail_columnadresswidth.dts | 19 ++++
...dts => nxp_imx8m_fspi_fail_devicetype.dts} | 3 +-
.../nxp_imx8m_fspi_fail_flashpadtype.dts | 19 ++++
.../nxp_imx8m_fspi_fail_readsampleclksrc.dts | 19 ++++
.../nxp_imx8m_fspi_fail_serialclkfreq.dts | 19 ++++
.../test/vendor/nxp_imx8m_fspi_pass.dts | 1 -
9 files changed, 179 insertions(+), 22 deletions(-)
create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_fail_columnadresswidth.dts
rename tools/binman/test/vendor/{nxp_imx8m_fspi_fail.dts => nxp_imx8m_fspi_fail_devicetype.dts} (83%)
create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_fail_flashpadtype.dts
create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_fail_readsampleclksrc.dts
create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts
diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
index 25c43438a87..92677cb54bd 100644
--- a/tools/binman/etype/nxp_imx8mimage.py
+++ b/tools/binman/etype/nxp_imx8mimage.py
@@ -7,7 +7,7 @@
# configuration file and input data.
#
-import os
+import struct
from collections import OrderedDict
@@ -25,8 +25,26 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
- nxp,boot-from - device to boot from (e.g. 'sd')
- nxp,loader-address - loader address (SPL text base)
- nxp,rom-version - BootROM version ('2' for i.MX8M Nano and Plus)
- - nxp,fspi-header-filename - FSPI header file name (CONFIG_FSPI_CONF_FILE).
- Used only if 'nxp,boot-from == "fspi"' .
+
+ Properties / Entry arguments for FSPI boot mode (nxp,boot-from = "fspi"):
+ - nxp,fspi-columnadresswidth - FSPI column address width
+ (3 - HyperFlash, 12/13 - Serial NAND, 0 - Otherwise (default))
+ - nxp,fspi-controllermisc-diffclk - FSPI differential clock enable (default off)
+ - nxp,fspi-controllermisc-wordaddr - FSPI word addressable enable (default off)
+ - nxp,fspi-controllermisc-safecfg - FSPI safe configuration frequency (default off)
+ - nxp,fspi-controllermisc-padovr - FSPI pad setting override (default off)
+ - nxp,fspi-controllermisc-ddrmode - FSPI DDR mode (default off)
+ - nxp,fspi-lutcustomseq - FSPI use LUT sequence parameters (default off)
+ - nxp,fspi-devicetype - FSPI device type
+ (1 - SPI NOR (default), 2 - Serial NAND)
+ - nxp,fspi-flasha1size - FSPI device size (default 0x10000000)
+ - nxp,fspi-flashpadtype - FSPI flash pad type
+ (1 - Single pad (default), 2 - Dual pads, 4 - Quad pads, 8 - Octal pads)
+ - nxp,fspi-readsampleclksrc - FSPI clock source
+ (0 - Internal loopback (default), 1 - loopback from DQS pad, 3 - Flash provided DQS).
+ - nxp,fspi-serialclkfreq - FSPI clock frequency
+ (1 - 30 MHz, 2 - 50 MHz (default), 3 - 60 MHz, 4 - 75 MHz, 5 - 80 MHz,
+ 6 - 100 MHz, 7 - 133 MHz, 8 - 166 MHz).
"""
def __init__(self, section, etype, node):
@@ -37,9 +55,30 @@ 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', 'fspi_header.bin')
+ self.fspi_columnadresswidth = fdt_util.GetInt(self._node, 'nxp,fspi-columnadresswidth', 0)
+ self.fspi_controllermisc_diffclk = fdt_util.GetBool(self._node, 'nxp,fspi-controllermisc-diffclk')
+ self.fspi_controllermisc_wordaddr = fdt_util.GetBool(self._node, 'nxp,fspi-controllermisc-wordaddr')
+ self.fspi_controllermisc_safecfg = fdt_util.GetBool(self._node, 'nxp,fspi-controllermisc-safecfg')
+ self.fspi_controllermisc_padovr = fdt_util.GetBool(self._node, 'nxp,fspi-controllermisc-padovr')
+ self.fspi_controllermisc_ddrmode = fdt_util.GetBool(self._node, 'nxp,fspi-controllermisc-ddrmode')
+ self.fspi_devicetype = fdt_util.GetInt(self._node, 'nxp,fspi-devicetype', 1)
+ self.fspi_flasha1size = fdt_util.GetInt(self._node, 'nxp,fspi-flasha1size', 0x10000000)
+ self.fspi_flashpadtype = fdt_util.GetInt(self._node, 'nxp,fspi-flashpadtype', 1)
+ self.fspi_lutcustomseq = fdt_util.GetBool(self._node, 'nxp,fspi-lutcustomseq')
+ self.fspi_readsampleclksrc = fdt_util.GetInt(self._node, 'nxp,fspi-readsampleclksrc', 0)
+ self.fspi_serialclkfreq = fdt_util.GetInt(self._node, 'nxp,fspi-serialclkfreq', 2)
self.loader_address = fdt_util.GetInt(self._node, 'nxp,loader-address')
self.rom_version = fdt_util.GetInt(self._node, 'nxp,rom-version')
+ if not self.fspi_columnadresswidth in [ 0, 3, 12, 13 ]:
+ raise ValueError('nxp,fspi-columnadresswidth can be 0, 3, 12, 13 only.')
+ if not self.fspi_devicetype in [ 1, 2 ]:
+ raise ValueError('nxp,fspi-devicetype can be 1, 2 only.')
+ if not self.fspi_flashpadtype in [ 1, 2, 4, 8 ]:
+ raise ValueError('nxp,fspi-flashpadtype can be 1, 2, 4, 8 only.')
+ if not self.fspi_readsampleclksrc in [ 0, 1, 3 ]:
+ raise ValueError('nxp,fspi-readsampleclksrc can be 0, 1, 3 only.')
+ if not self.fspi_serialclkfreq in [ 1, 2, 3, 4, 5, 6, 7, 8 ]:
+ raise ValueError('nxp,fspi-serialclkfreq can be 1..8 only.')
self.ReadEntries()
def BuildSectionData(self, required):
@@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
if self.mkimage.run_cmd(*args) is not None:
outdata = tools.read_file(output_fname)
if self.boot_from == 'fspi':
- spidata = tools.read_file(os.path.join(tools.get_output_dir(), self.fspi_header))
- if len(spidata) != 448:
- raise ValueError("FSPI header is not 448 Bytes long")
- spidata += tools.get_bytes(0, 0x1000 - len(spidata))
+ # 0x00 ... Tag
+ spidata = struct.pack('<I', 0x42464346)
+ # 0x04 ... Version
+ spidata += struct.pack('<I', 0x56010000)
+ # 0x08 ... Reserved
+ spidata += struct.pack('<I', 0)
+ # 0x0c ... readSampleClkSrc (LSByte at 0x0c), dataHoldTime,
+ # dataSetupTime, columnAdressWidth (MSByte at 0x0f)
+ spidata += struct.pack('<I', 0x00030300 |
+ (self.fspi_columnadresswidth << 24) |
+ self.fspi_readsampleclksrc)
+
+ # 0x10..0x3f ... Padding
+ spidata += tools.get_bytes(0, 0x30)
+
+ # 0x40 ... controllerMiscOption
+ spidata += struct.pack('<I',
+ ((1 << 0) if self.fspi_controllermisc_diffclk else 0) |
+ ((1 << 3) if self.fspi_controllermisc_wordaddr else 0) |
+ ((1 << 4) if self.fspi_controllermisc_safecfg else 0) |
+ ((1 << 5) if self.fspi_controllermisc_padovr else 0) |
+ ((1 << 6) if self.fspi_controllermisc_ddrmode else 0))
+
+ # 0x44 ... deviceType (LSByte at 0x44), sflashPadType,
+ # serialClkFreq, lutCustomSeqEnable (MSByte at 0x47)
+ spidata += struct.pack('<I',
+ ((1 << 24) if self.fspi_lutcustomseq else 0) |
+ (self.fspi_serialclkfreq << 16) |
+ (self.fspi_flashpadtype << 8) |
+ self.fspi_devicetype)
+
+ # 0x48..0x4f ... Padding
+ spidata += tools.get_bytes(0, 0x8)
+
+ # 0x50 ... flashA1Size
+ spidata += struct.pack('<I', self.fspi_flasha1size)
+
+ # 0x54..0x7f ... Padding
+ spidata += tools.get_bytes(0, 0x2c)
+
+ # 0x80 ... lookupTable
+ spidata += struct.pack('<I', 0x0818040b)
+ spidata += struct.pack('<I', 0x24043008)
+
+ # 0x88..0xfff ... Padding (end of FSPI block is 0x1bf, align to 4k)
+ spidata += tools.get_bytes(0, 0x1000 - 0xa8)
outdata = spidata + outdata
return outdata
else:
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index bf98b268ac1..03c9d42aeeb 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -8101,17 +8101,18 @@ 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.')
-
- tools.write_file(os.path.join(testdir, 'fspi_header.bin'), tools.get_bytes(0, 448))
- with terminal.capture():
- self._DoTestFile('vendor/nxp_imx8m_fspi.dts', output_dir=testdir)
- self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts', output_dir=testdir)
-
- tools.write_file(os.path.join(testdir, 'fspi_header_fail.bin'), tools.get_bytes(0, 4097))
- with terminal.capture():
- with self.assertRaises(ValueError) as e:
- self._DoTestFile('vendor/nxp_imx8m_fspi_fail.dts', output_dir=testdir)
+ self._DoTestFile('vendor/nxp_imx8m_fspi.dts')
+ self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts')
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('vendor/nxp_imx8m_fspi_fail_columnadresswidth.dts')
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('vendor/nxp_imx8m_fspi_fail_devicetype.dts')
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('vendor/nxp_imx8m_fspi_fail_flashpadtype.dts')
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('vendor/nxp_imx8m_fspi_fail_readsampleclksrc.dts')
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts')
def testNxpHeaderDdrfw(self):
"""Test that binman can add a header to DDR PHY firmware images"""
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi.dts b/tools/binman/test/vendor/nxp_imx8m_fspi.dts
index ae6cc5981e6..140e9bea2e7 100644
--- a/tools/binman/test/vendor/nxp_imx8m_fspi.dts
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi.dts
@@ -10,7 +10,6 @@
nxp-imx8mimage {
args; /* TODO: Needed by mkimage etype superclass */
nxp,boot-from = "fspi";
- nxp,fspi-header-filename = "fspi_header.bin";
nxp,rom-version = <1>;
nxp,loader-address = <0x10>;
};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail_columnadresswidth.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_columnadresswidth.dts
new file mode 100644
index 00000000000..de8bb076fc4
--- /dev/null
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_columnadresswidth.dts
@@ -0,0 +1,19 @@
+// 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,rom-version = <2>;
+ nxp,loader-address = <0x10>;
+ /* Bogus value */
+ nxp,fspi-columnadresswidth = <1>;
+ };
+ };
+};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_devicetype.dts
similarity index 83%
rename from tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts
rename to tools/binman/test/vendor/nxp_imx8m_fspi_fail_devicetype.dts
index 5a0d758e5a3..f3b343f942f 100644
--- a/tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_devicetype.dts
@@ -10,9 +10,10 @@
nxp-imx8mimage {
args; /* TODO: Needed by mkimage etype superclass */
nxp,boot-from = "fspi";
- nxp,fspi-header-filename = "fspi_header_fail.bin";
nxp,rom-version = <2>;
nxp,loader-address = <0x10>;
+ /* Bogus value */
+ nxp,fspi-devicetype = <3>;
};
};
};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail_flashpadtype.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_flashpadtype.dts
new file mode 100644
index 00000000000..515f81ba9f4
--- /dev/null
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_flashpadtype.dts
@@ -0,0 +1,19 @@
+// 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,rom-version = <2>;
+ nxp,loader-address = <0x10>;
+ /* Bogus value */
+ nxp,fspi-flashpadtype = <9>;
+ };
+ };
+};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail_readsampleclksrc.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_readsampleclksrc.dts
new file mode 100644
index 00000000000..b409a6099a3
--- /dev/null
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_readsampleclksrc.dts
@@ -0,0 +1,19 @@
+// 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,rom-version = <2>;
+ nxp,loader-address = <0x10>;
+ /* Bogus value */
+ nxp,fspi-readsampleclksrc = <2>;
+ };
+ };
+};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts
new file mode 100644
index 00000000000..a71522838e8
--- /dev/null
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts
@@ -0,0 +1,19 @@
+// 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,rom-version = <2>;
+ nxp,loader-address = <0x10>;
+ /* Bogus value */
+ nxp,fspi-serialclkfreq = <9>;
+ };
+ };
+};
diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts
index 448d93d277a..1545cf6e44c 100644
--- a/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts
+++ b/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts
@@ -10,7 +10,6 @@
nxp-imx8mimage {
args; /* TODO: Needed by mkimage etype superclass */
nxp,boot-from = "fspi";
- /* Default nxp,fspi-header-filename = "fspi_header.bin"; */
nxp,rom-version = <2>;
nxp,loader-address = <0x10>;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename
2026-06-30 8:40 [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Marek Vasut
@ 2026-06-30 8:40 ` Marek Vasut
2026-07-01 7:37 ` Peng Fan
2026-07-02 11:14 ` Simon Glass
2026-06-30 8:40 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Marek Vasut @ 2026-06-30 8:40 UTC (permalink / raw)
To: u-boot
Cc: Marek Vasut, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
The FSPI header is now generated purely using binman, drop no longer
supported nxp,fspi-header-filename property.
Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@nabladev.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Wojciech Dubowik <Wojciech.Dubowik@mt.com>
Cc: Yannic Moog <y.moog@phytec.de>
Cc: u-boot@lists.denx.de
---
V2: - New patch
---
arch/arm/dts/imx8mm-u-boot.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index ab135fc8a47..6cba8a9d484 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -62,7 +62,6 @@
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
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/3] arm64: dts: imx8mn: Drop nxp,fspi-header-filename
2026-06-30 8:40 [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Marek Vasut
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
@ 2026-06-30 8:40 ` Marek Vasut
2026-07-01 7:37 ` Peng Fan
2026-07-02 11:16 ` Simon Glass
2026-07-01 7:37 ` [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Peng Fan
2026-07-02 11:13 ` Simon Glass
3 siblings, 2 replies; 11+ messages in thread
From: Marek Vasut @ 2026-06-30 8:40 UTC (permalink / raw)
To: u-boot
Cc: Marek Vasut, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
The FSPI header is now generated purely using binman, drop no longer
supported nxp,fspi-header-filename property.
Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@nabladev.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Wojciech Dubowik <Wojciech.Dubowik@mt.com>
Cc: Yannic Moog <y.moog@phytec.de>
Cc: u-boot@lists.denx.de
---
V2: - New patch
---
arch/arm/dts/imx8mn-u-boot.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi
index 8993605af3c..60e222ef970 100644
--- a/arch/arm/dts/imx8mn-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-u-boot.dtsi
@@ -116,7 +116,6 @@
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
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage
2026-06-30 8:40 [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Marek Vasut
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
2026-06-30 8:40 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
@ 2026-07-01 7:37 ` Peng Fan
2026-07-02 11:13 ` Simon Glass
3 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2026-07-01 7:37 UTC (permalink / raw)
To: Marek Vasut
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
On Tue, Jun 30, 2026 at 10:40:46AM +0200, Marek Vasut wrote:
>Stop depending on the current mkimage method of generating the FSPI
>header, instead generate the FSPI header within binman itself. This
>is more flexible, as the FSPI header properties can be configured
>from within the board-specific DT instead of being hard-coded in
>mkimage at build time.
>
>Signed-off-by: Marek Vasut <marex@nabladev.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
@ 2026-07-01 7:37 ` Peng Fan
2026-07-02 11:14 ` Simon Glass
1 sibling, 0 replies; 11+ messages in thread
From: Peng Fan @ 2026-07-01 7:37 UTC (permalink / raw)
To: Marek Vasut
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
On Tue, Jun 30, 2026 at 10:40:47AM +0200, Marek Vasut wrote:
>The FSPI header is now generated purely using binman, drop no longer
>supported nxp,fspi-header-filename property.
>
>Signed-off-by: Marek Vasut <marex@nabladev.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] arm64: dts: imx8mn: Drop nxp,fspi-header-filename
2026-06-30 8:40 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
@ 2026-07-01 7:37 ` Peng Fan
2026-07-02 11:16 ` Simon Glass
1 sibling, 0 replies; 11+ messages in thread
From: Peng Fan @ 2026-07-01 7:37 UTC (permalink / raw)
To: Marek Vasut
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
On Tue, Jun 30, 2026 at 10:40:48AM +0200, Marek Vasut wrote:
>The FSPI header is now generated purely using binman, drop no longer
>supported nxp,fspi-header-filename property.
>
>Signed-off-by: Marek Vasut <marex@nabladev.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage
2026-06-30 8:40 [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Marek Vasut
` (2 preceding siblings ...)
2026-07-01 7:37 ` [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Peng Fan
@ 2026-07-02 11:13 ` Simon Glass
2026-07-05 21:23 ` Marek Vasut
3 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2026-07-02 11:13 UTC (permalink / raw)
To: marex
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
Hi Marek,
On 2026-06-30T08:40:46, Marek Vasut <marex@nabladev.com> wrote:
> binman: imx8mimage: Generate FSPI header in binman instead of mkimage
>
> Stop depending on the current mkimage method of generating the FSPI
> header, instead generate the FSPI header within binman itself. This
> is more flexible, as the FSPI header properties can be configured
> from within the board-specific DT instead of being hard-coded in
> mkimage at build time.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>
> Acked-by: Peng Fan <peng.fan@nxp.com>
>
> tools/binman/etype/nxp_imx8mimage.py | 97 ++++++++++++++++++++--
> tools/binman/ftest.py | 23 ++---
> tools/binman/test/vendor/nxp_imx8m_fspi.dts | 1 -
> .../nxp_imx8m_fspi_fail_columnadresswidth.dts | 19 +++++
> ...fail.dts => nxp_imx8m_fspi_fail_devicetype.dts} | 3 +-
> .../vendor/nxp_imx8m_fspi_fail_flashpadtype.dts | 19 +++++
> .../nxp_imx8m_fspi_fail_readsampleclksrc.dts | 19 +++++
> .../vendor/nxp_imx8m_fspi_fail_serialclkfreq.dts | 19 +++++
> tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts | 1 -
> 9 files changed, 179 insertions(+), 22 deletions(-)
> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -25,8 +25,26 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> + - nxp,fspi-columnadresswidth - FSPI column address width
This misspells 'address'. It becomes part of the binman DT binding and
will be hard to change later, so please can you rename it to
nxp,fspi-columnaddresswidth (and the matching variable)?
> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -37,9 +55,30 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> + if not self.fspi_columnadresswidth in [ 0, 3, 12, 13 ]:
> + raise ValueError('nxp,fspi-columnadresswidth can be 0, 3, 12, 13 only.')
Please use self.Raise() rather than raise ValueError, as with other
etypes - it adds the node path so the user can see which image is at
fault. Also 'not in' reads better than 'not x in':
if self.fspi_columnadresswidth not in [0, 3, 12, 13]:
self.Raise('nxp,fspi-columnadresswidth can be 0, 3, 12, 13 only')
Same for the other four checks.
> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> + # 0x80 ... lookupTable
> + spidata += struct.pack('<I', 0x0818040b)
> + spidata += struct.pack('<I', 0x24043008)
Just to check, this LUT is a single-pad fast-read sequence, so should
we mention the fixed read command? E.g. if a board uses quad pads,
what will happen.
> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> @@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> + # 0x88..0xfff ... Padding (end of FSPI block is 0x1bf, align to 4k)
> + spidata += tools.get_bytes(0, 0x1000 - 0xa8)
At this point len(spidata) is 0x88, not 0xa8, so the header comes out
as 0xfe0 bytes and the mkimage output starts at 0xfe0 instead of 0x1000
- 0x20 bytes short. Please use the actual length so this cannot go
stale:
spidata += tools.get_bytes(0, 0x1000 - len(spidata))
> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> @@ -8101,17 +8101,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
> + self._DoTestFile('vendor/nxp_imx8m_fspi.dts')
> + self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts')
Since binman now generates the header itself, please can you check the
output data in the test, e.g. verify the tag at offset 0 and that the
mkimage data starts at 0x1000? That would have caught the padding
problem above. Also please use assertIn() on str(e.exception) for each
failure case, so the test confirms the expected error rather than any
ValueError.
Regards,
Simon
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
2026-07-01 7:37 ` Peng Fan
@ 2026-07-02 11:14 ` Simon Glass
1 sibling, 0 replies; 11+ messages in thread
From: Simon Glass @ 2026-07-02 11:14 UTC (permalink / raw)
To: marex
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
On 2026-06-30T08:40:46, Marek Vasut <marex@nabladev.com> wrote:
> arm64: dts: imx8mm: Drop nxp,fspi-header-filename
>
> The FSPI header is now generated purely using binman, drop no longer
> supported nxp,fspi-header-filename property.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>
> Acked-by: Peng Fan <peng.fan@nxp.com>
>
> arch/arm/dts/imx8mm-u-boot.dtsi | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/3] arm64: dts: imx8mn: Drop nxp,fspi-header-filename
2026-06-30 8:40 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
2026-07-01 7:37 ` Peng Fan
@ 2026-07-02 11:16 ` Simon Glass
1 sibling, 0 replies; 11+ messages in thread
From: Simon Glass @ 2026-07-02 11:16 UTC (permalink / raw)
To: marex
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Simon Glass, Stefano Babic, Tom Rini, Wojciech Dubowik,
Yannic Moog
On 2026-06-30T08:40:46, Marek Vasut <marex@nabladev.com> wrote:
> arm64: dts: imx8mn: Drop nxp,fspi-header-filename
>
> The FSPI header is now generated purely using binman, drop no longer
> supported nxp,fspi-header-filename property.
>
> Signed-off-by: Marek Vasut <marex@nabladev.com>
> Acked-by: Peng Fan <peng.fan@nxp.com>
>
> arch/arm/dts/imx8mn-u-boot.dtsi | 1 -
> 1 file changed, 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage
2026-07-02 11:13 ` Simon Glass
@ 2026-07-05 21:23 ` Marek Vasut
2026-07-06 12:27 ` Simon Glass
0 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2026-07-05 21:23 UTC (permalink / raw)
To: Simon Glass
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Stefano Babic, Tom Rini, Wojciech Dubowik, Yannic Moog
On 7/2/26 1:13 PM, Simon Glass wrote:
[...]
>> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
>> @@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
>> + # 0x80 ... lookupTable
>> + spidata += struct.pack('<I', 0x0818040b)
>> + spidata += struct.pack('<I', 0x24043008)
>
> Just to check, this LUT is a single-pad fast-read sequence, so should
> we mention the fixed read command? E.g. if a board uses quad pads,
> what will happen.
Can you please rephrase this question ? I cannot make any sense of it.
[...]
>> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
>> @@ -8101,17 +8101,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
>> + self._DoTestFile('vendor/nxp_imx8m_fspi.dts')
>> + self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts')
>
> Since binman now generates the header itself, please can you check the
> output data in the test, e.g. verify the tag at offset 0 and that the
> mkimage data starts at 0x1000? That would have caught the padding
> problem above. Also please use assertIn() on str(e.exception) for each
> failure case, so the test confirms the expected error rather than any
> ValueError.
Sure, if you can provide actual comprehensible example, I can add that.
In the meantime, I skipped this and sent a V4.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage
2026-07-05 21:23 ` Marek Vasut
@ 2026-07-06 12:27 ` Simon Glass
0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2026-07-06 12:27 UTC (permalink / raw)
To: Marek Vasut
Cc: u-boot, NXP i.MX U-Boot Team, Fabio Estevam, Quentin Schulz,
Stefano Babic, Tom Rini, Wojciech Dubowik, Yannic Moog
Hi Marek,
On Sun, 5 Jul 2026 at 15:26, Marek Vasut <marex@nabladev.com> wrote:
>
> On 7/2/26 1:13 PM, Simon Glass wrote:
>
> [...]
>
> >> diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py
> >> @@ -59,10 +98,52 @@ class Entry_nxp_imx8mimage(Entry_mkimage):
> >> + # 0x80 ... lookupTable
> >> + spidata += struct.pack('<I', 0x0818040b)
> >> + spidata += struct.pack('<I', 0x24043008)
> >
> > Just to check, this LUT is a single-pad fast-read sequence, so should
> > we mention the fixed read command? E.g. if a board uses quad pads,
> > what will happen.
>
> Can you please rephrase this question ? I cannot make any sense of it.
I was trying to figure out what the magic numbers meant.
https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-do-I-properly-define-a-flexspi-LUT-entry/m-p/1016543
So I think you have:
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B, RADDR_SDR, FLEXSPI_1PAD, 0x18),
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 0x08, READ_SDR, FLEXSPI_1PAD, 0x04),
so always using a single pad. But you have the nxp,fspi-flashpadtype
property which sems to allow you to select that value, or at least
that is my reading of it. So my point was that people might think they
can change the pad setting using nxp,fspi-flashpadtype but it won't
actually work. Perhaps just a comment would help?
>
> [...]
>
> >> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> >> @@ -8101,17 +8101,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
> >> + self._DoTestFile('vendor/nxp_imx8m_fspi.dts')
> >> + self._DoTestFile('vendor/nxp_imx8m_fspi_pass.dts')
> >
> > Since binman now generates the header itself, please can you check the
> > output data in the test, e.g. verify the tag at offset 0 and that the
> > mkimage data starts at 0x1000? That would have caught the padding
> > problem above. Also please use assertIn() on str(e.exception) for each
> > failure case, so the test confirms the expected error rather than any
> > ValueError.
> Sure, if you can provide actual comprehensible example, I can add that.
>
> In the meantime, I skipped this and sent a V4.
For checking the error, see testNxpImx8mCSTFastAuth():
with terminal.capture() as (_, stderr):
self._DoTestFile('vendor/nxp_imx8_csf_fast_auth.dts',
force_missing_bintools='cst')
err = stderr.getvalue()
self.assertRegex(err, "Image 'image'.*missing bintools.*: cst")
For reading the file, if you call _DoReadFile() instead of
_DoTestFile() it returns the output image, so you can then disect it
as you wish. As it is your test checks that the code is exercised, but
not as much about what output is produced.
Regards,
Simon
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-07-06 12:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 8:40 [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Marek Vasut
2026-06-30 8:40 ` [PATCH v2 2/3] arm64: dts: imx8mm: Drop nxp,fspi-header-filename Marek Vasut
2026-07-01 7:37 ` Peng Fan
2026-07-02 11:14 ` Simon Glass
2026-06-30 8:40 ` [PATCH v2 3/3] arm64: dts: imx8mn: " Marek Vasut
2026-07-01 7:37 ` Peng Fan
2026-07-02 11:16 ` Simon Glass
2026-07-01 7:37 ` [PATCH v2 1/3] binman: imx8mimage: Generate FSPI header in binman instead of mkimage Peng Fan
2026-07-02 11:13 ` Simon Glass
2026-07-05 21:23 ` Marek Vasut
2026-07-06 12:27 ` 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.