public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] omap4: use plain text env file instead boot scripts
@ 2012-12-25 14:15 Javier Martinez Canillas
  2012-12-25 20:00 ` Wolfgang Denk
  2013-01-02 14:39 ` Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Javier Martinez Canillas @ 2012-12-25 14:15 UTC (permalink / raw)
  To: u-boot

Based on commit cf073e49bc3502be1b48a0e3faf0cde9edbb89db for beagleboard

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 at 60
run loaduimage
run mmcboot
-----------------------------------
you could create a file named uEnv.txt and use that instead of boot.scr:
-----------------------------------
dvimode=1024x768-16 at 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 at 60
-----------------------------------
as uEnv.txt because loaduimage and mmcboot is part of the default boot sequence

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 include/configs/omap4_common.h |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index a32369a..a821c01 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -156,9 +156,9 @@
 		"vram=${vram} " \
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
-	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
-		"source ${loadaddr}\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
+		"env import -t ${loadaddr} ${filesize}\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
 	"mmcboot=echo Booting from mmc${mmcdev} ...; " \
 		"run mmcargs; " \
@@ -166,12 +166,16 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"mmc dev ${mmcdev}; if mmc rescan; then " \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
-		"else " \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"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"
 
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-02 22:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-25 14:15 [U-Boot] [PATCH 1/1] omap4: use plain text env file instead boot scripts Javier Martinez Canillas
2012-12-25 20:00 ` Wolfgang Denk
2012-12-26  3:49   ` Javier Martinez Canillas
2012-12-26 11:40     ` Wolfgang Denk
2012-12-26 11:54       ` Javier Martinez Canillas
2013-01-02 14:39 ` Tom Rini
2013-01-02 22:05   ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox