[U-Boot] [PATCH-OMAP3] OMAP3: Enable command parser and add boot scripting

Dirk Behme dirk.behme at googlemail.com
Sat Dec 6 08:03:02 CET 2008


Enable "hush" command parser and set default environment to boot from MMC if
a bootable card is present, otherwise boot from NAND.

Signed-off-by: Steve Sakoman <sakoman at gmail.com>
Signed-off-by: Dirk Behme <dirk.behme at googlemail.com>

---

* This patch applies on top of last 6 pending OMAP3 patches (in this order):

http://lists.denx.de/pipermail/u-boot/2008-November/043771.html
http://lists.denx.de/pipermail/u-boot/2008-November/043898.html
http://lists.denx.de/pipermail/u-boot/2008-November/043899.html
http://lists.denx.de/pipermail/u-boot/2008-November/044026.html
http://lists.denx.de/pipermail/u-boot/2008-November/044027.html
http://lists.denx.de/pipermail/u-boot/2008-December/044292.html

* Compile tested for Beagle, Overo, Panora and EVM. Boot tested on Beagle.

 include/configs/omap3_beagle.h  |   47 ++++++++++++++++++++++++++++++++--------
 include/configs/omap3_evm.h     |   41 ++++++++++++++++++++++++++++------
 include/configs/omap3_overo.h   |   46 ++++++++++++++++++++++++++++++++-------
 include/configs/omap3_pandora.h |   45 ++++++++++++++++++++++++++++++++------
 4 files changed, 148 insertions(+), 31 deletions(-)

Index: u-boot-arm/include/configs/omap3_beagle.h
===================================================================
--- u-boot-arm.orig/include/configs/omap3_beagle.h
+++ u-boot-arm/include/configs/omap3_beagle.h
@@ -159,16 +159,43 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY		10
 
-#define CONFIG_BOOTCOMMAND		"nand read 80200000 280000 400000 ; " \
-					"bootm 80200000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"console=ttyS2,115200n8\0" \
+	"videomode=1024x768 at 60,vxres=1024,vyres=768\0" \
+	"videospec=omapfb:vram:2M,vram:4M\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mmcblk0p2 rw " \
+		"rootfstype=ext3 rootwait\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mtdblock4 rw " \
+		"rootfstype=jffs2\0" \
+	"loadbootscript=fatload mmc 0 ${loadaddr} boot.script\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"autoscr ${loadaddr}\0" \
+	"loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} 280000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+	"if mmcinit; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
 
-#define CONFIG_BOOTARGS			"setenv bootargs console=ttyS2," \
-					"115200n8 noinitrd " \
-					"root=/dev/mtdblock4 " \
-					"rw rootfstype=jffs2"
-
-#define CONFIG_NETMASK			255.255.254.0
-#define CONFIG_BOOTFILE			"uImage"
 #define CONFIG_AUTO_COMPLETE		1
 /*
  * Miscellaneous configurable options
@@ -176,6 +203,8 @@
 #define V_PROMPT			"OMAP3 beagleboard.org # "
 
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 #define CONFIG_SYS_PROMPT		V_PROMPT
 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
 /* Print Buffer Size */
Index: u-boot-arm/include/configs/omap3_evm.h
===================================================================
--- u-boot-arm.orig/include/configs/omap3_evm.h
+++ u-boot-arm/include/configs/omap3_evm.h
@@ -165,14 +165,39 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY	10
 
-#define CONFIG_BOOTCOMMAND	"onenand read 80200000 280000 400000 ; " \
-				"bootm 80200000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"console=ttyS2,115200n8\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"root=/dev/mmcblk0p2 rw " \
+		"rootfstype=ext3 rootwait\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"root=/dev/mtdblock4 rw " \
+		"rootfstype=jffs2\0" \
+	"loadbootscript=fatload mmc 0 ${loadaddr} boot.script\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"autoscr ${loadaddr}\0" \
+	"loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"onenand read ${loadaddr} 280000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+	"if mmcinit; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
 
-#define CONFIG_BOOTARGS	"setenv bootargs console=ttyS2,115200n8 noinitrd " \
-			"root=/dev/mtdblock4 rw rootfstype=jffs2"
-
-#define CONFIG_NETMASK		255.255.254.0
-#define CONFIG_BOOTFILE		"uImage"
 #define CONFIG_AUTO_COMPLETE	1
 /*
  * Miscellaneous configurable options
@@ -180,6 +205,8 @@
 #define V_PROMPT		"OMAP3_EVM # "
 
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 #define CONFIG_SYS_PROMPT		V_PROMPT
 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
 /* Print Buffer Size */
Index: u-boot-arm/include/configs/omap3_overo.h
===================================================================
--- u-boot-arm.orig/include/configs/omap3_overo.h
+++ u-boot-arm/include/configs/omap3_overo.h
@@ -151,15 +151,43 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY		5
 
-#define CONFIG_BOOTCOMMAND	"mmcinit; fatload mmc 0 82000000 uImage; "\
-				"bootm 82000000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"console=ttyS2,115200n8\0" \
+	"videomode=1024x768 at 60,vxres=1024,vyres=768\0" \
+	"videospec=omapfb:vram:2M,vram:4M\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mmcblk0p2 rw " \
+		"rootfstype=ext3 rootwait\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mtdblock4 rw " \
+		"rootfstype=jffs2\0" \
+	"loadbootscript=fatload mmc 0 ${loadaddr} boot.script\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"autoscr ${loadaddr}\0" \
+	"loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} 280000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+	"if mmcinit; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
 
-#define CONFIG_BOOTARGS		"setenv bootargs console=ttyS2,115200n8 " \
-				"root=/dev/mmcblk0p2 rw rootfstype=ext3 " \
-				"rootwait"
-
-#define CONFIG_NETMASK		255.255.254.0
-#define CONFIG_BOOTFILE		"uImage"
 #define CONFIG_AUTO_COMPLETE	1
 /*
  * Miscellaneous configurable options
@@ -167,6 +195,8 @@
 #define V_PROMPT		"Overo # "
 
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 #define CONFIG_SYS_PROMPT		V_PROMPT
 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
 /* Print Buffer Size */
Index: u-boot-arm/include/configs/omap3_pandora.h
===================================================================
--- u-boot-arm.orig/include/configs/omap3_pandora.h
+++ u-boot-arm/include/configs/omap3_pandora.h
@@ -151,14 +151,43 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY		1
 
-#define CONFIG_BOOTCOMMAND	"nand read 80200000 280000 400000 ; " \
-				"bootm 80200000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"console=ttyS0,115200n8\0" \
+	"videomode=1024x768 at 60,vxres=1024,vyres=768\0" \
+	"videospec=omapfb:vram:2M,vram:4M\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mmcblk0p2 rw " \
+		"rootfstype=ext3 rootwait\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"video=${videospec},mode:${videomode} " \
+		"root=/dev/mtdblock4 rw " \
+		"rootfstype=jffs2\0" \
+	"loadbootscript=fatload mmc 0 ${loadaddr} boot.script\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"autoscr ${loadaddr}\0" \
+	"loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} 280000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_BOOTCOMMAND \
+	"if mmcinit; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
 
-#define CONFIG_BOOTARGS		"console=ttyS0,115200n8 noinitrd " \
-				"root=/dev/mtdblock4 rw rootfstype=jffs2"
-
-#define CONFIG_NETMASK		255.255.254.0
-#define CONFIG_BOOTFILE		"uImage"
 #define CONFIG_AUTO_COMPLETE	1
 /*
  * Miscellaneous configurable options
@@ -166,6 +195,8 @@
 #define V_PROMPT		"Pandora # "
 
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 #define CONFIG_SYS_PROMPT		V_PROMPT
 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
 /* Print Buffer Size */


More information about the U-Boot mailing list