[U-Boot] [PATCH 3/3] arm: socfpga: mcvevk: Minor tweaks to the default env

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

diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h
index e7b5675..e23a859 100644
--- a/include/configs/socfpga_mcvevk.h
+++ b/include/configs/socfpga_mcvevk.h
@@ -53,6 +53,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=mcvevk\0"						\
 	"kernel_addr_r=0x10000000\0"					\
@@ -91,7 +93,7 @@
 	"addargs=run addcons addmisc\0"					\
 	"mmcload="							\
 		"mmc rescan ; "						\
-		"load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"		\
+		"load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0"		\
 	"netload="							\
 		"tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"	\
 	"miscargs=nohlt panic=1\0"					\
@@ -112,13 +114,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