Skip to contentSkip to conversation

FIT Image Boot Fixes for am57xx_hs_evm

PATCH RESEND In review Anurag Dutta 2 participants 5 messages Feb 11, 2025 – Feb 21, 2025

lore
Share & tools
lore
#0 lore raw

cover FIT Image Boot Fixes for am57xx_hs_evm

The u-boot is unable to load the FIT image due to incorrect boot arguments in case of am57_hs evm as can be seen in [1]. This series introduces multiple changes pertaining to several environment variables and overlays that are responsible for successful [2] loading of kernel image.

Test links:
[1] https://gist.github.com/anuragdutta731/7bbf0df73dd1e3327765f1807d337445
[2] https://gist.github.com/anuragdutta731/5244174c9b9556fd89132c8d72ae2d8b

Resending patch series due to incorrect subject-prefix.

Sinthu Raja (3):
include: configs: Override get_fit_config to get FIT config for AM57x
configs: omap5: Enable custom mmc boot to distroboot for AM57x
include: configs: omap5: Add support for FDT overlay

 include/configs/ti_omap5_common.h | 27 +++++++++++++++++++++++++++
 include/env/ti/mmc.h              |  1 +
 2 files changed, 28 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH RESEND 1/3 include: configs: Override get_fit_config to get FIT config for AM57x

From: Sinthu Raja <[email protected]>

Kernel commit 837833a724b7 ("environment: ti: Add get_fit_config command to get FIT config string") introduced "get_fit_config" in ti_armv7_common.h to mangle the fdtfile name when used to select a config node from the OE made FIT image. However, the ti_armv7_common.h is common for both K3 and AM57xx platforms. AM57xx platforms' fdtfile name does not have '/' and "conf-" prefix so the setexpr command fails and boot hangs.

Override the get_fit_config in AM57x specific config header to get the correct FIT config name.

---
 include/configs/ti_omap5_common.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/ti_omap5_common.h +1 -0
index 26b6c1cd188..d315a52f36f 100644
@@ -251,6 +251,7 @@
 	DEFAULT_LINUX_BOOT_ENV \
 	DEFAULT_MMC_TI_ARGS \
 	DEFAULT_FIT_TI_ARGS \
+	"get_fit_config=setenv name_fit_config ${fdtfile}\0" \
 	DEFAULT_COMMON_BOOT_TI_ARGS \
 	DEFAULT_FDT_TI_ARGS \
 	DFUARGS \
Signature · 1 line
2.34.1
#2 lore raw

PATCH RESEND 2/3 configs: omap5: Enable custom mmc boot to distroboot for AM57x

In reply to Anurag Dutta

From: Sinthu Raja <[email protected]>

TI AM57x boards use a custom (though family common to TI boards) mechanism for booting Linux. Add support to enable custom MMC boot as a default option along with the distroboot approach.

Also, add supporting mmc boot environment variables which shall be used for custom MMC boot

---
 include/configs/ti_omap5_common.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
include/configs/ti_omap5_common.h +15 -0
index d315a52f36f..ef97711e644 100644
@@ -240,16 +240,31 @@
 			"echo WARNING: Could not determine device tree to use; fi; \0"
 
 #define BOOT_TARGET_DEVICES(func) \
+	func(TI_MMC, ti_mmc, na) \
 	func(MMC, mmc, 0) \
 	func(MMC, mmc, 1) \
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
 
+#define BOOTENV_DEV_TI_MMC(devtypeu, devtypel, instance)	\
+	"bootcmd_ti_mmc= run get_name_kern; run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_TI_MMC(devtyeu, devtypel, instance)            \
+	"ti_mmc "
+
 #include <config_distro_bootcmd.h>
 
 #define CFG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
 	DEFAULT_MMC_TI_ARGS \
+	"bootpart=0:2\0" \
+	"bootdir=/boot\0" \
+	"get_name_kern=" \
+	"if test $boot_fit -eq 1; then " \
+		"setenv bootfile fitImage; " \
+	"else " \
+		"setenv bootfile zImage; " \
+	"fi\0" \
 	DEFAULT_FIT_TI_ARGS \
 	"get_fit_config=setenv name_fit_config ${fdtfile}\0" \
 	DEFAULT_COMMON_BOOT_TI_ARGS \
Signature · 1 line
2.34.1
#3 lore raw

PATCH RESEND 3/3 include: configs: omap5: Add support for FDT overlay

In reply to Anurag Dutta

From: Sinthu Raja <[email protected]>

As AM57x uses overlays for display and camera interfaces, add support to load DT overlay files to MMC boot.

---
 include/configs/ti_omap5_common.h | 11 +++++++++++
 include/env/ti/mmc.h              |  1 +
 2 files changed, 12 insertions(+)
include/configs/ti_omap5_common.h +11 -0
index ef97711e644..39102f15eb9 100644
@@ -239,6 +239,16 @@
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree to use; fi; \0"
 
+#define GET_OVERLAY_MMC_TI_ARGS \
+	"get_overlay_mmc=" \
+		"fdt address ${fdtaddr};" \
+		"fdt resize 0x100000;" \
+		"for overlay in $name_overlays;" \
+		"do;" \
+			"load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&" \
+			"fdt apply ${dtboaddr};" \
+		"done;\0" \
+
 #define BOOT_TARGET_DEVICES(func) \
 	func(TI_MMC, ti_mmc, na) \
 	func(MMC, mmc, 0) \
@@ -269,6 +279,7 @@
 	"get_fit_config=setenv name_fit_config ${fdtfile}\0" \
 	DEFAULT_COMMON_BOOT_TI_ARGS \
 	DEFAULT_FDT_TI_ARGS \
+	GET_OVERLAY_MMC_TI_ARGS \
 	DFUARGS \
 	NETARGS \
 	NANDARGS \
include/env/ti/mmc.h +1 -0
index d07189baaf4..dbb0e3559ea 100644
@@ -44,6 +44,7 @@
 	"mmcloados=" \
 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
 			"if run loadfdt; then " \
+				"run get_overlay_mmc;" \
 				"bootz ${loadaddr} - ${fdtaddr}; " \
 			"else " \
 				"if test ${boot_fdt} = try; then " \
Signature · 1 line
2.34.1
#4 lore raw
In reply to Anurag Dutta
Quoted 11 lines · Anurag Dutta

The u-boot is unable to load the FIT image due to incorrect boot arguments in case of am57_hs evm as can be seen in [1]. This series introduces multiple changes pertaining to several environment variables and overlays that are responsible for successful [2] loading of kernel image.

Test links:
[1] https://gist.github.com/anuragdutta731/7bbf0df73dd1e3327765f1807d337445
[2] https://gist.github.com/anuragdutta731/5244174c9b9556fd89132c8d72ae2d8b

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom