[PATCH 12/13] imx: kontron-sl-mx8mm: Force default environment for serial loader boot

Frieder Schrempf frieder at fris.de
Tue Oct 7 10:16:09 CEST 2025


From: Eberhard Stoll <eberhard.stoll at kontron.de>

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 at kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf at kontron.de>
---
 board/kontron/sl-mx8mm/sl-mx8mm.c  | 8 +++++++-
 configs/kontron-sl-mx8mm_defconfig | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c
index 220c9701ca5..df92765cb2d 100644
--- a/board/kontron/sl-mx8mm/sl-mx8mm.c
+++ b/board/kontron/sl-mx8mm/sl-mx8mm.c
@@ -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)
diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig
index a2cc4d03963..f9484b908d9 100644
--- a/configs/kontron-sl-mx8mm_defconfig
+++ b/configs/kontron-sl-mx8mm_defconfig
@@ -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
-- 
2.51.0



More information about the U-Boot mailing list