From: Fabio Estevam Date: Thu, 21 Apr 2022 18:05:23 +0000 (-0300) Subject: imx8mn/8mp: Allow booting via USB X-Git-Tag: v2025.01-rc5-pxa1908~1402^2~60 X-Git-Url: http://git.dujemihanovic.xyz/projects?a=commitdiff_plain;h=d175982c207bb2ace592d7985cd3f05ab99759d9;p=u-boot.git imx8mn/8mp: Allow booting via USB When trying to boot via USB on i.MX8MN it is necessary to specify the U-Boot environment location, otherwise the boot process simply hangs. Specify the environment location when booting from USB. Tested on a imx8mn-evk. Suggested-by: Michael Nazzareno Trimarchi Signed-off-by: Fabio Estevam Tested-By: Tim Harvey --- diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 8e23e6da32..bc3379a250 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1535,6 +1535,16 @@ enum env_location arch_env_get_location(enum env_operation op, int prio) return ENVL_UNKNOWN; switch (dev) { + case USB_BOOT: + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) + return ENVL_SPI_FLASH; + if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND)) + return ENVL_NAND; + if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC)) + return ENVL_MMC; + if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) + return ENVL_NOWHERE; + return ENVL_UNKNOWN; case QSPI_BOOT: case SPI_NOR_BOOT: if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))