diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | common/console.c | 17 | ||||
-rw-r--r-- | include/common.h | 1 |
3 files changed, 18 insertions, 5 deletions
@@ -556,6 +556,11 @@ The following options need to be configured: the "silent" environment variable. See doc/README.silent for more information. + When CONFIG_DELAY_CONSOLE is defined, the console init is + delayed until after relocation. To use this feature, the + board architecture code must call console_ready() after + relocation once everything is ready. + - Console Baudrate: CONFIG_BAUDRATE - in bps Select one of the baudrates listed in diff --git a/common/console.c b/common/console.c index 4ab87564cbd..af4b5b92d66 100644 --- a/common/console.c +++ b/common/console.c @@ -576,21 +576,28 @@ int console_assign(int file, const char *devname) return -1; } -/* Called before relocation - use serial functions */ -int console_init_f(void) +int console_ready(void) { - gd->have_console = 1; - #ifdef CONFIG_SILENT_CONSOLE if (getenv("silent") != NULL) gd->flags |= GD_FLG_SILENT; #endif - + gd->have_console = 1; print_pre_console_buffer(); return 0; } +/* Called before relocation - use serial functions */ +int console_init_f(void) +{ +#ifndef CONFIG_DELAY_CONSOLE + console_ready(); +#endif + + return 0; +} + void stdio_print_current_devices(void) { #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET diff --git a/include/common.h b/include/common.h index e1761f66c0a..7f383afd678 100644 --- a/include/common.h +++ b/include/common.h @@ -727,6 +727,7 @@ int ctrlc (void); int had_ctrlc (void); /* have we had a Control-C since last clear? */ void clear_ctrlc (void); /* clear the Control-C condition */ int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */ +int console_ready(void); /* console is now ready and accepting output */ /* * STDIO based functions (can always be used) |