]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
imx: kontron-sl-mx8mm: Force default environment for serial loader boot
authorEberhard Stoll <eberhard.stoll@kontron.de>
Tue, 7 Oct 2025 08:16:09 +0000 (10:16 +0200)
committerFabio Estevam <festevam@gmail.com>
Tue, 7 Oct 2025 11:58:28 +0000 (08:58 -0300)
Enable CONFIG_ENV_IS_NOWHERE and force default environment when SoC
boots from serial loader. In this case the U-Boot environment cannot
be stored to flash with the 'saveenv' command.

This makes serial loader boot completely independent from any
environment stored in flash.

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

index 220c9701ca54dfb27501a880f4a3a2a53921cb4c..df92765cb2db7bc90652ab12583e77f81d2f1dd4 100644 (file)
@@ -182,6 +182,9 @@ 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_usb_boot())
+               return ENVL_NOWHERE;
+
        /*
         * Make sure that the environment is loaded from
         * the MMC if we are running from SD card or eMMC.
@@ -194,7 +197,10 @@ enum env_location env_get_location(enum env_operation op, int prio)
        if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH))
                return ENVL_SPI_FLASH;
 
-       return ENVL_NOWHERE;
+       if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE))
+               return ENVL_NOWHERE;
+
+       return ENVL_UNKNOWN;
 }
 
 #if defined(CONFIG_ENV_IS_IN_MMC)
index a2cc4d03963851878d49cce70f5b6df3919cfc86..f9484b908d90b436fbbff595e9c6c95b6f27161c 100644 (file)
@@ -112,6 +112,7 @@ CONFIG_PARTITION_TYPE_GUID=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIST="imx8mm-kontron-bl imx8mm-kontron-bl-osm-s"
+CONFIG_ENV_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_REDUNDANT=y