[U-Boot] [PATCH 1/3] arm: mxs: m28evk: Minor tweaks to the default env

Marek Vasut marex at denx.de
Thu Jan 7 19:43:59 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/m28evk.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 8063a1e..7363b0c 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -165,6 +165,8 @@
 	"bootscript=boot.scr\0"						\
 	"bootdev=/dev/mmcblk0p2\0"					\
 	"rootdev=/dev/mmcblk0p3\0"					\
+	"bootpart=0:2\0"						\
+	"rootpart=0:3\0"						\
 	"netdev=eth0\0"							\
 	"hostname=m28evk\0"						\
 	"rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0"		\
@@ -229,7 +231,7 @@
 	"addargs=run addcons addmtd addmisc\0"				\
 	"mmcload="							\
 		"mmc rescan ; "						\
-		"load mmc 0:2 ${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"	\
@@ -271,13 +273,12 @@
 		"run netload nfsargs addip addargs ; "			\
 		"bootm ${kernel_addr_r}\0"				\
 	"try_bootscript="						\
-		"mmc rescan;"						\
-		"if test -e mmc 0:2 ${bootscript} ; then "		\
-		"if load mmc 0:2 ${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"
 
 /* The rest of the configuration is shared */
-- 
2.1.4



More information about the U-Boot mailing list