[U-Boot] [PATCH 2/2] ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support

Derald D. Woods woods.technical at gmail.com
Sun Jan 21 03:16:14 UTC 2018


The omap3_evm board does not boot when commit:
    a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
is applied after commit:
    3dde8f2037 ("Merge git://git.denx.de/u-boot-mmc")

This commit reduces the CONFIG_EXTRA_ENV_SETTINGS size and better
leverages the existing distro bootcmd infrastructure.

- Use updated UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC naming found in am335x_evm.h and ti_omap4_common.h
- Remove extra environment content that is no longer needed

[MMC(0:1)/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-fat
label omap3-evm-mmc-fat
	kernel /zImage
	fdt /omap3-evm.dtb
	append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[MMC(0:2)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-ext4
label omap3-evm-mmc-ext4
	kernel /boot/zImage
	fdt /boot/omap3-evm.dtb
	append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[NAND(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-nand-ubifs
label omap3-evm-nand-ubifs
	kernel /boot/zImage
	fdt /boot/omap3-evm.dtb
	append console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd rootfstype=ubifs rootwait
---8<-------------------------------------------------------------------

Fixes: a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
Signed-off-by: Derald D. Woods <woods.technical at gmail.com>
---
 include/configs/omap3_evm.h | 80 ++++++++++++++-------------------------------
 1 file changed, 25 insertions(+), 55 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 3ecfdbb3ce..c329d97528 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -89,43 +89,24 @@
 #define MEM_LAYOUT_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV
 
-#if defined(CONFIG_NAND) && defined(CONFIG_CMD_UBI)
-/* NAND boot with uImage from NAND 'kernel' partition */
 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
 	"bootcmd_" #devtypel #instance "=" \
 	"run nandboot\0"
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
 	#devtypel #instance " "
 
-/* NAND boot with zImage from UBIFS '/boot/zImage' */
-#define BOOTENV_DEV_UBIFS_NAND(devtypeu, devtypel, instance) \
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
 	"bootcmd_" #devtypel #instance "=" \
-	"run nandbootubifs\0"
-#define BOOTENV_DEV_NAME_UBIFS_NAND(devtypeu, devtypel, instance) \
-	#devtypel #instance " "
-#endif /* CONFIG_NAND && CONFIG_CMD_UBI */
-
-/* MMC boot with uImage from MMC 0:2 '/boot/uImage' */
-#define BOOTENV_DEV_UIMAGE_MMC(devtypeu, devtypel, instance) \
-	"bootcmd_" #devtypel #instance "=" \
-		"setenv mmcdev " #instance"; " \
-		"run mmcboot\0"
-#define BOOTENV_DEV_NAME_UIMAGE_MMC(devtypeu, devtypel, instance) \
-	#devtypel #instance " "
-
-/* MMC boot with zImage from MMC 0:2 '/boot/zImage' */
-#define BOOTENV_DEV_ZIMAGE_MMC(devtypeu, devtypel, instance) \
-	"bootcmd_" #devtypel #instance "=" \
-		"setenv mmcdev " #instance"; " \
-		"run mmcbootz\0"
-#define BOOTENV_DEV_NAME_ZIMAGE_MMC(devtypeu, devtypel, instance) \
+	"setenv mmcdev " #instance "; " \
+	"setenv bootpart " #instance ":${mmcpart} ; " \
+	"run mmcboot\0"
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
 	#devtypel #instance " "
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
-	func(ZIMAGE_MMC, zimage_mmc, 0) \
-	func(UIMAGE_MMC, uimage_mmc, 0) \
-	func(UBIFS_NAND, ubifs_nand, 0) \
+	func(LEGACY_MMC, legacy_mmc, 0) \
+	func(UBIFS, ubifs, 0) \
 	func(NAND, nand, 0)
 
 #include <config_distro_bootcmd.h>
@@ -138,9 +119,13 @@
 	"fdt_high=0xffffffff\0" \
 	"bootdir=/boot\0" \
 	"bootenv=uEnv.txt\0" \
+	"bootfile=zImage\0" \
+	"bootubivol=rootfs\0" \
+	"bootubipart=rootfs\0" \
 	"optargs=\0" \
 	"mmcdev=0\0" \
 	"mmcpart=2\0" \
+	"bootpart=${mmcdev}:${mmcpart}\0" \
 	"console=ttyO0,115200n8\0" \
 	"mmcargs=setenv bootargs console=${console} " \
 		"${mtdparts} " \
@@ -153,7 +138,7 @@
 		"root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
 		"rootfstype=ubifs rootwait\0" \
 	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
-	"ext4bootenv=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
+	"ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t ${loadaddr} ${filesize}\0" \
 	"mmcbootenv=mmc dev ${mmcdev}; " \
@@ -165,39 +150,24 @@
 				"run uenvcmd; " \
 			"fi; " \
 		"fi\0" \
-	"loaduimage=setenv bootfile uImage; " \
-		"ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-	"loadzimage=setenv bootfile zImage; " \
-		"ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-	"loaddtb=ext4load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-	"loadubizimage=setenv bootfile zImage; " \
-		"ubifsload ${loadaddr} ${bootdir}/${bootfile}\0" \
-	"loadubidtb=ubifsload ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+	"loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loaddtb=ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
 	"mmcboot=run mmcbootenv; " \
-		"if run loaduimage && run loaddtb; then " \
-			"echo Booting ${bootdir}/${bootfile} from mmc ${mmcdev}:${mmcpart} ...; " \
+		"if run loadimage && run loaddtb; then " \
+			"echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
 			"run mmcargs; " \
-			"bootm ${loadaddr} - ${fdtaddr}; " \
-		"fi\0" \
-	"mmcbootz=run mmcbootenv; " \
-		"if run loadzimage && run loaddtb; then " \
-			"echo Booting ${bootdir}/${bootfile} from mmc ${mmcdev}:${mmcpart} ...; " \
-			"run mmcargs; " \
-			"bootz ${loadaddr} - ${fdtaddr}; " \
+			"if test ${bootfile} = uImage; then " \
+				"bootm ${loadaddr} - ${fdtaddr}; " \
+			"fi; " \
+			"if test ${bootfile} = zImage; then " \
+				"bootz ${loadaddr} - ${fdtaddr}; " \
+			"fi; " \
 		"fi\0" \
 	"nandboot=" \
-		"nand read ${loadaddr} kernel; " \
-		"nand read ${fdtaddr} dtb; " \
-		"echo Booting uImage from NAND MTD 'kernel' partition ...; " \
-		"run nandargs; " \
-		"bootm ${loadaddr} - ${fdtaddr}\0" \
-	"nandbootubifs=" \
-		"ubi part rootfs; " \
-		"ubifsmount ubi0:rootfs; " \
-		"if run loadubizimage && run loadubidtb; then " \
-			"echo Booting ${bootdir}/${bootfile} from NAND ubi0:rootfs ...; " \
+		"if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
+			"echo Booting uImage from NAND MTD 'kernel' partition ...; " \
 			"run nandargs; " \
-			"bootz ${loadaddr} - ${fdtaddr}; " \
+			"bootm ${loadaddr} - ${fdtaddr}; " \
 		"fi\0" \
 	BOOTENV
 
-- 
2.16.0



More information about the U-Boot mailing list