Skip to contentSkip to conversation

toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt

PATCH In review Stefan Eichenberger 2 participants 5 messages Aug 21 – Aug 27 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt

From: Stefan Eichenberger <[email protected]>

On i.MX95 SoCs, peripherals like PCIe, the display pipeline (DPU, LVDS, MIPI-DSI), the 10G ENET port and the Cortex-M7 core can be fused off. U-Boot already fixes up the OS device tree accordingly in ft_system_setup(), but its own control device tree keeps those nodes enabled, so U-Boot might bind and probe drivers for hardware that are not present on the SoC.

Enable CONFIG_OF_BOARD_FIXUP and implement board_fix_fdt() for Aquila, Toradex SMARC iMX95 and Verdin iMX95 by calling imx9_uboot_fixup_by_fuse(), mirroring the i.MX95 reference board implementation.

---
 board/toradex/aquila-imx95/aquila-imx95.c | 8 ++++++++
 board/toradex/smarc-imx95/smarc-imx95.c   | 8 ++++++++
 board/toradex/verdin-imx95/verdin-imx95.c | 8 ++++++++
 configs/aquila-imx95_defconfig            | 1 +
 configs/toradex-smarc-imx95_defconfig     | 1 +
 configs/verdin-imx95_defconfig            | 1 +
 6 files changed, 27 insertions(+)
board/toradex/aquila-imx95/aquila-imx95.c +8 -0
index a5b26ef3dc3..a413f2fee62 100644
@@ -42,3 +42,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	return ft_common_board_setup(blob, bd);
 }
 #endif
+
+#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
+int board_fix_fdt(void *fdt)
+{
+	/* Remove nodes based on fuses. */
+	return imx9_uboot_fixup_by_fuse(fdt);
+}
+#endif
board/toradex/smarc-imx95/smarc-imx95.c +8 -0
index d09ce8a52ab..d8132c1abb9 100644
@@ -42,3 +42,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	return ft_common_board_setup(blob, bd);
 }
 #endif
+
+#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
+int board_fix_fdt(void *fdt)
+{
+	/* Remove nodes based on fuses. */
+	return imx9_uboot_fixup_by_fuse(fdt);
+}
+#endif
board/toradex/verdin-imx95/verdin-imx95.c +8 -0
index 7c0804c1d1c..e54ac309db4 100644
@@ -78,3 +78,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	return ft_common_board_setup(blob, bd);
 }
 #endif
+
+#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
+int board_fix_fdt(void *fdt)
+{
+	/* Remove nodes based on fuses. */
+	return imx9_uboot_fixup_by_fuse(fdt);
+}
+#endif
configs/aquila-imx95_defconfig +1 -0
index bb3d475ef4d..8dc6780d98b 100644
@@ -27,6 +27,7 @@ CONFIG_WATCHDOG_TIMEOUT_MSECS=30000
 CONFIG_SPL=y
 CONFIG_SPL_RECOVER_DATA_SECTION=y
 CONFIG_PCI=y
+CONFIG_OF_BOARD_FIXUP=y
 CONFIG_SYS_MEMTEST_START=0x90000000
 CONFIG_SYS_MEMTEST_END=0xA0000000
 CONFIG_REMAKE_ELF=y
configs/toradex-smarc-imx95_defconfig +1 -0
index 9abadb0ed1a..fcc006d1d2c 100644
@@ -27,6 +27,7 @@ CONFIG_WATCHDOG_TIMEOUT_MSECS=30000
 CONFIG_SPL=y
 CONFIG_SPL_RECOVER_DATA_SECTION=y
 CONFIG_PCI=y
+CONFIG_OF_BOARD_FIXUP=y
 CONFIG_SYS_MEMTEST_START=0x90000000
 CONFIG_SYS_MEMTEST_END=0xA0000000
 CONFIG_REMAKE_ELF=y
configs/verdin-imx95_defconfig +1 -0
index daf41a8b830..47a800d5ba6 100644
@@ -27,6 +27,7 @@ CONFIG_WATCHDOG_TIMEOUT_MSECS=30000
 CONFIG_SPL=y
 CONFIG_SPL_RECOVER_DATA_SECTION=y
 CONFIG_PCI=y
+CONFIG_OF_BOARD_FIXUP=y
 CONFIG_SYS_MEMTEST_START=0x90000000
 CONFIG_SYS_MEMTEST_END=0xA0000000
 CONFIG_REMAKE_ELF=y
Signature · 1 line
2.55.0
reviewer
#1 lore raw

Hi Stefan,

board/toradex/aquila-imx95/aquila-imx95.c int ft_board_setup(void *blob, struct bd_info *bd) · line 50

Quoted 5 lines · Stefan Eichenberger
board/toradex/aquila-imx95/aquila-imx95.c +5 -0
+#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
+int board_fix_fdt(void *fdt)
+{
+       /* Remove nodes based on fuses. */
+       return imx9_uboot_fixup_by_fuse(fdt);

Shouldn't this be added to the common i.MX95 SoC file instead of adding it per board?

#2 lore raw

Hi Fabio,

Quoted 4 lines · Fabio Estevam

Hi Stefan,

On Fri, Aug 21, 2026 at 4:10 AM Stefan Eichenberger <[email protected]> wrote:

Quoted 8 lines

board/toradex/aquila-imx95/aquila-imx95.c int ft_board_setup(void *blob, struct bd_info *bd) · line 50

Quoted 5 lines
board/toradex/aquila-imx95/aquila-imx95.c +5 -0
+#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
+int board_fix_fdt(void *fdt)
+{
+       /* Remove nodes based on fuses. */
+       return imx9_uboot_fixup_by_fuse(fdt);

Shouldn't this be added to the common i.MX95 SoC file instead of adding it per board?

We discussed this internally and decided to implement it in the same way as NXP does in board/nxp/imx95_frdm/imx95_frdm.c, but I'm not sure why it was necessary to put it in the board file. Perhaps because it can only be done in board_fix_fdt, which might be overwritten in the board file anyway? If we were to do this for the entire architecture, we would need to define a weak board_fix_fdt, which could be overwritten, if I understand correctly.

Regards,
Stefan

reviewer
#3 lore raw

Hi Stefan,

Quoted 7 lines · Stefan Eichenberger

We discussed this internally and decided to implement it in the same way as NXP does in board/nxp/imx95_frdm/imx95_frdm.c, but I'm not sure why it was necessary to put it in the board file. Perhaps because it can only be done in board_fix_fdt, which might be overwritten in the board file anyway? If we were to do this for the entire architecture, we would need to define a weak board_fix_fdt, which could be overwritten, if I understand correctly.

It seems we should handle this similarly to arch/arm/mach-imx/imx8m/soc.c, where peripherals are disabled according to the SoC fuses.

Since this is a property of the SoC rather than a particular board, I would prefer to implement the fuse-based fixup once in the common i.MX95 SoC code instead of adding the same board_fix_fdt() implementation to every i.MX95 board.

This would also avoid requiring each new i.MX95 board to duplicate this code in the future.

Could you please move this to the common i. MX95 SoC code? If there is a technical reason we can't do that, we can revisit the per-board approach.

Thanks,

Fabio Estevam

#4 lore raw

Hi Fabio,

Quoted 21 lines · Fabio Estevam

Hi Stefan,

Quoted 7 lines · Stefan Eichenberger

We discussed this internally and decided to implement it in the same way as NXP does in board/nxp/imx95_frdm/imx95_frdm.c, but I'm not sure why it was necessary to put it in the board file. Perhaps because it can only be done in board_fix_fdt, which might be overwritten in the board file anyway? If we were to do this for the entire architecture, we would need to define a weak board_fix_fdt, which could be overwritten, if I understand correctly.

It seems we should handle this similarly to arch/arm/mach-imx/imx8m/soc.c, where peripherals are disabled according to the SoC fuses.

Since this is a property of the SoC rather than a particular board, I would prefer to implement the fuse-based fixup once in the common i.MX95 SoC code instead of adding the same board_fix_fdt() implementation to every i.MX95 board.

Quoted 6 lines

This would also avoid requiring each new i.MX95 board to duplicate this code in the future.

Could you please move this to the common i. MX95 SoC code? If there is a technical reason we can't do that, we can revisit the per-board approach.

I think the only way I can implement it is by using board_fix_fdt. For the iMX8M, the Linux device tree peripherals are disabled based on the fuses. This has already been implemented for the iMX95 (ft_system_setup). However, board_fix_fdt disables the peripherals in the device tree for U-Boot proper. I can't find a machine-specific function. Am I missing something?

Should board_fix_fdt be defined in an arch based file? Wouldn't that be incorrect, given that it is called 'board_...'?

Regards,
Stefan