[U-Boot] [PATCH 4/8] AM3517 EVM: Add uEnv.txt to the default bootcmd

Tom Rini trini at ti.com
Tue Dec 6 16:49:38 CET 2011


This adds uEnv.txt (and optargs/uenvcmd) support to the MMC boot section

Signed-off-by: Tom Rini <trini at ti.com>
---
 include/configs/am3517_evm.h |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index d44eeec..39f1a82 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -191,10 +191,20 @@
 	"loadaddr=0x82000000\0" \
 	"console=ttyO2,115200n8\0" \
 	"mmcdev=0\0" \
-	"mmcargs=setenv bootargs console=${console} " \
+	"bootenv=uEnv.txt\0" \
+	"loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
+		"env import -t $loadaddr $filesize\0" \
+	"optargs=\0" \
+	"bootargs_defaults=setenv bootargs " \
+		"console=${console} " \
+		"${optargs}\0" \
+	"mmcargs=run bootargs_defaults; " \
+		"setenv bootargs ${bootargs} " \
 		"root=/dev/mmcblk0p2 rw " \
 		"rootfstype=ext3 rootwait\0" \
-	"nandargs=setenv bootargs console=${console} " \
+	"nandargs=run bootargs_defaults; " \
+		"setenv bootargs ${bootargs} " \
 		"root=/dev/mtdblock4 rw " \
 		"rootfstype=jffs2\0" \
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
@@ -214,6 +224,14 @@
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
+			"if run loadbootenv; then " \
+				"echo Loaded environment from ${bootenv};" \
+				"run importbootenv;" \
+			"fi;" \
+			"if test -n $uenvcmd; then " \
+				"echo Running uenvcmd ...;" \
+				"run uenvcmd;" \
+			"fi;" \
 			"if run loaduimage; then " \
 				"run mmcboot; " \
 			"else run nandboot; " \
-- 
1.7.0.4



More information about the U-Boot mailing list