Skip to contentSkip to conversation

configs: imxrt1050-evk: enable distro bootcmd

PATCH In review Jesse Taube 2 participants 2 messages Sep 18, 2023 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs: imxrt1050-evk: enable distro bootcmd

Add support to boot from script.scr from mmc.

imxrt1050-evk was not able to boot from script.scr because we did not include config_distro_bootcmd.h and set the device to mmc.

---
 configs/imxrt1050-evk_defconfig |  2 +-
 include/configs/imxrt1050-evk.h | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
configs/imxrt1050-evk_defconfig +1 -1
index cbf9469b24..35c0364e6b 100644
@@ -25,7 +25,6 @@ CONFIG_HAVE_SYS_UBOOT_START=y
 CONFIG_SYS_UBOOT_START=0x800023FD
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SD_BOOT=y
-# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_NO_BSS_LIMIT=y
@@ -40,6 +39,7 @@ CONFIG_SYS_PBSIZE=276
 # CONFIG_BOOTM_PLAN9 is not set
 # CONFIG_BOOTM_RTEMS is not set
 # CONFIG_BOOTM_VXWORKS is not set
+CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_MII is not set
 # CONFIG_SPL_DOS_PARTITION is not set
include/configs/imxrt1050-evk.h +14 -1
index 2af2dde2ae..4b78d61d3f 100644
@@ -19,10 +19,23 @@
 					 DMAMEM_SZ_ALL)
 
 #ifdef CONFIG_VIDEO
-#define CFG_EXTRA_ENV_SETTINGS \
+#define ENV_DEVICE_SETTINGS \
 		"stdin=serial\0" \
 		"stdout=serial,vidconsole\0" \
 		"stderr=serial,vidconsole\0"
 #endif
 
+/* Config distro_bootcmd */
+#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0)
+#include <config_distro_bootcmd.h>
+#endif
+
+#define CFG_EXTRA_ENV_SETTINGS \
+	ENV_DEVICE_SETTINGS \
+	BOOTENV \
+	"scriptaddr=" __stringify(PHYS_SDRAM) "\0" \
+	"kernel_addr_r" __stringify(PHYS_SDRAM) "\0"
+
 #endif /* __IMXRT1050_EVK_H */
Signature · 1 line
2.40.1
#1 lore raw
Quoted 6 lines · Jesse Taube

Add support to boot from script.scr from mmc.

imxrt1050-evk was not able to boot from script.scr because we did not include config_distro_bootcmd.h and set the device to mmc.

A few things. In general, we should be switching to standard boot instead of the script-based distro_bootcmd. Second:

include/configs/imxrt1050-evk.h line 33

Quoted 6 lines
include/configs/imxrt1050-evk.h +6 -0
+/* Config distro_bootcmd */
+#ifndef CONFIG_SPL_BUILD
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0)
+#include <config_distro_bootcmd.h>
+#endif

It's not allowed to use checks for CONFIG_SPL_BUILD like this.

Signature · 1 line
Tom