public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH-OMAP3] OMAP3: Enable command parser and add boot scripting
Date: Sat,  6 Dec 2008 08:03:02 +0100	[thread overview]
Message-ID: <1228546982-23329-1-git-send-email-dirk.behme@googlemail.com> (raw)

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@gmail.com>
Signed-off-by: Dirk Behme <dirk.behme@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 */

             reply	other threads:[~2008-12-06  7:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06  7:03 Dirk Behme [this message]
2008-12-06 16:38 ` [U-Boot] [PATCH-OMAP3] OMAP3: Enable command parser and add boot scripting Jason Kridner
2008-12-06 17:44   ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1228546982-23329-1-git-send-email-dirk.behme@googlemail.com \
    --to=dirk.behme@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox