Patchwork [U-Boot,v4] omap3_beagle: enable the use of a plain text file named uEnv.txt instead of boot.scr

login
register
mail settings
Submitter Jason Kridner
Date March 3, 2011, 3:08 p.m.
Message ID <1299164901-11339-1-git-send-email-jkridner@beagleboard.org>
Download mbox | patch
Permalink /patch/85292/
State Accepted
Delegated to: Sandeep Paulraj
Headers show

Comments

Jason Kridner - March 3, 2011, 3:08 p.m.
From: Alexander Holler <holler@ahsoftware.de>

Using the new env import command it is possible to use plain text files instead
of script-images. Plain text files are much easier to handle.

E.g. If your boot.scr contains the following:
-----------------------------------
setenv dvimode 1024x768-16@60
run loaduimage
run mmcboot
-----------------------------------
you could create a file named uEnv.txt and use that instead of boot.scr:
-----------------------------------
dvimode=1024x768-16@60
uenvcmd=run loaduimage; run mmcboot
-----------------------------------
The variable uenvcmd (if existent) will be executed (using run) after uEnv.txt
was loaded. If uenvcmd doesn't exist the default boot sequence will be started,
therefore you could just use
-----------------------------------
dvimode=1024x768-16@60
-----------------------------------
as uEnv.txt because loaduimage and mmcboot is part of the default boot sequence.
---
Changes for v2:
  - Eliminated else redundant clause that would be ignored if boot
    succeeds.

Changes for v3:
  - Removed boot.scr

Changes for v4:
  - Removed comment about boot.scr being supported.

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
---
 include/configs/omap3_beagle.h |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
Alexander Holler - March 5, 2011, 12:31 p.m.
Hello Jason,

I've just seen a patch which makes env import optional, so you might 
consider adding CONFIG_CMD_IMPORTENV to omap3_beagle.h to be prepared 
when env import will get optional.

Regards,

Alexander Holler
Alexander Holler - March 5, 2011, 12:50 p.m.
Am 05.03.2011 13:31, schrieb Alexander Holler:
> Hello Jason,
>
> I've just seen a patch which makes env import optional, so you might
> consider adding CONFIG_CMD_IMPORTENV to omap3_beagle.h to be prepared
> when env import will get optional.

Sorry for the noise, the patch which makes it optional enables it by 
default, so no action is necessary. Haven't seen that at first.

> Regards,
>
> Alexander Holler
Wolfgang Denk - March 13, 2011, 9:26 p.m.
Dear Alexander Holler,

In message <4D722D1F.1050509@ahsoftware.de> you wrote:
> 
> I've just seen a patch which makes env import optional, so you might 
> consider adding CONFIG_CMD_IMPORTENV to omap3_beagle.h to be prepared 
> when env import will get optional.

I disagree.  CONFIG_CMD_IMPORTENV shall be enabled by default.

Best regards,

Wolfgang Denk

Patch

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 8b580ef..c85537c 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -213,9 +213,9 @@ 
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source ${loadaddr}\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
@@ -227,15 +227,19 @@ 
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc rescan ${mmcdev}; then " \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
-		"else " \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"else run nandboot; " \
-			"fi; " \
-		"fi; " \
-	"else run nandboot; fi"
+		"echo SD/MMC found on device ${mmcdev};" \
+		"if run loadbootenv; then " \
+			"run importbootenv;" \
+		"fi;" \
+		"if test -n $uenvcmd; then " \
+			"echo Running uenvcmd ...;" \
+			"run uenvcmd;" \
+		"fi;" \
+		"if run loaduimage; then " \
+			"run mmcboot;" \
+		"fi;" \
+	"fi;" \
+	"run nandboot;" \
 
 #define CONFIG_AUTO_COMPLETE		1
 /*