On Thu, Apr 21, 2022 at 11:47 AM Fabio Estevam <feste...@denx.de> wrote: > > Hi Michael, > > On 21/04/2022 13:34, Michael Nazzareno Trimarchi wrote: > > > That function should drop. There is not other architecture that does > > it. What about: > > I implemented your suggestion like this: > > --- a/arch/arm/mach-imx/imx8m/soc.c > +++ b/arch/arm/mach-imx/imx8m/soc.c > @@ -1536,6 +1536,14 @@ 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; > + return ENVL_NOWHERE; > case QSPI_BOOT: > case SPI_NOR_BOOT: > if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) > > This still allows me to save the env into the eMMC when U-Boot > is loaded from USB. > > > register_enviroment_hook() > > deregister_enviroment_hook() > > > > This can replace the one default with board/arch etc > > Marek submitted these patches: > > https://source.denx.de/u-boot/u-boot/-/commit/de70e8879bb253f4d2a9ba9149cd41cb38b94ed8 > > https://source.denx.de/u-boot/u-boot/-/commit/e4dc2d0620851d6e0e784d4ef0a50f26e1e73857 >
I believe those were applied today. I haven't verified it yet, but I think I saw the e-mail go by. > Is this the mechanism that you are looking for?