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

login
register
mail settings
Submitter Tom Rini
Date Dec. 6, 2011, 3:49 p.m.
Message ID <1323186582-2811-5-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/129717/
State Deferred
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - Dec. 6, 2011, 3:49 p.m.
This adds uEnv.txt (and optargs/uenvcmd) support to the MMC boot section

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

Patch

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; " \