* [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK
@ 2025-01-09 3:29 Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 01/17] imx: imx93_evk: switch to BOOTSTD Peng Fan (OSS)
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.
Some cleanups are also included together with this patchset
CI: https://dev.azure.com/pengfan/uboot-ci/_build/results?buildId=17&view=results
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v3:
- Separate driver and dts changes for patch16 in V2
- Link to v2: https://lore.kernel.org/r/20250107-imx-bootstd-v2-0-97671b1694cd@nxp.com
Changes in v2:
- Separate cleanup headers to separate patch
- Separate drop global data to separate patch
- Drop CONFIG_ENV_SOURCE_FILE since same as default
- Link to v1: https://lore.kernel.org/r/20250104-imx-bootstd-v1-0-e09618cc1d65@nxp.com
---
Peng Fan (17):
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: Cleanup headers
imx: imx8mn_evk: Drop DECLARE_GLOBAL_DATA_PTR
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: Cleanup headers
imx: imx8mq_evk: Drop DECLARE_GLOBAL_DATA_PTR
imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot
imx: imx8mq_evk: Switch to BOOTSTD
imx: imx93-11x11-evk: drop duplicated nodes
gpio: adp5585: Update compatible string
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 | 12 +--
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 | 29 ++-----
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 | 3 +-
configs/imx8mm_evk_fspi_defconfig | 4 +-
configs/imx8mn_evk_defconfig | 2 +-
configs/imx8mp_evk_defconfig | 2 +-
configs/imx8mq_evk_defconfig | 3 +-
configs/imx91_11x11_evk_defconfig | 3 +-
configs/imx91_11x11_evk_inline_ecc_defconfig | 3 +-
configs/imx93_11x11_evk_defconfig | 2 +-
configs/imx93_9x9_qsb_defconfig | 3 +-
configs/imx93_9x9_qsb_inline_ecc_defconfig | 3 +-
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, 444 insertions(+), 366 deletions(-)
---
base-commit: ec9263b4f15c4cf82eb6a211c67baa6385065b8e
change-id: 20241231-imx-bootstd-abbf2e9e0d75
Best regards,
--
Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 01/17] imx: imx93_evk: switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 02/17] imx: imx93_qsb: " Peng Fan (OSS)
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Move the env to imx93_evk.env
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx9/Kconfig | 2 +
board/freescale/imx93_evk/imx93_evk.env | 88 ++++++++++++++++++++++++++
configs/imx93_11x11_evk_defconfig | 2 +-
include/configs/imx93_evk.h | 105 --------------------------------
4 files changed, 91 insertions(+), 106 deletions(-)
diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig
index 54c6b117fcff21be5c3800ebd1dc30f8ea12ac42..c52546084394a7cc26f35c93ac8fb62d9c5fe795 100644
--- a/arch/arm/mach-imx/imx9/Kconfig
+++ b/arch/arm/mach-imx/imx9/Kconfig
@@ -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"
diff --git a/board/freescale/imx93_evk/imx93_evk.env b/board/freescale/imx93_evk/imx93_evk.env
new file mode 100644
index 0000000000000000000000000000000000000000..f692f42f78ab67f004a483d886388218fadcbc15
--- /dev/null
+++ b/board/freescale/imx93_evk/imx93_evk.env
@@ -0,0 +1,88 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+boot_targets=mmc0 mmc1
+boot_fit=no
+bootm_size=0x10000000
+cntr_addr=0x98000000
+cntr_file=os_cntr_signed.bin
+console=ttyLP0,115200 earlycon
+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
+mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
+prepare_mcore=setenv mcore_clk clk-imx93.mcore_booted
+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 true; then
+ run boot_os;
+ else
+ echo ERR: failed to authenticate;
+ fi;
+ else
+ if run loadfdt; then
+ run boot_os;
+ 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;
+ if test ${sec_boot} = yes; then
+ ${get_cmd} ${cntr_addr} ${cntr_file};
+ if true; then
+ run boot_os;
+ else
+ echo ERR: failed to authenticate;
+ fi;
+ else
+ ${get_cmd} ${loadaddr} ${image};
+ if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then
+ run boot_os;
+ else
+ 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
diff --git a/configs/imx93_11x11_evk_defconfig b/configs/imx93_11x11_evk_defconfig
index df62eecdde455af561a23a54fde5dfc0a66d1835..43a67232d045e6f308b7bf79998d707841d3886e 100644
--- a/configs/imx93_11x11_evk_defconfig
+++ b/configs/imx93_11x11_evk_defconfig
@@ -26,7 +26,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
diff --git a/include/configs/imx93_evk.h b/include/configs/imx93_evk.h
index 260a5043d5370478a6245bd4eafcf5f1c24b495a..eb40a69d20cb0aeec973a9c1a32a6fcfd831b967 100644
--- a/include/configs/imx93_evk.h
+++ b/include/configs/imx93_evk.h
@@ -17,117 +17,12 @@
#define CFG_MALLOC_F_ADDR 0x204D0000
#endif
-#ifdef CONFIG_DISTRO_DEFAULTS
-#define BOOT_TARGET_DEVICES(func) \
- func(MMC, mmc, 0) \
- func(MMC, mmc, 1) \
-
-#include <config_distro_bootcmd.h>
-#else
-#define BOOTENV
-#endif
-
#ifdef CONFIG_SYS_MMC_ENV_DEV
#define IMX93_EVK_MMC_ENV_DEV CONFIG_SYS_MMC_ENV_DEV
#else
#define IMX93_EVK_MMC_ENV_DEV 0
#endif
-/* Initial environment variables */
-#define CFG_EXTRA_ENV_SETTINGS \
- BOOTENV \
- "scriptaddr=0x83500000\0" \
- "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
- "image=Image\0" \
- "splashimage=0x90000000\0" \
- "console=ttyLP0,115200 earlycon\0" \
- "fdt_addr_r=0x83000000\0" \
- "fdt_addr=0x83000000\0" \
- "cntr_addr=0x98000000\0" \
- "cntr_file=os_cntr_signed.bin\0" \
- "boot_fit=no\0" \
- "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
- "bootm_size=0x10000000\0" \
- "mmcdev=" __stringify(IMX93_EVK_MMC_ENV_DEV)"\0" \
- "mmcpart=1\0" \
- "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
- "mmcautodetect=yes\0" \
- "mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
- "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
- "bootscript=echo Running bootscript from mmc ...; " \
- "source\0" \
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
- "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
- "auth_os=auth_cntr ${cntr_addr}\0" \
- "boot_os=booti ${loadaddr} - ${fdt_addr_r};\0" \
- "mmcboot=echo Booting from mmc ...; " \
- "run mmcargs; " \
- "if test ${sec_boot} = yes; then " \
- "if run auth_os; then " \
- "run boot_os; " \
- "else " \
- "echo ERR: failed to authenticate; " \
- "fi; " \
- "else " \
- "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
- "bootm ${loadaddr}; " \
- "else " \
- "if run loadfdt; then " \
- "run boot_os; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi;" \
- "fi;\0" \
- "netargs=setenv bootargs ${jh_clk} console=${console} " \
- "root=/dev/nfs " \
- "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
- "netboot=echo Booting from net ...; " \
- "run netargs; " \
- "if test ${ip_dyn} = yes; then " \
- "setenv get_cmd dhcp; " \
- "else " \
- "setenv get_cmd tftp; " \
- "fi; " \
- "if test ${sec_boot} = yes; then " \
- "${get_cmd} ${cntr_addr} ${cntr_file}; " \
- "if run auth_os; then " \
- "run boot_os; " \
- "else " \
- "echo ERR: failed to authenticate; " \
- "fi; " \
- "else " \
- "${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 " \
- "run boot_os; " \
- "else " \
- "echo WARN: Cannot load the DT; " \
- "fi; " \
- "fi;" \
- "fi;\0" \
- "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;"
-
/* Link Definitions */
#define CFG_SYS_INIT_RAM_ADDR 0x80000000
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 02/17] imx: imx93_qsb: switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 01/17] imx: imx93_evk: switch to BOOTSTD Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 03/17] imx: imx91_evk: " Peng Fan (OSS)
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx9/Kconfig | 2 ++
board/freescale/imx93_qsb/imx93_qsb.env | 29 +++++++++++++++++++++++++++--
configs/imx93_9x9_qsb_defconfig | 3 +--
configs/imx93_9x9_qsb_inline_ecc_defconfig | 3 +--
4 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig
index c52546084394a7cc26f35c93ac8fb62d9c5fe795..d756f3dcad2e91172ecd885357b9d0adf2e387e3 100644
--- a/arch/arm/mach-imx/imx9/Kconfig
+++ b/arch/arm/mach-imx/imx9/Kconfig
@@ -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"
diff --git a/board/freescale/imx93_qsb/imx93_qsb.env b/board/freescale/imx93_qsb/imx93_qsb.env
index 92486c6f74d2ec12f638443dcf598daa28f306b6..c972d3eb2511542c1a11812f879d7627cadef797 100644
--- a/board/freescale/imx93_qsb/imx93_qsb.env
+++ b/board/freescale/imx93_qsb/imx93_qsb.env
@@ -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
diff --git a/configs/imx93_9x9_qsb_defconfig b/configs/imx93_9x9_qsb_defconfig
index 582fe5a318daaf568b48dac816cd15d80b430b22..8bd2ddda7da8f2a60b834777ae40fafc83963bb9 100644
--- a/configs/imx93_9x9_qsb_defconfig
+++ b/configs/imx93_9x9_qsb_defconfig
@@ -6,7 +6,6 @@ CONFIG_SYS_MALLOC_F_LEN=0x20000
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_NR_DRAM_BANKS=2
-CONFIG_ENV_SOURCE_FILE="imx93_qsb"
CONFIG_SF_DEFAULT_SPEED=40000000
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x700000
@@ -29,7 +28,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
diff --git a/configs/imx93_9x9_qsb_inline_ecc_defconfig b/configs/imx93_9x9_qsb_inline_ecc_defconfig
index c95145cce0ed31db81b49bc9834b4228a9f3ba81..3d07dfb00297d25b82bc586c13491614f3977dc7 100644
--- a/configs/imx93_9x9_qsb_inline_ecc_defconfig
+++ b/configs/imx93_9x9_qsb_inline_ecc_defconfig
@@ -6,7 +6,6 @@ CONFIG_SYS_MALLOC_F_LEN=0x20000
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_NR_DRAM_BANKS=2
-CONFIG_ENV_SOURCE_FILE="imx93_qsb"
CONFIG_SF_DEFAULT_SPEED=40000000
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x700000
@@ -29,7 +28,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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 03/17] imx: imx91_evk: switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 01/17] imx: imx93_evk: switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 02/17] imx: imx93_qsb: " Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 04/17] imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx9/Kconfig | 2 ++
board/freescale/imx91_evk/imx91_evk.env | 29 ++++++++++++++++++++++++++--
configs/imx91_11x11_evk_defconfig | 3 +--
configs/imx91_11x11_evk_inline_ecc_defconfig | 3 +--
4 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-imx/imx9/Kconfig b/arch/arm/mach-imx/imx9/Kconfig
index d756f3dcad2e91172ecd885357b9d0adf2e387e3..49220c0955ee4f658c06ba98c6cbe5ff411cd993 100644
--- a/arch/arm/mach-imx/imx9/Kconfig
+++ b/arch/arm/mach-imx/imx9/Kconfig
@@ -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"
diff --git a/board/freescale/imx91_evk/imx91_evk.env b/board/freescale/imx91_evk/imx91_evk.env
index 92486c6f74d2ec12f638443dcf598daa28f306b6..c972d3eb2511542c1a11812f879d7627cadef797 100644
--- a/board/freescale/imx91_evk/imx91_evk.env
+++ b/board/freescale/imx91_evk/imx91_evk.env
@@ -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
diff --git a/configs/imx91_11x11_evk_defconfig b/configs/imx91_11x11_evk_defconfig
index 6ee0b448f9932ae9c85d3a0a8f6b32787afbec6b..55ba71953c2ba76b3e9b958c5bcc5d7471f5f242 100644
--- a/configs/imx91_11x11_evk_defconfig
+++ b/configs/imx91_11x11_evk_defconfig
@@ -6,7 +6,6 @@ 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="imx91_evk"
CONFIG_SF_DEFAULT_SPEED=40000000
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x700000
@@ -31,7 +30,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
diff --git a/configs/imx91_11x11_evk_inline_ecc_defconfig b/configs/imx91_11x11_evk_inline_ecc_defconfig
index 761a66662641f16da6b9e2ba13690234df7c0a44..0eabd7aa8b3cf7a797ea1b3668c9639b59a7a009 100644
--- a/configs/imx91_11x11_evk_inline_ecc_defconfig
+++ b/configs/imx91_11x11_evk_inline_ecc_defconfig
@@ -6,7 +6,6 @@ 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="imx91_evk"
CONFIG_SF_DEFAULT_SPEED=40000000
CONFIG_ENV_SIZE=0x4000
CONFIG_ENV_OFFSET=0x700000
@@ -31,7 +30,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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 04/17] imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (2 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 03/17] imx: imx91_evk: " Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 05/17] imx: imx8mp_evk: Switch to BOOTSTD Peng Fan (OSS)
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Enable dynamic settings to mmcdev and mmcroot for i.MX8MP-EVK
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/common/Makefile | 2 +-
board/freescale/imx8mp_evk/imx8mp_evk.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index c2c86c0dd08252e8feef5d2f2f5176af408020ac..468a06725c1e470d0d36f79e8a25e31799562e9b 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -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
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index 024b46ef8bc28bd8f6085cc9cc290b719b37fd66..2ff067bc6752135f323398e620e37ef11d1b91bb 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -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");
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 05/17] imx: imx8mp_evk: Switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (3 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 04/17] imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 06/17] imx: imx8mn_evk: Cleanup headers Peng Fan (OSS)
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Move env to imx8mp_evk.env.
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx8m/Kconfig | 2 ++
board/freescale/imx8mp_evk/imx8mp_evk.env | 57 +++++++++++++++++++++++++++++++
configs/imx8mp_evk_defconfig | 2 +-
include/configs/imx8mp_evk.h | 21 ------------
4 files changed, 60 insertions(+), 22 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index b254a50b091a05393d99db6000dcfcb4427dfa5f..0cf3c1baffeecc5d7475e6f7b8d77539aa9646a2 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -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"
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.env b/board/freescale/imx8mp_evk/imx8mp_evk.env
new file mode 100644
index 0000000000000000000000000000000000000000..18f6c6e200ede28201c95eb34c23a596e6771fb3
--- /dev/null
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.env
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+boot_fdt=try
+boot_fit=no
+boot_targets=mmc1 mmc2
+bootm_size=0x10000000
+console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
+fdt_addr_r=0x43000000
+fdt_addr=0x43000000
+fdtfile=CONFIG_DEFAULT_FDT_FILE
+image=Image
+ip_dyn=yes
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
+mmcpart=1
+mmcroot=/dev/mmcblk1p2 rootwait rw
+mmcautodetect=yes
+mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
+prepare_mcore=setenv mcore_clk clk-imx8mp.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 run loadimage; then
+ run mmcboot;
+ else
+ run netboot;
+ fi;
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 5369f8b84a4172434dcef142c854d06e3437caf1..2438ab5d26a7d9b335b4dbf3451520bee81b665f 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -26,8 +26,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
diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
index 741ee39db1a340136b57d9411d96bca995e0ebd2..dfb5cd22528ec4febee8a2fe069c17cfdd77decc 100644
--- a/include/configs/imx8mp_evk.h
+++ b/include/configs/imx8mp_evk.h
@@ -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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 06/17] imx: imx8mn_evk: Cleanup headers
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (4 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 05/17] imx: imx8mp_evk: Switch to BOOTSTD Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 07/17] imx: imx8mn_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Drop unused headers and sort them
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mn_evk/imx8mn_evk.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c
index 6b6fb0a7dd2178a20d9869a1b478d5a8b5124ad8..f20ffbc52501a8a5c3ae9603b04847bab2cbd8dc 100644
--- a/board/freescale/imx8mn_evk/imx8mn_evk.c
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.c
@@ -3,12 +3,10 @@
* Copyright 2019 NXP
*/
-#include <env.h>
-#include <init.h>
#include <asm/global_data.h>
-#include <miiphy.h>
-#include <netdev.h>
#include <asm/io.h>
+#include <env.h>
+#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 07/17] imx: imx8mn_evk: Drop DECLARE_GLOBAL_DATA_PTR
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (5 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 06/17] imx: imx8mn_evk: Cleanup headers Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 08/17] imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
There is no users of global data in imx8mn_evk.c, drop it.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mn_evk/imx8mn_evk.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c
index f20ffbc52501a8a5c3ae9603b04847bab2cbd8dc..1b9dc51978b555256532f22e1cfd317bacee5b37 100644
--- a/board/freescale/imx8mn_evk/imx8mn_evk.c
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.c
@@ -3,13 +3,10 @@
* Copyright 2019 NXP
*/
-#include <asm/global_data.h>
#include <asm/io.h>
#include <env.h>
#include <init.h>
-DECLARE_GLOBAL_DATA_PTR;
-
int board_mmc_get_env_dev(int devno)
{
return devno;
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 08/17] imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (6 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 07/17] imx: imx8mn_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 09/17] imx: imx8mn_evk: Switch to BOOTSTD Peng Fan (OSS)
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Enable dynamic settings to mmcdev and mmcroot for i.MX8MN-EVK
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mn_evk/imx8mn_evk.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c
index 1b9dc51978b555256532f22e1cfd317bacee5b37..c62d7a47e21b77918af85e966ac2bf8f58a75df4 100644
--- a/board/freescale/imx8mn_evk/imx8mn_evk.c
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.c
@@ -3,6 +3,7 @@
* Copyright 2019 NXP
*/
+#include <asm/arch/sys_proto.h>
#include <asm/io.h>
#include <env.h>
#include <init.h>
@@ -30,6 +31,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");
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 09/17] imx: imx8mn_evk: Switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (7 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 08/17] imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 10/17] imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Move env to imx8mn_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mn_evk/imx8mn_evk.env | 67 +++++++++++++++++++++++++++++++
configs/imx8mn_evk_defconfig | 2 +-
include/configs/imx8mn_evk.h | 30 --------------
3 files changed, 68 insertions(+), 31 deletions(-)
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.env b/board/freescale/imx8mn_evk/imx8mn_evk.env
new file mode 100644
index 0000000000000000000000000000000000000000..16a6543ffc692f5ddce5baf1ced11889c444f3b1
--- /dev/null
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.env
@@ -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;
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index 43860fe3f56f9a178bbf83dbedb6a2ca0bba19fe..967eeea4051bbb00a758c46bd1aaa3ce61bbb115 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -26,8 +26,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
diff --git a/include/configs/imx8mn_evk.h b/include/configs/imx8mn_evk.h
index ca02e26c26e42f7606be4e17f77ccf25bdcf9bd1..9972dc17812b7da4f2996f96a618cf8abc871288 100644
--- a/include/configs/imx8mn_evk.h
+++ b/include/configs/imx8mn_evk.h
@@ -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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 10/17] imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (8 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 09/17] imx: imx8mn_evk: Switch to BOOTSTD Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 11/17] imx: imx8mm_evk: Switch to BOOTSTD Peng Fan (OSS)
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Enable dynamic settings to mmcdev and mmcroot for i.MX8MM-EVK
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mm_evk/imx8mm_evk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c
index 4c4436af3b1dd7e796e48458488d2df4e60c182a..d41db8d31d81b44b86a7aab5fa57d97d99e41a05 100644
--- a/board/freescale/imx8mm_evk/imx8mm_evk.c
+++ b/board/freescale/imx8mm_evk/imx8mm_evk.c
@@ -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");
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 11/17] imx: imx8mm_evk: Switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (9 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 10/17] imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 12/17] imx: imx8mq_evk: Cleanup headers Peng Fan (OSS)
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Move env to imx8mm_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx8m/Kconfig | 4 ++
board/freescale/imx8mm_evk/imx8mm_evk.env | 67 +++++++++++++++++++++++++++++++
configs/imx8mm_evk_defconfig | 3 +-
configs/imx8mm_evk_fspi_defconfig | 4 +-
include/configs/imx8mm_evk.h | 22 ----------
5 files changed, 76 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 0cf3c1baffeecc5d7475e6f7b8d77539aa9646a2..28be6a22bf07e1341ec841bace149cdbb871fac0 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -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"
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.env b/board/freescale/imx8mm_evk/imx8mm_evk.env
new file mode 100644
index 0000000000000000000000000000000000000000..29690e75b15aa7c3eb93bd918d42a4d124dde7b6
--- /dev/null
+++ b/board/freescale/imx8mm_evk/imx8mm_evk.env
@@ -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-imx8mm.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;
diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index 90757100c72877d961d3a110e5293c9248c790b7..2c583c4157111cfed8e467cde39be6c9582ac26b 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -24,8 +24,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
diff --git a/configs/imx8mm_evk_fspi_defconfig b/configs/imx8mm_evk_fspi_defconfig
index fb4a4421cf04c3e0f2cee10f1f7689227f44dfd0..af49b82c74cddb0b548b9970af2289e3de320060 100644
--- a/configs/imx8mm_evk_fspi_defconfig
+++ b/configs/imx8mm_evk_fspi_defconfig
@@ -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
diff --git a/include/configs/imx8mm_evk.h b/include/configs/imx8mm_evk.h
index 3bbbd900dd439a93af62cbcb9c95d03b012fee86..957d9c05083f10534467fcd7b3a5f8d7f1fd4b4a 100644
--- a/include/configs/imx8mm_evk.h
+++ b/include/configs/imx8mm_evk.h
@@ -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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 12/17] imx: imx8mq_evk: Cleanup headers
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (10 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 11/17] imx: imx8mm_evk: Switch to BOOTSTD Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 13/17] imx: imx8mq_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Drop unused headers and sort the order.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mq_evk/imx8mq_evk.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.c b/board/freescale/imx8mq_evk/imx8mq_evk.c
index ab920a4539cdf9a77607e1eba5640fa8a6233436..64a2f258f7a6f9bbc58466a47efa0098ec2a2333 100644
--- a/board/freescale/imx8mq_evk/imx8mq_evk.c
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.c
@@ -3,28 +3,12 @@
* Copyright 2018 NXP
*/
-#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"
+#include <asm/global_data.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <env.h>
DECLARE_GLOBAL_DATA_PTR;
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 13/17] imx: imx8mq_evk: Drop DECLARE_GLOBAL_DATA_PTR
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (11 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 12/17] imx: imx8mq_evk: Cleanup headers Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 14/17] imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
There is no gd used in the board file, so drop DECLARE_GLOBAL_DATA_PTR.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mq_evk/imx8mq_evk.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.c b/board/freescale/imx8mq_evk/imx8mq_evk.c
index 64a2f258f7a6f9bbc58466a47efa0098ec2a2333..f833996d5248eba637b443d7bc66141c3aff8f9b 100644
--- a/board/freescale/imx8mq_evk/imx8mq_evk.c
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.c
@@ -6,12 +6,9 @@
#include <asm/arch/clock.h>
#include <asm/arch/imx8mq_pins.h>
#include <asm/arch/sys_proto.h>
-#include <asm/global_data.h>
#include <asm/mach-imx/iomux-v3.h>
#include <env.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#define UART_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_FSEL1)
#define WDOG_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE)
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 14/17] imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (12 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 13/17] imx: imx8mq_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 15/17] imx: imx8mq_evk: Switch to BOOTSTD Peng Fan (OSS)
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Enable dynamic settings to mmcdev and mmcroot for i.MX8MQ-EVK
Since we are here, clean up the including headers
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
board/freescale/imx8mq_evk/imx8mq_evk.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.c b/board/freescale/imx8mq_evk/imx8mq_evk.c
index f833996d5248eba637b443d7bc66141c3aff8f9b..18e83d90a08d653dd629bb773ffd11f50532f4b9 100644
--- a/board/freescale/imx8mq_evk/imx8mq_evk.c
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.c
@@ -50,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");
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 15/17] imx: imx8mq_evk: Switch to BOOTSTD
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (13 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 14/17] imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 16/17] imx: imx93-11x11-evk: drop duplicated nodes Peng Fan (OSS)
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Move env to imx8mq_evk.env
Switch to support BOOTSTD with a bsp bootcmd as fallback.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx8m/Kconfig | 2 ++
board/freescale/imx8mq_evk/imx8mq_evk.env | 60 +++++++++++++++++++++++++++++++
configs/imx8mq_evk_defconfig | 3 +-
include/configs/imx8mq_evk.h | 22 ------------
4 files changed, 64 insertions(+), 23 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 28be6a22bf07e1341ec841bace149cdbb871fac0..76a8be7798c5d80a0384b1f28b1f18eff7b34e43 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -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"
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.env b/board/freescale/imx8mq_evk/imx8mq_evk.env
new file mode 100644
index 0000000000000000000000000000000000000000..dcfe1c2f2d4118e5af01078e2e4402f60c2b7f6a
--- /dev/null
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.env
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+boot_fdt=try
+boot_targets=mmc1 mmc2 dhcp
+bootm_size=0x10000000
+console=ttymxc0,115200
+fdt_addr_r=0x43000000
+fdtfile=CONFIG_DEFAULT_FDT_FILE
+initrd_addr=0x43800000
+image=Image
+ip_dyn=yes
+kernel_addr_r=CONFIG_SYS_LOAD_ADDR
+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-imx8mq.mcore_booted;
+scriptaddr=CONFIG_SYS_LOAD_ADDR
+
+mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
+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_fdt} = yes || test ${boot_fdt} = try; then
+ if run loadfdt; then
+ booti ${loadaddr} - ${fdt_addr_r};
+ else
+ echo WARN: Cannot load the DT;
+ fi;
+ else
+ echo wait for boot;
+ 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_fdt} = yes || test ${boot_fit} = try; then
+ 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;
diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig
index a3a2333c98268d17942cd76c654bad63406099a8..97ef352dfb866830b228e3e4ae77d78afe01ea8b 100644
--- a/configs/imx8mq_evk_defconfig
+++ b/configs/imx8mq_evk_defconfig
@@ -30,8 +30,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
diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 666f46ac105be6a7828bf54c388afad14ee1d1cf..2a86240e2c6dbf3e86e626a2b4a2c1311c68e8a0 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -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
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 16/17] imx: imx93-11x11-evk: drop duplicated nodes
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (14 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 15/17] imx: imx8mq_evk: Switch to BOOTSTD Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 17/17] gpio: adp5585: Update compatible string Peng Fan (OSS)
2025-01-16 14:40 ` [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Fabio Estevam
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
The upstream dts already has the lpi2c2 subnodes, so drop the duplicated
ones in u-boot dtsi.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/dts/imx93-11x11-evk-u-boot.dtsi | 118 -------------------------------
1 file changed, 118 deletions(-)
diff --git a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
index 408e601bc90eb69744ce1198498e01b12f814ca9..a99ba99bfb4f2c08752472536f2450c8e79fb87e 100644
--- a/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx93-11x11-evk-u-boot.dtsi
@@ -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
- >;
- };
};
®_usdhc2_vmmc {
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3 17/17] gpio: adp5585: Update compatible string
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (15 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 16/17] imx: imx93-11x11-evk: drop duplicated nodes Peng Fan (OSS)
@ 2025-01-09 3:29 ` Peng Fan (OSS)
2025-01-16 14:40 ` [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Fabio Estevam
17 siblings, 0 replies; 19+ messages in thread
From: Peng Fan (OSS) @ 2025-01-09 3:29 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team; +Cc: u-boot, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
i.MX93-11x11-EVK has switched to use upstream device tree, and use
"adi,adp5585". Since i.MX93-11x11-EVK is the only user of this driver,
so it is safe to drop "adp5585".
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/gpio/adp5585_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/adp5585_gpio.c b/drivers/gpio/adp5585_gpio.c
index ea0cb75459b741c0157aa9077c44163b3c0cab01..114583b3c3bd9a51fbe1960b7532150d0d7cabdd 100644
--- a/drivers/gpio/adp5585_gpio.c
+++ b/drivers/gpio/adp5585_gpio.c
@@ -224,7 +224,7 @@ static int adp5585_probe(struct udevice *dev)
}
static const struct udevice_id adp5585_ids[] = {
- { .compatible = "adp5585" },
+ { .compatible = "adi,adp5585" },
{ }
};
--
2.35.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
` (16 preceding siblings ...)
2025-01-09 3:29 ` [PATCH v3 17/17] gpio: adp5585: Update compatible string Peng Fan (OSS)
@ 2025-01-16 14:40 ` Fabio Estevam
17 siblings, 0 replies; 19+ messages in thread
From: Fabio Estevam @ 2025-01-16 14:40 UTC (permalink / raw)
To: Peng Fan (OSS); +Cc: Stefano Babic, NXP i.MX U-Boot Team, u-boot, Peng Fan
Hi Peng,
On Wed, Jan 8, 2025 at 11:23 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> Switch to bootstd for NXP i.MX9/8M boards with a bsp_bootcmd as fallback.
>
> Some cleanups are also included together with this patchset
>
> CI: https://dev.azure.com/pengfan/uboot-ci/_build/results?buildId=17&view=results
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> Changes in v3:
> - Separate driver and dts changes for patch16 in V2
> - Link to v2: https://lore.kernel.org/r/20250107-imx-bootstd-v2-0-97671b1694cd@nxp.com
Applied the series, thanks.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-01-16 14:40 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 3:29 [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 01/17] imx: imx93_evk: switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 02/17] imx: imx93_qsb: " Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 03/17] imx: imx91_evk: " Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 04/17] imx: imx8mp_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 05/17] imx: imx8mp_evk: Switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 06/17] imx: imx8mn_evk: Cleanup headers Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 07/17] imx: imx8mn_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 08/17] imx: imx8mn_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 09/17] imx: imx8mn_evk: Switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 10/17] imx: imx8mm_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 11/17] imx: imx8mm_evk: Switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 12/17] imx: imx8mq_evk: Cleanup headers Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 13/17] imx: imx8mq_evk: Drop DECLARE_GLOBAL_DATA_PTR Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 14/17] imx: imx8mq_evk: Enable dynamic settings to mmcdev and mmcroot Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 15/17] imx: imx8mq_evk: Switch to BOOTSTD Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 16/17] imx: imx93-11x11-evk: drop duplicated nodes Peng Fan (OSS)
2025-01-09 3:29 ` [PATCH v3 17/17] gpio: adp5585: Update compatible string Peng Fan (OSS)
2025-01-16 14:40 ` [PATCH v3 00/17] imx9: switch to bootstd for i.MX93/1 EVK/QSB and i.MX8M EVK Fabio Estevam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox