public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	 "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: u-boot@lists.denx.de, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH v3 02/17] imx: imx93_qsb: switch to BOOTSTD
Date: Thu, 09 Jan 2025 11:29:03 +0800	[thread overview]
Message-ID: <20250109-imx-bootstd-v3-2-16e5fc0baecf@nxp.com> (raw)
In-Reply-To: <20250109-imx-bootstd-v3-0-16e5fc0baecf@nxp.com>

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


  parent reply	other threads:[~2025-01-09  2:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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) [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250109-imx-bootstd-v3-2-16e5fc0baecf@nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox