Skip to contentSkip to conversation

imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

PATCH Superseded Peng Fan (OSS) 6 participants 26 messages Jan 4, 2025 – Jan 14, 2025

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.

Patch 12 not related to bootstd, it is just one addon patch to cleanup

CI: https://dev.azure.com/pengfan/uboot-ci/_build/results?buildId=15&view=results

---
Peng Fan (12):
imx: imx93_evk: switch to BOOTSTD
imx: imx93_qsb: switch to BOOTSTD
imx: imx91_evk: switch to BOOTSTD
imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mp_evk: Switch to BOOTSTD
imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mn_evk: Switch to BOOTSTD
imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mm_evk: Switch to BOOTSTD
imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mq_evk: Switch to BOOTSTD
imx: imx93-11x11-evk: drop duplicated nodes

 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi     | 118 ---------------------------
 arch/arm/mach-imx/imx8m/Kconfig              |   8 ++
 arch/arm/mach-imx/imx9/Kconfig               |   6 ++
 board/freescale/common/Makefile              |   2 +-
 board/freescale/imx8mm_evk/imx8mm_evk.c      |   3 +
 board/freescale/imx8mm_evk/imx8mm_evk.env    |  67 +++++++++++++++
 board/freescale/imx8mn_evk/imx8mn_evk.c      |   9 +-
 board/freescale/imx8mn_evk/imx8mn_evk.env    |  67 +++++++++++++++
 board/freescale/imx8mp_evk/imx8mp_evk.c      |   5 ++
 board/freescale/imx8mp_evk/imx8mp_evk.env    |  57 +++++++++++++
 board/freescale/imx8mq_evk/imx8mq_evk.c      |  25 ++----
 board/freescale/imx8mq_evk/imx8mq_evk.env    |  60 ++++++++++++++
 board/freescale/imx91_evk/imx91_evk.env      |  29 ++++++-
 board/freescale/imx93_evk/imx93_evk.env      |  88 ++++++++++++++++++++
 board/freescale/imx93_qsb/imx93_qsb.env      |  29 ++++++-
 configs/imx8mm_evk_defconfig                 |   4 +-
 configs/imx8mm_evk_fspi_defconfig            |   4 +-
 configs/imx8mn_evk_defconfig                 |   3 +-
 configs/imx8mp_evk_defconfig                 |   3 +-
 configs/imx8mq_evk_defconfig                 |   4 +-
 configs/imx91_11x11_evk_defconfig            |   2 +-
 configs/imx91_11x11_evk_inline_ecc_defconfig |   2 +-
 configs/imx93_11x11_evk_defconfig            |   3 +-
 configs/imx93_9x9_qsb_defconfig              |   2 +-
 configs/imx93_9x9_qsb_inline_ecc_defconfig   |   2 +-
 drivers/gpio/adp5585_gpio.c                  |   2 +-
 include/configs/imx8mm_evk.h                 |  22 -----
 include/configs/imx8mn_evk.h                 |  30 -------
 include/configs/imx8mp_evk.h                 |  21 -----
 include/configs/imx8mq_evk.h                 |  22 -----
 include/configs/imx93_evk.h                  | 105 ------------------------
 31 files changed, 448 insertions(+), 356 deletions(-)

---
base-commit: a3d3d869b6f5860660718d05ee9b4d040d938e0f
change-id: 20241231-imx-bootstd-abbf2e9e0d75

Best regards,

Signature · 1 line
Peng Fan <[email protected]>
#1 lore raw

PATCH 1/12 imx: imx93_evk: switch to BOOTSTD

From: Peng Fan <[email protected]>

Switch to support BOOTSTD with a bsp bootcmd as fallback. Move the env to imx93_evk.env

---
 arch/arm/mach-imx/imx9/Kconfig          |   2 +
 board/freescale/imx93_evk/imx93_evk.env |  88 ++++++++++++++++++++++++++
 configs/imx93_11x11_evk_defconfig       |   3 +-
 include/configs/imx93_evk.h             | 105 --------------------------------
 4 files changed, 92 insertions(+), 106 deletions(-)
arch/arm/mach-imx/imx9/Kconfig +2 -0
index 54c6b117fcff21be5c3800ebd1dc30f8ea12ac42..c52546084394a7cc26f35c93ac8fb62d9c5fe795 100644
@@ -47,6 +47,8 @@ config TARGET_IMX93_11X11_EVK
 	select OF_BOARD_FIXUP
 	select IMX93
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX93_VAR_SOM
 	bool "imx93_var_som"
board/freescale/imx93_evk/imx93_evk.env new file +88 -0

88 lines not on this page · raw message

configs/imx93_11x11_evk_defconfig +2 -1
index df62eecdde455af561a23a54fde5dfc0a66d1835..ed7f021b4fa08c1a6b7ab3de721e1d3593766eca 100644
@@ -6,6 +6,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x18000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ENV_SOURCE_FILE="imx93_evk"
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x700000
 CONFIG_IMX_CONFIG="arch/arm/mach-imx/imx9/imximage.cfg"
@@ -26,7 +27,7 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_REMAKE_ELF=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx93-11x11-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
include/configs/imx93_evk.h +0 -105

117 lines not on this page · raw message

Signature · 1 line
2.35.3
#3 lore raw

PATCH 2/12 imx: imx93_qsb: switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 arch/arm/mach-imx/imx9/Kconfig             |  2 ++
 board/freescale/imx93_qsb/imx93_qsb.env    | 29 +++++++++++++++++++++++++++--
 configs/imx93_9x9_qsb_defconfig            |  2 +-
 configs/imx93_9x9_qsb_inline_ecc_defconfig |  2 +-
 4 files changed, 31 insertions(+), 4 deletions(-)
arch/arm/mach-imx/imx9/Kconfig +2 -0
index c52546084394a7cc26f35c93ac8fb62d9c5fe795..d756f3dcad2e91172ecd885357b9d0adf2e387e3 100644
@@ -41,6 +41,8 @@ config TARGET_IMX93_9X9_QSB
 	select IMX93
 	select IMX9_LPDDR4X
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX93_11X11_EVK
 	bool "imx93_11x11_evk"
board/freescale/imx93_qsb/imx93_qsb.env +27 -2
index 92486c6f74d2ec12f638443dcf598daa28f306b6..c972d3eb2511542c1a11812f879d7627cadef797 100644
@@ -10,6 +10,7 @@ fdt_addr_r=0x83000000
 fdt_addr=0x83000000
 fdtfile=CONFIG_DEFAULT_FDT_FILE
 image=Image
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
 mmcpart=1
 mmcroot=/dev/mmcblk1p2 rootwait rw
 mmcautodetect=yes
@@ -19,12 +20,13 @@ loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
 loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
 loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}
 auth_os=auth_cntr ${cntr_addr}
+sec_boot=no
 boot_os=booti ${loadaddr} - ${fdt_addr_r}
 mmcboot=
 	echo Booting from mmc ...;
 	run mmcargs;
 	if test ${sec_boot} = yes; then
-		if run auth_os; then
+		if run true; then
 			run boot_os;
 		else
 			echo ERR: failed to authenticate;
@@ -48,7 +50,7 @@ netboot=
 	fi;
 	if test ${sec_boot} = yes; then
 		${get_cmd} ${cntr_addr} ${cntr_file};
-		if run auth_os; then
+		if true; then
 			run boot_os;
 		else
 			echo ERR: failed to authenticate;
@@ -61,3 +63,26 @@ netboot=
 			echo WARN: Cannot load the DT;
 		fi;
 	fi;
+bsp_bootcmd=
+	echo Running BSP bootcmd ...;
+	mmc dev ${mmcdev};
+	if mmc rescan; then
+		if run loadbootscript; then
+			run bootscript;
+		else
+			if test ${sec_boot} = yes; then
+				if run loadcntr; then
+					run mmcboot;
+				else
+					run netboot;
+				fi;
+			else
+				if run loadimage; then
+					run mmcboot;
+				else
+					run netboot;
+				fi;
+			fi;
+		fi;
+	fi;
+scriptaddr=0x83500000
configs/imx93_9x9_qsb_defconfig +1 -1
index 582fe5a318daaf568b48dac816cd15d80b430b22..545b8bf61d1a216d37199be302750419d624963e 100644
@@ -29,7 +29,7 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_REMAKE_ELF=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx93-9x9-qsb.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
configs/imx93_9x9_qsb_inline_ecc_defconfig +1 -1
index c95145cce0ed31db81b49bc9834b4228a9f3ba81..3c9df7470096708db7405d38bd11c3cdf3f7b69f 100644
@@ -29,7 +29,7 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_REMAKE_ELF=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx93-9x9-qsb.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
Signature · 1 line
2.35.3
#4 lore raw

PATCH 3/12 imx: imx91_evk: switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 arch/arm/mach-imx/imx9/Kconfig               |  2 ++
 board/freescale/imx91_evk/imx91_evk.env      | 29 ++++++++++++++++++++++++++--
 configs/imx91_11x11_evk_defconfig            |  2 +-
 configs/imx91_11x11_evk_inline_ecc_defconfig |  2 +-
 4 files changed, 31 insertions(+), 4 deletions(-)
arch/arm/mach-imx/imx9/Kconfig +2 -0
index d756f3dcad2e91172ecd885357b9d0adf2e387e3..49220c0955ee4f658c06ba98c6cbe5ff411cd993 100644
@@ -34,6 +34,8 @@ config TARGET_IMX91_11X11_EVK
 	select OF_BOARD_FIXUP
 	select IMX91
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX93_9X9_QSB
 	bool "imx93_qsb"
board/freescale/imx91_evk/imx91_evk.env +27 -2
index 92486c6f74d2ec12f638443dcf598daa28f306b6..c972d3eb2511542c1a11812f879d7627cadef797 100644
@@ -10,6 +10,7 @@ fdt_addr_r=0x83000000
 fdt_addr=0x83000000
 fdtfile=CONFIG_DEFAULT_FDT_FILE
 image=Image
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
 mmcpart=1
 mmcroot=/dev/mmcblk1p2 rootwait rw
 mmcautodetect=yes
@@ -19,12 +20,13 @@ loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
 loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
 loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}
 auth_os=auth_cntr ${cntr_addr}
+sec_boot=no
 boot_os=booti ${loadaddr} - ${fdt_addr_r}
 mmcboot=
 	echo Booting from mmc ...;
 	run mmcargs;
 	if test ${sec_boot} = yes; then
-		if run auth_os; then
+		if run true; then
 			run boot_os;
 		else
 			echo ERR: failed to authenticate;
@@ -48,7 +50,7 @@ netboot=
 	fi;
 	if test ${sec_boot} = yes; then
 		${get_cmd} ${cntr_addr} ${cntr_file};
-		if run auth_os; then
+		if true; then
 			run boot_os;
 		else
 			echo ERR: failed to authenticate;
@@ -61,3 +63,26 @@ netboot=
 			echo WARN: Cannot load the DT;
 		fi;
 	fi;
+bsp_bootcmd=
+	echo Running BSP bootcmd ...;
+	mmc dev ${mmcdev};
+	if mmc rescan; then
+		if run loadbootscript; then
+			run bootscript;
+		else
+			if test ${sec_boot} = yes; then
+				if run loadcntr; then
+					run mmcboot;
+				else
+					run netboot;
+				fi;
+			else
+				if run loadimage; then
+					run mmcboot;
+				else
+					run netboot;
+				fi;
+			fi;
+		fi;
+	fi;
+scriptaddr=0x83500000
configs/imx91_11x11_evk_defconfig +1 -1
index 6ee0b448f9932ae9c85d3a0a8f6b32787afbec6b..88630528a600a01faacacf44905d9d547f165094 100644
@@ -31,7 +31,7 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_REMAKE_ELF=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx91-11x11-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
configs/imx91_11x11_evk_inline_ecc_defconfig +1 -1
index 761a66662641f16da6b9e2ba13690234df7c0a44..c4b1dc65249752ad7d73fe64927009fc833d5f6a 100644
@@ -31,7 +31,7 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_REMAKE_ELF=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx91-11x11-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
Signature · 1 line
2.35.3
#5 lore raw

PATCH 4/12 imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable dynamic settings to mmcdev and mmcroot for i.MX8MP-EVK

---
 board/freescale/common/Makefile         | 2 +-
 board/freescale/imx8mp_evk/imx8mp_evk.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
board/freescale/common/Makefile +1 -1
index c2c86c0dd08252e8feef5d2f2f5176af408020ac..468a06725c1e470d0d36f79e8a25e31799562e9b 100644
@@ -59,7 +59,7 @@ obj-$(CONFIG_POWER_PFUZE100)	+= pfuze.o
 endif
 obj-$(CONFIG_DM_PMIC_PFUZE100)	+= pfuze.o
 obj-$(CONFIG_POWER_MC34VR500)	+= mc34vr500.o
-ifneq (,$(filter $(SOC), imx8ulp imx9))
+ifneq (,$(filter $(SOC), imx8m imx8ulp imx9))
 obj-y				+= mmc.o
 endif
 
board/freescale/imx8mp_evk/imx8mp_evk.c +5 -0
index 024b46ef8bc28bd8f6085cc9cc290b719b37fd66..2ff067bc6752135f323398e620e37ef11d1b91bb 100644
@@ -3,6 +3,7 @@
  * Copyright 2019 NXP
  */
 
+#include <asm/arch/sys_proto.h>
 #include <env.h>
 
 int board_init(void)
@@ -12,6 +13,10 @@ int board_init(void)
 
 int board_late_init(void)
 {
+#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
+	board_late_mmc_env_init();
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	env_set("board_name", "EVK");
 	env_set("board_rev", "iMX8MP");
Signature · 1 line
2.35.3
#6 lore raw

PATCH 5/12 imx: imx8mp_evk: Switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Move env to imx8mp_evk.env.
Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 arch/arm/mach-imx/imx8m/Kconfig           |  2 ++
 board/freescale/imx8mp_evk/imx8mp_evk.env | 57 +++++++++++++++++++++++++++++++
 configs/imx8mp_evk_defconfig              |  3 +-
 include/configs/imx8mp_evk.h              | 21 ------------
 4 files changed, 61 insertions(+), 22 deletions(-)
arch/arm/mach-imx/imx8m/Kconfig +2 -0
index b254a50b091a05393d99db6000dcfcb4427dfa5f..0cf3c1baffeecc5d7475e6f7b8d77539aa9646a2 100644
@@ -227,6 +227,8 @@ config TARGET_IMX8MP_EVK
 	select ARCH_MISC_INIT
 	select SPL_CRYPTO if SPL
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX8MP_NAVQP
 	bool "Emcraft Systems i.MX8M Plus NavQ+ board"
board/freescale/imx8mp_evk/imx8mp_evk.env new file +57 -0

57 lines not on this page · raw message

configs/imx8mp_evk_defconfig +2 -1
index 5369f8b84a4172434dcef142c854d06e3437caf1..6a8f9c64d9bf93e77a83dd5780f7295b3893703c 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SOURCE_FILE="imx8mp_evk"
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x400000
 CONFIG_DM_GPIO=y
@@ -26,8 +27,8 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
include/configs/imx8mp_evk.h +0 -21
index 741ee39db1a340136b57d9411d96bca995e0ebd2..dfb5cd22528ec4febee8a2fe069c17cfdd77decc 100644
@@ -17,27 +17,6 @@
 
 #endif
 
-#define BOOT_TARGET_DEVICES(func) \
-       func(MMC, mmc, 1) \
-       func(MMC, mmc, 2)
-
-#include <config_distro_bootcmd.h>
-
-/* Initial environment variables */
-#define CFG_EXTRA_ENV_SETTINGS		\
-	BOOTENV \
-	"scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"image=Image\0" \
-	"console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200\0" \
-	"fdt_addr_r=0x43000000\0"			\
-	"boot_fdt=try\0" \
-	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"initrd_addr=0x43800000\0"		\
-	"bootm_size=0x10000000\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
-
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR	0x40000000
Signature · 1 line
2.35.3
#7 lore raw

PATCH 6/12 imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable dynamic settings to mmcdev and mmcroot for i.MX8MN-EVK

---
 board/freescale/imx8mn_evk/imx8mn_evk.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
board/freescale/imx8mn_evk/imx8mn_evk.c +7 -2
index 6b6fb0a7dd2178a20d9869a1b478d5a8b5124ad8..da91d81ebd273163fc042924c77c0a23b77f7e4e 100644
@@ -3,12 +3,13 @@
  * Copyright 2019 NXP
  */
 
+#include <asm/arch/sys_proto.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
 #include <env.h>
 #include <init.h>
-#include <asm/global_data.h>
 #include <miiphy.h>
 #include <netdev.h>
-#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -35,6 +36,10 @@ int board_init(void)
 
 int board_late_init(void)
 {
+#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
+	board_late_mmc_env_init();
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	env_set("board_name", "DDR4 EVK");
 	env_set("board_rev", "iMX8MN");
Signature · 1 line
2.35.3
#9 lore raw

PATCH 7/12 imx: imx8mn_evk: Switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Move env to imx8mn_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 board/freescale/imx8mn_evk/imx8mn_evk.env | 67 +++++++++++++++++++++++++++++++
 configs/imx8mn_evk_defconfig              |  3 +-
 include/configs/imx8mn_evk.h              | 30 --------------
 3 files changed, 69 insertions(+), 31 deletions(-)
board/freescale/imx8mn_evk/imx8mn_evk.env new file +67 -0
new file mode 100644
index 0000000000000000000000000000000000000000..16a6543ffc692f5ddce5baf1ced11889c444f3b1
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+boot_fdt=try
+boot_fit=no
+boot_targets=mmc1 mmc2 dhcp
+bootm_size=0x10000000
+console=ttymxc1,115200
+fdt_addr_r=0x48000000
+fdtfile=CONFIG_DEFAULT_FDT_FILE
+fdtoverlay_addr_r=0x49000000
+initrd_addr=0x48080000
+image=Image
+ip_dyn=yes
+kernel_addr_r=0x42000000
+loadaddr=CONFIG_SYS_LOAD_ADDR
+mmcautodetect=yes
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
+mmcpart=1
+mmcroot=/dev/mmcblk1p2 rootwait rw
+prepare_mcore=setenv mcore_clk clk-imx8mn.mcore_booted;
+pxefile_addr_r=0x40100000
+ramdisk_addr_r=0x48080000
+scriptaddr=0x40000000
+
+mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
+prepare_mcore=setenv mcore_clk clk-imx8mn.mcore_booted
+loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
+mmcboot=echo Booting from mmc ...;
+	run mmcargs;
+	if test ${boot_fit} = yes || test ${boot_fit} = try; then
+		bootm ${loadaddr};
+	else
+		if run loadfdt; then
+			booti ${loadaddr} - ${fdt_addr_r};
+		else
+			echo WARN: Cannot load the DT;
+		fi;
+	fi
+netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs
+	ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
+netboot=echo Booting from net ...;
+	run netargs;
+	if test ${ip_dyn} = yes; then
+		setenv get_cmd dhcp;
+	else
+		setenv get_cmd tftp;
+	fi;
+	${get_cmd} ${loadaddr} ${image};
+	if test ${boot_fit} = yes || test ${boot_fit} = try; then
+		bootm ${loadaddr};
+	else
+		if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then
+			booti ${loadaddr} - ${fdt_addr_r};
+		else
+			echo WARN: Cannot load the DT;
+		fi;
+	fi;
+bsp_bootcmd=echo Running BSP bootcmd ...;
+	mmc dev ${mmcdev};
+	if mmc rescan; then
+		if run loadimage; then
+			run mmcboot;
+		else
+			run netboot;
+		fi;
+	fi;
configs/imx8mn_evk_defconfig +2 -1
index 43860fe3f56f9a178bbf83dbedb6a2ca0bba19fe..b112c30b8242aab890b5861b67a9c8a01ddbc460 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SOURCE_FILE="imx8mn_evk"
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x400000
 CONFIG_DM_GPIO=y
@@ -26,8 +27,8 @@ CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx8mn-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
include/configs/imx8mn_evk.h +0 -30
index ca02e26c26e42f7606be4e17f77ccf25bdcf9bd1..9972dc17812b7da4f2996f96a618cf8abc871288 100644
@@ -13,36 +13,6 @@
 #define CFG_SYS_UBOOT_BASE	\
 	(QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
 
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 1) \
-	func(MMC, mmc, 2) \
-	func(DHCP, dhcp, na)
-
-#include <config_distro_bootcmd.h>
-
-/* Initial environment variables */
-/* see include/configs/ti_armv7_common.h */
-#define ENV_MEM_LAYOUT_SETTINGS \
-	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"kernel_addr_r=0x42000000\0" \
-	"fdt_addr_r=0x48000000\0" \
-	"fdtoverlay_addr_r=0x49000000\0" \
-	"ramdisk_addr_r=0x48080000\0" \
-	"initrd_addr=0x48080000\0" \
-	"scriptaddr=0x40000000\0" \
-	"pxefile_addr_r=0x40100000\0"
-
-#define CFG_EXTRA_ENV_SETTINGS		\
-	"image=Image\0" \
-	BOOTENV \
-	"console=ttymxc1,115200\0" \
-	"boot_fit=no\0" \
-	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"bootm_size=0x10000000\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
-	ENV_MEM_LAYOUT_SETTINGS
-
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR        0x40000000
Signature · 1 line
2.35.3
#10 lore raw

PATCH 8/12 imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable dynamic settings to mmcdev and mmcroot for i.MX8MM-EVK

---
 board/freescale/imx8mm_evk/imx8mm_evk.c | 3 +++
 1 file changed, 3 insertions(+)
board/freescale/imx8mm_evk/imx8mm_evk.c +3 -0
index 4c4436af3b1dd7e796e48458488d2df4e60c182a..d41db8d31d81b44b86a7aab5fa57d97d99e41a05 100644
@@ -59,6 +59,9 @@ int board_mmc_get_env_dev(int devno)
 
 int board_late_init(void)
 {
+	if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC))
+		board_late_mmc_env_init();
+
 	if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) {
 		env_set("board_name", "EVK");
 		env_set("board_rev", "iMX8MM");
Signature · 1 line
2.35.3
#11 lore raw

PATCH 9/12 imx: imx8mm_evk: Switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Move env to imx8mm_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 arch/arm/mach-imx/imx8m/Kconfig           |  4 ++
 board/freescale/imx8mm_evk/imx8mm_evk.env | 67 +++++++++++++++++++++++++++++++
 configs/imx8mm_evk_defconfig              |  4 +-
 configs/imx8mm_evk_fspi_defconfig         |  4 +-
 include/configs/imx8mm_evk.h              | 22 ----------
 5 files changed, 77 insertions(+), 24 deletions(-)
arch/arm/mach-imx/imx8m/Kconfig +4 -0
index 0cf3c1baffeecc5d7475e6f7b8d77539aa9646a2..28be6a22bf07e1341ec841bace149cdbb871fac0 100644
@@ -154,6 +154,8 @@ config TARGET_IMX8MN_EVK
 	select FSL_CAAM
 	select SPL_CRYPTO if SPL
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX8MN_DDR4_EVK
 	bool "imx8mn DDR4 EVK board"
@@ -163,6 +165,8 @@ config TARGET_IMX8MN_DDR4_EVK
 	select FSL_CAAM
 	select SPL_CRYPTO if SPL
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX8MN_VENICE
 	bool "Support Gateworks Venice iMX8M Nano module"
board/freescale/imx8mm_evk/imx8mm_evk.env new file +67 -0

67 lines not on this page · raw message

configs/imx8mm_evk_defconfig +3 -1
index 90757100c72877d961d3a110e5293c9248c790b7..fa576bbde0208d12e42d117fac46ee7a9a57f230 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SOURCE_FILE="imx8mn_evk"
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x400000
 CONFIG_DM_GPIO=y
@@ -24,8 +25,9 @@ CONFIG_SPL=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
 CONFIG_BOARD_LATE_INIT=y
configs/imx8mm_evk_fspi_defconfig +3 -1
index fb4a4421cf04c3e0f2cee10f1f7689227f44dfd0..af49b82c74cddb0b548b9970af2289e3de320060 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SOURCE_FILE="imx8mn_evk"
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_ENV_SIZE=0x1000
@@ -27,8 +28,9 @@ CONFIG_SPL=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
 CONFIG_BOARD_LATE_INIT=y
include/configs/imx8mm_evk.h +0 -22
index 3bbbd900dd439a93af62cbcb9c95d03b012fee86..957d9c05083f10534467fcd7b3a5f8d7f1fd4b4a 100644
@@ -29,28 +29,6 @@
 
 #endif
 
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 1) \
-	func(MMC, mmc, 2) \
-	func(DHCP, dhcp, na)
-
-#include <config_distro_bootcmd.h>
-
-/* Initial environment variables */
-#define CFG_EXTRA_ENV_SETTINGS		\
-	BOOTENV \
-	"scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"image=Image\0" \
-	"console=ttymxc1,115200\0" \
-	"fdt_addr_r=0x43000000\0"			\
-	"boot_fit=no\0" \
-	"fdtfile=imx8mm-evk.dtb\0" \
-	"initrd_addr=0x43800000\0"		\
-	"bootm_size=0x10000000\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
-
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR        0x40000000
Signature · 1 line
2.35.3
#12 lore raw

PATCH 10/12 imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Enable dynamic settings to mmcdev and mmcroot for i.MX8MQ-EVK Since we are here, clean up the including headers

---
 board/freescale/imx8mq_evk/imx8mq_evk.c | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)
board/freescale/imx8mq_evk/imx8mq_evk.c +5 -20
index ab920a4539cdf9a77607e1eba5640fa8a6233436..752a84635b419e834adf2089167460a0beb4b9db 100644
@@ -4,29 +4,10 @@
  */
 
 #include <env.h>
-#include <init.h>
-#include <malloc.h>
-#include <errno.h>
-#include <asm/global_data.h>
-#include <asm/io.h>
-#include <miiphy.h>
-#include <netdev.h>
 #include <asm/mach-imx/iomux-v3.h>
-#include <asm-generic/gpio.h>
-#include <fsl_esdhc_imx.h>
-#include <mmc.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/imx8mq_pins.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/mach-imx/gpio.h>
-#include <asm/mach-imx/mxc_i2c.h>
-#include <asm/arch/clock.h>
-#include <spl.h>
-#include <linux/bitops.h>
-#include <power/pmic.h>
-#include <power/pfuze100_pmic.h>
-#include "../common/pfuze.h"
-
-DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_FSEL1)
 
@@ -69,6 +50,10 @@ int board_mmc_get_env_dev(int devno)
 
 int board_late_init(void)
 {
+#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
+	board_late_mmc_env_init();
+#endif
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	env_set("board_name", "EVK");
 	env_set("board_rev", "iMX8MQ");
Signature · 1 line
2.35.3
#14 lore raw

PATCH 11/12 imx: imx8mq_evk: Switch to BOOTSTD

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Move env to imx8mq_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.

---
 arch/arm/mach-imx/imx8m/Kconfig           |  2 ++
 board/freescale/imx8mq_evk/imx8mq_evk.env | 60 +++++++++++++++++++++++++++++++
 configs/imx8mq_evk_defconfig              |  4 ++-
 include/configs/imx8mq_evk.h              | 22 ------------
 4 files changed, 65 insertions(+), 23 deletions(-)
arch/arm/mach-imx/imx8m/Kconfig +2 -0
index 28be6a22bf07e1341ec841bace149cdbb871fac0..76a8be7798c5d80a0384b1f28b1f18eff7b34e43 100644
@@ -54,6 +54,8 @@ config TARGET_IMX8MQ_EVK
 	select ARCH_MISC_INIT
 	select SPL_CRYPTO if SPL
 	imply OF_UPSTREAM
+	imply BOOTSTD_FULL
+	imply BOOTSTD_BOOTCOMMAND
 
 config TARGET_IMX8MQ_PHANBELL
 	bool "imx8mq_phanbell"
board/freescale/imx8mq_evk/imx8mq_evk.env new file +60 -0

60 lines not on this page · raw message

configs/imx8mq_evk_defconfig +3 -1
index a3a2333c98268d17942cd76c654bad63406099a8..13ad5f8e0de753ac69331509b1c68ac9aa9cb864 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_LEN=0x600000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_ENV_SOURCE_FILE="imx8mq_evk"
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x400000
 CONFIG_SYS_I2C_MXC_I2C1=y
@@ -30,8 +31,9 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTCOMMAND="bootflow scan -lb; run bsp_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_SYS_PBSIZE=1050
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
include/configs/imx8mq_evk.h +0 -22
index 666f46ac105be6a7828bf54c388afad14ee1d1cf..2a86240e2c6dbf3e86e626a2b4a2c1311c68e8a0 100644
@@ -26,28 +26,6 @@
 #define CFG_FEC_MXC_PHYADDR          0
 #endif
 
-#define BOOT_TARGET_DEVICES(func) \
-       func(MMC, mmc, 0) \
-       func(MMC, mmc, 1) \
-       func(DHCP, dhcp, na)
-
-#include <config_distro_bootcmd.h>
-
-/* Initial environment variables */
-#define CFG_EXTRA_ENV_SETTINGS		\
-	BOOTENV \
-	"scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"image=Image\0" \
-	"console=ttymxc0,115200\0" \
-	"fdt_addr_r=0x43000000\0"			\
-	"boot_fdt=try\0" \
-	"fdtfile=imx8mq-evk.dtb\0" \
-	"initrd_addr=0x43800000\0"		\
-	"bootm_size=0x10000000\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
-
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR        0x40000000
Signature · 1 line
2.35.3
#15 lore raw

PATCH 12/12 imx: imx93-11x11-evk: drop duplicated nodes

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

The upstream dts already has the lpi2c2 subnodes, so drop the duplicated ones in u-boot dtsi.

Since the adp5585 compatible string changes, update the driver compatible string. i.MX93 11x11 EVK is the only user of the driver as of now, so it is safe to drop legacy compatible string.

---
 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi | 118 -------------------------------
 drivers/gpio/adp5585_gpio.c              |   2 +-
 2 files changed, 1 insertion(+), 119 deletions(-)
arch/arm/dts/imx93-11x11-evk-u-boot.dtsi +0 -118
index 408e601bc90eb69744ce1198498e01b12f814ca9..a99ba99bfb4f2c08752472536f2450c8e79fb87e 100644
@@ -26,111 +26,6 @@
 	bootph-pre-ram;
 };
 
-&lpi2c2 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-	clock-frequency = <400000>;
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&pinctrl_lpi2c2>;
-	pinctrl-1 = <&pinctrl_lpi2c2>;
-	status = "okay";
-
-	pmic@25 {
-		compatible = "nxp,pca9451a";
-		reg = <0x25>;
-		interrupt-parent = <&pcal6524>;
-		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
-
-		regulators {
-			buck1: BUCK1 {
-				regulator-name = "BUCK1";
-				regulator-min-microvolt = <650000>;
-				regulator-max-microvolt = <2237500>;
-				regulator-boot-on;
-				regulator-always-on;
-				regulator-ramp-delay = <3125>;
-			};
-
-			buck2: BUCK2 {
-				regulator-name = "BUCK2";
-				regulator-min-microvolt = <600000>;
-				regulator-max-microvolt = <2187500>;
-				regulator-boot-on;
-				regulator-always-on;
-				regulator-ramp-delay = <3125>;
-			};
-
-			buck4: BUCK4{
-				regulator-name = "BUCK4";
-				regulator-min-microvolt = <600000>;
-				regulator-max-microvolt = <3400000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			buck5: BUCK5{
-				regulator-name = "BUCK5";
-				regulator-min-microvolt = <600000>;
-				regulator-max-microvolt = <3400000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			buck6: BUCK6 {
-				regulator-name = "BUCK6";
-				regulator-min-microvolt = <600000>;
-				regulator-max-microvolt = <3400000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			ldo1: LDO1 {
-				regulator-name = "LDO1";
-				regulator-min-microvolt = <1600000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			ldo4: LDO4 {
-				regulator-name = "LDO4";
-				regulator-min-microvolt = <800000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			ldo5: LDO5 {
-				regulator-name = "LDO5";
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-		};
-	};
-
-	pcal6524: gpio@22 {
-		compatible = "nxp,pcal6524";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_pcal6524>;
-		reg = <0x22>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupt-parent = <&gpio3>;
-		interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
-	};
-
-	adp5585gpio: gpio@34 {
-		compatible = "adp5585";
-		reg = <0x34>;
-		gpio-controller;
-		#gpio-cells = <2>;
-	};
-};
-
 &aips1 {
 	bootph-pre-ram;
 	bootph-all;
@@ -149,19 +44,6 @@
 &iomuxc {
 	bootph-pre-ram;
 	bootph-some-ram;
-
-	pinctrl_lpi2c2: lpi2c2grp {
-		fsl,pins = <
-			MX93_PAD_I2C2_SCL__LPI2C2_SCL			0x40000b9e
-			MX93_PAD_I2C2_SDA__LPI2C2_SDA			0x40000b9e
-		>;
-	};
-
-	pinctrl_pcal6524: pcal6524grp {
-		fsl,pins = <
-			MX93_PAD_CCM_CLKO2__GPIO3_IO27			0x31e
-		>;
-	};
 };
 
 &reg_usdhc2_vmmc {
drivers/gpio/adp5585_gpio.c +1 -1
index ea0cb75459b741c0157aa9077c44163b3c0cab01..114583b3c3bd9a51fbe1960b7532150d0d7cabdd 100644
@@ -224,7 +224,7 @@ static int adp5585_probe(struct udevice *dev)
 }
 
 static const struct udevice_id adp5585_ids[] = {
-	{ .compatible = "adp5585" },
+	{ .compatible = "adi,adp5585" },
 	{ }
 };
 
Signature · 1 line
2.35.3
#16 lore raw
In reply to Peng Fan (OSS)

Hi Peng,

Quoted 55 lines · Peng Fan (OSS)

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.

Patch 12 not related to bootstd, it is just one addon patch to cleanup

CI: https://dev.azure.com/pengfan/uboot-ci/_build/results?buildId=15&view=results

---
Peng Fan (12):
imx: imx93_evk: switch to BOOTSTD
imx: imx93_qsb: switch to BOOTSTD
imx: imx91_evk: switch to BOOTSTD
imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mp_evk: Switch to BOOTSTD
imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mn_evk: Switch to BOOTSTD
imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mm_evk: Switch to BOOTSTD
imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mq_evk: Switch to BOOTSTD
imx: imx93-11x11-evk: drop duplicated nodes

 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi     | 118 ---------------------------
 arch/arm/mach-imx/imx8m/Kconfig              |   8 ++
 arch/arm/mach-imx/imx9/Kconfig               |   6 ++
 board/freescale/common/Makefile              |   2 +-
 board/freescale/imx8mm_evk/imx8mm_evk.c      |   3 +
 board/freescale/imx8mm_evk/imx8mm_evk.env    |  67 +++++++++++++++
 board/freescale/imx8mn_evk/imx8mn_evk.c      |   9 +-
 board/freescale/imx8mn_evk/imx8mn_evk.env    |  67 +++++++++++++++
 board/freescale/imx8mp_evk/imx8mp_evk.c      |   5 ++
 board/freescale/imx8mp_evk/imx8mp_evk.env    |  57 +++++++++++++
 board/freescale/imx8mq_evk/imx8mq_evk.c      |  25 ++----
 board/freescale/imx8mq_evk/imx8mq_evk.env    |  60 ++++++++++++++
 board/freescale/imx91_evk/imx91_evk.env      |  29 ++++++-
 board/freescale/imx93_evk/imx93_evk.env      |  88 ++++++++++++++++++++
 board/freescale/imx93_qsb/imx93_qsb.env      |  29 ++++++-
 configs/imx8mm_evk_defconfig                 |   4 +-
 configs/imx8mm_evk_fspi_defconfig            |   4 +-
 configs/imx8mn_evk_defconfig                 |   3 +-
 configs/imx8mp_evk_defconfig                 |   3 +-
 configs/imx8mq_evk_defconfig                 |   4 +-
 configs/imx91_11x11_evk_defconfig            |   2 +-
 configs/imx91_11x11_evk_inline_ecc_defconfig |   2 +-
 configs/imx93_11x11_evk_defconfig            |   3 +-
 configs/imx93_9x9_qsb_defconfig              |   2 +-
 configs/imx93_9x9_qsb_inline_ecc_defconfig   |   2 +-
 drivers/gpio/adp5585_gpio.c                  |   2 +-
 include/configs/imx8mm_evk.h                 |  22 -----
 include/configs/imx8mn_evk.h                 |  30 -------
 include/configs/imx8mp_evk.h                 |  21 -----
 include/configs/imx8mq_evk.h                 |  22 -----
 include/configs/imx93_evk.h                  | 105 ------------------------
 31 files changed, 448 insertions(+), 356 deletions(-)
Quoted 8 lines

---
base-commit: a3d3d869b6f5860660718d05ee9b4d040d938e0f
change-id: 20241231-imx-bootstd-abbf2e9e0d75

Best regards,
--
Peng Fan <[email protected]>

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use case? If you would like to take a look (separate from this series), I could help with any issues that come up.

Regards,
Simon

author
#17 lore raw

Hi Simon,

Quoted 6 lines · Simon Glass

Hi Peng,

Quoted 3 lines · Peng Fan (OSS)

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.

[...]

Quoted 7 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use case? If you would like to take a look (separate from this series), I could help with any issues that come up.

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

Thanks,
Peng.

Quoted 3 lines

Regards,
Simon

#18 lore raw

Hi Peng,

Quoted 19 lines · Peng Fan

Hi Simon,

Quoted 6 lines · Simon Glass

Hi Peng,

Quoted 3 lines · Peng Fan (OSS)

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.

[...]

Quoted 7 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use case? If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd, but you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

Regards,
Simonn

#19 lore raw
Quoted 28 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 3 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 7 lines
Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP Yocto releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 5 lines

you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

I will give a look, but this seems we need put the "run loadimage and etc" in dtb and needs bootmeth_imx.c to support it.

Thanks,
Peng.

Quoted 3 lines

Regards,
Simonn

reviewer
#2 lore raw

Re: [PATCH 01/12] imx: imx93_evk: switch to BOOTSTD

In reply to Peng Fan (OSS)

configs/imx93_11x11_evk_defconfig CONFIG_SYS_MALLOC_F_LEN=0x18000 · line 9

Quoted 7 lines · Peng Fan (OSS)
configs/imx93_11x11_evk_defconfig +1 -0
@@ -6,6 +6,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x18000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ENV_SOURCE_FILE="imx93_evk"

This line can be dropped as it is the default.

reviewer
#8 lore raw

Re: [PATCH 06/12] imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)

board/freescale/imx8mn_evk/imx8mn_evk.c line 11

Quoted 9 lines · Peng Fan (OSS)
board/freescale/imx8mn_evk/imx8mn_evk.c +3 -2
+#include <asm/arch/sys_proto.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
 #include <env.h>
 #include <init.h>
-#include <asm/global_data.h>
 #include <miiphy.h>
 #include <netdev.h>
-#include <asm/io.h>

Sorting the includes should be a separate change as it is unrelated to adding support for mmcdev/mmcroot dynamic setting.

reviewer
#13 lore raw

Re: [PATCH 10/12] imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot

In reply to Peng Fan (OSS)
Quoted 15 lines · Peng Fan (OSS)

#include <env.h>

board/freescale/imx8mq_evk/imx8mq_evk.c +1 -10
-#include <init.h>
-#include <malloc.h>
-#include <errno.h>
-#include <asm/global_data.h>
-#include <asm/io.h>
-#include <miiphy.h>
-#include <netdev.h>
 #include <asm/mach-imx/iomux-v3.h>
-#include <asm-generic/gpio.h>
-#include <fsl_esdhc_imx.h>
-#include <mmc.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/imx8mq_pins.h>
 #include <asm/arch/sys_proto.h>

board/freescale/imx8mq_evk/imx8mq_evk.c line 29

Quoted 10 lines
board/freescale/imx8mq_evk/imx8mq_evk.c +0 -10
-#include <asm/mach-imx/gpio.h>
-#include <asm/mach-imx/mxc_i2c.h>
-#include <asm/arch/clock.h>
-#include <spl.h>
-#include <linux/bitops.h>
-#include <power/pmic.h>
-#include <power/pfuze100_pmic.h>
-#include "../common/pfuze.h"
-
-DECLARE_GLOBAL_DATA_PTR;

Same here: sorting includes and removing DECLARE_GLOBAL_DATA_PTR should be separate changes.

#20 lore raw
In reply to Peng Fan

Hi Peng,

Quoted 45 lines · Peng Fan
Quoted 29 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 3 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 7 lines
Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP Yocto releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 8 lines
Quoted 5 lines

you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

I will give a look, but this seems we need put the "run loadimage and etc" in dtb and needs bootmeth_imx.c to support it.

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

Regards,
SImon

#21 lore raw

Hi Peng & Simon,

Quoted 58 lines · Simon Glass

Hi Peng,

Quoted 45 lines · Peng Fan
Quoted 29 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 3 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 7 lines
Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP Yocto releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 8 lines
Quoted 5 lines

you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

I will give a look, but this seems we need put the "run loadimage and etc" in dtb and needs bootmeth_imx.c to support it.

Quoted 9 lines

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

Can we call this bootmeth_internal, and have it read the internal board/xxx/yyy/bootflow? And then this "default' bootflow can contain the envs scripting to boot the board when all other boot methods have failed. Of course, it can also be executed manually at command prompt like other bootflows.

I think if we go this far to add another bootmeth, it would be nice to make it generic so it can be used in other boards.

All the best,
Tony

Quoted 2 lines

Regards,
SImon

#24 lore raw
In reply to Simon Glass

Hi Simon,

Quoted 63 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan
Quoted 7 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

On Sun, 5 Jan 2025 at 17:27, Peng Fan <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 7 lines

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a

bsp_bootcmd

Quoted 16 lines
Quoted 16 lines

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 7 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP

Yocto

Quoted 9 lines

releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 1 line

you could write your own bootmeth, e.g. using common code from

the

Quoted 1 line
Quoted 1 line

others. For example, bootmeth_script.c shows how to run a script

and

Quoted 4 lines
Quoted 3 lines

bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

Quoted 7 lines
Quoted 1 line

I will give a look, but this seems we need put the "run loadimage and

etc"

Quoted 1 line

in dtb and needs bootmeth_imx.c to support it.

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

I see.

Quoted 5 lines

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

It would be great if you could help here. Appreciate in advance.

Thanks,
Peng.

Quoted 3 lines

Regards,
SImon

#25 lore raw

Hi Peng,

Quoted 76 lines · Peng Fan

Hi Simon,

Quoted 63 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan
Quoted 7 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

On Sun, 5 Jan 2025 at 17:27, Peng Fan <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 7 lines

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a

bsp_bootcmd

Quoted 16 lines
Quoted 16 lines

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 7 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP

Yocto

Quoted 9 lines

releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 1 line

you could write your own bootmeth, e.g. using common code from

the

Quoted 1 line
Quoted 1 line

others. For example, bootmeth_script.c shows how to run a script

and

Quoted 4 lines
Quoted 3 lines

bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

Quoted 7 lines
Quoted 1 line

I will give a look, but this seems we need put the "run loadimage and

etc"

Quoted 1 line

in dtb and needs bootmeth_imx.c to support it.

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

I see.

Quoted 7 lines
Quoted 5 lines

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

It would be great if you could help here. Appreciate in advance.

Separately, if you have access to a low-cost board you can send me, I'd like to add it to my lab, which is now available to custodians via gitlab now.

Regards,
Simon

#22 lore raw
In reply to Tony Dinh
Quoted 71 lines · Tony Dinh

Hi Peng & Simon,

Quoted 58 lines · Simon Glass

Hi Peng,

Quoted 45 lines · Peng Fan
Quoted 29 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 3 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 7 lines
Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP Yocto releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 8 lines
Quoted 5 lines

you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

I will give a look, but this seems we need put the "run loadimage and etc" in dtb and needs bootmeth_imx.c to support it.

Quoted 9 lines

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

Quoted 8 lines

Can we call this bootmeth_internal, and have it read the internal board/xxx/yyy/bootflow? And then this "default' bootflow can contain the envs scripting to boot the board when all other boot methods have failed. Of course, it can also be executed manually at command prompt like other bootflows.

I think if we go this far to add another bootmeth, it would be nice to make it generic so it can be used in other boards.

I agree that a generic bootmeth would be really helpful. We would like to have some simple A/B boot mechanism (using RAUC) and I think implementing it as bootmeth and sharing it across different platforms and boards is better than implementing it in the env for each board/vendor.

#23 lore raw

Hi Frieder,

Quoted 79 lines · Frieder Schrempf
Quoted 77 lines · Tony Dinh

Hi Peng & Simon,

Quoted 58 lines · Simon Glass

Hi Peng,

Quoted 45 lines · Peng Fan
Quoted 29 lines

Subject: Re: [PATCH 00/12] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK

Hi Peng,

Quoted 7 lines · Peng Fan

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Peng,

On Sat, 4 Jan 2025 at 16:19, Peng Fan (OSS)

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines

Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd

as fallback.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

[...]

Quoted 5 lines
Quoted 1 line

This also switches to a text environment, great!

For bsp_bootcmd is it possible to create a bootmeth for your use

case?

Quoted 3 lines
Quoted 2 lines

If you would like to take a look (separate from this series), I could help with any issues that come up.

Quoted 7 lines
Quoted 5 lines

I just give a quick look of bootmeth, seems needs extlinux or bootscript (boot.scr). But both are used on NXP i.MX release as of now. In NXP releases, we put all script in the U-Boot ENV.

Do you have suggestions how to move to support bootmeth.

I'm not entirely sure what you are trying to do with the bootcmd,

With a single u-boot, we want to support Fedora/SUSE/etc and NXP Yocto releases.

So add a bsp_bootcmd as fallback to run NXP Yocto releases. NXP Yocto releases not have extlinux.cfg, nor boot.scr, we just have simple uboot hush command in bootcmd, simplied saying:
run loadimage; run loadfdt; run mmcargs; booti ${loadaddr} - ${fdtaddr}

Quoted 8 lines
Quoted 5 lines

you could write your own bootmeth, e.g. using common code from the others. For example, bootmeth_script.c shows how to run a script and bootmeth_extlinux.c shows how to run an extlinux file. You could then create C code to perform your 'bsp' function, e.g. a new bootmeth_bsp.c.

I will give a look, but this seems we need put the "run loadimage and etc" in dtb and needs bootmeth_imx.c to support it.

Quoted 9 lines

Note that my suggestion here is as a follow-on to you current series, which I believe can be applied as is.

Anyway, as a starting point, yes you can use run_command() lots of times in the bootmeth to run the things you need. From there you can potentially change some commands to direct calls into the U-Boot functionality. The idea is to be able to locate the bootflow as a separate thing from booting it. I am quite happy to help as well.

Can we call this bootmeth_internal, and have it read the internal board/xxx/yyy/bootflow? And then this "default' bootflow can contain the envs scripting to boot the board when all other boot methods have failed. Of course, it can also be executed manually at command prompt like other bootflows.

Quoted 7 lines
Quoted 2 lines

I think if we go this far to add another bootmeth, it would be nice to make it generic so it can be used in other boards.

I agree that a generic bootmeth would be really helpful. We would like to have some simple A/B boot mechanism (using RAUC) and I think implementing it as bootmeth and sharing it across different platforms and boards is better than implementing it in the env for each board/vendor.

I am hoping that VBE's abrec will land before too long. That is programmatic. Fwupd only supports VBE-simple at present but I plan to add support for that in the middle of the year.

Regards,
Simon