All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt
@ 2026-08-21  7:09 Stefan Eichenberger
  2026-08-25  1:24 ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Eichenberger @ 2026-08-21  7:09 UTC (permalink / raw)
  To: francesco.dolcini, sbabic, festevam, uboot-imx, trini,
	franz.schnyder, stefan.eichenberger, emanuele.ghidoli, sjg
  Cc: u-boot

From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

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.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
 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(+)

diff --git a/board/toradex/aquila-imx95/aquila-imx95.c b/board/toradex/aquila-imx95/aquila-imx95.c
index a5b26ef3dc3..a413f2fee62 100644
--- a/board/toradex/aquila-imx95/aquila-imx95.c
+++ b/board/toradex/aquila-imx95/aquila-imx95.c
@@ -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
diff --git a/board/toradex/smarc-imx95/smarc-imx95.c b/board/toradex/smarc-imx95/smarc-imx95.c
index d09ce8a52ab..d8132c1abb9 100644
--- a/board/toradex/smarc-imx95/smarc-imx95.c
+++ b/board/toradex/smarc-imx95/smarc-imx95.c
@@ -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
diff --git a/board/toradex/verdin-imx95/verdin-imx95.c b/board/toradex/verdin-imx95/verdin-imx95.c
index 7c0804c1d1c..e54ac309db4 100644
--- a/board/toradex/verdin-imx95/verdin-imx95.c
+++ b/board/toradex/verdin-imx95/verdin-imx95.c
@@ -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
diff --git a/configs/aquila-imx95_defconfig b/configs/aquila-imx95_defconfig
index bb3d475ef4d..8dc6780d98b 100644
--- a/configs/aquila-imx95_defconfig
+++ b/configs/aquila-imx95_defconfig
@@ -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
diff --git a/configs/toradex-smarc-imx95_defconfig b/configs/toradex-smarc-imx95_defconfig
index 9abadb0ed1a..fcc006d1d2c 100644
--- a/configs/toradex-smarc-imx95_defconfig
+++ b/configs/toradex-smarc-imx95_defconfig
@@ -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
diff --git a/configs/verdin-imx95_defconfig b/configs/verdin-imx95_defconfig
index daf41a8b830..47a800d5ba6 100644
--- a/configs/verdin-imx95_defconfig
+++ b/configs/verdin-imx95_defconfig
@@ -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
-- 
2.55.0


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

* Re: [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt
  2026-08-21  7:09 [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt Stefan Eichenberger
@ 2026-08-25  1:24 ` Fabio Estevam
  2026-08-25  7:45   ` Stefan Eichenberger
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2026-08-25  1:24 UTC (permalink / raw)
  To: Stefan Eichenberger
  Cc: francesco.dolcini, sbabic, uboot-imx, trini, franz.schnyder,
	stefan.eichenberger, emanuele.ghidoli, sjg, u-boot

Hi Stefan,

On Fri, Aug 21, 2026 at 4:10 AM Stefan Eichenberger <eichest@gmail.com> wrote:

> +#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?

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

* Re: [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt
  2026-08-25  1:24 ` Fabio Estevam
@ 2026-08-25  7:45   ` Stefan Eichenberger
  2026-08-26 14:33     ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Eichenberger @ 2026-08-25  7:45 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: francesco.dolcini, sbabic, uboot-imx, trini, franz.schnyder,
	stefan.eichenberger, emanuele.ghidoli, sjg, u-boot

Hi Fabio,

On Mon, Aug 24, 2026 at 10:24:41PM -0300, Fabio Estevam wrote:
> Hi Stefan,
> 
> On Fri, Aug 21, 2026 at 4:10 AM Stefan Eichenberger <eichest@gmail.com> wrote:
> 
> > +#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

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

* Re: [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt
  2026-08-25  7:45   ` Stefan Eichenberger
@ 2026-08-26 14:33     ` Fabio Estevam
  2026-08-27  8:38       ` Stefan Eichenberger
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2026-08-26 14:33 UTC (permalink / raw)
  To: Stefan Eichenberger
  Cc: francesco.dolcini, sbabic, uboot-imx, trini, franz.schnyder,
	stefan.eichenberger, emanuele.ghidoli, sjg, u-boot

Hi Stefan,

On Tue, Aug 25, 2026 at 4:45 AM Stefan Eichenberger <eichest@gmail.com> wrote:

> 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

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

* Re: [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt
  2026-08-26 14:33     ` Fabio Estevam
@ 2026-08-27  8:38       ` Stefan Eichenberger
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Eichenberger @ 2026-08-27  8:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: francesco.dolcini, sbabic, uboot-imx, trini, franz.schnyder,
	stefan.eichenberger, emanuele.ghidoli, sjg, u-boot

Hi Fabio,

On Wed, Aug 26, 2026 at 11:33:56AM -0300, Fabio Estevam wrote:
> Hi Stefan,
> 
> On Tue, Aug 25, 2026 at 4:45 AM Stefan Eichenberger <eichest@gmail.com> wrote:
> 
> > 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.

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

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

end of thread, other threads:[~2026-08-27 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21  7:09 [PATCH v1] toradex: {aquila, smarc, verdin}-imx95: add board_fix_fdt Stefan Eichenberger
2026-08-25  1:24 ` Fabio Estevam
2026-08-25  7:45   ` Stefan Eichenberger
2026-08-26 14:33     ` Fabio Estevam
2026-08-27  8:38       ` Stefan Eichenberger

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.