diff options
-rw-r--r-- | common/console.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial.c | 1 | ||||
-rw-r--r-- | include/asm-generic/global_data.h | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/common/console.c b/common/console.c index 5576dfd..898da39 100644 --- a/common/console.c +++ b/common/console.c @@ -417,7 +417,7 @@ static inline void print_pre_console_buffer(void) {} void putc(const char c) { #ifdef CONFIG_SANDBOX - if (!gd) { + if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) { os_putc(c); return; } @@ -447,7 +447,7 @@ void putc(const char c) void puts(const char *s) { #ifdef CONFIG_SANDBOX - if (!gd) { + if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) { os_puts(s); return; } diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 803d850..d2eb752 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -418,6 +418,7 @@ static struct serial_device *get_current(void) */ int serial_init(void) { + gd->flags |= GD_FLG_SERIAL_READY; return get_current()->start(); } diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index edde9d7..74df210 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -106,5 +106,6 @@ typedef struct global_data { #define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */ #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ #define GD_FLG_ENV_READY 0x00080 /* Env. imported into hash table */ +#define GD_FLG_SERIAL_READY 0x00100 /* Pre-reloc serial console ready */ #endif /* __ASM_GENERIC_GBL_DATA_H */ |