public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] omap3_beagle: enable the use of a plain text file named uEnv.txt instead of boot.scr
@ 2011-01-24 23:08 Alexander Holler
  2011-02-04 17:41 ` Jason Kridner
  2011-03-01 23:37 ` [U-Boot] [PATCH v2] " Jason Kridner
  0 siblings, 2 replies; 21+ messages in thread
From: Alexander Holler @ 2011-01-24 23:08 UTC (permalink / raw)
  To: u-boot

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.

For backwards compatibility the use of boot.scr is still supported.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 include/configs/omap3_beagle.h |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 5cfa4cb..0214c7f 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -218,6 +218,9 @@
 	"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; " \
@@ -229,12 +232,24 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc rescan ${mmcdev}; then " \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
+		"if run loadbootenv; then " \
+			"run importbootenv;" \
+			"if test -n $uenvcmd; then " \
+				"echo Running uenvcmd ...;run uenvcmd;" \
+			"else " \
+				"if run loaduimage; then " \
+					"run mmcboot; " \
+				"else run nandboot; " \
+				"fi; " \
+			"fi; " \
 		"else " \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"else run nandboot; " \
+			"if run loadbootscript; then " \
+				"run bootscript; " \
+			"else " \
+				"if run loaduimage; then " \
+					"run mmcboot; " \
+				"else run nandboot; " \
+				"fi; " \
 			"fi; " \
 		"fi; " \
 	"else run nandboot; fi"
-- 
1.7.2.2

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

end of thread, other threads:[~2011-04-18 23:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 23:08 [U-Boot] [PATCH] omap3_beagle: enable the use of a plain text file named uEnv.txt instead of boot.scr Alexander Holler
2011-02-04 17:41 ` Jason Kridner
2011-03-01 23:37 ` [U-Boot] [PATCH v2] " Jason Kridner
2011-03-02  2:54   ` Alexander Holler
2011-03-02 15:44     ` Jason Kridner
2011-03-02 17:47       ` Alexander Holler
2011-03-02 19:55         ` Alexander Holler
2011-03-02 20:26   ` [U-Boot] [PATCH v3] " Jason Kridner
2011-03-02 23:41     ` Alexander Holler
2011-03-02 23:48       ` [U-Boot] [beagleboard] " Robert Nelson
2011-03-03 15:04         ` Jason Kridner
2011-03-04  1:30           ` Alexander Holler
2011-03-04  1:43         ` [U-Boot] " Alexander Holler
2011-03-04  1:51           ` Robert Nelson
2011-03-03 15:08     ` [U-Boot] [PATCH v4] " Jason Kridner
2011-03-05 12:31       ` Alexander Holler
2011-03-05 12:50         ` Alexander Holler
2011-03-13 21:26         ` Wolfgang Denk
2011-04-18 21:35     ` [U-Boot] [PATCH v3] " Paulraj, Sandeep
2011-04-18 23:01       ` Wolfgang Denk
2011-04-18 23:32         ` Paulraj, Sandeep

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