All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict
@ 2022-06-14  2:57 Tom Rini
  2022-06-14  2:57 ` [PATCH 2/8] env: Remove include/generated/env.* under "make clean" Tom Rini
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot; +Cc: Joe Hershberger, Wolfgang Denk, Simon Glass

Largely, the use of CONFIG_EXTRA_ENV_SETTINGS can be migrated directly
to come from CONFIG_EXTRA_ENV_TEXT.  The biggest case that cannot easily
be migrated is distro_bootcmd support.  Rather than block migration on
this, remove the #error here so that we can being moving forward.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
I spent about a day working at getting config_distro_bootcmd to work via
CONFIG_EXTRA_ENV_TEXT and _maybe_ there's a path forward if we rely on
less nesting of macros, I'm not convinced.  But I can clearly see how
moving everything else forward to text based environment files will
encourage sharing of environment and both remove otherwise unmigrated
CONFIG symbols and generally move forward with being able to remove
include/config/board.h files.
---
 include/env_default.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/env_default.h b/include/env_default.h
index 7004a6fef29b..7113e08e6b0f 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -109,9 +109,6 @@ const char default_environment[] = {
 	"bootlimit="	__stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
 #endif
 #ifdef CONFIG_EXTRA_ENV_TEXT
-# ifdef CONFIG_EXTRA_ENV_SETTINGS
-# error "Your board uses a text-file environment, so must not define CONFIG_EXTRA_ENV_SETTINGS"
-# endif
 	/* This is created in the Makefile */
 	CONFIG_EXTRA_ENV_TEXT
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/8] env: Remove include/generated/env.* under "make clean"
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 3/8] dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot; +Cc: Simon Glass

When running "make clean" we want to remove env.in and well as env.txt.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 2fa3a3b488e6..101534566847 100644
--- a/Makefile
+++ b/Makefile
@@ -2209,7 +2209,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
 			$(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
-	       include/generated/env.in drivers/video/u_boot_logo.S \
+	       include/generated/env.* drivers/video/u_boot_logo.S \
 	       tools/version.h u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
 	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/8] dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
  2022-06-14  2:57 ` [PATCH 2/8] env: Remove include/generated/env.* under "make clean" Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 4/8] Convert CONFIG_ENV_RANGE to Kconfig Tom Rini
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot; +Cc: Ramon Fried

With the exception of distro_boot support, we can move all of the rest
of the environment changes to come from CONFIG_EXTRA_ENV_TEXT and in
turn remove CONFIG_ENV_REFLASH.

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 .../dragonboard410c/dragonboard410c.env       | 36 ++++++++++++++++
 include/configs/dragonboard410c.h             | 42 +------------------
 2 files changed, 38 insertions(+), 40 deletions(-)
 create mode 100644 board/qualcomm/dragonboard410c/dragonboard410c.env

diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.env b/board/qualcomm/dragonboard410c/dragonboard410c.env
new file mode 100644
index 000000000000..9d9a575a0c3f
--- /dev/null
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.env
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/* Does what recovery does */
+#define REFLASH(file, partnum) \
+part start mmc 0 partnum start && \
+part size mmc 0 partnum size && \
+tftp $loadaddr file &&  \
+mmc write $loadaddr $start $size &&
+
+reflash=
+mmc dev 0 &&
+usb start &&
+dhcp &&
+tftp $loadaddr dragonboard/rescue/gpt_both0.bin &&
+mmc write $loadaddr 0 43 &&
+mmc rescan &&
+REFLASH(dragonboard/rescue/NON-HLOS.bin, 1)
+REFLASH(dragonboard/rescue/sbl1.mbn, 2)
+REFLASH(dragonboard/rescue/rpm.mbn, 3)
+REFLASH(dragonboard/rescue/tz.mbn, 4)
+REFLASH(dragonboard/rescue/hyp.mbn, 5)
+REFLASH(dragonboard/rescue/sec.dat, 6)
+REFLASH(dragonboard/rescue/emmc_appsboot.mbn, 7)
+REFLASH(dragonboard/u-boot.img, 8)
+usb stop &&
+echo Reflash completed
+
+loadaddr=0x81000000
+initrd_high=0xffffffffffffffff
+linux_image=Image
+kernel_addr_r=0x81000000
+fdtfile=qcom/apq8016-sbc.dtb
+fdt_addr_r=0x83000000
+ramdisk_addr_r=0x84000000
+scriptaddr=0x90000000
+pxefile_addr_r=0x90100000
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 26a714c2886b..e1d580b1c8f8 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -20,8 +20,7 @@
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
-/* UART */
-
+/* Environment */
 #define BOOT_TARGET_DEVICES(func) \
 	func(USB, usb, 0) \
 	func(MMC, mmc, 1) \
@@ -30,43 +29,6 @@
 
 #include <config_distro_bootcmd.h>
 
-/* Does what recovery does */
-#define REFLASH(file, part) \
-"part start mmc 0 "#part" start && "\
-"part size mmc 0 "#part" size && "\
-"tftp $loadaddr "#file" && " \
-"mmc write $loadaddr $start $size && "
-
-#define CONFIG_ENV_REFLASH \
-"mmc dev 0 && "\
-"usb start && "\
-"dhcp && "\
-"tftp $loadaddr dragonboard/rescue/gpt_both0.bin && "\
-"mmc write $loadaddr 0 43 && " \
-"mmc rescan && "\
-REFLASH(dragonboard/rescue/NON-HLOS.bin, 1)\
-REFLASH(dragonboard/rescue/sbl1.mbn, 2)\
-REFLASH(dragonboard/rescue/rpm.mbn, 3)\
-REFLASH(dragonboard/rescue/tz.mbn, 4)\
-REFLASH(dragonboard/rescue/hyp.mbn, 5)\
-REFLASH(dragonboard/rescue/sec.dat, 6)\
-REFLASH(dragonboard/rescue/emmc_appsboot.mbn, 7)\
-REFLASH(dragonboard/u-boot.img, 8)\
-"usb stop &&"\
-"echo Reflash completed"
-
-/* Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"reflash="CONFIG_ENV_REFLASH"\0"\
-	"loadaddr=0x81000000\0" \
-	"initrd_high=0xffffffffffffffff\0" \
-	"linux_image=Image\0" \
-	"kernel_addr_r=0x81000000\0"\
-	"fdtfile=qcom/apq8016-sbc.dtb\0" \
-	"fdt_addr_r=0x83000000\0"\
-	"ramdisk_addr_r=0x84000000\0"\
-	"scriptaddr=0x90000000\0"\
-	"pxefile_addr_r=0x90100000\0"\
-	BOOTENV
+#define CONFIG_EXTRA_ENV_SETTINGS BOOTENV
 
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/8] Convert CONFIG_ENV_RANGE to Kconfig
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
  2022-06-14  2:57 ` [PATCH 2/8] env: Remove include/generated/env.* under "make clean" Tom Rini
  2022-06-14  2:57 ` [PATCH 3/8] dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 5/8] opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot

This converts the following to Kconfig:
   CONFIG_ENV_RANGE

Now that this is in Kconfig we can enforce a minimum size and so remove
the check in C code to ensure range is larger than size.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 configs/P1010RDB-PA_36BIT_NAND_defconfig |  1 +
 configs/P1010RDB-PA_NAND_defconfig       |  1 +
 configs/P1010RDB-PB_36BIT_NAND_defconfig |  1 +
 configs/P1010RDB-PB_NAND_defconfig       |  1 +
 configs/P1020RDB-PC_36BIT_NAND_defconfig |  1 +
 configs/P1020RDB-PC_NAND_defconfig       |  1 +
 configs/P1020RDB-PD_NAND_defconfig       |  1 +
 configs/P2020RDB-PC_36BIT_NAND_defconfig |  1 +
 configs/P2020RDB-PC_NAND_defconfig       |  1 +
 configs/colibri-imx6ull_defconfig        |  1 +
 configs/colibri_imx7_defconfig           |  1 +
 configs/colibri_vf_defconfig             |  1 +
 configs/draco_defconfig                  |  1 +
 configs/etamin_defconfig                 |  1 +
 configs/m53menlo_defconfig               |  1 +
 configs/mx28evk_nand_defconfig           |  1 +
 configs/rastaban_defconfig               |  1 +
 configs/smartweb_defconfig               |  1 +
 configs/thuban_defconfig                 |  1 +
 configs/vf610twr_nand_defconfig          |  1 +
 env/Kconfig                              | 18 ++++++++++--------
 env/nand.c                               |  8 --------
 include/configs/P1010RDB.h               |  6 ------
 include/configs/colibri-imx6ull.h        |  5 -----
 include/configs/colibri_imx7.h           |  5 -----
 include/configs/colibri_vf.h             |  5 -----
 include/configs/draco.h                  |  3 ---
 include/configs/etamin.h                 |  4 ----
 include/configs/m53menlo.h               |  3 ---
 include/configs/mx28evk.h                | 11 -----------
 include/configs/p1_p2_rdb_pc.h           |  1 -
 include/configs/rastaban.h               |  3 ---
 include/configs/smartweb.h               |  5 -----
 include/configs/thuban.h                 |  3 ---
 include/configs/vf610twr.h               |  4 ----
 35 files changed, 30 insertions(+), 74 deletions(-)

diff --git a/configs/P1010RDB-PA_36BIT_NAND_defconfig b/configs/P1010RDB-PA_36BIT_NAND_defconfig
index 4ebb8d06cdd3..8af653c65661 100644
--- a/configs/P1010RDB-PA_36BIT_NAND_defconfig
+++ b/configs/P1010RDB-PA_36BIT_NAND_defconfig
@@ -69,6 +69,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1010RDB-PA_NAND_defconfig b/configs/P1010RDB-PA_NAND_defconfig
index 9ab41e80a278..f94b24d3bdc7 100644
--- a/configs/P1010RDB-PA_NAND_defconfig
+++ b/configs/P1010RDB-PA_NAND_defconfig
@@ -68,6 +68,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1010RDB-PB_36BIT_NAND_defconfig b/configs/P1010RDB-PB_36BIT_NAND_defconfig
index e2abe92e7a6b..d5577435c922 100644
--- a/configs/P1010RDB-PB_36BIT_NAND_defconfig
+++ b/configs/P1010RDB-PB_36BIT_NAND_defconfig
@@ -70,6 +70,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1010RDB-PB_NAND_defconfig b/configs/P1010RDB-PB_NAND_defconfig
index f27a24b7a18e..3469ea0f40da 100644
--- a/configs/P1010RDB-PB_NAND_defconfig
+++ b/configs/P1010RDB-PB_NAND_defconfig
@@ -69,6 +69,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1020RDB-PC_36BIT_NAND_defconfig b/configs/P1020RDB-PC_36BIT_NAND_defconfig
index d8902bc03ffb..19d1718830e5 100644
--- a/configs/P1020RDB-PC_36BIT_NAND_defconfig
+++ b/configs/P1020RDB-PC_36BIT_NAND_defconfig
@@ -69,6 +69,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1020RDB-PC_NAND_defconfig b/configs/P1020RDB-PC_NAND_defconfig
index c581b9ddbe6c..19f4e1cbcb33 100644
--- a/configs/P1020RDB-PC_NAND_defconfig
+++ b/configs/P1020RDB-PC_NAND_defconfig
@@ -68,6 +68,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P1020RDB-PD_NAND_defconfig b/configs/P1020RDB-PD_NAND_defconfig
index 68034b1febd8..d10d6e802c8a 100644
--- a/configs/P1020RDB-PD_NAND_defconfig
+++ b/configs/P1020RDB-PD_NAND_defconfig
@@ -71,6 +71,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ec000000.nor:128k(dtb),6016k(kernel),57088k(fs
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x60000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P2020RDB-PC_36BIT_NAND_defconfig b/configs/P2020RDB-PC_36BIT_NAND_defconfig
index 1401009fb62b..6a6a2bbf6ea6 100644
--- a/configs/P2020RDB-PC_36BIT_NAND_defconfig
+++ b/configs/P2020RDB-PC_36BIT_NAND_defconfig
@@ -73,6 +73,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=fef000000.nor:256k(vsc7385-firmware),256k(dtb)
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/P2020RDB-PC_NAND_defconfig b/configs/P2020RDB-PC_NAND_defconfig
index 627c2ab18673..095812ea8b89 100644
--- a/configs/P2020RDB-PC_NAND_defconfig
+++ b/configs/P2020RDB-PC_NAND_defconfig
@@ -72,6 +72,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ef000000.nor:256k(vsc7385-firmware),256k(dtb),
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0xc000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
 CONFIG_BOOTFILE="uImage"
diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig
index 750b03b74d8f..a4225d862b44 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -55,6 +55,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
index f56064d34d35..15dae6b3db94 100644
--- a/configs/colibri_imx7_defconfig
+++ b/configs/colibri_imx7_defconfig
@@ -56,6 +56,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index d92756fb1667..9dbe6280dd74 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -62,6 +62,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
diff --git a/configs/draco_defconfig b/configs/draco_defconfig
index f7bb01f3bf3a..c137fc72e0f2 100644
--- a/configs/draco_defconfig
+++ b/configs/draco_defconfig
@@ -79,6 +79,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RETRY_COUNT=10
diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig
index 294a67a7facb..f0b10f029239 100644
--- a/configs/etamin_defconfig
+++ b/configs/etamin_defconfig
@@ -80,6 +80,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x200000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RETRY_COUNT=10
diff --git a/configs/m53menlo_defconfig b/configs/m53menlo_defconfig
index 2ccea8315c71..2ce0ab91819e 100644
--- a/configs/m53menlo_defconfig
+++ b/configs/m53menlo_defconfig
@@ -68,6 +68,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=mxc_nand:1m(u-boot),512k(env1),512k(env2),-(ub
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
diff --git a/configs/mx28evk_nand_defconfig b/configs/mx28evk_nand_defconfig
index 6b3235ca6e03..136c1d60699b 100644
--- a/configs/mx28evk_nand_defconfig
+++ b/configs/mx28evk_nand_defconfig
@@ -43,6 +43,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:3m(bootloader)ro,512k(environment),5
 CONFIG_CMD_UBI=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_BOOTFILE=y
diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
index 9f27592088cb..373bca678dda 100644
--- a/configs/rastaban_defconfig
+++ b/configs/rastaban_defconfig
@@ -79,6 +79,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RETRY_COUNT=10
diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index 57c5218d4b0c..4e05f71bf3af 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -69,6 +69,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RETRY_COUNT=20
diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig
index 0a6b0e88b3fe..6115e9e3edca 100644
--- a/configs/thuban_defconfig
+++ b/configs/thuban_defconfig
@@ -79,6 +79,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RETRY_COUNT=10
diff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig
index f6ed47f73488..288169c7ee3f 100644
--- a/configs/vf610twr_nand_defconfig
+++ b/configs/vf610twr_nand_defconfig
@@ -45,6 +45,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_VYBRID_GPIO=y
diff --git a/env/Kconfig b/env/Kconfig
index 0aed7aea46bc..238e4c70cf05 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -264,14 +264,6 @@ config ENV_IS_IN_NAND
 	  during a "saveenv" operation.	 CONFIG_ENV_OFFSET_REDUND must be
 	  aligned to an erase block boundary.
 
-	  - CONFIG_ENV_RANGE (optional):
-
-	  Specifies the length of the region in which the environment
-	  can be written.  This should be a multiple of the NAND device's
-	  block size.  Specifying a range with more erase blocks than
-	  are needed to hold CONFIG_ENV_SIZE allows bad blocks within
-	  the range to be avoided.
-
 	  - CONFIG_ENV_OFFSET_OOB (optional):
 
 	  Enables support for dynamically retrieving the offset of the
@@ -280,6 +272,16 @@ config ENV_IS_IN_NAND
 	  Currently, CONFIG_ENV_OFFSET_REDUND is not supported when
 	  using CONFIG_ENV_OFFSET_OOB.
 
+config ENV_RANGE
+	hex "Length of the region in which the environment can be written"
+	depends on ENV_IS_IN_NAND
+	range ENV_SIZE 0x7fffffff
+	default ENV_SIZE
+	help
+	  This should be a multiple of the NAND device's block size.
+	  Specifying a range with more erase blocks than are needed to hold
+	  CONFIG_ENV_SIZE allows bad blocks within the range to be avoided.
+
 config ENV_IS_IN_NVRAM
 	bool "Environment in a non-volatile RAM"
 	depends on !CHAIN_OF_TRUST
diff --git a/env/nand.c b/env/nand.c
index 21aa367d5bdf..df300b131793 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -33,10 +33,6 @@
 #error CONFIG_ENV_OFFSET_REDUND must have CONFIG_CMD_SAVEENV & CONFIG_CMD_NAND
 #endif
 
-#ifndef CONFIG_ENV_RANGE
-#define CONFIG_ENV_RANGE	CONFIG_ENV_SIZE
-#endif
-
 #if defined(ENV_IS_EMBEDDED)
 static env_t *env_ptr = &environment;
 #elif defined(CONFIG_NAND_ENV_DST)
@@ -201,10 +197,6 @@ static int env_nand_save(void)
 #endif
 	};
 
-
-	if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
-		return 1;
-
 	ret = env_export(env_new);
 	if (ret)
 		return ret;
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 27361f2d447f..ad78dba865b7 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -477,12 +477,6 @@ extern unsigned long get_sdram_size(void);
 #elif defined(CONFIG_MTD_RAW_NAND)
 #ifdef CONFIG_TPL_BUILD
 #define SPL_ENV_ADDR		(CONFIG_SYS_INIT_L2_ADDR + (160 << 10))
-#else
-#if defined(CONFIG_TARGET_P1010RDB_PA)
-#define CONFIG_ENV_RANGE	(3 * CONFIG_ENV_SIZE) /* 3*16=48K for env */
-#elif defined(CONFIG_TARGET_P1010RDB_PB)
-#define CONFIG_ENV_RANGE	(32 * CONFIG_ENV_SIZE) /* new block size 512K */
-#endif
 #endif
 #endif
 
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 40d145a1bec5..bf020612837f 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -122,11 +122,6 @@
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
 
-/* environment organization */
-#if defined(CONFIG_ENV_IS_IN_NAND)
-#define CONFIG_ENV_RANGE	(4 * CONFIG_ENV_SIZE)
-#endif
-
 #ifdef CONFIG_TARGET_COLIBRI_IMX6ULL_NAND
 /* NAND stuff */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index 8e50eeaec15a..c8884e61b715 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -166,11 +166,6 @@
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
 
-/* environment organization */
-#if defined(CONFIG_ENV_IS_IN_NAND)
-#define CONFIG_ENV_RANGE	(4 * CONFIG_ENV_SIZE)
-#endif
-
 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
 /* NAND stuff */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 9b1cec578e61..7d2b7dece029 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -91,11 +91,6 @@
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
 
-/* Environment organization */
-#ifdef CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_RANGE		(4 * 64 * 2048)
-#endif
-
 /* USB Host Support */
 
 /* USB DFU */
diff --git a/include/configs/draco.h b/include/configs/draco.h
index 21367f0a6f5e..4869008da440 100644
--- a/include/configs/draco.h
+++ b/include/configs/draco.h
@@ -27,9 +27,6 @@
  /* Physical Memory Map */
 #define CONFIG_MAX_RAM_BANK_SIZE	(1024 << 20)	/* 1GB */
 
-/* Define own nand partitions */
-#define CONFIG_ENV_RANGE        (4 * CONFIG_SYS_ENV_SECT_SIZE)
-
 /* Default env settings */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"hostname=draco\0" \
diff --git a/include/configs/etamin.h b/include/configs/etamin.h
index 654bfc612168..3acc62d9e178 100644
--- a/include/configs/etamin.h
+++ b/include/configs/etamin.h
@@ -77,10 +77,6 @@
 
 /* nedded by compliance test in read mode */
 
-/* Define own nand partitions */
-#define CONFIG_ENV_RANGE		(4 * CONFIG_SYS_ENV_SECT_SIZE)
-
-
 #undef COMMON_ENV_DFU_ARGS
 #define COMMON_ENV_DFU_ARGS	"dfu_args=run bootargs_defaults;" \
 				"setenv bootargs ${bootargs};" \
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index b8ad0c3a2164..1533e57fa8ca 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -51,9 +51,6 @@
 #define CONFIG_MXC_NAND_IP_REGS_BASE	NFC_BASE_ADDR
 #define CONFIG_SYS_NAND_LARGEPAGE
 #define CONFIG_MXC_NAND_HWECC
-
-/* Environment is in NAND */
-#define CONFIG_ENV_RANGE		(0x00080000) /* 512 KiB */
 #endif
 
 /*
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 7a352bd2a605..9f3ac48b70a2 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -15,17 +15,6 @@
 #define PHYS_SDRAM_1_SIZE		0x40000000	/* Max 1 GB RAM */
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 
-/* Environment */
-
-/* Environment is in MMC */
-
-/* Environment is in NAND */
-#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
-#define CONFIG_ENV_RANGE		(512 * 1024)
-#endif
-
-/* Environment is in SPI flash */
-
 /* UBI and NAND partitioning */
 
 /* RTC */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index f241f1483487..786b9812072a 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -433,7 +433,6 @@
 #if defined(CONFIG_SDCARD)
 #define CONFIG_FSL_FIXED_MMC_LOCATION
 #elif defined(CONFIG_MTD_RAW_NAND)
-#define CONFIG_ENV_RANGE	(3 * CONFIG_ENV_SIZE)
 #ifdef CONFIG_TPL_BUILD
 #define SPL_ENV_ADDR		(CONFIG_SYS_INIT_L2_ADDR + (160 << 10))
 #endif
diff --git a/include/configs/rastaban.h b/include/configs/rastaban.h
index 5de980ddc00a..49cd11c17b44 100644
--- a/include/configs/rastaban.h
+++ b/include/configs/rastaban.h
@@ -37,9 +37,6 @@
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-/* Define own nand partitions */
-#define CONFIG_ENV_RANGE		(4 * CONFIG_SYS_ENV_SECT_SIZE)
-
 /* Default env settings */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"hostname=rastaban\0" \
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index 458d22d61f48..da6fb18c17ad 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -87,11 +87,6 @@
 
 /* General Boot Parameter */
 
-/*
- * The NAND Flash partitions:
- */
-#define CONFIG_ENV_RANGE		(SZ_512K)
-
 /*
  * Predefined environment variables.
  * Usefull to define some easy to use boot commands.
diff --git a/include/configs/thuban.h b/include/configs/thuban.h
index fd903537ae5e..696306e46592 100644
--- a/include/configs/thuban.h
+++ b/include/configs/thuban.h
@@ -30,9 +30,6 @@
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-/* Define own nand partitions */
-#define CONFIG_ENV_RANGE        (4 * CONFIG_SYS_ENV_SECT_SIZE)
-
 /* Default env settings */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"hostname=thuban\0" \
diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 6ad1ba9e0217..7f4bfb5124ac 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -130,8 +130,4 @@
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
 
-#ifdef CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_RANGE		(512 * 1024)
-#endif
-
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/8] opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
                   ` (2 preceding siblings ...)
  2022-06-14  2:57 ` [PATCH 4/8] Convert CONFIG_ENV_RANGE to Kconfig Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 6/8] Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD Tom Rini
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot; +Cc: Sébastien Szymanski

Move the environment text over from being set via
CONFIG_EXTRA_ENV_SETTINGS in include/configs/opos6uldev.h and over to
plain text in board/armadeus/opos6uldev/opos6uldev.env.  This lets us
manage env_version without a CONFIG variable.

Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 board/armadeus/opos6uldev/opos6uldev.env | 133 +++++++++++++++++++++++
 include/configs/opos6uldev.h             | 131 ----------------------
 2 files changed, 133 insertions(+), 131 deletions(-)
 create mode 100644 board/armadeus/opos6uldev/opos6uldev.env

diff --git a/board/armadeus/opos6uldev/opos6uldev.env b/board/armadeus/opos6uldev/opos6uldev.env
new file mode 100644
index 000000000000..585f28ca8587
--- /dev/null
+++ b/board/armadeus/opos6uldev/opos6uldev.env
@@ -0,0 +1,133 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/*
+ * Copyright (C) 2017 Armadeus Systems
+ */
+
+/* Environment is stored in the eMMC boot partition */
+
+env_version=100
+consoledev=ttymxc0
+board_name=opos6ul
+fdt_addr=0x88000000
+fdt_high=0xffffffff
+fdt_name=opos6uldev
+initrd_high=0xffffffff
+ip_dyn=yes
+stdin=serial
+stdout=serial
+stderr=serial
+mmcdev=0
+mmcpart=2
+mmcroot=/dev/mmcblk0p2 ro
+mmcrootfstype=ext4 rootwait
+kernelimg=opos6ul-linux.bin
+splashpos=0,0
+splashimage=CONFIG_SYS_LOAD_ADDR
+videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0
+check_env=if test -n ${flash_env_version};
+	then env default env_version;
+	else env set flash_env_version ${env_version}; env save;
+	fi;
+	if itest ${flash_env_version} != ${env_version}; then
+		echo "*** Warning - Environment version
+		 change suggests: run flash_reset_env; reset";
+		env default flash_reset_env;
+	else exit; fi; 
+flash_reset_env=env default -f -a && saveenv &&
+	echo Environment variables erased!
+download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl
+flash_uboot_spl=
+	if mmc dev 0 1; then
+		setexpr sz ${filesize} / 0x200;
+		setexpr sz ${sz} + 1;
+		if mmc write ${loadaddr} 0x2 ${sz}; then
+			echo Flashing of U-boot SPL succeed;
+		else echo Flashing of U-boot SPL failed;
+		fi;
+	fi;
+download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img
+flash_uboot_img=
+	if mmc dev 0 1; then
+		setexpr sz ${filesize} / 0x200;
+		setexpr sz ${sz} + 1;
+		if mmc write ${loadaddr} 0x8a ${sz}; then
+			echo Flashing of U-boot image succeed;
+		else echo Flashing of U-boot image failed;
+		fi;
+	fi;
+update_uboot=run download_uboot_spl flash_uboot_spl
+	download_uboot_img flash_uboot_img
+download_kernel=tftpboot ${loadaddr} ${kernelimg}
+flash_kernel=
+	if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then
+		echo kernel update succeed;
+		else echo kernel update failed;
+	fi;
+update_kernel=run download_kernel flash_kernel
+download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb
+flash_dtb=
+	if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then
+		echo dtb update succeed;
+		else echo dtb update in failed;
+	fi;
+update_dtb=run download_dtb flash_dtb
+download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4
+flash_rootfs=
+	if mmc dev 0 0; then
+		setexpr nbblocks ${filesize} / 0x200;
+		setexpr nbblocks ${nbblocks} + 1;
+		if mmc write ${loadaddr} 0x40800 ${nbblocks}; then
+			echo Flashing of rootfs image succeed;
+		else echo Flashing of rootfs image failed;
+		fi;
+	fi;
+update_rootfs=run download_rootfs flash_rootfs
+flash_failsafe=
+	if mmc dev 0 0; then
+		setexpr nbblocks ${filesize} / 0x200;
+		setexpr nbblocks ${nbblocks} + 1;
+		if mmc write ${loadaddr} 0x800 ${nbblocks}; then
+			echo Flashing of rootfs image in failsafe partition succeed;
+		else echo Flashing of rootfs image in failsafe partition failed;
+		fi;
+	fi;
+update_failsafe=run download_rootfs flash_failsafe
+download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4
+flash_userdata=
+	if mmc dev 0 0; then
+		setexpr nbblocks ${filesize} / 0x200;
+		setexpr nbblocks ${nbblocks} + 1;
+		if mmc write ${loadaddr} 0 ${nbblocks}; then
+			echo Flashing of user_data image succeed;
+		else echo Flashing of user_data image failed;
+		fi;
+	fi;
+update_userdata=run download_userdata flash_userdata; mmc rescan
+erase_userdata=
+	if mmc dev 0 0; then
+		echo Erasing eMMC User Data partition, no way out...;
+		mw ${loadaddr} 0 0x200000;
+		mmc write ${loadaddr} 0 0x1000;
+		mmc write ${loadaddr} 0x800 0x1000;
+		mmc write ${loadaddr} 0x40800 0x1000;
+		mmc write ${loadaddr} 0x440800 0x1000;
+	fi;
+	mmc rescan
+update_all=run update_rootfs update_uboot
+initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}
+addipargs=setenv bootargs ${bootargs}
+	ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
+addmmcargs=setenv bootargs ${bootargs} root=${mmcroot}
+	rootfstype=${mmcrootfstype}
+emmcboot=run initargs; run addmmcargs;
+	load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} &&
+	load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb &&
+	bootz ${loadaddr} - ${fdt_addr};
+emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;
+addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw
+	nfsroot=${serverip}:${rootpath}
+nfsboot=run initargs; run addnfsargs addipargs;
+	nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} &&
+	nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb &&
+	bootz ${loadaddr} - ${fdt_addr};
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index 9b89d9e524fd..73fe86f9bab8 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -31,138 +31,7 @@
 /* LCD */
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 
-/* Environment is stored in the eMMC boot partition */
-
-#define CONFIG_ENV_VERSION	100
-#define ACFG_CONSOLE_DEV        ttymxc0
 #define CONFIG_SYS_AUTOLOAD     "no"
 #define CONFIG_ROOTPATH         "/tftpboot/opos6ul-root"
 
-#define CONFIG_EXTRA_ENV_SETTINGS \
-	"env_version="          __stringify(CONFIG_ENV_VERSION)         "\0"                    \
-	"consoledev="           __stringify(ACFG_CONSOLE_DEV)           "\0"                    \
-	"board_name=opos6ul\0"                                                                  \
-	"fdt_addr=0x88000000\0"                                                                 \
-	"fdt_high=0xffffffff\0"                                                                 \
-	"fdt_name=opos6uldev\0"                                                                 \
-	"initrd_high=0xffffffff\0"                                                              \
-	"ip_dyn=yes\0"                                                                          \
-	"stdin=serial\0"                                                                        \
-	"stdout=serial\0"                                                                       \
-	"stderr=serial\0"                                                                       \
-	"mmcdev=0\0"                                                                            \
-	"mmcpart=2\0"                                                                           \
-	"mmcroot=/dev/mmcblk0p2 ro\0"                                                           \
-	"mmcrootfstype=ext4 rootwait\0"                                                         \
-	"kernelimg=opos6ul-linux.bin\0"                                                         \
-	"splashpos=0,0\0"									\
-	"splashimage="		__stringify(CONFIG_SYS_LOAD_ADDR)	"\0"			\
-	"videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0\0" \
-	"check_env=if test -n ${flash_env_version}; "                                           \
-		"then env default env_version; "                                                \
-		"else env set flash_env_version ${env_version}; env save; "                     \
-		"fi; "                                                                          \
-		"if itest ${flash_env_version} != ${env_version}; then "                        \
-			"echo \"*** Warning - Environment version"                              \
-			" change suggests: run flash_reset_env; reset\"; "                      \
-			"env default flash_reset_env; "                                         \
-		"else exit; fi; \0"                                                             \
-	"flash_reset_env=env default -f -a && saveenv && "                                      \
-		"echo Environment variables erased!\0"                                          \
-	"download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl\0"                    \
-	"flash_uboot_spl="                                                                      \
-		"if mmc dev 0 1; then "                                                         \
-			"setexpr sz ${filesize} / 0x200; "                                      \
-			"setexpr sz ${sz} + 1; "                                                \
-			"if mmc write ${loadaddr} 0x2 ${sz}; then "                             \
-				"echo Flashing of U-boot SPL succeed; "                         \
-			"else echo Flashing of U-boot SPL failed; "                             \
-			"fi; "                                                                  \
-		"fi;\0"                                                                         \
-	"download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img\0"                    \
-	"flash_uboot_img="                                                                      \
-		"if mmc dev 0 1; then "                                                         \
-			"setexpr sz ${filesize} / 0x200; "                                      \
-			"setexpr sz ${sz} + 1; "                                                \
-			"if mmc write ${loadaddr} 0x8a ${sz}; then "                            \
-				"echo Flashing of U-boot image succeed; "                       \
-			"else echo Flashing of U-boot image failed; "                           \
-			"fi; "                                                                  \
-		"fi;\0"                                                                         \
-	"update_uboot=run download_uboot_spl flash_uboot_spl "                                  \
-		"download_uboot_img flash_uboot_img\0"                                          \
-	"download_kernel=tftpboot ${loadaddr} ${kernelimg}\0"                                   \
-	"flash_kernel="                                                                         \
-		"if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then "    \
-			"echo kernel update succeed; "                                          \
-			"else echo kernel update failed; "                                      \
-		"fi;\0"                                                                         \
-	"update_kernel=run download_kernel flash_kernel\0"                                      \
-	"download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb\0"                            \
-	"flash_dtb="                                                                            \
-		"if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then " \
-			"echo dtb update succeed; "                                             \
-			"else echo dtb update in failed; "                                      \
-		"fi;\0"                                                                         \
-	"update_dtb=run download_dtb flash_dtb\0"                                               \
-	"download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4\0"                      \
-	"flash_rootfs="                                                                         \
-		"if mmc dev 0 0; then "                                                         \
-			"setexpr nbblocks ${filesize} / 0x200; "                                \
-			"setexpr nbblocks ${nbblocks} + 1; "                                    \
-			"if mmc write ${loadaddr} 0x40800 ${nbblocks}; then "                   \
-				"echo Flashing of rootfs image succeed; "                       \
-			"else echo Flashing of rootfs image failed; "                           \
-			"fi; "                                                                  \
-		"fi;\0"                                                                         \
-	"update_rootfs=run download_rootfs flash_rootfs\0"                                      \
-	"flash_failsafe="                                                                       \
-		"if mmc dev 0 0; then "                                                         \
-			"setexpr nbblocks ${filesize} / 0x200; "                                \
-			"setexpr nbblocks ${nbblocks} + 1; "                                    \
-			"if mmc write ${loadaddr} 0x800 ${nbblocks}; then "                     \
-				"echo Flashing of rootfs image in failsafe partition succeed; " \
-			"else echo Flashing of rootfs image in failsafe partition failed; "     \
-			"fi; "                                                                  \
-		"fi;\0"                                                                         \
-	"update_failsafe=run download_rootfs flash_failsafe\0"                                  \
-	"download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4\0"                 \
-	"flash_userdata="                                                                       \
-		"if mmc dev 0 0; then "                                                         \
-			"setexpr nbblocks ${filesize} / 0x200; "                                \
-			"setexpr nbblocks ${nbblocks} + 1; "                                    \
-			"if mmc write ${loadaddr} 0 ${nbblocks}; then "                         \
-				"echo Flashing of user_data image succeed; "                    \
-			"else echo Flashing of user_data image failed; "                        \
-			"fi; "                                                                  \
-		"fi;\0"                                                                         \
-	"update_userdata=run download_userdata flash_userdata; mmc rescan\0"                    \
-	"erase_userdata="                                                                       \
-		"if mmc dev 0 0; then "                                                         \
-			"echo Erasing eMMC User Data partition, no way out...; "                \
-			"mw ${loadaddr} 0 0x200000; "                                           \
-			"mmc write ${loadaddr} 0 0x1000; "                                      \
-			"mmc write ${loadaddr} 0x800 0x1000; "                                  \
-			"mmc write ${loadaddr} 0x40800 0x1000; "                                \
-			"mmc write ${loadaddr} 0x440800 0x1000; "                               \
-		"fi;"                                                                           \
-		"mmc rescan\0"                                                                  \
-	"update_all=run update_rootfs update_uboot\0"						\
-	"initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}\0"         \
-	"addipargs=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:"                       \
-		"${gatewayip}:${netmask}:${hostname}:eth0:off\0"                                \
-	"addmmcargs=setenv bootargs ${bootargs} root=${mmcroot} "                               \
-		"rootfstype=${mmcrootfstype}\0"                                                 \
-	"emmcboot=run initargs; run addmmcargs; "                                               \
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} && "              \
-		"load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb && "    \
-		"bootz ${loadaddr} - ${fdt_addr};\0"                                            \
-	"emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;\0"      \
-	"addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw "                              \
-		"nfsroot=${serverip}:${rootpath}\0"                                             \
-	"nfsboot=run initargs; run addnfsargs addipargs; "                                      \
-		"nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} && "                 \
-		"nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb && "       \
-		"bootz ${loadaddr} - ${fdt_addr};\0"
-
 #endif /* __OPOS6ULDEV_CONFIG_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/8] Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
                   ` (3 preceding siblings ...)
  2022-06-14  2:57 ` [PATCH 5/8] opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 7/8] Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment Tom Rini
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot

The "autoload" environment variable is always checked with env_get_yesno
as it can be set to any form of no.  The default behavior of
env_get_yesno is to return -1 on variables that are not set, which acts
as true in general (we test for non-zero return).  To convert
CONFIG_SYS_AUTOLOAD to Kconfig, given that it was almost always used to
set autoload to no, first rename to CONFIG_SYS_DISABLE_AUTOLOAD for
consistency sake.  Then, make it so that if enabled we set autoload=0 in
the default environment.  Migrate all platforms which set
CONFIG_SYS_AUTOLOAD to non-true or that set autoload to false in their
default environment to using CONFIG_SYS_DISABLE_AUTOLOAD

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 cmd/Kconfig                                              | 9 +++++++++
 configs/am335x_guardian_defconfig                        | 1 +
 configs/bitmain_antminer_s9_defconfig                    | 1 +
 configs/bk4r1_defconfig                                  | 1 +
 configs/brppt1_mmc_defconfig                             | 1 +
 configs/brppt1_nand_defconfig                            | 1 +
 configs/brppt1_spi_defconfig                             | 1 +
 configs/brppt2_defconfig                                 | 1 +
 configs/brsmarc1_defconfig                               | 1 +
 configs/brxre1_defconfig                                 | 1 +
 configs/cl-som-imx7_defconfig                            | 1 +
 configs/cm_fx6_defconfig                                 | 1 +
 configs/cm_t335_defconfig                                | 1 +
 configs/cm_t43_defconfig                                 | 1 +
 configs/d2net_v2_defconfig                               | 1 +
 configs/devkit3250_defconfig                             | 1 +
 configs/dns325_defconfig                                 | 1 +
 configs/ethernut5_defconfig                              | 1 +
 configs/inetspace_v2_defconfig                           | 1 +
 configs/nas220_defconfig                                 | 1 +
 configs/net2big_v2_defconfig                             | 1 +
 configs/netspace_lite_v2_defconfig                       | 1 +
 configs/netspace_max_v2_defconfig                        | 1 +
 configs/netspace_mini_v2_defconfig                       | 1 +
 configs/netspace_v2_defconfig                            | 1 +
 configs/octeontx2_95xx_defconfig                         | 1 +
 configs/octeontx2_96xx_defconfig                         | 1 +
 configs/omap35_logic_defconfig                           | 1 +
 configs/omap35_logic_somlv_defconfig                     | 1 +
 configs/omap3_logic_defconfig                            | 1 +
 configs/omap3_logic_somlv_defconfig                      | 1 +
 configs/opos6uldev_defconfig                             | 1 +
 configs/pcm052_defconfig                                 | 1 +
 configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig       | 1 +
 configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig      | 1 +
 .../stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig  | 1 +
 configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig  | 1 +
 configs/stm32mp15_basic_defconfig                        | 1 +
 configs/stm32mp15_defconfig                              | 1 +
 configs/stm32mp15_dhcom_basic_defconfig                  | 1 +
 configs/stm32mp15_dhcor_basic_defconfig                  | 1 +
 configs/stm32mp15_trusted_defconfig                      | 1 +
 include/configs/am335x_guardian.h                        | 1 -
 include/configs/bitmain_antminer_s9.h                    | 1 -
 include/configs/bk4r1.h                                  | 1 -
 include/configs/brppt1.h                                 | 1 -
 include/configs/brppt2.h                                 | 1 -
 include/configs/brsmarc1.h                               | 1 -
 include/configs/brxre1.h                                 | 1 -
 include/configs/cl-som-imx7.h                            | 4 ----
 include/configs/cm_fx6.h                                 | 1 -
 include/configs/cm_t335.h                                | 2 --
 include/configs/cm_t43.h                                 | 1 -
 include/configs/devkit3250.h                             | 1 -
 include/configs/dns325.h                                 | 1 -
 include/configs/ethernut5.h                              | 5 -----
 include/configs/imx7-cm.h                                | 1 -
 include/configs/lacie_kw.h                               | 1 -
 include/configs/nas220.h                                 | 3 +--
 include/configs/octeontx2_common.h                       | 3 +--
 include/configs/octeontx_common.h                        | 1 -
 include/configs/omap3_logic.h                            | 1 -
 include/configs/opos6uldev.h                             | 1 -
 include/configs/pcm052.h                                 | 1 -
 include/configs/siemens-am33x-common.h                   | 2 --
 include/configs/smartweb.h                               | 3 ---
 include/configs/stm32mp15_common.h                       | 1 -
 include/env_default.h                                    | 4 ++--
 68 files changed, 54 insertions(+), 40 deletions(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 9a0b7203112d..44d7b62e4fb5 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1732,6 +1732,15 @@ config NFS_TIMEOUT
 	  "ERROR: Cannot umount" in nfs command, try longer timeout such as
 	  10000.
 
+config SYS_DISABLE_AUTOLOAD
+	bool "Disable automatically loading files over the network"
+	depends on CMD_BOOTP || CMD_DHCP || CMD_NFS || CMD_RARP
+	help
+	  Typically, commands such as "dhcp" will attempt to automatically
+	  load a file from the network, once the initial network configuration
+	  is complete.  Enable this option to disable this behavior and instead
+	  require files to be loaded over the network by subsequent commands.
+
 config CMD_MII
 	bool "mii"
 	imply CMD_MDIO
diff --git a/configs/am335x_guardian_defconfig b/configs/am335x_guardian_defconfig
index 0dc4bb25be28..34bef30edd3b 100644
--- a/configs/am335x_guardian_defconfig
+++ b/configs/am335x_guardian_defconfig
@@ -59,6 +59,7 @@ CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
index f8ab91435875..98d38a89a042 100644
--- a/configs/bitmain_antminer_s9_defconfig
+++ b/configs/bitmain_antminer_s9_defconfig
@@ -56,6 +56,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_PXE=y
diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
index 838090e3039d..0f8955dbbf18 100644
--- a/configs/bk4r1_defconfig
+++ b/configs/bk4r1_defconfig
@@ -41,6 +41,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_BOOTCOUNT=y
diff --git a/configs/brppt1_mmc_defconfig b/configs/brppt1_mmc_defconfig
index 488167e27f15..b1c8577ab627 100644
--- a/configs/brppt1_mmc_defconfig
+++ b/configs/brppt1_mmc_defconfig
@@ -61,6 +61,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_BOOTCOUNT=y
diff --git a/configs/brppt1_nand_defconfig b/configs/brppt1_nand_defconfig
index dce6bebd81d4..5addd4970b2a 100644
--- a/configs/brppt1_nand_defconfig
+++ b/configs/brppt1_nand_defconfig
@@ -61,6 +61,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_BOOTCOUNT=y
diff --git a/configs/brppt1_spi_defconfig b/configs/brppt1_spi_defconfig
index 41dd24feddab..67683c895d23 100644
--- a/configs/brppt1_spi_defconfig
+++ b/configs/brppt1_spi_defconfig
@@ -70,6 +70,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_BOOTCOUNT=y
diff --git a/configs/brppt2_defconfig b/configs/brppt2_defconfig
index 952bbc446c5f..e2c36e13add8 100644
--- a/configs/brppt2_defconfig
+++ b/configs/brppt2_defconfig
@@ -57,6 +57,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
diff --git a/configs/brsmarc1_defconfig b/configs/brsmarc1_defconfig
index 3134d3b4b6a9..2f7ff524cc1d 100644
--- a/configs/brsmarc1_defconfig
+++ b/configs/brsmarc1_defconfig
@@ -72,6 +72,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
diff --git a/configs/brxre1_defconfig b/configs/brxre1_defconfig
index c39389451f1b..c38393410f3d 100644
--- a/configs/brxre1_defconfig
+++ b/configs/brxre1_defconfig
@@ -63,6 +63,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_MAY_FAIL=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
diff --git a/configs/cl-som-imx7_defconfig b/configs/cl-som-imx7_defconfig
index 075d8678c8a9..bf670dbae689 100644
--- a/configs/cl-som-imx7_defconfig
+++ b/configs/cl-som-imx7_defconfig
@@ -52,6 +52,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 # CONFIG_CMD_MDIO is not set
 CONFIG_CMD_PING=y
diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
index 4d8788099f49..9bf78788e497 100644
--- a/configs/cm_fx6_defconfig
+++ b/configs/cm_fx6_defconfig
@@ -56,6 +56,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
diff --git a/configs/cm_t335_defconfig b/configs/cm_t335_defconfig
index 0c2e8a35ef87..f1b4b622cbd5 100644
--- a/configs/cm_t335_defconfig
+++ b/configs/cm_t335_defconfig
@@ -46,6 +46,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_DNS2=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand"
diff --git a/configs/cm_t43_defconfig b/configs/cm_t43_defconfig
index 30afd5e7d004..c0dc70312a2e 100644
--- a/configs/cm_t43_defconfig
+++ b/configs/cm_t43_defconfig
@@ -62,6 +62,7 @@ CONFIG_CMD_NAND=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_NFS is not set
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_OF_CONTROL=y
diff --git a/configs/d2net_v2_defconfig b/configs/d2net_v2_defconfig
index 05f0d4bb35ed..bbafd5772795 100644
--- a/configs/d2net_v2_defconfig
+++ b/configs/d2net_v2_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/devkit3250_defconfig b/configs/devkit3250_defconfig
index 5290ac5e82e1..a0b7a2e2d36c 100644
--- a/configs/devkit3250_defconfig
+++ b/configs/devkit3250_defconfig
@@ -43,6 +43,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
diff --git a/configs/dns325_defconfig b/configs/dns325_defconfig
index 511ca2f64736..242cc36fcef0 100644
--- a/configs/dns325_defconfig
+++ b/configs/dns325_defconfig
@@ -30,6 +30,7 @@ CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/ethernut5_defconfig b/configs/ethernut5_defconfig
index 256f6520a598..796b71793a7f 100644
--- a/configs/ethernut5_defconfig
+++ b/configs/ethernut5_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_RARP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 # CONFIG_CMD_MDIO is not set
 CONFIG_CMD_PING=y
diff --git a/configs/inetspace_v2_defconfig b/configs/inetspace_v2_defconfig
index 160a0898f2ed..7b1e8dee16df 100644
--- a/configs/inetspace_v2_defconfig
+++ b/configs/inetspace_v2_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/nas220_defconfig b/configs/nas220_defconfig
index 5d105522dd12..99f36b72bf97 100644
--- a/configs/nas220_defconfig
+++ b/configs/nas220_defconfig
@@ -30,6 +30,7 @@ CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/net2big_v2_defconfig b/configs/net2big_v2_defconfig
index 68d1eeff11e0..248ce90519eb 100644
--- a/configs/net2big_v2_defconfig
+++ b/configs/net2big_v2_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/netspace_lite_v2_defconfig b/configs/netspace_lite_v2_defconfig
index 98d8e59119f0..eea86eb0b736 100644
--- a/configs/netspace_lite_v2_defconfig
+++ b/configs/netspace_lite_v2_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/netspace_max_v2_defconfig b/configs/netspace_max_v2_defconfig
index 11fd496e6d38..cb06fe2ae3cf 100644
--- a/configs/netspace_max_v2_defconfig
+++ b/configs/netspace_max_v2_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/netspace_mini_v2_defconfig b/configs/netspace_mini_v2_defconfig
index 1025ca30ad93..3a461469106f 100644
--- a/configs/netspace_mini_v2_defconfig
+++ b/configs/netspace_mini_v2_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_SATA=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/netspace_v2_defconfig b/configs/netspace_v2_defconfig
index 1bb9915cc1ed..d39b6a479e94 100644
--- a/configs/netspace_v2_defconfig
+++ b/configs/netspace_v2_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
diff --git a/configs/octeontx2_95xx_defconfig b/configs/octeontx2_95xx_defconfig
index fc7bc6d50ec4..2b3748b2d049 100644
--- a/configs/octeontx2_95xx_defconfig
+++ b/configs/octeontx2_95xx_defconfig
@@ -59,6 +59,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TFTPSRV=y
 CONFIG_CMD_RARP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CDP=y
diff --git a/configs/octeontx2_96xx_defconfig b/configs/octeontx2_96xx_defconfig
index e0d4fe76a0f9..0fd5b7212b82 100644
--- a/configs/octeontx2_96xx_defconfig
+++ b/configs/octeontx2_96xx_defconfig
@@ -60,6 +60,7 @@ CONFIG_BOOTP_BOOTFILESIZE=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TFTPSRV=y
 CONFIG_CMD_RARP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CDP=y
diff --git a/configs/omap35_logic_defconfig b/configs/omap35_logic_defconfig
index c76c10ac70fd..787c26eaa477 100644
--- a/configs/omap35_logic_defconfig
+++ b/configs/omap35_logic_defconfig
@@ -51,6 +51,7 @@ CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_UUID=y
 CONFIG_CMD_MTDPARTS=y
diff --git a/configs/omap35_logic_somlv_defconfig b/configs/omap35_logic_somlv_defconfig
index 2637ecf9c50e..ab5dfad28fcc 100644
--- a/configs/omap35_logic_somlv_defconfig
+++ b/configs/omap35_logic_somlv_defconfig
@@ -52,6 +52,7 @@ CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_UUID=y
 CONFIG_CMD_MTDPARTS=y
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index f55d52736bae..ce777cae88b3 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -50,6 +50,7 @@ CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_UUID=y
 CONFIG_CMD_MTDPARTS=y
diff --git a/configs/omap3_logic_somlv_defconfig b/configs/omap3_logic_somlv_defconfig
index 97cdc9491d3b..8c5bc19f10bf 100644
--- a/configs/omap3_logic_somlv_defconfig
+++ b/configs/omap3_logic_somlv_defconfig
@@ -52,6 +52,7 @@ CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_UUID=y
 CONFIG_CMD_MTDPARTS=y
diff --git a/configs/opos6uldev_defconfig b/configs/opos6uldev_defconfig
index 1c1daf86a3b6..b76e272e2552 100644
--- a/configs/opos6uldev_defconfig
+++ b/configs/opos6uldev_defconfig
@@ -55,6 +55,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_TFTPPUT=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
diff --git a/configs/pcm052_defconfig b/configs/pcm052_defconfig
index 75999d177dc9..41f1dc22c88a 100644
--- a/configs/pcm052_defconfig
+++ b/configs/pcm052_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_DHCP=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
diff --git a/configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig b/configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig
index 9441b8c3b1c3..76a450952fc1 100644
--- a/configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig
+++ b/configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig
@@ -43,6 +43,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig b/configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig
index 961628545232..d413d2cac4b6 100644
--- a/configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig
+++ b/configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig
@@ -43,6 +43,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig b/configs/stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig
index 354a43cf55ef..dd270975508c 100644
--- a/configs/stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig
+++ b/configs/stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig
@@ -43,6 +43,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig b/configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig
index a601477d127b..54a5385926f1 100644
--- a/configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig
+++ b/configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig
@@ -43,6 +43,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig
index 662754128da0..330417be9ac5 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -64,6 +64,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig
index a6398c75278a..41cbb633d9a1 100644
--- a/configs/stm32mp15_defconfig
+++ b/configs/stm32mp15_defconfig
@@ -40,6 +40,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig
index 72d2f6e9a7c6..5680850061fd 100644
--- a/configs/stm32mp15_dhcom_basic_defconfig
+++ b/configs/stm32mp15_dhcom_basic_defconfig
@@ -72,6 +72,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig
index b16ad4fca2a5..925b5c1a7fd6 100644
--- a/configs/stm32mp15_dhcor_basic_defconfig
+++ b/configs/stm32mp15_dhcor_basic_defconfig
@@ -70,6 +70,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig
index 626398b9e86b..071a381ac1a7 100644
--- a/configs/stm32mp15_trusted_defconfig
+++ b/configs/stm32mp15_trusted_defconfig
@@ -41,6 +41,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h
index b92703205cde..93fea95996cc 100644
--- a/include/configs/am335x_guardian.h
+++ b/include/configs/am335x_guardian.h
@@ -52,7 +52,6 @@
 	MEM_LAYOUT_ENV_SETTINGS \
 	BOOTENV \
 	GUARDIAN_DEFAULT_PROD_ENV \
-	"autoload=no\0" \
 	"backlight_brightness=50\0" \
 	"bootubivol=rootfs\0" \
 	"distro_bootcmd=" \
diff --git a/include/configs/bitmain_antminer_s9.h b/include/configs/bitmain_antminer_s9.h
index 2bcd0e1a989d..829e816ad664 100644
--- a/include/configs/bitmain_antminer_s9.h
+++ b/include/configs/bitmain_antminer_s9.h
@@ -10,7 +10,6 @@
 #define CONFIG_SYS_SDRAM_SIZE	0x40000000
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"autoload=no\0" \
 	"pxefile_addr_r=0x2000000\0" \
 	"scriptaddr=0x3000000\0" \
 	"kernel_addr_r=0x2000000\0" \
diff --git a/include/configs/bk4r1.h b/include/configs/bk4r1.h
index 2069d51d2fd1..5311dc4eff9c 100644
--- a/include/configs/bk4r1.h
+++ b/include/configs/bk4r1.h
@@ -67,7 +67,6 @@
 /* Extra env settings (including the target-defined ones if any) */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	BK4_EXTRA_ENV_SETTINGS \
-	"autoload=no\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"blimg_file=u-boot.vyb\0" \
diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h
index 440571a799e5..d7755b8cafa2 100644
--- a/include/configs/brppt1.h
+++ b/include/configs/brppt1.h
@@ -102,7 +102,6 @@ MMCSPI_TGTS \
 #define CONFIG_EXTRA_ENV_SETTINGS \
 BUR_COMMON_ENV \
 "verify=no\0" \
-"autoload=0\0" \
 "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \
 "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \
 "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \
diff --git a/include/configs/brppt2.h b/include/configs/brppt2.h
index 19276cc6ecab..adaba410ce97 100644
--- a/include/configs/brppt2.h
+++ b/include/configs/brppt2.h
@@ -29,7 +29,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 BUR_COMMON_ENV \
-"autoload=0\0" \
 "cfgaddr=0x106F0000\0" \
 "scraddr=0x10700000\0" \
 "loadaddr=0x10800000\0" \
diff --git a/include/configs/brsmarc1.h b/include/configs/brsmarc1.h
index eccf16fdb7a1..8fa5843be5d1 100644
--- a/include/configs/brsmarc1.h
+++ b/include/configs/brsmarc1.h
@@ -27,7 +27,6 @@
 /* Default environment */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 BUR_COMMON_ENV \
-"autoload=0\0" \
 "scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 "cfgscr=mw ${dtbaddr} 0;" \
 " sf probe && sf read ${scradr} 0xC0000 0x10000 && source ${scradr};" \
diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h
index b4e8d73db05a..4d91a776ba84 100644
--- a/include/configs/brxre1.h
+++ b/include/configs/brxre1.h
@@ -26,7 +26,6 @@
 /* Default environment */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 BUR_COMMON_ENV \
-"autoload=0\0" \
 "scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 "bootaddr=0x80001100\0" \
 "bootdev=cpsw(0,0)\0" \
diff --git a/include/configs/cl-som-imx7.h b/include/configs/cl-som-imx7.h
index 4e982189559d..1043eb75060f 100644
--- a/include/configs/cl-som-imx7.h
+++ b/include/configs/cl-som-imx7.h
@@ -26,13 +26,9 @@
 #define CONFIG_SYS_I2C_PCA953X_ADDR	0x20
 #define CONFIG_SYS_I2C_PCA953X_WIDTH	{ {0x20, 16} }
 
-#undef CONFIG_SYS_AUTOLOAD
 #undef CONFIG_EXTRA_ENV_SETTINGS
 
-#define CONFIG_SYS_AUTOLOAD		"no"
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"autoload=off\0" \
 	"script=boot.scr\0" \
 	"loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
 	"loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 6bffeb6a65b5..3bb00a359f88 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -43,7 +43,6 @@
 	"stdout=serial,vidconsole\0" \
 	"stderr=serial,vidconsole\0" \
 	"panel=HDMI\0" \
-	"autoload=no\0" \
 	"uImage=uImage-cm-fx6\0" \
 	"zImage=zImage-cm-fx6\0" \
 	"kernel=uImage-cm-fx6\0" \
diff --git a/include/configs/cm_t335.h b/include/configs/cm_t335.h
index b2bec10960aa..b81c3af29f62 100644
--- a/include/configs/cm_t335.h
+++ b/include/configs/cm_t335.h
@@ -55,8 +55,6 @@
 	MMCARGS \
 	NANDARGS
 
-#define CONFIG_SYS_AUTOLOAD		"no"
-
 /* Serial console configuration */
 
 /* NS16550 Configuration */
diff --git a/include/configs/cm_t43.h b/include/configs/cm_t43.h
index ec1355b8a320..07c5cb8ded1b 100644
--- a/include/configs/cm_t43.h
+++ b/include/configs/cm_t43.h
@@ -56,7 +56,6 @@
 	"loadaddr=0x80200000\0" \
 	"fdtaddr=0x81200000\0" \
 	"bootm_size=0x8000000\0" \
-	"autoload=no\0" \
 	"console=ttyO0,115200n8\0" \
 	"fdtfile=am437x-sb-som-t43.dtb\0" \
 	"kernel=zImage-cm-t43\0" \
diff --git a/include/configs/devkit3250.h b/include/configs/devkit3250.h
index 15160db276d7..e101d1f60048 100644
--- a/include/configs/devkit3250.h
+++ b/include/configs/devkit3250.h
@@ -71,7 +71,6 @@
  */
 
 #define CONFIG_EXTRA_ENV_SETTINGS		\
-	"autoload=no\0"				\
 	"ethaddr=00:01:90:00:C0:81\0"		\
 	"dtbaddr=0x81000000\0"			\
 	"nfsroot=/opt/projects/images/vladimir/oe/devkit3250/rootfs\0"	\
diff --git a/include/configs/dns325.h b/include/configs/dns325.h
index 0590704000ec..af2d3b6bcc3a 100644
--- a/include/configs/dns325.h
+++ b/include/configs/dns325.h
@@ -40,7 +40,6 @@
 	"stdout=serial\0" \
 	"stderr=serial\0" \
 	"loadaddr=0x800000\0" \
-	"autoload=no\0" \
 	"console=ttyS0,115200\0" \
 	"mtdparts="CONFIG_MTDPARTS_DEFAULT \
 	"optargs=\0" \
diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
index 8f9cfd50bc1e..2126731ccfc9 100644
--- a/include/configs/ethernut5.h
+++ b/include/configs/ethernut5.h
@@ -98,11 +98,6 @@
 #define I2C_DELAY	udelay(100)
 #define I2C_READ	at91_get_pio_value(AT91_PIO_PORTA, 23)
 
-/* DHCP/BOOTP options */
-#ifdef CONFIG_CMD_DHCP
-#define CONFIG_SYS_AUTOLOAD	"n"
-#endif
-
 /* File systems */
 
 /* Boot command */
diff --git a/include/configs/imx7-cm.h b/include/configs/imx7-cm.h
index 2f00198e40ea..f0f800b8409b 100644
--- a/include/configs/imx7-cm.h
+++ b/include/configs/imx7-cm.h
@@ -12,7 +12,6 @@
 
 #define CONFIG_MXC_UART_BASE            UART1_IPS_BASE_ADDR
 
-#undef CONFIG_SYS_AUTOLOAD
 #undef CONFIG_EXTRA_ENV_SETTINGS
 
 /*
diff --git a/include/configs/lacie_kw.h b/include/configs/lacie_kw.h
index 5e0f1c90934e..9b70eed46f7c 100644
--- a/include/configs/lacie_kw.h
+++ b/include/configs/lacie_kw.h
@@ -57,7 +57,6 @@
 	"stderr=serial\0"					\
 	"bootfile=uImage\0"					\
 	"loadaddr=0x800000\0"					\
-	"autoload=no\0"						\
 	"netconsole="						\
 		"set stdin $stdin,nc; "				\
 		"set stdout $stdout,nc; "			\
diff --git a/include/configs/nas220.h b/include/configs/nas220.h
index 815f81f6493d..a8a905d4942a 100644
--- a/include/configs/nas220.h
+++ b/include/configs/nas220.h
@@ -42,8 +42,7 @@
 	"0x500000@0xc0000(uimage),"\
 	"0x1a40000@0x5c0000(rootfs)\0" \
 	"mtdids=nand0=orion_nand\0"\
-	"autostart=no\0"\
-	"autoload=no\0"
+	"autostart=no\0"
 
 /*
  * Ethernet Driver configuration
diff --git a/include/configs/octeontx2_common.h b/include/configs/octeontx2_common.h
index 5c75f23a0bfb..f377ba8fa2ec 100644
--- a/include/configs/octeontx2_common.h
+++ b/include/configs/octeontx2_common.h
@@ -18,8 +18,7 @@
 /** Extra environment settings */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 					"loadaddr=20080000\0"	\
-					"ethrotate=yes\0"	\
-					"autoload=0\0"
+					"ethrotate=yes\0"
 
 #define CONFIG_SYS_MMC_MAX_BLK_COUNT	8192
 
diff --git a/include/configs/octeontx_common.h b/include/configs/octeontx_common.h
index 2697a703cea5..73a14b25de67 100644
--- a/include/configs/octeontx_common.h
+++ b/include/configs/octeontx_common.h
@@ -18,7 +18,6 @@
 #include <config_distro_bootcmd.h>
 /* Extra environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS	\
-	"autoload=0\0"			\
 	"loadaddr=0x20080000\0"		\
 	"kernel_addr_r=0x02000000\0"	\
 	"ramdisk_addr_r=0x03000000\0"	\
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index 12e502cd3640..ef55a6216747 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -87,7 +87,6 @@
 		"nfsroot=${nfsrootpath} " \
 		"ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
 	"nfsrootpath=/opt/nfs-exports/omap\0" \
-	"autoload=no\0" \
 	"fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	"loadfdt=mmc rescan; " \
 		"load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index 73fe86f9bab8..3e551e13aa67 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -31,7 +31,6 @@
 /* LCD */
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 
-#define CONFIG_SYS_AUTOLOAD     "no"
 #define CONFIG_ROOTPATH         "/tftpboot/opos6ul-root"
 
 #endif /* __OPOS6ULDEV_CONFIG_H */
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index e360b166f557..bc4a59b38757 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -33,7 +33,6 @@
 /* Extra env settings (including the target-defined ones if any) */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	PCM052_EXTRA_ENV_SETTINGS \
-	"autoload=no\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"blimg_file=u-boot.vyb\0" \
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index db8ff848285a..d2d4296eed62 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -19,8 +19,6 @@
 
 #define CONFIG_ROOTPATH		"/opt/eldk"
 
-#define CONFIG_SYS_AUTOLOAD	"yes"
-
 /* Clock Defines */
 #define V_OSCK				24000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index da6fb18c17ad..b86b05b3193a 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -41,9 +41,6 @@
 
 /* misc settings */
 
-/* setting board specific options */
-#define CONFIG_SYS_AUTOLOAD "yes"
-
 /*
  * SDRAM: 1 bank, 64 MB, base address 0x20000000
  * Already initialized before u-boot gets started.
diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h
index ec41a8172c72..327c294f89a2 100644
--- a/include/configs/stm32mp15_common.h
+++ b/include/configs/stm32mp15_common.h
@@ -44,7 +44,6 @@
 /* Ethernet need */
 #ifdef CONFIG_DWC_ETH_QOS
 #define CONFIG_SERVERIP                 192.168.1.1
-#define CONFIG_SYS_AUTOLOAD		"no"
 #endif
 
 /*****************************************************************************/
diff --git a/include/env_default.h b/include/env_default.h
index 7113e08e6b0f..d1508b3ff44e 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -59,8 +59,8 @@ const char default_environment[] = {
 #ifdef	CONFIG_SERVERIP
 	"serverip="	__stringify(CONFIG_SERVERIP)	"\0"
 #endif
-#ifdef	CONFIG_SYS_AUTOLOAD
-	"autoload="	CONFIG_SYS_AUTOLOAD		"\0"
+#ifdef	CONFIG_SYS_DISABLE_AUTOLOAD
+	"autoload=0\0"
 #endif
 #ifdef	CONFIG_PREBOOT
 	"preboot="	CONFIG_PREBOOT			"\0"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/8] Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
                   ` (4 preceding siblings ...)
  2022-06-14  2:57 ` [PATCH 6/8] Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14  2:57 ` [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
  2022-06-29 14:11 ` [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot

- Ensure that everyone setting mtdids= and mtdparts= is doing so via the
  CONFIG options.
- If the CONFIG options are set, ensure that the default environment
  sets mtdparts / mtdids.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 configs/aristainetos2c_defconfig       |  2 ++
 configs/aristainetos2ccslb_defconfig   |  2 ++
 configs/dockstar_defconfig             |  1 +
 configs/ib62x0_defconfig               |  1 +
 configs/iconnect_defconfig             |  1 +
 configs/nas220_defconfig               |  2 ++
 configs/nsa310s_defconfig              |  1 +
 configs/pogo_e02_defconfig             |  2 ++
 include/configs/am335x_evm.h           |  2 --
 include/configs/am335x_igep003x.h      |  2 --
 include/configs/am3517_evm.h           |  2 --
 include/configs/am43xx_evm.h           |  2 --
 include/configs/am65x_evm.h            |  9 ---------
 include/configs/aristainetos2.h        |  3 ---
 include/configs/at91sam9n12ek.h        |  1 -
 include/configs/baltos.h               |  2 --
 include/configs/bk4r1.h                |  1 -
 include/configs/brppt1.h               |  2 --
 include/configs/chiliboard.h           |  2 --
 include/configs/cm_fx6.h               |  2 --
 include/configs/cm_t335.h              |  2 --
 include/configs/colibri-imx6ull.h      |  1 -
 include/configs/colibri_imx7.h         |  1 -
 include/configs/colibri_t20.h          |  1 -
 include/configs/colibri_vf.h           |  1 -
 include/configs/dns325.h               |  1 -
 include/configs/dockstar.h             |  2 --
 include/configs/goflexhome.h           |  2 --
 include/configs/guruplug.h             |  1 -
 include/configs/gw_ventana.h           |  2 --
 include/configs/ib62x0.h               |  2 --
 include/configs/iconnect.h             |  2 --
 include/configs/ids8313.h              |  2 --
 include/configs/imx27lite-common.h     |  2 --
 include/configs/imx8mn_bsh_smm_s2.h    |  2 --
 include/configs/j721e_evm.h            |  9 ---------
 include/configs/j721s2_evm.h           |  9 ---------
 include/configs/km/keymile-common.h    |  2 --
 include/configs/ls1028aqds.h           |  1 -
 include/configs/ls1028ardb.h           |  1 -
 include/configs/ls1043a_common.h       |  1 -
 include/configs/m53menlo.h             |  2 --
 include/configs/mccmon6.h              |  1 -
 include/configs/mys_6ulx.h             |  2 --
 include/configs/nas220.h               |  5 -----
 include/configs/npi_imx6ull.h          |  2 --
 include/configs/nsa310s.h              |  2 --
 include/configs/omap3_evm.h            |  2 --
 include/configs/omap3_logic.h          |  2 --
 include/configs/pcl063.h               |  2 --
 include/configs/pcm052.h               |  1 -
 include/configs/pcm058.h               |  2 --
 include/configs/phycore_am335x_r2.h    |  2 --
 include/configs/pm9261.h               |  2 --
 include/configs/pm9263.h               |  2 --
 include/configs/pogo_e02.h             |  3 ---
 include/configs/pogo_v4.h              |  2 --
 include/configs/s5pc210_universal.h    |  1 -
 include/configs/smartweb.h             |  1 -
 include/configs/smdkc100.h             |  1 -
 include/configs/socfpga_arria5_secu1.h |  2 --
 include/configs/sunxi-common.h         | 16 ----------------
 include/configs/ti816x_evm.h           |  4 +---
 include/configs/ti_armv7_keystone2.h   |  4 +---
 include/configs/usb_a9263.h            |  1 -
 include/configs/vcoreiii.h             |  9 ---------
 include/env_default.h                  |  6 ++++++
 67 files changed, 20 insertions(+), 148 deletions(-)

diff --git a/configs/aristainetos2c_defconfig b/configs/aristainetos2c_defconfig
index 7a3e690ed661..26bcb00ff537 100644
--- a/configs/aristainetos2c_defconfig
+++ b/configs/aristainetos2c_defconfig
@@ -51,6 +51,8 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nor0=spi0.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red),-(ubi-nor)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_DTB_RESELECT=y
diff --git a/configs/aristainetos2ccslb_defconfig b/configs/aristainetos2ccslb_defconfig
index 6bc78b773295..682903082cba 100644
--- a/configs/aristainetos2ccslb_defconfig
+++ b/configs/aristainetos2ccslb_defconfig
@@ -51,6 +51,8 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nor0=spi0.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red),-(ubi-nor)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_DTB_RESELECT=y
diff --git a/configs/dockstar_defconfig b/configs/dockstar_defconfig
index 3cb09ea4f7f0..6f99cdd44b05 100644
--- a/configs/dockstar_defconfig
+++ b/configs/dockstar_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),-(root)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
diff --git a/configs/ib62x0_defconfig b/configs/ib62x0_defconfig
index 4771e720c9b7..6ed3d68cd9c6 100644
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -37,6 +37,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),-@0x100000(root)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
diff --git a/configs/iconnect_defconfig b/configs/iconnect_defconfig
index 644d0abd3aaa..7adf76d77799 100644
--- a/configs/iconnect_defconfig
+++ b/configs/iconnect_defconfig
@@ -37,6 +37,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0x80000(uboot_env),-@0xa0000(rootfs)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
diff --git a/configs/nas220_defconfig b/configs/nas220_defconfig
index 99f36b72bf97..cc971f9b19a0 100644
--- a/configs/nas220_defconfig
+++ b/configs/nas220_defconfig
@@ -38,6 +38,8 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x500000@0xc0000(uimage),0x1a40000@0x5c0000(rootfs)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
diff --git a/configs/nsa310s_defconfig b/configs/nsa310s_defconfig
index 0c1d808f127f..2b39ae74b315 100644
--- a/configs/nsa310s_defconfig
+++ b/configs/nsa310s_defconfig
@@ -39,6 +39,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(root)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
diff --git a/configs/pogo_e02_defconfig b/configs/pogo_e02_defconfig
index b7f9c12efcd6..e1a2517eb637 100644
--- a/configs/pogo_e02_defconfig
+++ b/configs/pogo_e02_defconfig
@@ -35,6 +35,8 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_JFFS2=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)"
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
 CONFIG_OF_CONTROL=y
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 13d11084cd4e..754bcc3304b9 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -27,8 +27,6 @@
 
 #ifdef CONFIG_MTD_RAW_NAND
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"root=${nandroot} " \
diff --git a/include/configs/am335x_igep003x.h b/include/configs/am335x_igep003x.h
index 8d36ddeba596..3952783ee1a7 100644
--- a/include/configs/am335x_igep003x.h
+++ b/include/configs/am335x_igep003x.h
@@ -54,8 +54,6 @@
 				"bootz ${loadaddr} - ${fdtaddr};" \
 			"fi;" \
 		"fi;\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandroot=ubi0:rootfs rw ubi.mtd=1\0" \
 	"nandrootfstype=ubifs rootwait\0" \
 	"nandload=ubi part UBI; " \
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index b896f962f080..e6c9039d1664 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -49,8 +49,6 @@
 	"bootenv=uEnv.txt\0" \
 	"cmdline=\0" \
 	"optargs=\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"mmcdev=0\0" \
 	"mmcpart=1\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index e3a01adae971..87d3a27099bd 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -146,8 +146,6 @@
 #define CONFIG_SYS_NAND_ECCSIZE		512
 #define CONFIG_SYS_NAND_ECCBYTES	26
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"root=${nandroot} " \
diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
index 65b0a576a6f4..d8f18d0b9ac9 100644
--- a/include/configs/am65x_evm.h
+++ b/include/configs/am65x_evm.h
@@ -65,14 +65,6 @@
 		"0 /lib/firmware/am65x-mcu-r5f0_0-fw "			\
 		"1 /lib/firmware/am65x-mcu-r5f0_1-fw "
 
-#ifdef CONFIG_TARGET_AM654_A53_EVM
-#define EXTRA_ENV_AM65X_BOARD_SETTINGS_MTD				\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
-#else
-#define EXTRA_ENV_AM65X_BOARD_SETTINGS_MTD
-#endif
-
 #define EXTRA_ENV_AM65X_BOARD_SETTINGS_UBI				\
 	"init_ubi=run args_all args_ubi; sf probe; "			\
 		"ubi part ospi.rootfs; ubifsmount ubi:rootfs;\0"	\
@@ -104,7 +96,6 @@
 	DEFAULT_FIT_TI_ARGS						\
 	EXTRA_ENV_AM65X_BOARD_SETTINGS					\
 	EXTRA_ENV_AM65X_BOARD_SETTINGS_MMC				\
-	EXTRA_ENV_AM65X_BOARD_SETTINGS_MTD				\
 	EXTRA_ENV_AM65X_BOARD_SETTINGS_UBI				\
 	EXTRA_ENV_RPROC_SETTINGS					\
 	EXTRA_ENV_DFUARGS						\
diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h
index 2fd505dffdc0..469d3b28cea1 100644
--- a/include/configs/aristainetos2.h
+++ b/include/configs/aristainetos2.h
@@ -112,9 +112,6 @@
 	"splashpos=m,m\0" \
 	"console=" CONSOLE_DEV "\0" \
 	"emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
-	"mtdids=nor0=spi0.0\0" \
-	"mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
-		"-(ubi-nor)\0" \
 	"mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
 	"mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
 	"mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
diff --git a/include/configs/at91sam9n12ek.h b/include/configs/at91sam9n12ek.h
index abcddc3cc9d7..29affe7b5cd6 100644
--- a/include/configs/at91sam9n12ek.h
+++ b/include/configs/at91sam9n12ek.h
@@ -36,7 +36,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
 	"console=console=ttyS0,115200\0"                                \
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT"\0"					\
 	"bootargs_nand=rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw\0"\
 	"bootargs_mmc=root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait\0"
 
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 1abda0836ab6..25906e404b1c 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -29,8 +29,6 @@
 #ifdef CONFIG_MTD_RAW_NAND
 
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"${mtdparts} " \
diff --git a/include/configs/bk4r1.h b/include/configs/bk4r1.h
index 5311dc4eff9c..925a68787c91 100644
--- a/include/configs/bk4r1.h
+++ b/include/configs/bk4r1.h
@@ -80,7 +80,6 @@
 	"nfs_root=/path/to/nfs/root\0" \
 	"tftptimeout=1000\0" \
 	"tftptimeoutcountmax=1000000\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"ipaddr=192.168.0.60\0" \
 	"serverip=192.168.0.1\0" \
 	"bootargs_base=setenv bootargs rw " \
diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h
index d7755b8cafa2..c046fcb2bec0 100644
--- a/include/configs/brppt1.h
+++ b/include/configs/brppt1.h
@@ -39,8 +39,6 @@
 
 #ifdef CONFIG_MTD_RAW_NAND
 #define NANDTGTS \
-"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 "cfgscr=mw ${dtbaddr} 0; nand read ${cfgaddr} cfgscr && source ${cfgaddr};" \
 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \
 "nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \
diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h
index 8bad0f9ac4b6..97adb8353591 100644
--- a/include/configs/chiliboard.h
+++ b/include/configs/chiliboard.h
@@ -13,8 +13,6 @@
 #define V_SCLK				(V_OSCK)
 
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} ${optargs} " \
 		"${mtdparts} " \
 		"root=${nandroot} " \
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 3bb00a359f88..cbba72644002 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -53,8 +53,6 @@
 	"video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \
 	"doboot=bootm ${kernel_addr_r}\0" \
 	"doloadfdt=false\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"setboottypez=setenv kernel ${zImage};" \
 		"setenv doboot bootz ${kernel_addr_r} - ${fdt_addr_r};" \
 		"setenv doloadfdt true;\0" \
diff --git a/include/configs/cm_t335.h b/include/configs/cm_t335.h
index b81c3af29f62..4baf7f7e24ae 100644
--- a/include/configs/cm_t335.h
+++ b/include/configs/cm_t335.h
@@ -31,8 +31,6 @@
 		"bootm ${loadaddr}\0"
 
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandroot=ubi0:rootfs rw\0" \
 	"nandrootfstype=ubifs\0" \
 	"nandargs=setenv bootargs console=${console} " \
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index bf020612837f..528c7c98d235 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -65,7 +65,6 @@
 #define DFU_ALT_NAND_INFO "imx6ull-bcb part 0,1;u-boot1 part 0,2;u-boot2 part 0,3;u-boot-env part 0,4;ubi partubi 0,5"
 #define MODULE_EXTRA_ENV_SETTINGS \
 	"dfu_alt_info=" DFU_ALT_NAND_INFO "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	UBI_BOOTCMD
 #else
 #define	MODULE_EXTRA_ENV_SETTINGS ""
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index c8884e61b715..8a6536eec891 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -102,7 +102,6 @@
 
 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
 #define MODULE_EXTRA_ENV_SETTINGS \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	UBI_BOOTCMD
 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
 #define MODULE_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h
index 1e6561dc281b..73d18444215a 100644
--- a/include/configs/colibri_t20.h
+++ b/include/configs/colibri_t20.h
@@ -25,7 +25,6 @@
 /* Environment in NAND, 64K is a bit excessive but erase block is 512K anyway */
 #define BOARD_EXTRA_ENV_SETTINGS \
 	"boot_script_dhcp=boot.scr\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	UBOOT_UPDATE
 
 #include "tegra-common-post.h"
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 7d2b7dece029..268afbb7fa38 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -68,7 +68,6 @@
 	"fdt_board=eval-v3\0" \
 	"fdt_fixup=;\0" \
 	"kernel_image=zImage\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"setsdupdate=mmc rescan && set interface mmc && " \
 		"fatload ${interface} 0:1 ${loadaddr} flash_blk.img && " \
 		"source ${loadaddr}\0" \
diff --git a/include/configs/dns325.h b/include/configs/dns325.h
index af2d3b6bcc3a..015bc78648f3 100644
--- a/include/configs/dns325.h
+++ b/include/configs/dns325.h
@@ -41,7 +41,6 @@
 	"stderr=serial\0" \
 	"loadaddr=0x800000\0" \
 	"console=ttyS0,115200\0" \
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT \
 	"optargs=\0" \
 	"bootenv=uEnv.txt\0" \
 	"importbootenv=echo Importing environment ...; " \
diff --git a/include/configs/dockstar.h b/include/configs/dockstar.h
index 381a189149ea..33ae7d654b0b 100644
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -24,8 +24,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0" \
-	"mtdids=nand0=orion_nand\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT \
 	"kernel=/boot/uImage\0" \
 	"initrd=/boot/uInitrd\0" \
 	"bootargs_root=ubi.mtd=1 root=ubi0:root rootfstype=ubifs ro\0"
diff --git a/include/configs/goflexhome.h b/include/configs/goflexhome.h
index d335a42e99c1..66eed9e14f81 100644
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -33,8 +33,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0" \
-	"mtdids=nand0=orion_nand\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT \
 	"kernel=/boot/uImage\0" \
 	"bootargs_root=ubi.mtd=root root=ubi0:root rootfstype=ubifs ro\0"
 
diff --git a/include/configs/guruplug.h b/include/configs/guruplug.h
index d5655e4ada69..4954c5ca0800 100644
--- a/include/configs/guruplug.h
+++ b/include/configs/guruplug.h
@@ -26,7 +26,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0"				\
 	"mtdids=nand0=orion_nand\0"					\
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT			\
 	"kernel=/boot/zImage\0"						\
 	"fdt=/boot/guruplug-server-plus.dtb\0"				\
 	"bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 251e360daa9c..77f41502220a 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -85,8 +85,6 @@
 	"hwconfig=_UNKNOWN_\0" \
 	"video=\0" \
 	\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
 	"disk=0\0" \
 	"part=1\0" \
 	\
diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
index aff948cfe708..05192218d225 100644
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -20,8 +20,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0"				\
-	"mtdids=nand0=orion_nand\0"					\
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT			\
 	"kernel=/boot/zImage\0"						\
 	"fdt=/boot/ib62x0.dtb\0"					\
 	"bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
diff --git a/include/configs/iconnect.h b/include/configs/iconnect.h
index cb4cf9beb740..f2e3608d3a3f 100644
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -13,8 +13,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0"	\
-	"mtdids=nand0=orion_nand\0"		\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT	\
 	"kernel=/boot/uImage\0"			\
 	"bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
 
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index aa6a471cc254..e0994d12baf4 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -244,8 +244,6 @@
 			"${netmask}:${hostname}:${netdev}:off "		\
 			"console=${console},${baudrate} ${othbootargs}\0" \
 	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"		\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"					\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"				\
 	"\0"
 
 /* UBI Support */
diff --git a/include/configs/imx27lite-common.h b/include/configs/imx27lite-common.h
index 40c0f1fe36bd..17430f15d139 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -132,8 +132,6 @@
 		" +${filesize};cp.b ${fileaddr} "			\
 		__stringify(CONFIG_SYS_MONITOR_BASE) " ${filesize}\0"	\
 	"upd=run load update\0"						\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"					\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"				\
 
 /* additions for new relocation code, must be added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
diff --git a/include/configs/imx8mn_bsh_smm_s2.h b/include/configs/imx8mn_bsh_smm_s2.h
index f7529783692e..84c19824bdca 100644
--- a/include/configs/imx8mn_bsh_smm_s2.h
+++ b/include/configs/imx8mn_bsh_smm_s2.h
@@ -14,8 +14,6 @@
 #include <config_distro_bootcmd.h>
 
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"root=${nandroot} " \
diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
index c0b52558d81c..ecf876478100 100644
--- a/include/configs/j721e_evm.h
+++ b/include/configs/j721e_evm.h
@@ -151,14 +151,6 @@
 	DFU_ALT_INFO_RAM \
 	DFU_ALT_INFO_OSPI
 
-#if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
-#define EXTRA_ENV_J721E_BOARD_SETTINGS_MTD				\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
-#else
-#define EXTRA_ENV_J721E_BOARD_SETTINGS_MTD
-#endif
-
 #if CONFIG_IS_ENABLED(CMD_PXE)
 # define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
 #else
@@ -189,7 +181,6 @@
 	EXTRA_ENV_RPROC_SETTINGS					\
 	EXTRA_ENV_DFUARGS						\
 	DEFAULT_UFS_TI_ARGS						\
-	EXTRA_ENV_J721E_BOARD_SETTINGS_MTD				\
 	EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY				\
 	BOOTENV
 
diff --git a/include/configs/j721s2_evm.h b/include/configs/j721s2_evm.h
index 8e3ea670d089..4c3a155a950a 100644
--- a/include/configs/j721s2_evm.h
+++ b/include/configs/j721s2_evm.h
@@ -128,14 +128,6 @@
 	DFU_ALT_INFO_RAM \
 	DFU_ALT_INFO_OSPI
 
-#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
-#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD				\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
-#else
-#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD
-#endif
-
 /* Incorporate settings into the U-Boot environment */
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	DEFAULT_LINUX_BOOT_ENV						\
@@ -146,7 +138,6 @@
 	EXTRA_ENV_RPROC_SETTINGS					\
 	EXTRA_ENV_DFUARGS						\
 	DEFAULT_UFS_TI_ARGS						\
-	EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD				\
 	EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
 
 /* Now for the remaining common defines */
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h
index 4bca1a783020..1bfc89bf44ca 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -171,8 +171,6 @@
 	"init=/sbin/init-overlay.sh\0"					\
 	"load_addr_r=" __stringify(CONFIG_KM_KERNEL_ADDR) "\0"		\
 	"load=tftpboot ${load_addr_r} ${u-boot}\0"			\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"					\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"				\
 	""
 #endif /* CONFIG_KM_DEF_ENV */
 
diff --git a/include/configs/ls1028aqds.h b/include/configs/ls1028aqds.h
index 52703632a7e3..253911518669 100644
--- a/include/configs/ls1028aqds.h
+++ b/include/configs/ls1028aqds.h
@@ -87,7 +87,6 @@
 	"kernelhdr_addr_sd=0x3000\0" \
 	"kernelhdr_size_sd=0x10\0" \
 	"console=ttyS0,115200\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	BOOTENV \
 	"boot_scripts=ls1028aqds_boot.scr\0" \
 	"boot_script_hdr=hdr_ls1028aqds_bs.out\0" \
diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h
index 665723b15116..e7b2543b7301 100644
--- a/include/configs/ls1028ardb.h
+++ b/include/configs/ls1028ardb.h
@@ -82,7 +82,6 @@
 	"kernelhdr_addr_sd=0x3000\0"		\
 	"kernelhdr_size_sd=0x20\0"		\
 	"console=ttyS0,115200\0"                \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"	\
 	BOOTENV					\
 	"boot_scripts=ls1028ardb_boot.scr\0"    \
 	"boot_script_hdr=hdr_ls1028ardb_bs.out\0"	\
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 6e2c048fb128..8363969d557c 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -167,7 +167,6 @@
 	"kernelhdr_size_sd=0x10\0"		\
 	"console=ttyS0,115200\0"		\
 	"boot_os=y\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"	\
 	BOOTENV					\
 	"boot_scripts=ls1043ardb_boot.scr\0"	\
 	"boot_script_hdr=hdr_ls1043ardb_bs.out\0"	\
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index 1533e57fa8ca..b3348bc63bb9 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -112,8 +112,6 @@
 	"mmcpart=1\0"							\
 	"rootpath=/srv/\0"						\
 	"kernel_addr_r=0x72000000\0"					\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"			\
 	"netdev=eth0\0"							\
 	"splashsource=mmc_fs\0"						\
 	"splashfile=boot/usplash.bmp.gz\0"				\
diff --git a/include/configs/mccmon6.h b/include/configs/mccmon6.h
index 2c862e9ddcc2..02a22351874b 100644
--- a/include/configs/mccmon6.h
+++ b/include/configs/mccmon6.h
@@ -109,7 +109,6 @@
 			  "fi;" \
 		     "fi;" \
 		"fi\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"bootdev=1\0" \
 	"bootpart=1\0" \
 	"netdev=eth0\0" \
diff --git a/include/configs/mys_6ulx.h b/include/configs/mys_6ulx.h
index f7dd31e55780..b9689238195f 100644
--- a/include/configs/mys_6ulx.h
+++ b/include/configs/mys_6ulx.h
@@ -39,8 +39,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=ttymxc0,115200n8\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"fdt_addr_r=0x82000000\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
diff --git a/include/configs/nas220.h b/include/configs/nas220.h
index a8a905d4942a..1b7eb3433483 100644
--- a/include/configs/nas220.h
+++ b/include/configs/nas220.h
@@ -37,11 +37,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"bootargs=console=ttyS0,115200\0" \
-	"mtdparts=mtdparts=orion_nand:0xa0000@0x0(uboot),"\
-	"0x010000@0xa0000(env),"\
-	"0x500000@0xc0000(uimage),"\
-	"0x1a40000@0x5c0000(rootfs)\0" \
-	"mtdids=nand0=orion_nand\0"\
 	"autostart=no\0"
 
 /*
diff --git a/include/configs/npi_imx6ull.h b/include/configs/npi_imx6ull.h
index 96f570af1d05..6cdb1afcd9a9 100644
--- a/include/configs/npi_imx6ull.h
+++ b/include/configs/npi_imx6ull.h
@@ -48,8 +48,6 @@
 	"console=ttymxc0,115200n8\0" \
 	"image=zImage\0" \
 	"fdtfile=imx6ull-seeed-npi-dev-board.dtb\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"fdt_addr_r=0x82000000\0" \
 	"kernel_addr_r=0x81000000\0" \
 	"pxefile_addr_r=0x87100000\0" \
diff --git a/include/configs/nsa310s.h b/include/configs/nsa310s.h
index 46fd6e6e3b52..027a47b5a32f 100644
--- a/include/configs/nsa310s.h
+++ b/include/configs/nsa310s.h
@@ -15,8 +15,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0" \
-	"mtdids=nand0=orion_nand\0" \
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT \
 	"kernel=/boot/zImage\0" \
 	"fdt=/boot/nsa310s.dtb\0" \
 	"bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw\0"
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 9c4e172d037d..1b94f8efa224 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -76,8 +76,6 @@
 	DEFAULT_MMC_TI_ARGS \
 	DEFAULT_FIT_TI_ARGS \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"fdt_high=0xffffffff\0" \
 	"console=ttyO0,115200n8\0" \
 	"bootdir=/boot\0" \
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index ef55a6216747..38dc7ea88f7b 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -35,8 +35,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"	\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"mmcdev=0\0" \
 	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
 	"mmcrootfstype=ext4 rootwait\0" \
diff --git a/include/configs/pcl063.h b/include/configs/pcl063.h
index a07d3517ce29..6683f21d15d2 100644
--- a/include/configs/pcl063.h
+++ b/include/configs/pcl063.h
@@ -51,8 +51,6 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=ttymxc0,115200n8\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"fdt_addr_r=0x82000000\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index bc4a59b38757..a8cfec965959 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -49,7 +49,6 @@
 	"nfs_root=/path/to/nfs/root\0" \
 	"tftptimeout=1000\0" \
 	"tftptimeoutcountmax=1000000\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"bootargs_base=setenv bootargs rw " \
 		" mem=" __stringify(CONFIG_PCM052_DDR_SIZE) "M " \
 		"console=ttyLP1,115200n8\0" \
diff --git a/include/configs/pcm058.h b/include/configs/pcm058.h
index e87b6409bab0..cff71df1c962 100644
--- a/include/configs/pcm058.h
+++ b/include/configs/pcm058.h
@@ -37,8 +37,6 @@
 	"mmcboot=run mmcloadfit;run mmcargs;bootm ${loadaddr}\0"
 
 #define ENV_NAND \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandroot=ubi0:root ubi.mtd=rootfs\0" \
 	"nandrootfstype=ubifs\0" \
 	"nandargs=setenv bootargs root=${nandroot} " \
diff --git a/include/configs/phycore_am335x_r2.h b/include/configs/phycore_am335x_r2.h
index 7fa911620e11..f69d8adb91ca 100644
--- a/include/configs/phycore_am335x_r2.h
+++ b/include/configs/phycore_am335x_r2.h
@@ -16,8 +16,6 @@
 
 #ifdef CONFIG_MTD_RAW_NAND
 #define NANDARGS \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs console=${console} " \
 		"${optargs} " \
 		"root=${nandroot} " \
diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index 921f92bd012d..bc15cdb44602 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -161,8 +161,6 @@
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
 
 #define CONFIG_EXTRA_ENV_SETTINGS				\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"			\
 	"partition=nand0,0\0"					\
 	"ramargs=setenv bootargs $(bootargs) $(mtdparts)\0"	\
 	"nfsargs=setenv bootargs root=/dev/nfs rw "		\
diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index c6b106c64cbf..a0eed66b5ff1 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -184,8 +184,6 @@
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
 
 #define CONFIG_EXTRA_ENV_SETTINGS				\
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"				\
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"			\
 	"partition=nand0,0\0"					\
 	"ramargs=setenv bootargs $(bootargs) $(mtdparts)\0"	\
 	"nfsargs=setenv bootargs root=/dev/nfs rw "		\
diff --git a/include/configs/pogo_e02.h b/include/configs/pogo_e02.h
index cb221501e269..085732214e50 100644
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -19,9 +19,6 @@
  */
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)," \
-	"32M(rootfs),-(data)\0"\
-	"mtdids=nand0=orion_nand\0"\
 	"bootargs_console=console=ttyS0,115200\0" \
 	"bootcmd_usb=usb start; ext2load usb 0:1 0x00800000 /uImage; " \
 	"ext2load usb 0:1 0x01100000 /uInitrd\0"
diff --git a/include/configs/pogo_v4.h b/include/configs/pogo_v4.h
index 24cbf6b72ea7..7fff78b7b5d6 100644
--- a/include/configs/pogo_v4.h
+++ b/include/configs/pogo_v4.h
@@ -26,8 +26,6 @@
  */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"dtb_file=/boot/dts/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"\
-	"mtdids=nand0=orion_nand\0"\
 	"bootargs_console=console=ttyS0,115200\0" \
 	"bootcmd_usb=usb start; load usb 0:1 0x00800000 /boot/uImage; " \
 	"load usb 0:1 0x01100000 /boot/uInitrd; " \
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h
index 3b94b17ff788..ab4fe6b46024 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -75,7 +75,6 @@
 	"verify=n\0" \
 	"rootfstype=ext4\0" \
 	"console=console=ttySAC1,115200n8\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT \
 	"mbrparts=" MBRPARTS_DEFAULT \
 	"meminfo=crashkernel=32M@0x50000000\0" \
 	"nfsroot=/nfsroot/arm\0" \
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index b86b05b3193a..215c31bca410 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -92,7 +92,6 @@
 									\
 	"basicargs=console=ttyS0,115200\0"				\
 									\
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT"\0"
 
 /*
  * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
index 9a9f3fedff18..a7b0ce9f975a 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -69,7 +69,6 @@
 		" console=ttySAC0,115200n8 mem=128M" \
 		" initrd=0x33000000,8M ramdisk=8192\0" \
 	"rootfstype=cramfs\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"meminfo=mem=128M\0" \
 	"nfsroot=/nfsroot/arm\0" \
 	"bootblock=5\0" \
diff --git a/include/configs/socfpga_arria5_secu1.h b/include/configs/socfpga_arria5_secu1.h
index 3a77c71874d9..2d654b42d56b 100644
--- a/include/configs/socfpga_arria5_secu1.h
+++ b/include/configs/socfpga_arria5_secu1.h
@@ -66,8 +66,6 @@
 	"fdt_addr=" __stringify(CONFIG_KM_FDT_ADDR) "\0" \
 	"load=tftpboot ${loadaddr} u-boot-with-nand-spl.sfp\0" \
 	"loadaddr=" __stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"update=nand erase 0x0 0x00100000 && nand write ${loadaddr} 0x0 ${filesize}\0" \
 	"userload=ubi part nand.ubi &&" \
 		"ubi check rootfs$bootnum &&" \
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 1f77b7b2dfde..d52552c5fe76 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -317,20 +317,6 @@
 	"stderr=serial\0"
 #endif
 
-#ifdef CONFIG_MTDIDS_DEFAULT
-#define SUNXI_MTDIDS_DEFAULT \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"
-#else
-#define SUNXI_MTDIDS_DEFAULT
-#endif
-
-#ifdef CONFIG_MTDPARTS_DEFAULT
-#define SUNXI_MTDPARTS_DEFAULT \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
-#else
-#define SUNXI_MTDPARTS_DEFAULT
-#endif
-
 #define PARTS_DEFAULT \
 	"name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};" \
 	"name=loader2,size=984k,uuid=${uuid_gpt_loader2};" \
@@ -362,8 +348,6 @@
 	DFU_ALT_INFO_RAM \
 	"fdtfile=" FDTFILE "\0" \
 	"console=ttyS0,115200\0" \
-	SUNXI_MTDIDS_DEFAULT \
-	SUNXI_MTDPARTS_DEFAULT \
 	"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
 	"uuid_gpt_system=" UUID_GPT_SYSTEM "\0" \
 	"partitions=" PARTS_DEFAULT "\0" \
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index fa5d91099e1a..1aca83a9bceb 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -13,9 +13,7 @@
 #include <asm/arch/omap.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS	\
-	DEFAULT_LINUX_BOOT_ENV \
-	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+	DEFAULT_LINUX_BOOT_ENV
 
 /* Clock Defines */
 #define V_OSCK          24000000    /* Clock output from T2 */
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
index 6952cc637199..bf76afaededc 100644
--- a/include/configs/ti_armv7_keystone2.h
+++ b/include/configs/ti_armv7_keystone2.h
@@ -184,9 +184,7 @@
 	"args_ramfs=setenv bootargs ${bootargs} "			\
 		"rdinit=/sbin/init rw root=/dev/ram0 "			\
 		"initrd=0x808080000,80M\0"				\
-	"no_post=1\0"							\
-	"mtdparts=mtdparts=davinci_nand.0:"				\
-		"1024k(bootloader)ro,512k(params)ro,-(ubifs)\0"
+	"no_post=1\0"
 
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
diff --git a/include/configs/usb_a9263.h b/include/configs/usb_a9263.h
index 32e8f6be0d1e..e432b04e9f5a 100644
--- a/include/configs/usb_a9263.h
+++ b/include/configs/usb_a9263.h
@@ -55,6 +55,5 @@
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 
 #endif
diff --git a/include/configs/vcoreiii.h b/include/configs/vcoreiii.h
index 88c3061db632..43127ae649a6 100644
--- a/include/configs/vcoreiii.h
+++ b/include/configs/vcoreiii.h
@@ -32,18 +32,9 @@
 #error Unknown DDR size - please add!
 #endif
 
-#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
-#define VCOREIII_DEFAULT_MTD_ENV		    \
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT"\0"	    \
-	"mtdids="CONFIG_MTDIDS_DEFAULT"\0"
-#else
-#define VCOREIII_DEFAULT_MTD_ENV    /* Go away */
-#endif
-
 #define CONFIG_SYS_BOOTM_LEN      (16 << 20)      /* Increase max gunzip size */
 
 #define CONFIG_EXTRA_ENV_SETTINGS					\
-	VCOREIII_DEFAULT_MTD_ENV					\
 	"loadaddr=0x81000000\0"						\
 	"spi_image_off=0x00100000\0"					\
 	"console=ttyS0,115200\0"					\
diff --git a/include/env_default.h b/include/env_default.h
index d1508b3ff44e..4e461c815a79 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -108,6 +108,12 @@ const char default_environment[] = {
 #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
 	"bootlimit="	__stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
 #endif
+#ifdef CONFIG_MTDIDS_DEFAULT
+	 "mtdids="	CONFIG_MTDIDS_DEFAULT		"\0"
+#endif
+#ifdef CONFIG_MTDPARTS_DEFAULT
+	"mtdparts="	CONFIG_MTDPARTS_DEFAULT		"\0"
+#endif
 #ifdef CONFIG_EXTRA_ENV_TEXT
 	/* This is created in the Makefile */
 	CONFIG_EXTRA_ENV_TEXT
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
                   ` (5 preceding siblings ...)
  2022-06-14  2:57 ` [PATCH 7/8] Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment Tom Rini
@ 2022-06-14  2:57 ` Tom Rini
  2022-06-14 16:14   ` Tim Harvey
  2022-06-29 14:11 ` [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
  7 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2022-06-14  2:57 UTC (permalink / raw)
  To: u-boot; +Cc: Tim Harvey

Move the environment text over from being set via
CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
single environment file now.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
 include/configs/gw_ventana.h              | 148 ----------------------
 2 files changed, 145 insertions(+), 148 deletions(-)
 create mode 100644 board/gateworks/gw_ventana/gw_ventana.env

diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
new file mode 100644
index 000000000000..9a316c74f215
--- /dev/null
+++ b/board/gateworks/gw_ventana/gw_ventana.env
@@ -0,0 +1,145 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2013 Gateworks Corporation
+ */
+
+splashpos=m,m
+splashimage=CONFIG_SYS_LOAD_ADDR
+usb_pgood_delay=2000
+console=ttymxc1
+bootdevs=usb mmc sata flash
+hwconfig=_UNKNOWN_
+
+disk=0
+part=1
+
+fdt_high=0xffffffff
+fdt_addr=0x18000000
+initrd_high=0xffffffff
+fixfdt=fdt addr ${fdt_addr}
+bootdir=boot
+loadfdt=
+	if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
+		echo Loaded DTB from ${bootdir}/${fdt_file};
+		run fixfdt;
+	elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
+		echo Loaded DTB from ${bootdir}/${fdt_file1};
+		run fixfdt;
+	elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
+		echo Loaded DTB from ${bootdir}/${fdt_file2};
+		run fixfdt;
+	fi
+
+fs=ext4
+script=6x_bootscript-ventana
+loadscript=
+	if ${fsload} ${loadaddr} ${bootdir}/${script}; then
+		source ${loadaddr};
+	fi
+
+uimage=uImage
+mmc_root=mmcblk0p1
+mmc_boot=
+	setenv fsload "${fs}load mmc ${disk}:${part}";
+	mmc dev ${disk} && mmc rescan &&
+	setenv dtype mmc; run loadscript;
+	if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
+		setenv bootargs console=${console},${baudrate}
+			root=/dev/${mmc_root} rootfstype=${fs}
+			rootwait rw ${video} ${extra};
+		if run loadfdt; then
+			bootm ${loadaddr} - ${fdt_addr};
+		else
+			bootm;
+		fi;
+	fi
+
+sata_boot=
+	setenv fsload "${fs}load sata ${disk}:${part}";
+	sata init &&
+	setenv dtype sata; run loadscript;
+	if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
+		setenv bootargs console=${console},${baudrate}
+			root=/dev/sda1 rootfstype=${fs}
+			rootwait rw ${video} ${extra};
+		if run loadfdt; then
+			bootm ${loadaddr} - ${fdt_addr};
+		else
+			bootm;
+		fi;
+	fi
+
+usb_boot=
+	setenv fsload "${fs}load usb ${disk}:${part}";
+	usb start && usb dev ${disk} &&
+	setenv dtype usb; run loadscript;
+	if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
+		setenv bootargs console=${console},${baudrate}
+			root=/dev/sda1 rootfstype=${fs}
+			rootwait rw ${video} ${extra};
+		if run loadfdt; then
+			bootm ${loadaddr} - ${fdt_addr};
+		else
+			bootm;
+		fi;
+	fi
+
+#ifdef CONFIG_SPI_FLASH
+image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
+image_uboot=ventana/u-boot_spi.imx
+
+spi_koffset=0x90000
+spi_klen=0x200000
+
+spi_updateuboot=echo Updating uboot from
+	${serverip}:${image_uboot}...;
+	tftpboot ${loadaddr} ${image_uboot} &&
+	sf probe && sf erase 0 80000 &&
+		sf write ${loadaddr} 400 ${filesize}
+spi_update=echo Updating OS from ${serverip}:${image_os}
+	to ${spi_koffset} ...;
+	tftp ${loadaddr} ${image_os} &&
+	sf probe &&
+	sf update ${loadaddr} ${spi_koffset} ${filesize}
+
+flash_boot=
+	if sf probe &&
+	sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
+		setenv bootargs console=${console},${baudrate}
+			root=/dev/mtdblock3
+			rootfstype=squashfs,jffs2
+			${video} ${extra};
+		bootm;
+	fi
+#else
+image_rootfs=openwrt-imx6-ventana-rootfs.ubi
+nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
+	tftp ${loadaddr} ${image_rootfs} &&
+	nand erase.part rootfs &&
+	nand write ${loadaddr} rootfs ${filesize}
+
+flash_boot=
+	setenv fsload 'ubifsload';
+	ubi part rootfs;
+	if ubi check boot; then
+		ubifsmount ubi0:boot;
+		setenv root ubi0:rootfs ubi.mtd=2
+			rootfstype=squashfs,ubifs;
+		setenv bootdir;
+	elif ubi check rootfs; then
+		ubifsmount ubi0:rootfs;
+		setenv root ubi0:rootfs ubi.mtd=2
+			rootfstype=ubifs;
+	fi;
+	setenv dtype nand; run loadscript;
+	if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
+		setenv bootargs console=${console},${baudrate}
+			root=${root} ${video} ${extra};
+		if run loadfdt; then
+			ubifsumount;
+			bootm ${loadaddr} - ${fdt_addr};
+		else
+			ubifsumount; bootm;
+		fi;
+	fi
+#endif
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 77f41502220a..47a72fc8fce5 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -76,152 +76,4 @@
 #define CONFIG_IPADDR             192.168.1.1
 #define CONFIG_SERVERIP           192.168.1.146
 
-#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
-	"splashpos=m,m\0" \
-	"splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"usb_pgood_delay=2000\0" \
-	"console=ttymxc1\0" \
-	"bootdevs=usb mmc sata flash\0" \
-	"hwconfig=_UNKNOWN_\0" \
-	"video=\0" \
-	\
-	"disk=0\0" \
-	"part=1\0" \
-	\
-	"fdt_high=0xffffffff\0" \
-	"fdt_addr=0x18000000\0" \
-	"initrd_high=0xffffffff\0" \
-	"fixfdt=" \
-		"fdt addr ${fdt_addr}\0" \
-	"bootdir=boot\0" \
-	"loadfdt=" \
-		"if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
-			"echo Loaded DTB from ${bootdir}/${fdt_file}; " \
-			"run fixfdt; " \
-		"elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
-			"echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
-			"run fixfdt; " \
-		"elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
-			"echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
-			"run fixfdt; " \
-		"fi\0" \
-	\
-	"fs=ext4\0" \
-	"script=6x_bootscript-ventana\0" \
-	"loadscript=" \
-		"if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
-			"source ${loadaddr}; " \
-		"fi\0" \
-	\
-	"uimage=uImage\0" \
-	"mmc_root=mmcblk0p1\0" \
-	"mmc_boot=" \
-		"setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
-		"mmc dev ${disk} && mmc rescan && " \
-		"setenv dtype mmc; run loadscript; " \
-		"if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
-			"setenv bootargs console=${console},${baudrate} " \
-				"root=/dev/${mmc_root} rootfstype=${fs} " \
-				"rootwait rw ${video} ${extra}; " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"bootm; " \
-			"fi; " \
-		"fi\0" \
-	\
-	"sata_boot=" \
-		"setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
-		"sata init && " \
-		"setenv dtype sata; run loadscript; " \
-		"if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
-			"setenv bootargs console=${console},${baudrate} " \
-				"root=/dev/sda1 rootfstype=${fs} " \
-				"rootwait rw ${video} ${extra}; " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"bootm; " \
-			"fi; " \
-		"fi\0" \
-	"usb_boot=" \
-		"setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
-		"usb start && usb dev ${disk} && " \
-		"setenv dtype usb; run loadscript; " \
-		"if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
-			"setenv bootargs console=${console},${baudrate} " \
-				"root=/dev/sda1 rootfstype=${fs} " \
-				"rootwait rw ${video} ${extra}; " \
-			"if run loadfdt; then " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"bootm; " \
-			"fi; " \
-		"fi\0"
-
-#ifdef CONFIG_SPI_FLASH
-	#define CONFIG_EXTRA_ENV_SETTINGS \
-	CONFIG_EXTRA_ENV_SETTINGS_COMMON \
-	"image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
-	"image_uboot=ventana/u-boot_spi.imx\0" \
-	\
-	"spi_koffset=0x90000\0" \
-	"spi_klen=0x200000\0" \
-	\
-	"spi_updateuboot=echo Updating uboot from " \
-		"${serverip}:${image_uboot}...; " \
-		"tftpboot ${loadaddr} ${image_uboot} && " \
-		"sf probe && sf erase 0 80000 && " \
-			"sf write ${loadaddr} 400 ${filesize}\0" \
-	"spi_update=echo Updating OS from ${serverip}:${image_os} " \
-		"to ${spi_koffset} ...; " \
-		"tftp ${loadaddr} ${image_os} && " \
-		"sf probe && " \
-		"sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
-	\
-	"flash_boot=" \
-		"if sf probe && " \
-		"sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
-			"setenv bootargs console=${console},${baudrate} " \
-				"root=/dev/mtdblock3 " \
-				"rootfstype=squashfs,jffs2 " \
-				"${video} ${extra}; " \
-			"bootm; " \
-		"fi\0"
-#else
-	#define CONFIG_EXTRA_ENV_SETTINGS \
-	CONFIG_EXTRA_ENV_SETTINGS_COMMON \
-	\
-	"image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
-	"nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
-		"tftp ${loadaddr} ${image_rootfs} && " \
-		"nand erase.part rootfs && " \
-		"nand write ${loadaddr} rootfs ${filesize}\0" \
-	\
-	"flash_boot=" \
-		"setenv fsload 'ubifsload'; " \
-		"ubi part rootfs; " \
-		"if ubi check boot; then " \
-			"ubifsmount ubi0:boot; " \
-			"setenv root ubi0:rootfs ubi.mtd=2 " \
-				"rootfstype=squashfs,ubifs; " \
-			"setenv bootdir; " \
-		"elif ubi check rootfs; then " \
-			"ubifsmount ubi0:rootfs; " \
-			"setenv root ubi0:rootfs ubi.mtd=2 " \
-				"rootfstype=ubifs; " \
-		"fi; " \
-		"setenv dtype nand; run loadscript; " \
-		"if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
-			"setenv bootargs console=${console},${baudrate} " \
-				"root=${root} ${video} ${extra}; " \
-			"if run loadfdt; then " \
-				"ubifsumount; " \
-				"bootm ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"ubifsumount; bootm; " \
-			"fi; " \
-		"fi\0"
-#endif
-
 #endif			       /* __CONFIG_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14  2:57 ` [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
@ 2022-06-14 16:14   ` Tim Harvey
  2022-06-14 16:18     ` Tom Rini
  0 siblings, 1 reply; 14+ messages in thread
From: Tim Harvey @ 2022-06-14 16:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

On Mon, Jun 13, 2022 at 7:57 PM Tom Rini <trini@konsulko.com> wrote:
>
> Move the environment text over from being set via
> CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
> to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
> us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
> single environment file now.
>
> Cc: Tim Harvey <tharvey@gateworks.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
>  include/configs/gw_ventana.h              | 148 ----------------------
>  2 files changed, 145 insertions(+), 148 deletions(-)
>  create mode 100644 board/gateworks/gw_ventana/gw_ventana.env
>
> diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
> new file mode 100644
> index 000000000000..9a316c74f215
> --- /dev/null
> +++ b/board/gateworks/gw_ventana/gw_ventana.env
> @@ -0,0 +1,145 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Copyright (C) 2013 Gateworks Corporation
> + */
> +
> +splashpos=m,m
> +splashimage=CONFIG_SYS_LOAD_ADDR
> +usb_pgood_delay=2000
> +console=ttymxc1
> +bootdevs=usb mmc sata flash
> +hwconfig=_UNKNOWN_
> +
> +disk=0
> +part=1
> +
> +fdt_high=0xffffffff
> +fdt_addr=0x18000000
> +initrd_high=0xffffffff
> +fixfdt=fdt addr ${fdt_addr}
> +bootdir=boot
> +loadfdt=
> +       if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
> +               echo Loaded DTB from ${bootdir}/${fdt_file};
> +               run fixfdt;
> +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
> +               echo Loaded DTB from ${bootdir}/${fdt_file1};
> +               run fixfdt;
> +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
> +               echo Loaded DTB from ${bootdir}/${fdt_file2};
> +               run fixfdt;
> +       fi
> +
> +fs=ext4
> +script=6x_bootscript-ventana
> +loadscript=
> +       if ${fsload} ${loadaddr} ${bootdir}/${script}; then
> +               source ${loadaddr};
> +       fi
> +
> +uimage=uImage
> +mmc_root=mmcblk0p1
> +mmc_boot=
> +       setenv fsload "${fs}load mmc ${disk}:${part}";
> +       mmc dev ${disk} && mmc rescan &&
> +       setenv dtype mmc; run loadscript;
> +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> +               setenv bootargs console=${console},${baudrate}
> +                       root=/dev/${mmc_root} rootfstype=${fs}
> +                       rootwait rw ${video} ${extra};
> +               if run loadfdt; then
> +                       bootm ${loadaddr} - ${fdt_addr};
> +               else
> +                       bootm;
> +               fi;
> +       fi
> +
> +sata_boot=
> +       setenv fsload "${fs}load sata ${disk}:${part}";
> +       sata init &&
> +       setenv dtype sata; run loadscript;
> +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> +               setenv bootargs console=${console},${baudrate}
> +                       root=/dev/sda1 rootfstype=${fs}
> +                       rootwait rw ${video} ${extra};
> +               if run loadfdt; then
> +                       bootm ${loadaddr} - ${fdt_addr};
> +               else
> +                       bootm;
> +               fi;
> +       fi
> +
> +usb_boot=
> +       setenv fsload "${fs}load usb ${disk}:${part}";
> +       usb start && usb dev ${disk} &&
> +       setenv dtype usb; run loadscript;
> +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> +               setenv bootargs console=${console},${baudrate}
> +                       root=/dev/sda1 rootfstype=${fs}
> +                       rootwait rw ${video} ${extra};
> +               if run loadfdt; then
> +                       bootm ${loadaddr} - ${fdt_addr};
> +               else
> +                       bootm;
> +               fi;
> +       fi
> +
> +#ifdef CONFIG_SPI_FLASH
> +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
> +image_uboot=ventana/u-boot_spi.imx
> +
> +spi_koffset=0x90000
> +spi_klen=0x200000
> +
> +spi_updateuboot=echo Updating uboot from
> +       ${serverip}:${image_uboot}...;
> +       tftpboot ${loadaddr} ${image_uboot} &&
> +       sf probe && sf erase 0 80000 &&
> +               sf write ${loadaddr} 400 ${filesize}
> +spi_update=echo Updating OS from ${serverip}:${image_os}
> +       to ${spi_koffset} ...;
> +       tftp ${loadaddr} ${image_os} &&
> +       sf probe &&
> +       sf update ${loadaddr} ${spi_koffset} ${filesize}
> +
> +flash_boot=
> +       if sf probe &&
> +       sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
> +               setenv bootargs console=${console},${baudrate}
> +                       root=/dev/mtdblock3
> +                       rootfstype=squashfs,jffs2
> +                       ${video} ${extra};
> +               bootm;
> +       fi
> +#else
> +image_rootfs=openwrt-imx6-ventana-rootfs.ubi
> +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
> +       tftp ${loadaddr} ${image_rootfs} &&
> +       nand erase.part rootfs &&
> +       nand write ${loadaddr} rootfs ${filesize}
> +
> +flash_boot=
> +       setenv fsload 'ubifsload';
> +       ubi part rootfs;
> +       if ubi check boot; then
> +               ubifsmount ubi0:boot;
> +               setenv root ubi0:rootfs ubi.mtd=2
> +                       rootfstype=squashfs,ubifs;
> +               setenv bootdir;
> +       elif ubi check rootfs; then
> +               ubifsmount ubi0:rootfs;
> +               setenv root ubi0:rootfs ubi.mtd=2
> +                       rootfstype=ubifs;
> +       fi;
> +       setenv dtype nand; run loadscript;
> +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> +               setenv bootargs console=${console},${baudrate}
> +                       root=${root} ${video} ${extra};
> +               if run loadfdt; then
> +                       ubifsumount;
> +                       bootm ${loadaddr} - ${fdt_addr};
> +               else
> +                       ubifsumount; bootm;
> +               fi;
> +       fi
> +#endif
> diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
> index 77f41502220a..47a72fc8fce5 100644
> --- a/include/configs/gw_ventana.h
> +++ b/include/configs/gw_ventana.h
> @@ -76,152 +76,4 @@
>  #define CONFIG_IPADDR             192.168.1.1
>  #define CONFIG_SERVERIP           192.168.1.146
>
> -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> -       "splashpos=m,m\0" \
> -       "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> -       "usb_pgood_delay=2000\0" \
> -       "console=ttymxc1\0" \
> -       "bootdevs=usb mmc sata flash\0" \
> -       "hwconfig=_UNKNOWN_\0" \
> -       "video=\0" \
> -       \
> -       "disk=0\0" \
> -       "part=1\0" \
> -       \
> -       "fdt_high=0xffffffff\0" \
> -       "fdt_addr=0x18000000\0" \
> -       "initrd_high=0xffffffff\0" \
> -       "fixfdt=" \
> -               "fdt addr ${fdt_addr}\0" \
> -       "bootdir=boot\0" \
> -       "loadfdt=" \
> -               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
> -                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
> -                       "run fixfdt; " \
> -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
> -                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
> -                       "run fixfdt; " \
> -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
> -                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
> -                       "run fixfdt; " \
> -               "fi\0" \
> -       \
> -       "fs=ext4\0" \
> -       "script=6x_bootscript-ventana\0" \
> -       "loadscript=" \
> -               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
> -                       "source ${loadaddr}; " \
> -               "fi\0" \
> -       \
> -       "uimage=uImage\0" \
> -       "mmc_root=mmcblk0p1\0" \
> -       "mmc_boot=" \
> -               "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
> -               "mmc dev ${disk} && mmc rescan && " \
> -               "setenv dtype mmc; run loadscript; " \
> -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> -                       "setenv bootargs console=${console},${baudrate} " \
> -                               "root=/dev/${mmc_root} rootfstype=${fs} " \
> -                               "rootwait rw ${video} ${extra}; " \
> -                       "if run loadfdt; then " \
> -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "bootm; " \
> -                       "fi; " \
> -               "fi\0" \
> -       \
> -       "sata_boot=" \
> -               "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
> -               "sata init && " \
> -               "setenv dtype sata; run loadscript; " \
> -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> -                       "setenv bootargs console=${console},${baudrate} " \
> -                               "root=/dev/sda1 rootfstype=${fs} " \
> -                               "rootwait rw ${video} ${extra}; " \
> -                       "if run loadfdt; then " \
> -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "bootm; " \
> -                       "fi; " \
> -               "fi\0" \
> -       "usb_boot=" \
> -               "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
> -               "usb start && usb dev ${disk} && " \
> -               "setenv dtype usb; run loadscript; " \
> -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> -                       "setenv bootargs console=${console},${baudrate} " \
> -                               "root=/dev/sda1 rootfstype=${fs} " \
> -                               "rootwait rw ${video} ${extra}; " \
> -                       "if run loadfdt; then " \
> -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "bootm; " \
> -                       "fi; " \
> -               "fi\0"
> -
> -#ifdef CONFIG_SPI_FLASH
> -       #define CONFIG_EXTRA_ENV_SETTINGS \
> -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> -       "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
> -       "image_uboot=ventana/u-boot_spi.imx\0" \
> -       \
> -       "spi_koffset=0x90000\0" \
> -       "spi_klen=0x200000\0" \
> -       \
> -       "spi_updateuboot=echo Updating uboot from " \
> -               "${serverip}:${image_uboot}...; " \
> -               "tftpboot ${loadaddr} ${image_uboot} && " \
> -               "sf probe && sf erase 0 80000 && " \
> -                       "sf write ${loadaddr} 400 ${filesize}\0" \
> -       "spi_update=echo Updating OS from ${serverip}:${image_os} " \
> -               "to ${spi_koffset} ...; " \
> -               "tftp ${loadaddr} ${image_os} && " \
> -               "sf probe && " \
> -               "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
> -       \
> -       "flash_boot=" \
> -               "if sf probe && " \
> -               "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
> -                       "setenv bootargs console=${console},${baudrate} " \
> -                               "root=/dev/mtdblock3 " \
> -                               "rootfstype=squashfs,jffs2 " \
> -                               "${video} ${extra}; " \
> -                       "bootm; " \
> -               "fi\0"
> -#else
> -       #define CONFIG_EXTRA_ENV_SETTINGS \
> -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> -       \
> -       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
> -       "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
> -               "tftp ${loadaddr} ${image_rootfs} && " \
> -               "nand erase.part rootfs && " \
> -               "nand write ${loadaddr} rootfs ${filesize}\0" \
> -       \
> -       "flash_boot=" \
> -               "setenv fsload 'ubifsload'; " \
> -               "ubi part rootfs; " \
> -               "if ubi check boot; then " \
> -                       "ubifsmount ubi0:boot; " \
> -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> -                               "rootfstype=squashfs,ubifs; " \
> -                       "setenv bootdir; " \
> -               "elif ubi check rootfs; then " \
> -                       "ubifsmount ubi0:rootfs; " \
> -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> -                               "rootfstype=ubifs; " \
> -               "fi; " \
> -               "setenv dtype nand; run loadscript; " \
> -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> -                       "setenv bootargs console=${console},${baudrate} " \
> -                               "root=${root} ${video} ${extra}; " \
> -                       "if run loadfdt; then " \
> -                               "ubifsumount; " \
> -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> -                       "else " \
> -                               "ubifsumount; bootm; " \
> -                       "fi; " \
> -               "fi\0"
> -#endif
> -
>  #endif                        /* __CONFIG_H */
> --
> 2.25.1
>

Tom,

Thanks, I've been looking forward to seeing how env is going to get
migrated out of headers. Can you explain the process used to create
this patch? It seems you may have something automated.

Acked-by: Tim Harvey <tharvey@gateworks.com>

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14 16:14   ` Tim Harvey
@ 2022-06-14 16:18     ` Tom Rini
  2022-06-14 16:58       ` Tim Harvey
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2022-06-14 16:18 UTC (permalink / raw)
  To: Tim Harvey; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 15318 bytes --]

On Tue, Jun 14, 2022 at 09:14:03AM -0700, Tim Harvey wrote:
> On Mon, Jun 13, 2022 at 7:57 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > Move the environment text over from being set via
> > CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
> > to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
> > us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
> > single environment file now.
> >
> > Cc: Tim Harvey <tharvey@gateworks.com>
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
> >  include/configs/gw_ventana.h              | 148 ----------------------
> >  2 files changed, 145 insertions(+), 148 deletions(-)
> >  create mode 100644 board/gateworks/gw_ventana/gw_ventana.env
> >
> > diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
> > new file mode 100644
> > index 000000000000..9a316c74f215
> > --- /dev/null
> > +++ b/board/gateworks/gw_ventana/gw_ventana.env
> > @@ -0,0 +1,145 @@
> > +/* SPDX-License-Identifier: GPL-2.0+ */
> > +/*
> > + * Copyright (C) 2013 Gateworks Corporation
> > + */
> > +
> > +splashpos=m,m
> > +splashimage=CONFIG_SYS_LOAD_ADDR
> > +usb_pgood_delay=2000
> > +console=ttymxc1
> > +bootdevs=usb mmc sata flash
> > +hwconfig=_UNKNOWN_
> > +
> > +disk=0
> > +part=1
> > +
> > +fdt_high=0xffffffff
> > +fdt_addr=0x18000000
> > +initrd_high=0xffffffff
> > +fixfdt=fdt addr ${fdt_addr}
> > +bootdir=boot
> > +loadfdt=
> > +       if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
> > +               echo Loaded DTB from ${bootdir}/${fdt_file};
> > +               run fixfdt;
> > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
> > +               echo Loaded DTB from ${bootdir}/${fdt_file1};
> > +               run fixfdt;
> > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
> > +               echo Loaded DTB from ${bootdir}/${fdt_file2};
> > +               run fixfdt;
> > +       fi
> > +
> > +fs=ext4
> > +script=6x_bootscript-ventana
> > +loadscript=
> > +       if ${fsload} ${loadaddr} ${bootdir}/${script}; then
> > +               source ${loadaddr};
> > +       fi
> > +
> > +uimage=uImage
> > +mmc_root=mmcblk0p1
> > +mmc_boot=
> > +       setenv fsload "${fs}load mmc ${disk}:${part}";
> > +       mmc dev ${disk} && mmc rescan &&
> > +       setenv dtype mmc; run loadscript;
> > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > +               setenv bootargs console=${console},${baudrate}
> > +                       root=/dev/${mmc_root} rootfstype=${fs}
> > +                       rootwait rw ${video} ${extra};
> > +               if run loadfdt; then
> > +                       bootm ${loadaddr} - ${fdt_addr};
> > +               else
> > +                       bootm;
> > +               fi;
> > +       fi
> > +
> > +sata_boot=
> > +       setenv fsload "${fs}load sata ${disk}:${part}";
> > +       sata init &&
> > +       setenv dtype sata; run loadscript;
> > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > +               setenv bootargs console=${console},${baudrate}
> > +                       root=/dev/sda1 rootfstype=${fs}
> > +                       rootwait rw ${video} ${extra};
> > +               if run loadfdt; then
> > +                       bootm ${loadaddr} - ${fdt_addr};
> > +               else
> > +                       bootm;
> > +               fi;
> > +       fi
> > +
> > +usb_boot=
> > +       setenv fsload "${fs}load usb ${disk}:${part}";
> > +       usb start && usb dev ${disk} &&
> > +       setenv dtype usb; run loadscript;
> > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > +               setenv bootargs console=${console},${baudrate}
> > +                       root=/dev/sda1 rootfstype=${fs}
> > +                       rootwait rw ${video} ${extra};
> > +               if run loadfdt; then
> > +                       bootm ${loadaddr} - ${fdt_addr};
> > +               else
> > +                       bootm;
> > +               fi;
> > +       fi
> > +
> > +#ifdef CONFIG_SPI_FLASH
> > +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
> > +image_uboot=ventana/u-boot_spi.imx
> > +
> > +spi_koffset=0x90000
> > +spi_klen=0x200000
> > +
> > +spi_updateuboot=echo Updating uboot from
> > +       ${serverip}:${image_uboot}...;
> > +       tftpboot ${loadaddr} ${image_uboot} &&
> > +       sf probe && sf erase 0 80000 &&
> > +               sf write ${loadaddr} 400 ${filesize}
> > +spi_update=echo Updating OS from ${serverip}:${image_os}
> > +       to ${spi_koffset} ...;
> > +       tftp ${loadaddr} ${image_os} &&
> > +       sf probe &&
> > +       sf update ${loadaddr} ${spi_koffset} ${filesize}
> > +
> > +flash_boot=
> > +       if sf probe &&
> > +       sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
> > +               setenv bootargs console=${console},${baudrate}
> > +                       root=/dev/mtdblock3
> > +                       rootfstype=squashfs,jffs2
> > +                       ${video} ${extra};
> > +               bootm;
> > +       fi
> > +#else
> > +image_rootfs=openwrt-imx6-ventana-rootfs.ubi
> > +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
> > +       tftp ${loadaddr} ${image_rootfs} &&
> > +       nand erase.part rootfs &&
> > +       nand write ${loadaddr} rootfs ${filesize}
> > +
> > +flash_boot=
> > +       setenv fsload 'ubifsload';
> > +       ubi part rootfs;
> > +       if ubi check boot; then
> > +               ubifsmount ubi0:boot;
> > +               setenv root ubi0:rootfs ubi.mtd=2
> > +                       rootfstype=squashfs,ubifs;
> > +               setenv bootdir;
> > +       elif ubi check rootfs; then
> > +               ubifsmount ubi0:rootfs;
> > +               setenv root ubi0:rootfs ubi.mtd=2
> > +                       rootfstype=ubifs;
> > +       fi;
> > +       setenv dtype nand; run loadscript;
> > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > +               setenv bootargs console=${console},${baudrate}
> > +                       root=${root} ${video} ${extra};
> > +               if run loadfdt; then
> > +                       ubifsumount;
> > +                       bootm ${loadaddr} - ${fdt_addr};
> > +               else
> > +                       ubifsumount; bootm;
> > +               fi;
> > +       fi
> > +#endif
> > diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
> > index 77f41502220a..47a72fc8fce5 100644
> > --- a/include/configs/gw_ventana.h
> > +++ b/include/configs/gw_ventana.h
> > @@ -76,152 +76,4 @@
> >  #define CONFIG_IPADDR             192.168.1.1
> >  #define CONFIG_SERVERIP           192.168.1.146
> >
> > -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > -       "splashpos=m,m\0" \
> > -       "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> > -       "usb_pgood_delay=2000\0" \
> > -       "console=ttymxc1\0" \
> > -       "bootdevs=usb mmc sata flash\0" \
> > -       "hwconfig=_UNKNOWN_\0" \
> > -       "video=\0" \
> > -       \
> > -       "disk=0\0" \
> > -       "part=1\0" \
> > -       \
> > -       "fdt_high=0xffffffff\0" \
> > -       "fdt_addr=0x18000000\0" \
> > -       "initrd_high=0xffffffff\0" \
> > -       "fixfdt=" \
> > -               "fdt addr ${fdt_addr}\0" \
> > -       "bootdir=boot\0" \
> > -       "loadfdt=" \
> > -               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
> > -                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
> > -                       "run fixfdt; " \
> > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
> > -                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
> > -                       "run fixfdt; " \
> > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
> > -                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
> > -                       "run fixfdt; " \
> > -               "fi\0" \
> > -       \
> > -       "fs=ext4\0" \
> > -       "script=6x_bootscript-ventana\0" \
> > -       "loadscript=" \
> > -               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
> > -                       "source ${loadaddr}; " \
> > -               "fi\0" \
> > -       \
> > -       "uimage=uImage\0" \
> > -       "mmc_root=mmcblk0p1\0" \
> > -       "mmc_boot=" \
> > -               "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
> > -               "mmc dev ${disk} && mmc rescan && " \
> > -               "setenv dtype mmc; run loadscript; " \
> > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > -                       "setenv bootargs console=${console},${baudrate} " \
> > -                               "root=/dev/${mmc_root} rootfstype=${fs} " \
> > -                               "rootwait rw ${video} ${extra}; " \
> > -                       "if run loadfdt; then " \
> > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > -                       "else " \
> > -                               "bootm; " \
> > -                       "fi; " \
> > -               "fi\0" \
> > -       \
> > -       "sata_boot=" \
> > -               "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
> > -               "sata init && " \
> > -               "setenv dtype sata; run loadscript; " \
> > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > -                       "setenv bootargs console=${console},${baudrate} " \
> > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > -                               "rootwait rw ${video} ${extra}; " \
> > -                       "if run loadfdt; then " \
> > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > -                       "else " \
> > -                               "bootm; " \
> > -                       "fi; " \
> > -               "fi\0" \
> > -       "usb_boot=" \
> > -               "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
> > -               "usb start && usb dev ${disk} && " \
> > -               "setenv dtype usb; run loadscript; " \
> > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > -                       "setenv bootargs console=${console},${baudrate} " \
> > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > -                               "rootwait rw ${video} ${extra}; " \
> > -                       "if run loadfdt; then " \
> > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > -                       "else " \
> > -                               "bootm; " \
> > -                       "fi; " \
> > -               "fi\0"
> > -
> > -#ifdef CONFIG_SPI_FLASH
> > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > -       "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
> > -       "image_uboot=ventana/u-boot_spi.imx\0" \
> > -       \
> > -       "spi_koffset=0x90000\0" \
> > -       "spi_klen=0x200000\0" \
> > -       \
> > -       "spi_updateuboot=echo Updating uboot from " \
> > -               "${serverip}:${image_uboot}...; " \
> > -               "tftpboot ${loadaddr} ${image_uboot} && " \
> > -               "sf probe && sf erase 0 80000 && " \
> > -                       "sf write ${loadaddr} 400 ${filesize}\0" \
> > -       "spi_update=echo Updating OS from ${serverip}:${image_os} " \
> > -               "to ${spi_koffset} ...; " \
> > -               "tftp ${loadaddr} ${image_os} && " \
> > -               "sf probe && " \
> > -               "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
> > -       \
> > -       "flash_boot=" \
> > -               "if sf probe && " \
> > -               "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
> > -                       "setenv bootargs console=${console},${baudrate} " \
> > -                               "root=/dev/mtdblock3 " \
> > -                               "rootfstype=squashfs,jffs2 " \
> > -                               "${video} ${extra}; " \
> > -                       "bootm; " \
> > -               "fi\0"
> > -#else
> > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > -       \
> > -       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
> > -       "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
> > -               "tftp ${loadaddr} ${image_rootfs} && " \
> > -               "nand erase.part rootfs && " \
> > -               "nand write ${loadaddr} rootfs ${filesize}\0" \
> > -       \
> > -       "flash_boot=" \
> > -               "setenv fsload 'ubifsload'; " \
> > -               "ubi part rootfs; " \
> > -               "if ubi check boot; then " \
> > -                       "ubifsmount ubi0:boot; " \
> > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > -                               "rootfstype=squashfs,ubifs; " \
> > -                       "setenv bootdir; " \
> > -               "elif ubi check rootfs; then " \
> > -                       "ubifsmount ubi0:rootfs; " \
> > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > -                               "rootfstype=ubifs; " \
> > -               "fi; " \
> > -               "setenv dtype nand; run loadscript; " \
> > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > -                       "setenv bootargs console=${console},${baudrate} " \
> > -                               "root=${root} ${video} ${extra}; " \
> > -                       "if run loadfdt; then " \
> > -                               "ubifsumount; " \
> > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > -                       "else " \
> > -                               "ubifsumount; bootm; " \
> > -                       "fi; " \
> > -               "fi\0"
> > -#endif
> > -
> >  #endif                        /* __CONFIG_H */
> > --
> > 2.25.1
> >
> 
> Tom,
> 
> Thanks, I've been looking forward to seeing how env is going to get
> migrated out of headers. Can you explain the process used to create
> this patch? It seems you may have something automated.
> 
> Acked-by: Tim Harvey <tharvey@gateworks.com>

So, I do not have anything automated, unfortunately.  In cases like this
where we don't use distro_bootcmd and also don't use defined blocks of
commands, it's a matter of applying a few regexs to remove quotes,
spaces and trailing \, then giving it a quick read to make sure it's
still right.  This last part is some of why it can't be automated as we
have cases of:
"some_bootargs=a=1 b=2" \
"c=3\0"
and since there's no indent on c=3, it would become "c=3" in the
environment rather than "some_bootargs" being set to "a=1 b=2 c=3".

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14 16:18     ` Tom Rini
@ 2022-06-14 16:58       ` Tim Harvey
  2022-06-16 16:51         ` Tim Harvey
  0 siblings, 1 reply; 14+ messages in thread
From: Tim Harvey @ 2022-06-14 16:58 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

On Tue, Jun 14, 2022 at 9:18 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Tue, Jun 14, 2022 at 09:14:03AM -0700, Tim Harvey wrote:
> > On Mon, Jun 13, 2022 at 7:57 PM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > Move the environment text over from being set via
> > > CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
> > > to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
> > > us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
> > > single environment file now.
> > >
> > > Cc: Tim Harvey <tharvey@gateworks.com>
> > > Signed-off-by: Tom Rini <trini@konsulko.com>
> > > ---
> > >  board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
> > >  include/configs/gw_ventana.h              | 148 ----------------------
> > >  2 files changed, 145 insertions(+), 148 deletions(-)
> > >  create mode 100644 board/gateworks/gw_ventana/gw_ventana.env
> > >
> > > diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
> > > new file mode 100644
> > > index 000000000000..9a316c74f215
> > > --- /dev/null
> > > +++ b/board/gateworks/gw_ventana/gw_ventana.env
> > > @@ -0,0 +1,145 @@
> > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > +/*
> > > + * Copyright (C) 2013 Gateworks Corporation
> > > + */
> > > +
> > > +splashpos=m,m
> > > +splashimage=CONFIG_SYS_LOAD_ADDR
> > > +usb_pgood_delay=2000
> > > +console=ttymxc1
> > > +bootdevs=usb mmc sata flash
> > > +hwconfig=_UNKNOWN_
> > > +
> > > +disk=0
> > > +part=1
> > > +
> > > +fdt_high=0xffffffff
> > > +fdt_addr=0x18000000
> > > +initrd_high=0xffffffff
> > > +fixfdt=fdt addr ${fdt_addr}
> > > +bootdir=boot
> > > +loadfdt=
> > > +       if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
> > > +               echo Loaded DTB from ${bootdir}/${fdt_file};
> > > +               run fixfdt;
> > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
> > > +               echo Loaded DTB from ${bootdir}/${fdt_file1};
> > > +               run fixfdt;
> > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
> > > +               echo Loaded DTB from ${bootdir}/${fdt_file2};
> > > +               run fixfdt;
> > > +       fi
> > > +
> > > +fs=ext4
> > > +script=6x_bootscript-ventana
> > > +loadscript=
> > > +       if ${fsload} ${loadaddr} ${bootdir}/${script}; then
> > > +               source ${loadaddr};
> > > +       fi
> > > +
> > > +uimage=uImage
> > > +mmc_root=mmcblk0p1
> > > +mmc_boot=
> > > +       setenv fsload "${fs}load mmc ${disk}:${part}";
> > > +       mmc dev ${disk} && mmc rescan &&
> > > +       setenv dtype mmc; run loadscript;
> > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > +               setenv bootargs console=${console},${baudrate}
> > > +                       root=/dev/${mmc_root} rootfstype=${fs}
> > > +                       rootwait rw ${video} ${extra};
> > > +               if run loadfdt; then
> > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > +               else
> > > +                       bootm;
> > > +               fi;
> > > +       fi
> > > +
> > > +sata_boot=
> > > +       setenv fsload "${fs}load sata ${disk}:${part}";
> > > +       sata init &&
> > > +       setenv dtype sata; run loadscript;
> > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > +               setenv bootargs console=${console},${baudrate}
> > > +                       root=/dev/sda1 rootfstype=${fs}
> > > +                       rootwait rw ${video} ${extra};
> > > +               if run loadfdt; then
> > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > +               else
> > > +                       bootm;
> > > +               fi;
> > > +       fi
> > > +
> > > +usb_boot=
> > > +       setenv fsload "${fs}load usb ${disk}:${part}";
> > > +       usb start && usb dev ${disk} &&
> > > +       setenv dtype usb; run loadscript;
> > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > +               setenv bootargs console=${console},${baudrate}
> > > +                       root=/dev/sda1 rootfstype=${fs}
> > > +                       rootwait rw ${video} ${extra};
> > > +               if run loadfdt; then
> > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > +               else
> > > +                       bootm;
> > > +               fi;
> > > +       fi
> > > +
> > > +#ifdef CONFIG_SPI_FLASH
> > > +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
> > > +image_uboot=ventana/u-boot_spi.imx
> > > +
> > > +spi_koffset=0x90000
> > > +spi_klen=0x200000
> > > +
> > > +spi_updateuboot=echo Updating uboot from
> > > +       ${serverip}:${image_uboot}...;
> > > +       tftpboot ${loadaddr} ${image_uboot} &&
> > > +       sf probe && sf erase 0 80000 &&
> > > +               sf write ${loadaddr} 400 ${filesize}
> > > +spi_update=echo Updating OS from ${serverip}:${image_os}
> > > +       to ${spi_koffset} ...;
> > > +       tftp ${loadaddr} ${image_os} &&
> > > +       sf probe &&
> > > +       sf update ${loadaddr} ${spi_koffset} ${filesize}
> > > +
> > > +flash_boot=
> > > +       if sf probe &&
> > > +       sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
> > > +               setenv bootargs console=${console},${baudrate}
> > > +                       root=/dev/mtdblock3
> > > +                       rootfstype=squashfs,jffs2
> > > +                       ${video} ${extra};
> > > +               bootm;
> > > +       fi
> > > +#else
> > > +image_rootfs=openwrt-imx6-ventana-rootfs.ubi
> > > +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
> > > +       tftp ${loadaddr} ${image_rootfs} &&
> > > +       nand erase.part rootfs &&
> > > +       nand write ${loadaddr} rootfs ${filesize}
> > > +
> > > +flash_boot=
> > > +       setenv fsload 'ubifsload';
> > > +       ubi part rootfs;
> > > +       if ubi check boot; then
> > > +               ubifsmount ubi0:boot;
> > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > +                       rootfstype=squashfs,ubifs;
> > > +               setenv bootdir;
> > > +       elif ubi check rootfs; then
> > > +               ubifsmount ubi0:rootfs;
> > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > +                       rootfstype=ubifs;
> > > +       fi;
> > > +       setenv dtype nand; run loadscript;
> > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > +               setenv bootargs console=${console},${baudrate}
> > > +                       root=${root} ${video} ${extra};
> > > +               if run loadfdt; then
> > > +                       ubifsumount;
> > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > +               else
> > > +                       ubifsumount; bootm;
> > > +               fi;
> > > +       fi
> > > +#endif
> > > diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
> > > index 77f41502220a..47a72fc8fce5 100644
> > > --- a/include/configs/gw_ventana.h
> > > +++ b/include/configs/gw_ventana.h
> > > @@ -76,152 +76,4 @@
> > >  #define CONFIG_IPADDR             192.168.1.1
> > >  #define CONFIG_SERVERIP           192.168.1.146
> > >
> > > -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > -       "splashpos=m,m\0" \
> > > -       "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> > > -       "usb_pgood_delay=2000\0" \
> > > -       "console=ttymxc1\0" \
> > > -       "bootdevs=usb mmc sata flash\0" \
> > > -       "hwconfig=_UNKNOWN_\0" \
> > > -       "video=\0" \
> > > -       \
> > > -       "disk=0\0" \
> > > -       "part=1\0" \
> > > -       \
> > > -       "fdt_high=0xffffffff\0" \
> > > -       "fdt_addr=0x18000000\0" \
> > > -       "initrd_high=0xffffffff\0" \
> > > -       "fixfdt=" \
> > > -               "fdt addr ${fdt_addr}\0" \
> > > -       "bootdir=boot\0" \
> > > -       "loadfdt=" \
> > > -               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
> > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
> > > -                       "run fixfdt; " \
> > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
> > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
> > > -                       "run fixfdt; " \
> > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
> > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
> > > -                       "run fixfdt; " \
> > > -               "fi\0" \
> > > -       \
> > > -       "fs=ext4\0" \
> > > -       "script=6x_bootscript-ventana\0" \
> > > -       "loadscript=" \
> > > -               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
> > > -                       "source ${loadaddr}; " \
> > > -               "fi\0" \
> > > -       \
> > > -       "uimage=uImage\0" \
> > > -       "mmc_root=mmcblk0p1\0" \
> > > -       "mmc_boot=" \
> > > -               "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
> > > -               "mmc dev ${disk} && mmc rescan && " \
> > > -               "setenv dtype mmc; run loadscript; " \
> > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > -                               "root=/dev/${mmc_root} rootfstype=${fs} " \
> > > -                               "rootwait rw ${video} ${extra}; " \
> > > -                       "if run loadfdt; then " \
> > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > -                       "else " \
> > > -                               "bootm; " \
> > > -                       "fi; " \
> > > -               "fi\0" \
> > > -       \
> > > -       "sata_boot=" \
> > > -               "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
> > > -               "sata init && " \
> > > -               "setenv dtype sata; run loadscript; " \
> > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > -                               "rootwait rw ${video} ${extra}; " \
> > > -                       "if run loadfdt; then " \
> > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > -                       "else " \
> > > -                               "bootm; " \
> > > -                       "fi; " \
> > > -               "fi\0" \
> > > -       "usb_boot=" \
> > > -               "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
> > > -               "usb start && usb dev ${disk} && " \
> > > -               "setenv dtype usb; run loadscript; " \
> > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > -                               "rootwait rw ${video} ${extra}; " \
> > > -                       "if run loadfdt; then " \
> > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > -                       "else " \
> > > -                               "bootm; " \
> > > -                       "fi; " \
> > > -               "fi\0"
> > > -
> > > -#ifdef CONFIG_SPI_FLASH
> > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > -       "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
> > > -       "image_uboot=ventana/u-boot_spi.imx\0" \
> > > -       \
> > > -       "spi_koffset=0x90000\0" \
> > > -       "spi_klen=0x200000\0" \
> > > -       \
> > > -       "spi_updateuboot=echo Updating uboot from " \
> > > -               "${serverip}:${image_uboot}...; " \
> > > -               "tftpboot ${loadaddr} ${image_uboot} && " \
> > > -               "sf probe && sf erase 0 80000 && " \
> > > -                       "sf write ${loadaddr} 400 ${filesize}\0" \
> > > -       "spi_update=echo Updating OS from ${serverip}:${image_os} " \
> > > -               "to ${spi_koffset} ...; " \
> > > -               "tftp ${loadaddr} ${image_os} && " \
> > > -               "sf probe && " \
> > > -               "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
> > > -       \
> > > -       "flash_boot=" \
> > > -               "if sf probe && " \
> > > -               "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
> > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > -                               "root=/dev/mtdblock3 " \
> > > -                               "rootfstype=squashfs,jffs2 " \
> > > -                               "${video} ${extra}; " \
> > > -                       "bootm; " \
> > > -               "fi\0"
> > > -#else
> > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > -       \
> > > -       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
> > > -       "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
> > > -               "tftp ${loadaddr} ${image_rootfs} && " \
> > > -               "nand erase.part rootfs && " \
> > > -               "nand write ${loadaddr} rootfs ${filesize}\0" \
> > > -       \
> > > -       "flash_boot=" \
> > > -               "setenv fsload 'ubifsload'; " \
> > > -               "ubi part rootfs; " \
> > > -               "if ubi check boot; then " \
> > > -                       "ubifsmount ubi0:boot; " \
> > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > -                               "rootfstype=squashfs,ubifs; " \
> > > -                       "setenv bootdir; " \
> > > -               "elif ubi check rootfs; then " \
> > > -                       "ubifsmount ubi0:rootfs; " \
> > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > -                               "rootfstype=ubifs; " \
> > > -               "fi; " \
> > > -               "setenv dtype nand; run loadscript; " \
> > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > -                               "root=${root} ${video} ${extra}; " \
> > > -                       "if run loadfdt; then " \
> > > -                               "ubifsumount; " \
> > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > -                       "else " \
> > > -                               "ubifsumount; bootm; " \
> > > -                       "fi; " \
> > > -               "fi\0"
> > > -#endif
> > > -
> > >  #endif                        /* __CONFIG_H */
> > > --
> > > 2.25.1
> > >
> >
> > Tom,
> >
> > Thanks, I've been looking forward to seeing how env is going to get
> > migrated out of headers. Can you explain the process used to create
> > this patch? It seems you may have something automated.
> >
> > Acked-by: Tim Harvey <tharvey@gateworks.com>
>
> So, I do not have anything automated, unfortunately.  In cases like this
> where we don't use distro_bootcmd and also don't use defined blocks of
> commands, it's a matter of applying a few regexs to remove quotes,
> spaces and trailing \, then giving it a quick read to make sure it's
> still right.  This last part is some of why it can't be automated as we
> have cases of:
> "some_bootargs=a=1 b=2" \
> "c=3\0"
> and since there's no indent on c=3, it would become "c=3" in the
> environment rather than "some_bootargs" being set to "a=1 b=2 c=3".
>

Tom,

I see - Its good to see this as an example and thanks for the cleanup!

Tim

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-14 16:58       ` Tim Harvey
@ 2022-06-16 16:51         ` Tim Harvey
  2022-06-16 17:04           ` Tom Rini
  0 siblings, 1 reply; 14+ messages in thread
From: Tim Harvey @ 2022-06-16 16:51 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

On Tue, Jun 14, 2022 at 9:58 AM Tim Harvey <tharvey@gateworks.com> wrote:
>
> On Tue, Jun 14, 2022 at 9:18 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Tue, Jun 14, 2022 at 09:14:03AM -0700, Tim Harvey wrote:
> > > On Mon, Jun 13, 2022 at 7:57 PM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > Move the environment text over from being set via
> > > > CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
> > > > to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
> > > > us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
> > > > single environment file now.
> > > >
> > > > Cc: Tim Harvey <tharvey@gateworks.com>
> > > > Signed-off-by: Tom Rini <trini@konsulko.com>
> > > > ---
> > > >  board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
> > > >  include/configs/gw_ventana.h              | 148 ----------------------
> > > >  2 files changed, 145 insertions(+), 148 deletions(-)
> > > >  create mode 100644 board/gateworks/gw_ventana/gw_ventana.env
> > > >
> > > > diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
> > > > new file mode 100644
> > > > index 000000000000..9a316c74f215
> > > > --- /dev/null
> > > > +++ b/board/gateworks/gw_ventana/gw_ventana.env
> > > > @@ -0,0 +1,145 @@
> > > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > > +/*
> > > > + * Copyright (C) 2013 Gateworks Corporation
> > > > + */
> > > > +
> > > > +splashpos=m,m
> > > > +splashimage=CONFIG_SYS_LOAD_ADDR
> > > > +usb_pgood_delay=2000
> > > > +console=ttymxc1
> > > > +bootdevs=usb mmc sata flash
> > > > +hwconfig=_UNKNOWN_
> > > > +
> > > > +disk=0
> > > > +part=1
> > > > +
> > > > +fdt_high=0xffffffff
> > > > +fdt_addr=0x18000000
> > > > +initrd_high=0xffffffff
> > > > +fixfdt=fdt addr ${fdt_addr}
> > > > +bootdir=boot
> > > > +loadfdt=
> > > > +       if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
> > > > +               echo Loaded DTB from ${bootdir}/${fdt_file};
> > > > +               run fixfdt;
> > > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
> > > > +               echo Loaded DTB from ${bootdir}/${fdt_file1};
> > > > +               run fixfdt;
> > > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
> > > > +               echo Loaded DTB from ${bootdir}/${fdt_file2};
> > > > +               run fixfdt;
> > > > +       fi
> > > > +
> > > > +fs=ext4
> > > > +script=6x_bootscript-ventana
> > > > +loadscript=
> > > > +       if ${fsload} ${loadaddr} ${bootdir}/${script}; then
> > > > +               source ${loadaddr};
> > > > +       fi
> > > > +
> > > > +uimage=uImage
> > > > +mmc_root=mmcblk0p1
> > > > +mmc_boot=
> > > > +       setenv fsload "${fs}load mmc ${disk}:${part}";
> > > > +       mmc dev ${disk} && mmc rescan &&
> > > > +       setenv dtype mmc; run loadscript;
> > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > +               setenv bootargs console=${console},${baudrate}
> > > > +                       root=/dev/${mmc_root} rootfstype=${fs}
> > > > +                       rootwait rw ${video} ${extra};
> > > > +               if run loadfdt; then
> > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > +               else
> > > > +                       bootm;
> > > > +               fi;
> > > > +       fi
> > > > +
> > > > +sata_boot=
> > > > +       setenv fsload "${fs}load sata ${disk}:${part}";
> > > > +       sata init &&
> > > > +       setenv dtype sata; run loadscript;
> > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > +               setenv bootargs console=${console},${baudrate}
> > > > +                       root=/dev/sda1 rootfstype=${fs}
> > > > +                       rootwait rw ${video} ${extra};
> > > > +               if run loadfdt; then
> > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > +               else
> > > > +                       bootm;
> > > > +               fi;
> > > > +       fi
> > > > +
> > > > +usb_boot=
> > > > +       setenv fsload "${fs}load usb ${disk}:${part}";
> > > > +       usb start && usb dev ${disk} &&
> > > > +       setenv dtype usb; run loadscript;
> > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > +               setenv bootargs console=${console},${baudrate}
> > > > +                       root=/dev/sda1 rootfstype=${fs}
> > > > +                       rootwait rw ${video} ${extra};
> > > > +               if run loadfdt; then
> > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > +               else
> > > > +                       bootm;
> > > > +               fi;
> > > > +       fi
> > > > +
> > > > +#ifdef CONFIG_SPI_FLASH
> > > > +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
> > > > +image_uboot=ventana/u-boot_spi.imx
> > > > +
> > > > +spi_koffset=0x90000
> > > > +spi_klen=0x200000
> > > > +
> > > > +spi_updateuboot=echo Updating uboot from
> > > > +       ${serverip}:${image_uboot}...;
> > > > +       tftpboot ${loadaddr} ${image_uboot} &&
> > > > +       sf probe && sf erase 0 80000 &&
> > > > +               sf write ${loadaddr} 400 ${filesize}
> > > > +spi_update=echo Updating OS from ${serverip}:${image_os}
> > > > +       to ${spi_koffset} ...;
> > > > +       tftp ${loadaddr} ${image_os} &&
> > > > +       sf probe &&
> > > > +       sf update ${loadaddr} ${spi_koffset} ${filesize}
> > > > +
> > > > +flash_boot=
> > > > +       if sf probe &&
> > > > +       sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
> > > > +               setenv bootargs console=${console},${baudrate}
> > > > +                       root=/dev/mtdblock3
> > > > +                       rootfstype=squashfs,jffs2
> > > > +                       ${video} ${extra};
> > > > +               bootm;
> > > > +       fi
> > > > +#else
> > > > +image_rootfs=openwrt-imx6-ventana-rootfs.ubi
> > > > +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
> > > > +       tftp ${loadaddr} ${image_rootfs} &&
> > > > +       nand erase.part rootfs &&
> > > > +       nand write ${loadaddr} rootfs ${filesize}
> > > > +
> > > > +flash_boot=
> > > > +       setenv fsload 'ubifsload';
> > > > +       ubi part rootfs;
> > > > +       if ubi check boot; then
> > > > +               ubifsmount ubi0:boot;
> > > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > > +                       rootfstype=squashfs,ubifs;
> > > > +               setenv bootdir;
> > > > +       elif ubi check rootfs; then
> > > > +               ubifsmount ubi0:rootfs;
> > > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > > +                       rootfstype=ubifs;
> > > > +       fi;
> > > > +       setenv dtype nand; run loadscript;
> > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > +               setenv bootargs console=${console},${baudrate}
> > > > +                       root=${root} ${video} ${extra};
> > > > +               if run loadfdt; then
> > > > +                       ubifsumount;
> > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > +               else
> > > > +                       ubifsumount; bootm;
> > > > +               fi;
> > > > +       fi
> > > > +#endif
> > > > diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
> > > > index 77f41502220a..47a72fc8fce5 100644
> > > > --- a/include/configs/gw_ventana.h
> > > > +++ b/include/configs/gw_ventana.h
> > > > @@ -76,152 +76,4 @@
> > > >  #define CONFIG_IPADDR             192.168.1.1
> > > >  #define CONFIG_SERVERIP           192.168.1.146
> > > >
> > > > -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > -       "splashpos=m,m\0" \
> > > > -       "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> > > > -       "usb_pgood_delay=2000\0" \
> > > > -       "console=ttymxc1\0" \
> > > > -       "bootdevs=usb mmc sata flash\0" \
> > > > -       "hwconfig=_UNKNOWN_\0" \
> > > > -       "video=\0" \
> > > > -       \
> > > > -       "disk=0\0" \
> > > > -       "part=1\0" \
> > > > -       \
> > > > -       "fdt_high=0xffffffff\0" \
> > > > -       "fdt_addr=0x18000000\0" \
> > > > -       "initrd_high=0xffffffff\0" \
> > > > -       "fixfdt=" \
> > > > -               "fdt addr ${fdt_addr}\0" \
> > > > -       "bootdir=boot\0" \
> > > > -       "loadfdt=" \
> > > > -               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
> > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
> > > > -                       "run fixfdt; " \
> > > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
> > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
> > > > -                       "run fixfdt; " \
> > > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
> > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
> > > > -                       "run fixfdt; " \
> > > > -               "fi\0" \
> > > > -       \
> > > > -       "fs=ext4\0" \
> > > > -       "script=6x_bootscript-ventana\0" \
> > > > -       "loadscript=" \
> > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
> > > > -                       "source ${loadaddr}; " \
> > > > -               "fi\0" \
> > > > -       \
> > > > -       "uimage=uImage\0" \
> > > > -       "mmc_root=mmcblk0p1\0" \
> > > > -       "mmc_boot=" \
> > > > -               "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
> > > > -               "mmc dev ${disk} && mmc rescan && " \
> > > > -               "setenv dtype mmc; run loadscript; " \
> > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > -                               "root=/dev/${mmc_root} rootfstype=${fs} " \
> > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > -                       "if run loadfdt; then " \
> > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > -                       "else " \
> > > > -                               "bootm; " \
> > > > -                       "fi; " \
> > > > -               "fi\0" \
> > > > -       \
> > > > -       "sata_boot=" \
> > > > -               "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
> > > > -               "sata init && " \
> > > > -               "setenv dtype sata; run loadscript; " \
> > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > -                       "if run loadfdt; then " \
> > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > -                       "else " \
> > > > -                               "bootm; " \
> > > > -                       "fi; " \
> > > > -               "fi\0" \
> > > > -       "usb_boot=" \
> > > > -               "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
> > > > -               "usb start && usb dev ${disk} && " \
> > > > -               "setenv dtype usb; run loadscript; " \
> > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > -                       "if run loadfdt; then " \
> > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > -                       "else " \
> > > > -                               "bootm; " \
> > > > -                       "fi; " \
> > > > -               "fi\0"
> > > > -
> > > > -#ifdef CONFIG_SPI_FLASH
> > > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > -       "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
> > > > -       "image_uboot=ventana/u-boot_spi.imx\0" \
> > > > -       \
> > > > -       "spi_koffset=0x90000\0" \
> > > > -       "spi_klen=0x200000\0" \
> > > > -       \
> > > > -       "spi_updateuboot=echo Updating uboot from " \
> > > > -               "${serverip}:${image_uboot}...; " \
> > > > -               "tftpboot ${loadaddr} ${image_uboot} && " \
> > > > -               "sf probe && sf erase 0 80000 && " \
> > > > -                       "sf write ${loadaddr} 400 ${filesize}\0" \
> > > > -       "spi_update=echo Updating OS from ${serverip}:${image_os} " \
> > > > -               "to ${spi_koffset} ...; " \
> > > > -               "tftp ${loadaddr} ${image_os} && " \
> > > > -               "sf probe && " \
> > > > -               "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
> > > > -       \
> > > > -       "flash_boot=" \
> > > > -               "if sf probe && " \
> > > > -               "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
> > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > -                               "root=/dev/mtdblock3 " \
> > > > -                               "rootfstype=squashfs,jffs2 " \
> > > > -                               "${video} ${extra}; " \
> > > > -                       "bootm; " \
> > > > -               "fi\0"
> > > > -#else
> > > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > -       \
> > > > -       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
> > > > -       "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
> > > > -               "tftp ${loadaddr} ${image_rootfs} && " \
> > > > -               "nand erase.part rootfs && " \
> > > > -               "nand write ${loadaddr} rootfs ${filesize}\0" \
> > > > -       \
> > > > -       "flash_boot=" \
> > > > -               "setenv fsload 'ubifsload'; " \
> > > > -               "ubi part rootfs; " \
> > > > -               "if ubi check boot; then " \
> > > > -                       "ubifsmount ubi0:boot; " \
> > > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > > -                               "rootfstype=squashfs,ubifs; " \
> > > > -                       "setenv bootdir; " \
> > > > -               "elif ubi check rootfs; then " \
> > > > -                       "ubifsmount ubi0:rootfs; " \
> > > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > > -                               "rootfstype=ubifs; " \
> > > > -               "fi; " \
> > > > -               "setenv dtype nand; run loadscript; " \
> > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > -                               "root=${root} ${video} ${extra}; " \
> > > > -                       "if run loadfdt; then " \
> > > > -                               "ubifsumount; " \
> > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > -                       "else " \
> > > > -                               "ubifsumount; bootm; " \
> > > > -                       "fi; " \
> > > > -               "fi\0"
> > > > -#endif
> > > > -
> > > >  #endif                        /* __CONFIG_H */
> > > > --
> > > > 2.25.1
> > > >
> > >
> > > Tom,
> > >
> > > Thanks, I've been looking forward to seeing how env is going to get
> > > migrated out of headers. Can you explain the process used to create
> > > this patch? It seems you may have something automated.
> > >
> > > Acked-by: Tim Harvey <tharvey@gateworks.com>
> >
> > So, I do not have anything automated, unfortunately.  In cases like this
> > where we don't use distro_bootcmd and also don't use defined blocks of
> > commands, it's a matter of applying a few regexs to remove quotes,
> > spaces and trailing \, then giving it a quick read to make sure it's
> > still right.  This last part is some of why it can't be automated as we
> > have cases of:
> > "some_bootargs=a=1 b=2" \
> > "c=3\0"
> > and since there's no indent on c=3, it would become "c=3" in the
> > environment rather than "some_bootargs" being set to "a=1 b=2 c=3".
> >
>
> Tom,
>
> I see - Its good to see this as an example and thanks for the cleanup!
>

Tom,

What is the plan or challenges to move env from headers when generic
distro config is used?

Best Regards,

Tim

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT
  2022-06-16 16:51         ` Tim Harvey
@ 2022-06-16 17:04           ` Tom Rini
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-16 17:04 UTC (permalink / raw)
  To: Tim Harvey; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 18336 bytes --]

On Thu, Jun 16, 2022 at 09:51:13AM -0700, Tim Harvey wrote:
> On Tue, Jun 14, 2022 at 9:58 AM Tim Harvey <tharvey@gateworks.com> wrote:
> >
> > On Tue, Jun 14, 2022 at 9:18 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Tue, Jun 14, 2022 at 09:14:03AM -0700, Tim Harvey wrote:
> > > > On Mon, Jun 13, 2022 at 7:57 PM Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > Move the environment text over from being set via
> > > > > CONFIG_EXTRA_ENV_SETTINGS in include/configs/gw_ventana.h and over
> > > > > to plain text in board/gateworks/gw_ventana/gw_ventana.env.  This lets
> > > > > us drop CONFIG_EXTRA_ENV_SETTINGS_COMMON as everything resides in a
> > > > > single environment file now.
> > > > >
> > > > > Cc: Tim Harvey <tharvey@gateworks.com>
> > > > > Signed-off-by: Tom Rini <trini@konsulko.com>
> > > > > ---
> > > > >  board/gateworks/gw_ventana/gw_ventana.env | 145 +++++++++++++++++++++
> > > > >  include/configs/gw_ventana.h              | 148 ----------------------
> > > > >  2 files changed, 145 insertions(+), 148 deletions(-)
> > > > >  create mode 100644 board/gateworks/gw_ventana/gw_ventana.env
> > > > >
> > > > > diff --git a/board/gateworks/gw_ventana/gw_ventana.env b/board/gateworks/gw_ventana/gw_ventana.env
> > > > > new file mode 100644
> > > > > index 000000000000..9a316c74f215
> > > > > --- /dev/null
> > > > > +++ b/board/gateworks/gw_ventana/gw_ventana.env
> > > > > @@ -0,0 +1,145 @@
> > > > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > > > +/*
> > > > > + * Copyright (C) 2013 Gateworks Corporation
> > > > > + */
> > > > > +
> > > > > +splashpos=m,m
> > > > > +splashimage=CONFIG_SYS_LOAD_ADDR
> > > > > +usb_pgood_delay=2000
> > > > > +console=ttymxc1
> > > > > +bootdevs=usb mmc sata flash
> > > > > +hwconfig=_UNKNOWN_
> > > > > +
> > > > > +disk=0
> > > > > +part=1
> > > > > +
> > > > > +fdt_high=0xffffffff
> > > > > +fdt_addr=0x18000000
> > > > > +initrd_high=0xffffffff
> > > > > +fixfdt=fdt addr ${fdt_addr}
> > > > > +bootdir=boot
> > > > > +loadfdt=
> > > > > +       if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then
> > > > > +               echo Loaded DTB from ${bootdir}/${fdt_file};
> > > > > +               run fixfdt;
> > > > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then
> > > > > +               echo Loaded DTB from ${bootdir}/${fdt_file1};
> > > > > +               run fixfdt;
> > > > > +       elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then
> > > > > +               echo Loaded DTB from ${bootdir}/${fdt_file2};
> > > > > +               run fixfdt;
> > > > > +       fi
> > > > > +
> > > > > +fs=ext4
> > > > > +script=6x_bootscript-ventana
> > > > > +loadscript=
> > > > > +       if ${fsload} ${loadaddr} ${bootdir}/${script}; then
> > > > > +               source ${loadaddr};
> > > > > +       fi
> > > > > +
> > > > > +uimage=uImage
> > > > > +mmc_root=mmcblk0p1
> > > > > +mmc_boot=
> > > > > +       setenv fsload "${fs}load mmc ${disk}:${part}";
> > > > > +       mmc dev ${disk} && mmc rescan &&
> > > > > +       setenv dtype mmc; run loadscript;
> > > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > > +               setenv bootargs console=${console},${baudrate}
> > > > > +                       root=/dev/${mmc_root} rootfstype=${fs}
> > > > > +                       rootwait rw ${video} ${extra};
> > > > > +               if run loadfdt; then
> > > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > > +               else
> > > > > +                       bootm;
> > > > > +               fi;
> > > > > +       fi
> > > > > +
> > > > > +sata_boot=
> > > > > +       setenv fsload "${fs}load sata ${disk}:${part}";
> > > > > +       sata init &&
> > > > > +       setenv dtype sata; run loadscript;
> > > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > > +               setenv bootargs console=${console},${baudrate}
> > > > > +                       root=/dev/sda1 rootfstype=${fs}
> > > > > +                       rootwait rw ${video} ${extra};
> > > > > +               if run loadfdt; then
> > > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > > +               else
> > > > > +                       bootm;
> > > > > +               fi;
> > > > > +       fi
> > > > > +
> > > > > +usb_boot=
> > > > > +       setenv fsload "${fs}load usb ${disk}:${part}";
> > > > > +       usb start && usb dev ${disk} &&
> > > > > +       setenv dtype usb; run loadscript;
> > > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > > +               setenv bootargs console=${console},${baudrate}
> > > > > +                       root=/dev/sda1 rootfstype=${fs}
> > > > > +                       rootwait rw ${video} ${extra};
> > > > > +               if run loadfdt; then
> > > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > > +               else
> > > > > +                       bootm;
> > > > > +               fi;
> > > > > +       fi
> > > > > +
> > > > > +#ifdef CONFIG_SPI_FLASH
> > > > > +image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin
> > > > > +image_uboot=ventana/u-boot_spi.imx
> > > > > +
> > > > > +spi_koffset=0x90000
> > > > > +spi_klen=0x200000
> > > > > +
> > > > > +spi_updateuboot=echo Updating uboot from
> > > > > +       ${serverip}:${image_uboot}...;
> > > > > +       tftpboot ${loadaddr} ${image_uboot} &&
> > > > > +       sf probe && sf erase 0 80000 &&
> > > > > +               sf write ${loadaddr} 400 ${filesize}
> > > > > +spi_update=echo Updating OS from ${serverip}:${image_os}
> > > > > +       to ${spi_koffset} ...;
> > > > > +       tftp ${loadaddr} ${image_os} &&
> > > > > +       sf probe &&
> > > > > +       sf update ${loadaddr} ${spi_koffset} ${filesize}
> > > > > +
> > > > > +flash_boot=
> > > > > +       if sf probe &&
> > > > > +       sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then
> > > > > +               setenv bootargs console=${console},${baudrate}
> > > > > +                       root=/dev/mtdblock3
> > > > > +                       rootfstype=squashfs,jffs2
> > > > > +                       ${video} ${extra};
> > > > > +               bootm;
> > > > > +       fi
> > > > > +#else
> > > > > +image_rootfs=openwrt-imx6-ventana-rootfs.ubi
> > > > > +nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...;
> > > > > +       tftp ${loadaddr} ${image_rootfs} &&
> > > > > +       nand erase.part rootfs &&
> > > > > +       nand write ${loadaddr} rootfs ${filesize}
> > > > > +
> > > > > +flash_boot=
> > > > > +       setenv fsload 'ubifsload';
> > > > > +       ubi part rootfs;
> > > > > +       if ubi check boot; then
> > > > > +               ubifsmount ubi0:boot;
> > > > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > > > +                       rootfstype=squashfs,ubifs;
> > > > > +               setenv bootdir;
> > > > > +       elif ubi check rootfs; then
> > > > > +               ubifsmount ubi0:rootfs;
> > > > > +               setenv root ubi0:rootfs ubi.mtd=2
> > > > > +                       rootfstype=ubifs;
> > > > > +       fi;
> > > > > +       setenv dtype nand; run loadscript;
> > > > > +       if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then
> > > > > +               setenv bootargs console=${console},${baudrate}
> > > > > +                       root=${root} ${video} ${extra};
> > > > > +               if run loadfdt; then
> > > > > +                       ubifsumount;
> > > > > +                       bootm ${loadaddr} - ${fdt_addr};
> > > > > +               else
> > > > > +                       ubifsumount; bootm;
> > > > > +               fi;
> > > > > +       fi
> > > > > +#endif
> > > > > diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
> > > > > index 77f41502220a..47a72fc8fce5 100644
> > > > > --- a/include/configs/gw_ventana.h
> > > > > +++ b/include/configs/gw_ventana.h
> > > > > @@ -76,152 +76,4 @@
> > > > >  #define CONFIG_IPADDR             192.168.1.1
> > > > >  #define CONFIG_SERVERIP           192.168.1.146
> > > > >
> > > > > -#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > > -       "splashpos=m,m\0" \
> > > > > -       "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> > > > > -       "usb_pgood_delay=2000\0" \
> > > > > -       "console=ttymxc1\0" \
> > > > > -       "bootdevs=usb mmc sata flash\0" \
> > > > > -       "hwconfig=_UNKNOWN_\0" \
> > > > > -       "video=\0" \
> > > > > -       \
> > > > > -       "disk=0\0" \
> > > > > -       "part=1\0" \
> > > > > -       \
> > > > > -       "fdt_high=0xffffffff\0" \
> > > > > -       "fdt_addr=0x18000000\0" \
> > > > > -       "initrd_high=0xffffffff\0" \
> > > > > -       "fixfdt=" \
> > > > > -               "fdt addr ${fdt_addr}\0" \
> > > > > -       "bootdir=boot\0" \
> > > > > -       "loadfdt=" \
> > > > > -               "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
> > > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
> > > > > -                       "run fixfdt; " \
> > > > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
> > > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
> > > > > -                       "run fixfdt; " \
> > > > > -               "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
> > > > > -                       "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
> > > > > -                       "run fixfdt; " \
> > > > > -               "fi\0" \
> > > > > -       \
> > > > > -       "fs=ext4\0" \
> > > > > -       "script=6x_bootscript-ventana\0" \
> > > > > -       "loadscript=" \
> > > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
> > > > > -                       "source ${loadaddr}; " \
> > > > > -               "fi\0" \
> > > > > -       \
> > > > > -       "uimage=uImage\0" \
> > > > > -       "mmc_root=mmcblk0p1\0" \
> > > > > -       "mmc_boot=" \
> > > > > -               "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
> > > > > -               "mmc dev ${disk} && mmc rescan && " \
> > > > > -               "setenv dtype mmc; run loadscript; " \
> > > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > > -                               "root=/dev/${mmc_root} rootfstype=${fs} " \
> > > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > > -                       "if run loadfdt; then " \
> > > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > > -                       "else " \
> > > > > -                               "bootm; " \
> > > > > -                       "fi; " \
> > > > > -               "fi\0" \
> > > > > -       \
> > > > > -       "sata_boot=" \
> > > > > -               "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
> > > > > -               "sata init && " \
> > > > > -               "setenv dtype sata; run loadscript; " \
> > > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > > -                       "if run loadfdt; then " \
> > > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > > -                       "else " \
> > > > > -                               "bootm; " \
> > > > > -                       "fi; " \
> > > > > -               "fi\0" \
> > > > > -       "usb_boot=" \
> > > > > -               "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
> > > > > -               "usb start && usb dev ${disk} && " \
> > > > > -               "setenv dtype usb; run loadscript; " \
> > > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > > -                               "root=/dev/sda1 rootfstype=${fs} " \
> > > > > -                               "rootwait rw ${video} ${extra}; " \
> > > > > -                       "if run loadfdt; then " \
> > > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > > -                       "else " \
> > > > > -                               "bootm; " \
> > > > > -                       "fi; " \
> > > > > -               "fi\0"
> > > > > -
> > > > > -#ifdef CONFIG_SPI_FLASH
> > > > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > > -       "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
> > > > > -       "image_uboot=ventana/u-boot_spi.imx\0" \
> > > > > -       \
> > > > > -       "spi_koffset=0x90000\0" \
> > > > > -       "spi_klen=0x200000\0" \
> > > > > -       \
> > > > > -       "spi_updateuboot=echo Updating uboot from " \
> > > > > -               "${serverip}:${image_uboot}...; " \
> > > > > -               "tftpboot ${loadaddr} ${image_uboot} && " \
> > > > > -               "sf probe && sf erase 0 80000 && " \
> > > > > -                       "sf write ${loadaddr} 400 ${filesize}\0" \
> > > > > -       "spi_update=echo Updating OS from ${serverip}:${image_os} " \
> > > > > -               "to ${spi_koffset} ...; " \
> > > > > -               "tftp ${loadaddr} ${image_os} && " \
> > > > > -               "sf probe && " \
> > > > > -               "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
> > > > > -       \
> > > > > -       "flash_boot=" \
> > > > > -               "if sf probe && " \
> > > > > -               "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
> > > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > > -                               "root=/dev/mtdblock3 " \
> > > > > -                               "rootfstype=squashfs,jffs2 " \
> > > > > -                               "${video} ${extra}; " \
> > > > > -                       "bootm; " \
> > > > > -               "fi\0"
> > > > > -#else
> > > > > -       #define CONFIG_EXTRA_ENV_SETTINGS \
> > > > > -       CONFIG_EXTRA_ENV_SETTINGS_COMMON \
> > > > > -       \
> > > > > -       "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
> > > > > -       "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
> > > > > -               "tftp ${loadaddr} ${image_rootfs} && " \
> > > > > -               "nand erase.part rootfs && " \
> > > > > -               "nand write ${loadaddr} rootfs ${filesize}\0" \
> > > > > -       \
> > > > > -       "flash_boot=" \
> > > > > -               "setenv fsload 'ubifsload'; " \
> > > > > -               "ubi part rootfs; " \
> > > > > -               "if ubi check boot; then " \
> > > > > -                       "ubifsmount ubi0:boot; " \
> > > > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > > > -                               "rootfstype=squashfs,ubifs; " \
> > > > > -                       "setenv bootdir; " \
> > > > > -               "elif ubi check rootfs; then " \
> > > > > -                       "ubifsmount ubi0:rootfs; " \
> > > > > -                       "setenv root ubi0:rootfs ubi.mtd=2 " \
> > > > > -                               "rootfstype=ubifs; " \
> > > > > -               "fi; " \
> > > > > -               "setenv dtype nand; run loadscript; " \
> > > > > -               "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
> > > > > -                       "setenv bootargs console=${console},${baudrate} " \
> > > > > -                               "root=${root} ${video} ${extra}; " \
> > > > > -                       "if run loadfdt; then " \
> > > > > -                               "ubifsumount; " \
> > > > > -                               "bootm ${loadaddr} - ${fdt_addr}; " \
> > > > > -                       "else " \
> > > > > -                               "ubifsumount; bootm; " \
> > > > > -                       "fi; " \
> > > > > -               "fi\0"
> > > > > -#endif
> > > > > -
> > > > >  #endif                        /* __CONFIG_H */
> > > > > --
> > > > > 2.25.1
> > > > >
> > > >
> > > > Tom,
> > > >
> > > > Thanks, I've been looking forward to seeing how env is going to get
> > > > migrated out of headers. Can you explain the process used to create
> > > > this patch? It seems you may have something automated.
> > > >
> > > > Acked-by: Tim Harvey <tharvey@gateworks.com>
> > >
> > > So, I do not have anything automated, unfortunately.  In cases like this
> > > where we don't use distro_bootcmd and also don't use defined blocks of
> > > commands, it's a matter of applying a few regexs to remove quotes,
> > > spaces and trailing \, then giving it a quick read to make sure it's
> > > still right.  This last part is some of why it can't be automated as we
> > > have cases of:
> > > "some_bootargs=a=1 b=2" \
> > > "c=3\0"
> > > and since there's no indent on c=3, it would become "c=3" in the
> > > environment rather than "some_bootargs" being set to "a=1 b=2 c=3".
> > >
> >
> > Tom,
> >
> > I see - Its good to see this as an example and thanks for the cleanup!
> 
> Tom,
> 
> What is the plan or challenges to move env from headers when generic
> distro config is used?

It's a good question I don't have an answer to just yet.  One potential
answer is to say stop using include/config_distro_bootcmd.h and use
"bootmeth" to achieve the same results, but in a way that doesn't make
heavy use of macros and environment being constructed of null-terminated
tokens.

Or something new and clever is needed to let the macro work done in
include/config_distro_bootcmd.h work with a script that requires new
variables to begin a new line with no leading whitespace.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict
  2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
                   ` (6 preceding siblings ...)
  2022-06-14  2:57 ` [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
@ 2022-06-29 14:11 ` Tom Rini
  7 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2022-06-29 14:11 UTC (permalink / raw)
  To: u-boot; +Cc: Joe Hershberger, Wolfgang Denk, Simon Glass

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On Mon, Jun 13, 2022 at 10:57:30PM -0400, Tom Rini wrote:

> Largely, the use of CONFIG_EXTRA_ENV_SETTINGS can be migrated directly
> to come from CONFIG_EXTRA_ENV_TEXT.  The biggest case that cannot easily
> be migrated is distro_bootcmd support.  Rather than block migration on
> this, remove the #error here so that we can being moving forward.
> 
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Tom Rini <trini@konsulko.com>

For the series, applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-29 14:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14  2:57 [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini
2022-06-14  2:57 ` [PATCH 2/8] env: Remove include/generated/env.* under "make clean" Tom Rini
2022-06-14  2:57 ` [PATCH 3/8] dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
2022-06-14  2:57 ` [PATCH 4/8] Convert CONFIG_ENV_RANGE to Kconfig Tom Rini
2022-06-14  2:57 ` [PATCH 5/8] opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
2022-06-14  2:57 ` [PATCH 6/8] Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOAD Tom Rini
2022-06-14  2:57 ` [PATCH 7/8] Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment Tom Rini
2022-06-14  2:57 ` [PATCH 8/8] gw_ventana: Migrate to using CONFIG_EXTRA_ENV_TEXT Tom Rini
2022-06-14 16:14   ` Tim Harvey
2022-06-14 16:18     ` Tom Rini
2022-06-14 16:58       ` Tim Harvey
2022-06-16 16:51         ` Tim Harvey
2022-06-16 17:04           ` Tom Rini
2022-06-29 14:11 ` [PATCH 1/8] env: Do not make CONFIG_EXTRA_ENV_TEXT and CONFIG_EXTRA_ENV_SETTINGS conflict Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.