[PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Thu Apr 21 19:01:13 CEST 2022


Hi

On Thu, Apr 21, 2022 at 6:51 PM Adam Ford <aford173 at gmail.com> wrote:
>
> On Thu, Apr 21, 2022 at 11:47 AM Fabio Estevam <festevam at 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?

I have seen those patches already but the cost of a function pointer
and a call is more readable. If they get applied, I will be fine with
them ;)

Michael



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list