From 37c6f531dafb370e7fe378f547fb8bd7a79e3869 Mon Sep 17 00:00:00 2001 From: Emanuele Ghidoli Date: Wed, 20 May 2026 15:51:34 +0200 Subject: [PATCH 1/7] board: toradex: verdin-imx95: fix ram size check calculated addresses The ram_alias_checks addresses are 32 bit values. When summed as 64 bit values the calculation is done correctly, otherwise, if they are summed as 32 bit values, the sum wraps around. Fix by adding uintptr_t recast to the base address. Fixes: 60d8255d8dc0 ("board: toradex: add Toradex Verdin iMX95") Signed-off-by: Emanuele Ghidoli Acked-by: Francesco Dolcini --- board/toradex/verdin-imx95/verdin-imx95.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/toradex/verdin-imx95/verdin-imx95.c b/board/toradex/verdin-imx95/verdin-imx95.c index 60c1dbb5e29..7c0804c1d1c 100644 --- a/board/toradex/verdin-imx95/verdin-imx95.c +++ b/board/toradex/verdin-imx95/verdin-imx95.c @@ -50,10 +50,10 @@ int board_late_init(void) } static const struct ram_alias_check ram_alias_checks[] = { - { (void *)(PHYS_SDRAM + SZ_8G), (void *)(PHYS_SDRAM), SZ_16G }, - { (void *)(PHYS_SDRAM + SZ_4G), (void *)(PHYS_SDRAM), SZ_8G }, - { (void *)(PHYS_SDRAM + SZ_2G), (void *)(PHYS_SDRAM), SZ_4G }, - { (void *)(PHYS_SDRAM + SZ_1G), (void *)(PHYS_SDRAM), SZ_2G }, + { (void *)((uintptr_t)PHYS_SDRAM + SZ_8G), (void *)(PHYS_SDRAM), SZ_16G }, + { (void *)((uintptr_t)PHYS_SDRAM + SZ_4G), (void *)(PHYS_SDRAM), SZ_8G }, + { (void *)((uintptr_t)PHYS_SDRAM + SZ_2G), (void *)(PHYS_SDRAM), SZ_4G }, + { (void *)((uintptr_t)PHYS_SDRAM + SZ_1G), (void *)(PHYS_SDRAM), SZ_2G }, { NULL } }; From 8377214282d00989722e1ff0ea83e6234f99564d Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Thu, 4 Jun 2026 17:18:41 -0300 Subject: [PATCH 2/7] imx: kontron-sl-mx6ul: Enable CONFIG_DM_MDIO to fix boot abort The following failure occurs right before switching to the kernel: data abort pc : [<9ff60162>] lr : [<9ff79d13>] reloc pc : [<8781c162>] lr : [<87835d13>] sp : 9bf30f78 ip : 9bf4b140 fp : 007963a0 r10: fffffdfb r9 : 9bf3bed0 r8 : 00004600 r7 : 00000000 r6 : 9ffe5a0c r5 : 00004600 r4 : 9bf4acf0 r3 : f5f5f5f5 r2 : f5f5f5f5 r1 : 9ffe0c5c r0 : 9bf7c130 Flags: NzCv IRQs off FIQs off Mode SVC_32 (T) Code: 9ffe b158 e9d0 2300 (6053) 601a Resetting CPU ... This is due to the fact that the board uses a shared MDIO bus for both ethernet controllers, but FEC_MXC_SHARE_MDIO is not enabled. This results in a double free in fecmxc_remove(). To fix this enable CONFIG_DM_MDIO so the shared MDIO is correctly detected from the devicetree. Fixes: 048fdda977ab ("imx: kontron-sl-mx6ul: Enable second ethernet interface") Signed-off-by: Frieder Schrempf --- configs/kontron-sl-mx6ul_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/kontron-sl-mx6ul_defconfig b/configs/kontron-sl-mx6ul_defconfig index f800c3e4039..b1f5b13e404 100644 --- a/configs/kontron-sl-mx6ul_defconfig +++ b/configs/kontron-sl-mx6ul_defconfig @@ -92,6 +92,7 @@ CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_SPI_FLASH_MTD=y +CONFIG_DM_MDIO=y CONFIG_DM_ETH_PHY=y CONFIG_FEC_MXC=y CONFIG_MII=y From cdb9e79056dcc94440202845a75a31e4e40cc3a2 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Fri, 22 May 2026 21:51:42 +0800 Subject: [PATCH 3/7] cpu: imx8_cpu: Fix CPU segment information print Should not use CONFIG_IMX_TMU to determine the print of CPU market segment information. Only iMX8 platforms don't have segment fuse. And there is no extended commercial part on iMX9 (91/93/94/95), fix it to extended industrial. Signed-off-by: Ye Li --- drivers/cpu/imx8_cpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index 785c299eca5..3473712a423 100644 --- a/drivers/cpu/imx8_cpu.c +++ b/drivers/cpu/imx8_cpu.c @@ -222,7 +222,7 @@ static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size) ret = snprintf(buf, size, "NXP i.MX%s Rev%s %s at %u MHz", plat->type, plat->rev, plat->name, plat->freq_mhz); - if (IS_ENABLED(CONFIG_IMX_TMU)) { + if (!IS_ENABLED(CONFIG_IMX8)) { /* imx8 does not have segment fuse */ switch (get_cpu_temp_grade(&minc, &maxc)) { case TEMP_AUTOMOTIVE: grade = "Automotive temperature grade"; @@ -231,7 +231,10 @@ static int cpu_imx_get_desc(const struct udevice *dev, char *buf, int size) grade = "Industrial temperature grade"; break; case TEMP_EXTCOMMERCIAL: - grade = "Extended Consumer temperature grade"; + if (IS_ENABLED(CONFIG_ARCH_IMX9)) + grade = "Extended Industrial temperature grade"; + else + grade = "Extended Consumer temperature grade"; break; default: grade = "Consumer temperature grade"; From 822a98588d16e5542b4e4d9d23c19a8ee7e93040 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2026 19:08:24 +0200 Subject: [PATCH 4/7] 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 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 --- tools/binman/etype/nxp_imx8mimage.py | 14 +++++++++++++- tools/binman/ftest.py | 14 ++++++++++++++ tools/binman/test/vendor/nxp_imx8m_fspi.dts | 18 ++++++++++++++++++ .../binman/test/vendor/nxp_imx8m_fspi_fail.dts | 18 ++++++++++++++++++ .../binman/test/vendor/nxp_imx8m_fspi_pass.dts | 18 ++++++++++++++++++ 5 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi.dts create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts create mode 100644 tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts diff --git a/tools/binman/etype/nxp_imx8mimage.py b/tools/binman/etype/nxp_imx8mimage.py index 8ad177b3b65..25c43438a87 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 @@ -23,6 +25,8 @@ 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"' . """ def __init__(self, section, etype, node): @@ -33,6 +37,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', 'fspi_header.bin') 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 +57,14 @@ 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': + 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)) + 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..bf98b268ac1 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -8099,6 +8099,20 @@ 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.') + + 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) + 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..ae6cc5981e6 --- /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 = <1>; + nxp,loader-address = <0x10>; + }; + }; +}; diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_fail.dts new file mode 100644 index 00000000000..5a0d758e5a3 --- /dev/null +++ b/tools/binman/test/vendor/nxp_imx8m_fspi_fail.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_fail.bin"; + nxp,rom-version = <2>; + nxp,loader-address = <0x10>; + }; + }; +}; diff --git a/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts b/tools/binman/test/vendor/nxp_imx8m_fspi_pass.dts new file mode 100644 index 00000000000..448d93d277a --- /dev/null +++ b/tools/binman/test/vendor/nxp_imx8m_fspi_pass.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"; + /* Default nxp,fspi-header-filename = "fspi_header.bin"; */ + nxp,rom-version = <2>; + nxp,loader-address = <0x10>; + }; + }; +}; From c3680dcf9a7e0f90bfb0b91d6f640a09557b2320 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2026 19:08:25 +0200 Subject: [PATCH 5/7] 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 --- 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 = ; args; /* Needed by mkimage etype superclass */ From b9fc16e72ddb1cfa3f01b484613343d77b97b1c0 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 30 May 2026 19:08:26 +0200 Subject: [PATCH 6/7] 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 --- 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 = ; args; /* Needed by mkimage etype superclass */ From 0fba623e4fd421bbea6e44156ea15a135d08576d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 4 Jun 2026 00:32:12 +0200 Subject: [PATCH 7/7] tools: imx8image: Fix FSPI alignment to 4 kiB The SPI NOR minimum subsector size is 4 kiB, update the alignment. THis is particularly important in case of embedded DUMMY_DDR, which must be at at least 4 kiB aligned offset. Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support") Signed-off-by: Marek Vasut Reviewed-by: Peng Fan --- tools/imx8image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/imx8image.c b/tools/imx8image.c index 84f46bcaf37..bb1b8667971 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -80,7 +80,7 @@ static table_entry_t imx8image_core_entries[] = { static table_entry_t imx8image_sector_size[] = { {0x400, "sd", "sd/emmc",}, {0x400, "emmc_fastboot", "emmc fastboot",}, - {0x400, "fspi", "flexspi", }, + {0x1000, "fspi", "flexspi", }, {0x1000, "nand_4k", "nand 4K", }, {0x2000, "nand_8k", "nand 8K", }, {0x4000, "nand_16k", "nand 16K", },