]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
imx: kontron-sl-mx6ul: Force default environment for serial loader boot
authorEberhard Stoll <eberhard.stoll@kontron.de>
Mon, 25 Aug 2025 13:54:34 +0000 (15:54 +0200)
committerFabio Estevam <festevam@gmail.com>
Fri, 5 Sep 2025 12:03:28 +0000 (09:03 -0300)
In case of booting from serial loader (USB) we want to always use the
default environment in order to get a defined state that is
independent of any environment stored in persistent memory.

This way we can avoid corruption of the boot process during
development and manufacturing by existing environment settings in
flash.

Signed-off-by: Eberhard Stoll <eberhard.stoll@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
board/kontron/sl-mx6ul/sl-mx6ul.c

index e33907ee1241cd1c2411127bfc3d9774b6a7bedf..65f9b75c1a0f53a36cfb7da4c09cfbbebcc63475 100644 (file)
@@ -104,10 +104,16 @@ enum env_location env_get_location(enum env_operation op, int prio)
        if (prio)
                return ENVL_UNKNOWN;
 
+       if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE) && is_boot_from_usb())
+               return ENVL_NOWHERE;
+
        if (sl_mx6ul_is_spi_nor_boot() && CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH))
                return ENVL_SPI_FLASH;
        else if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
                return ENVL_MMC;
 
-       return ENVL_NOWHERE;
+       if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE))
+               return ENVL_NOWHERE;
+
+       return ENVL_UNKNOWN;
 }