summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Jackson <mpfj@mimc.co.uk>2008-08-25 19:21:30 +0100
committerWolfgang Denk <wd@denx.de>2008-09-06 22:36:54 +0200
commitf5c3ba79788b0e39baab7026d374fe375dd1a43f (patch)
tree35d2f149ce9d4dd63eb2eb3fc38e457b4aced883
parent2b22d608f370565c87f55928b524207031419c11 (diff)
downloadtalos-obmc-uboot-f5c3ba79788b0e39baab7026d374fe375dd1a43f.tar.gz
talos-obmc-uboot-f5c3ba79788b0e39baab7026d374fe375dd1a43f.zip
Allow console input to be disabled
Added new CONFIG_DISABLE_CONSOLE define and GD_FLG_DISABLE_CONSOLE. When CONFIG_DISABLE_CONSOLE is defined, setting GD_FLG_DISABLE_CONSOLE disables all console input and output. Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
-rw-r--r--common/console.c20
-rw-r--r--include/asm-arm/global_data.h1
-rw-r--r--include/asm-avr32/global_data.h1
-rw-r--r--include/asm-blackfin/global_data.h1
-rw-r--r--include/asm-i386/global_data.h1
-rw-r--r--include/asm-m68k/global_data.h1
-rw-r--r--include/asm-microblaze/global_data.h1
-rw-r--r--include/asm-mips/global_data.h1
-rw-r--r--include/asm-nios/global_data.h1
-rw-r--r--include/asm-nios2/global_data.h1
-rw-r--r--include/asm-ppc/global_data.h1
-rw-r--r--include/asm-sh/global_data.h1
-rw-r--r--include/asm-sparc/global_data.h1
13 files changed, 32 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index cfcaeb86ca..56d9118cb2 100644
--- a/common/console.c
+++ b/common/console.c
@@ -162,6 +162,11 @@ void fprintf (int file, const char *fmt, ...)
int getc (void)
{
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return 0;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Get from the standard input */
return fgetc (stdin);
@@ -173,6 +178,11 @@ int getc (void)
int tstc (void)
{
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return 0;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Test the standard input */
return ftstc (stdin);
@@ -189,6 +199,11 @@ void putc (const char c)
return;
#endif
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Send to the standard output */
fputc (stdout, c);
@@ -205,6 +220,11 @@ void puts (const char *s)
return;
#endif
+#ifdef CONFIG_DISABLE_CONSOLE
+ if (gd->flags & GD_FLG_DISABLE_CONSOLE)
+ return;
+#endif
+
if (gd->flags & GD_FLG_DEVINIT) {
/* Send to the standard output */
fputs (stdout, s);
diff --git a/include/asm-arm/global_data.h b/include/asm-arm/global_data.h
index 7e2a53adb0..f419b42adc 100644
--- a/include/asm-arm/global_data.h
+++ b/include/asm-arm/global_data.h
@@ -63,6 +63,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
diff --git a/include/asm-avr32/global_data.h b/include/asm-avr32/global_data.h
index 007cfe4e7e..75e75cc6c8 100644
--- a/include/asm-avr32/global_data.h
+++ b/include/asm-avr32/global_data.h
@@ -54,6 +54,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buf has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
diff --git a/include/asm-blackfin/global_data.h b/include/asm-blackfin/global_data.h
index b0b01e4856..2f408705e4 100644
--- a/include/asm-blackfin/global_data.h
+++ b/include/asm-blackfin/global_data.h
@@ -64,6 +64,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buf has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P5")
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h
index 5dfb595109..35bad23c17 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -57,6 +57,7 @@ typedef struct {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
extern gd_t *global_data;
diff --git a/include/asm-m68k/global_data.h b/include/asm-m68k/global_data.h
index 10c6931534..187618d72c 100644
--- a/include/asm-m68k/global_data.h
+++ b/include/asm-m68k/global_data.h
@@ -75,6 +75,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#if 0
extern gd_t *global_data;
diff --git a/include/asm-microblaze/global_data.h b/include/asm-microblaze/global_data.h
index 376786fca9..013c56a492 100644
--- a/include/asm-microblaze/global_data.h
+++ b/include/asm-microblaze/global_data.h
@@ -55,6 +55,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r31")
diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h
index ecee6dea6a..7cf2a00acb 100644
--- a/include/asm-mips/global_data.h
+++ b/include/asm-mips/global_data.h
@@ -57,6 +57,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buf has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("k0")
diff --git a/include/asm-nios/global_data.h b/include/asm-nios/global_data.h
index a56f939df3..4929a5b872 100644
--- a/include/asm-nios/global_data.h
+++ b/include/asm-nios/global_data.h
@@ -48,6 +48,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("%g7")
diff --git a/include/asm-nios2/global_data.h b/include/asm-nios2/global_data.h
index cd17e0894f..db71324d49 100644
--- a/include/asm-nios2/global_data.h
+++ b/include/asm-nios2/global_data.h
@@ -47,6 +47,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r15")
diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
index a9366c3673..4331a154ea 100644
--- a/include/asm-ppc/global_data.h
+++ b/include/asm-ppc/global_data.h
@@ -180,6 +180,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#if 1
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
diff --git a/include/asm-sh/global_data.h b/include/asm-sh/global_data.h
index d61421b687..f8ade5ca62 100644
--- a/include/asm-sh/global_data.h
+++ b/include/asm-sh/global_data.h
@@ -47,6 +47,7 @@ typedef struct global_data
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("r13")
diff --git a/include/asm-sparc/global_data.h b/include/asm-sparc/global_data.h
index a8d85f1b5c..eeb35d08d0 100644
--- a/include/asm-sparc/global_data.h
+++ b/include/asm-sparc/global_data.h
@@ -82,6 +82,7 @@ typedef struct global_data {
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
+#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("%g7")
OpenPOWER on IntegriCloud