Skip to contentSkip to conversation

OMAP3: Enable command parser and add boot scripting

U-Boot Dirk Behme 3 participants 3 messages Dec 6, 2008

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

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

---

* 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(-)
include/configs/omap3_beagle.h +38 -9
Index: 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 */
include/configs/omap3_evm.h +34 -7

54 lines not on this page · raw message

include/configs/omap3_overo.h +38 -8

59 lines not on this page · raw message

include/configs/omap3_pandora.h +38 -7

58 lines not on this page · raw message

#1 lore raw

Is it possible to rename boot.script to boot.scr or something with an 8.3 filename, in case someone formats their SD card as msdos, rather than vfat?

Quoted 293 lines · Dirk Behme

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

---

* 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
===================================================================

include/configs/omap3_beagle.h +38 -9
@@ -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
===================================================================

include/configs/omap3_evm.h +32 -7
@@ -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

include/configs/omap3_evm.h +2 -0
@@ -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
===================================================================

include/configs/omap3_overo.h +36 -8
@@ -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

include/configs/omap3_overo.h +2 -0
@@ -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
===================================================================

include/configs/omap3_pandora.h +38 -7
@@ -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 */

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw
Quoted 4 lines · Jason Kridner

Is it possible to rename boot.script to boot.scr or something with an 8.3 filename, in case someone formats their SD card as msdos, rather than vfat?

Ack

Best Regards,
J.