[oe-commits] Steffen Sledz : u-boot-2009.03: abortboot behaviour changed for hipox machine

git version control git at git.openembedded.org
Tue May 25 07:47:18 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: de05c6b5748b787d3d945b9df0a6135d9ec658f7
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=de05c6b5748b787d3d945b9df0a6135d9ec658f7

Author: Steffen Sledz <sledz at dresearch.de>
Date:   Fri May 21 08:45:29 2010 +0200

u-boot-2009.03: abortboot behaviour changed for hipox machine

* ignore all chars sent before boot prompt
* accept only '.' to abort boot

Signed-off-by: Mario Schuknecht <m.schuknecht at dresearch.de>
Acked-by: Steffen Sledz <sledz at dresearch.de>

---

 .../hipox/10-hipox-boot-abort-key.patch            |   73 ++++++++++++++++++++
 recipes/u-boot/u-boot_2009.03.bb                   |    3 +-
 2 files changed, 75 insertions(+), 1 deletions(-)

diff --git a/recipes/u-boot/u-boot-2009.03/hipox/10-hipox-boot-abort-key.patch b/recipes/u-boot/u-boot-2009.03/hipox/10-hipox-boot-abort-key.patch
new file mode 100644
index 0000000..86838d6
--- /dev/null
+++ b/recipes/u-boot/u-boot-2009.03/hipox/10-hipox-boot-abort-key.patch
@@ -0,0 +1,73 @@
+diff -Nurd u-boot-2009.03.orig//common/main.c u-boot-2009.03/common/main.c
+--- u-boot-2009.03.orig//common/main.c	2010-05-25 08:10:52.000000000 +0200
++++ u-boot-2009.03/common/main.c	2010-05-25 08:16:03.000000000 +0200
+@@ -62,6 +62,9 @@
+ 
+ #define MAX_DELAY_STOP_STR 32
+ 
++/* The boot abort character '.' */
++#define BOOT_ABORT_CHAR 0x2E
++
+ #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
+ static int abortboot(int);
+ #endif
+@@ -214,11 +217,18 @@
+ static __inline__ int abortboot(int bootdelay)
+ {
+ 	int abort = 0;
++	// flush 16 byte UART read fifo
++	int i;
++	for(i=0; (i<16) && tstc(); ++i)
++	{
++		int dropbyte = getc();  /* consume input        */
++		printf("drop UART byte: 0x%02X\n", dropbyte);
++	}
+ 
+ #ifdef CONFIG_MENUPROMPT
+ 	printf(CONFIG_MENUPROMPT);
+ #else
+-	printf("Hit any key to stop autoboot: %2d ", bootdelay);
++	printf("Hit '%c' to stop autoboot: %2d ", BOOT_ABORT_CHAR, bootdelay);
+ #endif
+ 
+ #if defined CONFIG_ZERO_BOOTDELAY_CHECK
+@@ -228,9 +238,12 @@
+ 	 */
+ 	if (bootdelay >= 0) {
+ 		if (tstc()) {	/* we got a key press	*/
+-			(void) getc();  /* consume input	*/
+-			puts ("\b\b\b 0");
+-			abort = 1;	/* don't auto boot	*/
++			int currkey = getc();  /* consume input	*/
++			if(BOOT_ABORT_CHAR == currkey)
++			{
++				puts ("\b\b\b 0");
++				abort = 1;	/* don't auto boot	*/
++			}
+ 		}
+ 	}
+ #endif
+@@ -242,14 +255,20 @@
+ 		/* delay 100 * 10ms */
+ 		for (i=0; !abort && i<100; ++i) {
+ 			if (tstc()) {	/* we got a key press	*/
++# ifdef CONFIG_MENUKEY
+ 				abort  = 1;	/* don't auto boot	*/
+ 				bootdelay = 0;	/* no more delay	*/
+-# ifdef CONFIG_MENUKEY
+ 				menukey = getc();
++				break;
+ # else
+-				(void) getc();  /* consume input	*/
++				int currkey = getc();  /* consume input	*/
++				if(BOOT_ABORT_CHAR == currkey)
++				{
++					abort  = 1;	/* don't auto boot	*/
++					bootdelay = 0;	/* no more delay	*/
++					break;
++				}
+ # endif
+-				break;
+ 			}
+ 			udelay(10000);
+ 		}
diff --git a/recipes/u-boot/u-boot_2009.03.bb b/recipes/u-boot/u-boot_2009.03.bb
index 7749aea..7f22087 100644
--- a/recipes/u-boot/u-boot_2009.03.bb
+++ b/recipes/u-boot/u-boot_2009.03.bb
@@ -1,4 +1,4 @@
-PR = "r2"
+PR = "r3"
 require u-boot.inc
 
 DEFAULT_PREFERENCE = "-1"
@@ -13,6 +13,7 @@ SRC_URI_append_hipox = "file://00-hipox.patch;patch=1 \
 	file://02-hipox-enable-mmu.patch;patch=1 \
 	file://03-hipox-direct-switch.patch;patch=1 \
 	file://04-hipox-env.patch;patch=1 \
+	file://10-hipox-boot-abort-key.patch;patch=1 \
 "
 
 TARGET_LDFLAGS = ""





More information about the Openembedded-commits mailing list