Hi, Am 28.07.25 um 18:44 schrieb Francesco Dolcini: > On Mon, Jul 28, 2025 at 11:25:04AM -0300, Fabio Estevam wrote: >> On Mon, Jul 28, 2025 at 7:29 AM Francesco Dolcini <france...@dolcini.it> >> wrote: >> >>> You worked on a similar topic, for imx8m, some time ago, commit >>> d175982c207b ("imx8mn/8mp: Allow booting via USB"). What's your opinion >>> here? How should we fix this? >> >> The solution on the commit you mentioned is related to the >> i.MX8MN/i.MX8MP boot ROM implementation, and it works there. >> >> What confuses me about João's patch is that it was not tested against >> the mainline U-Boot. >> >> Can U-Boot mainline boot over serial download on i.MX95? >> >> Adding Tim, as he has been trying to get USB boot to work with i.MX95. >> >> I don't have access to any i.MX95 board to try it myself, so I >> appreciate some help here. > > The issue here is not specific about USB, this is about code assuming > that the relevant env config options are enabled without checking > anything AND assuming that ENVL_NOWHERE is working as a default in any > case. > > See also env_locations in env/env.c and arch_env_get_location() > > Francesco
I have the below patch in our downstream fork to fix the issue mentioned here for i.MX93. It is derived from Fabio's patch [1]. I'm not sure if it's correct, though. [1] https://source.denx.de/u-boot/u-boot/-/commit/d175982c207bb2ace592d7985cd3f05ab99759d9 Best regards Frieder >From 49b028284e36eeb7516f618e31bbf569956295ad Mon Sep 17 00:00:00 2001 From: Frieder Schrempf <frieder.schre...@kontron.de> Date: Thu, 16 May 2024 14:27:39 +0200 Subject: [PATCH] arm: imx: imx9: Allow booting via USB When trying to boot via USB on i.MX93 it is necessary to specify the U-Boot environment location, otherwise the boot process simply hangs (unless CONFIG_ENV_IS_NOWHERE is enabled). Specify the environment location when booting from USB. Signed-off-by: Frieder Schrempf <frieder.schre...@kontron.de> --- arch/arm/mach-imx/imx9/soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c index 829b3b7b748..5bb0ab871ac 100644 --- a/arch/arm/mach-imx/imx9/soc.c +++ b/arch/arm/mach-imx/imx9/soc.c @@ -808,6 +808,14 @@ enum env_location arch_env_get_location(enum env_operation op, int prio) return ENVL_UNKNOWN; switch (dev) { + case USB_BOOT: + if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH)) + return ENVL_SPI_FLASH; + if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC)) + return ENVL_MMC; + if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE)) + return ENVL_NOWHERE; + return ENVL_UNKNOWN; case QSPI_BOOT: if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH)) return ENVL_SPI_FLASH; -- 2.50.1