[U-Boot] [PATCH 2/3] arm: mx5: m53evk: Minor tweaks to the default env

Marek Vasut marex at denx.de
Thu Jan 7 19:44:00 CET 2016


Polish the environment a bit, add two new variables so that the MMC
boot and root partitions are not explicitly hard-coded in the env.
Use one less if condition in the try_bootscript and handle possible
mmc rescan failure there.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Stefano Babic <sbabic at denx.de>
---
 include/configs/m53evk.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/configs/m53evk.h b/include/configs/m53evk.h
index fbaa600..e321cca 100644
--- a/include/configs/m53evk.h
+++ b/include/configs/m53evk.h
@@ -283,6 +283,8 @@
 	"bootscript=boot.scr\0"						\
 	"bootdev=/dev/mmcblk0p1\0"					\
 	"rootdev=/dev/mmcblk0p2\0"					\
+	"bootpart=0:1\0"						\
+	"rootpart=0:2\0"						\
 	"netdev=eth0\0"							\
 	"rootpath=/opt/eldk-5.5/armv7a-hf/rootfs-qte-sdk\0"		\
 	"kernel_addr_r=0x72000000\0"					\
@@ -305,7 +307,7 @@
 	"addargs=run addcons addmtd addmisc\0"				\
 	"mmcload="							\
 		"mmc rescan ; "						\
-		"load mmc 0:1 ${kernel_addr_r} ${bootfile}\0"		\
+		"load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0"		\
 	"ubiload="							\
 		"ubi part UBI ; ubifsmount ubi0:rootfs ; "		\
 		"ubifsload ${kernel_addr_r} /boot/${bootfile}\0"	\
@@ -347,13 +349,12 @@
 		"run netload nfsargs addip addargs ; "			\
 		"bootm ${kernel_addr_r}\0"				\
 	"try_bootscript="						\
-		"mmc rescan;"						\
-		"if test -e mmc 0:1 ${bootscript} ; then "		\
-		"if load mmc 0:1 ${kernel_addr_r} ${bootscript};"	\
-		"then ; "						\
+		"if mmc rescan && "					\
+		"test -e mmc ${bootpart} ${bootscript} && "		\
+		"load mmc ${bootpart} ${kernel_addr_r} ${bootscript} ; "\
+		"then "							\
 			"echo Running bootscript... ; "			\
 			"source ${kernel_addr_r} ; "			\
-		"fi ; "							\
 		"fi\0"
 
 #endif	/* __M53EVK_CONFIG_H__ */
-- 
2.1.4



More information about the U-Boot mailing list