diff mbox series

[4/5] configs: am62a: convert bootcmd to distro_bootcmd

Message ID 20221224011525.4696-5-bb@ti.com
State Accepted
Delegated to: Tom Rini
Headers show
Series add support for hs bootflows to am62a | expand

Commit Message

Bryan Brattlof Dec. 24, 2022, 1:15 a.m. UTC
We're currently using CONFIG_BOOTCOMMAND to run custom boot scripts to
jump into linux. While this works, let's begin the transition to more
distribution friendly jumps to linux by enabling distro_bootcmd.

Convert the custom bootcmd to a distro_bootcmd

Signed-off-by: Judith Mendez <jm@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
---
 configs/am62ax_evm_a53_defconfig |  1 -
 include/configs/am62ax_evm.h     | 29 ++++++++++++++++++++++++++---
 2 files changed, 26 insertions(+), 4 deletions(-)

Comments

Tom Rini Jan. 11, 2023, 2:17 a.m. UTC | #1
On Fri, Dec 23, 2022 at 07:15:24PM -0600, Bryan Brattlof wrote:

> We're currently using CONFIG_BOOTCOMMAND to run custom boot scripts to
> jump into linux. While this works, let's begin the transition to more
> distribution friendly jumps to linux by enabling distro_bootcmd.
> 
> Convert the custom bootcmd to a distro_bootcmd
> 
> Signed-off-by: Judith Mendez <jm@ti.com>
> Signed-off-by: Bryan Brattlof <bb@ti.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig
index 0c2cf945c62bf..6e97fd4060e05 100644
--- a/configs/am62ax_evm_a53_defconfig
+++ b/configs/am62ax_evm_a53_defconfig
@@ -20,7 +20,6 @@  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_SPL_MAX_SIZE=0x58000
 CONFIG_SPL_PAD_TO=0x0
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
diff --git a/include/configs/am62ax_evm.h b/include/configs/am62ax_evm.h
index 5406c39350f64..0bc0b13922f0f 100644
--- a/include/configs/am62ax_evm.h
+++ b/include/configs/am62ax_evm.h
@@ -9,7 +9,6 @@ 
 #define __CONFIG_AM62AX_EVM_H
 
 #include <linux/sizes.h>
-#include <config_distro_bootcmd.h>
 #include <environment/ti/mmc.h>
 #include <environment/ti/k3_dfu.h>
 
@@ -55,12 +54,36 @@ 
 		"${bootdir}/${name_fit}\0"				\
 	"partitions=" PARTS_DEFAULT
 
+#define BOOTENV_DEV_TI_MMC(devtypeu, devtypel, instance)		\
+	DEFAULT_MMC_TI_ARGS						\
+	EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC				\
+	"bootcmd_ti_mmc="						\
+		"run findfdt; run envboot; run init_mmc;"		\
+		"run get_kern_mmc; run get_fdt_mmc;"			\
+		"run get_overlay_mmc;"					\
+		"run run_kern;\0"
+
+#define BOOTENV_DEV_NAME_TI_MMC(devtyeu, devtypel, instance)		\
+	"ti_mmc "
+
+#if CONFIG_IS_ENABLED(CMD_MMC)
+	#define BOOT_TARGET_MMC(func)					\
+		func(TI_MMC, ti_mmc, na)
+#else
+	#define BOOT_TARGET_MMC(func)
+#endif /* CONFIG_IS_ENABLED(CMD_MMC) */
+
+#define BOOT_TARGET_DEVICES(func)					\
+	BOOT_TARGET_MMC(func)
+
+#include <config_distro_bootcmd.h>
+
 /* Incorporate settings into the U-Boot environment */
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	DEFAULT_LINUX_BOOT_ENV						\
-	DEFAULT_MMC_TI_ARGS						\
+	DEFAULT_FIT_TI_ARGS						\
 	EXTRA_ENV_AM62A7_BOARD_SETTINGS					\
-	EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC				\
+	BOOTENV
 
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>