[PATCH v1 2/3] mx6ullevk: Move environment variables to .env file
Aristo Chen
aristo.chen at canonical.com
Wed Jun 10 15:24:23 CEST 2026
Move the board environment from CFG_EXTRA_ENV_SETTINGS in the config
header to board/nxp/mx6ullevk/mx6ullevk.env for better maintainability.
The file is named after CONFIG_SYS_BOARD so it is selected automatically
without setting CONFIG_ENV_SOURCE_FILE. Drop the now unused
linux/stringify.h include.
The generated default environment is unchanged. This was verified by
comparing the output of scripts/get_default_envs.sh before and after the
change, which produced identical results.
Signed-off-by: Aristo Chen <aristo.chen at canonical.com>
---
board/nxp/mx6ullevk/mx6ullevk.env | 69 +++++++++++++++++++++++++++++
include/configs/mx6ullevk.h | 73 -------------------------------
2 files changed, 69 insertions(+), 73 deletions(-)
create mode 100644 board/nxp/mx6ullevk/mx6ullevk.env
diff --git a/board/nxp/mx6ullevk/mx6ullevk.env b/board/nxp/mx6ullevk/mx6ullevk.env
new file mode 100644
index 00000000000..0fce3aaaa4e
--- /dev/null
+++ b/board/nxp/mx6ullevk/mx6ullevk.env
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+script=boot.scr
+image=zImage
+console=ttymxc0
+initrd_high=0xffffffff
+fdt_file=undefined
+fdt_addr=0x83000000
+boot_fdt=try
+ip_dyn=yes
+videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0
+mmcdev=CONFIG_ENV_MMC_DEVICE_INDEX
+mmcpart=1
+mmcroot=/dev/mmcblk1p2 rootwait rw
+mmcautodetect=yes
+mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}
+loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
+bootscript=echo Running bootscript from mmc ...; source
+loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
+mmcboot=echo Booting from mmc ...;
+ run mmcargs;
+ if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
+ if run loadfdt; then
+ bootz ${loadaddr} - ${fdt_addr};
+ else
+ if test ${boot_fdt} = try; then
+ bootz;
+ else
+ echo WARN: Cannot load the DT;
+ fi;
+ fi;
+ else
+ bootz;
+ fi;
+findfdt=if test $fdt_file = undefined; then
+ if test $board_name = ULZ-EVK && test $board_rev = 14X14; then
+ setenv fdt_file imx6ulz-14x14-evk.dtb;
+ fi;
+ if test $board_name = EVK && test $board_rev = 14X14; then
+ setenv fdt_file imx6ull-14x14-evk.dtb;
+ fi;
+ if test $fdt_file = undefined; then
+ echo WARNING: Could not determine dtb to use;
+ fi;
+ fi;
+netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs
+ ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
+netboot=echo Booting from net ...;
+ run netargs;
+ if test ${ip_dyn} = yes; then
+ setenv get_cmd dhcp;
+ else
+ setenv get_cmd tftp;
+ fi;
+ ${get_cmd} ${image};
+ if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
+ if ${get_cmd} ${fdt_addr} ${fdt_file}; then
+ bootz ${loadaddr} - ${fdt_addr};
+ else
+ if test ${boot_fdt} = try; then
+ bootz;
+ else
+ echo WARN: Cannot load the DT;
+ fi;
+ fi;
+ else
+ bootz;
+ fi;
diff --git a/include/configs/mx6ullevk.h b/include/configs/mx6ullevk.h
index 88b535e1bd0..a535163fd19 100644
--- a/include/configs/mx6ullevk.h
+++ b/include/configs/mx6ullevk.h
@@ -9,7 +9,6 @@
#include <asm/arch/imx-regs.h>
#include <linux/sizes.h>
-#include <linux/stringify.h>
#include "mx6_common.h"
#include <asm/mach-imx/gpio.h>
@@ -23,78 +22,6 @@
#define CFG_SYS_FSL_USDHC_NUM 2
#endif
-#define CFG_EXTRA_ENV_SETTINGS \
- "script=boot.scr\0" \
- "image=zImage\0" \
- "console=ttymxc0\0" \
- "initrd_high=0xffffffff\0" \
- "fdt_file=undefined\0" \
- "fdt_addr=0x83000000\0" \
- "boot_fdt=try\0" \
- "ip_dyn=yes\0" \
- "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \
- "mmcdev="__stringify(CONFIG_ENV_MMC_DEVICE_INDEX)"\0" \
- "mmcpart=1\0" \
- "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
- "mmcautodetect=yes\0" \
- "mmcargs=setenv bootargs console=${console},${baudrate} " \
- "root=${mmcroot}\0" \
- "loadbootscript=" \
- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
- "bootscript=echo Running bootscript from mmc ...; " \
- "source\0" \
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
- "mmcboot=echo Booting from mmc ...; " \
- "run mmcargs; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if run loadfdt; then " \
- "bootz ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootz; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootz; " \
- "fi;\0" \
- "findfdt="\
- "if test $fdt_file = undefined; then " \
- "if test $board_name = ULZ-EVK && test $board_rev = 14X14; then " \
- "setenv fdt_file imx6ulz-14x14-evk.dtb; fi; " \
- "if test $board_name = EVK && test $board_rev = 14X14; then " \
- "setenv fdt_file imx6ull-14x14-evk.dtb; fi; " \
- "if test $fdt_file = undefined; then " \
- "echo WARNING: Could not determine dtb to use; " \
- "fi; " \
- "fi;\0" \
- "netargs=setenv bootargs console=${console},${baudrate} " \
- "root=/dev/nfs " \
- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
- "netboot=echo Booting from net ...; " \
- "run netargs; " \
- "if test ${ip_dyn} = yes; then " \
- "setenv get_cmd dhcp; " \
- "else " \
- "setenv get_cmd tftp; " \
- "fi; " \
- "${get_cmd} ${image}; " \
- "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
- "bootz ${loadaddr} - ${fdt_addr}; " \
- "else " \
- "if test ${boot_fdt} = try; then " \
- "bootz; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi; " \
- "else " \
- "bootz; " \
- "fi;\0" \
-
/* Miscellaneous configurable options */
/* Physical Memory Map */
--
2.43.0
More information about the U-Boot
mailing list