diff options
author | Simon Glass <sjg@chromium.org> | 2011-12-19 15:47:12 -0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2011-12-21 13:16:26 -0800 |
commit | 416b0a008f27eb6ff99fa6824532b131b783e32d (patch) | |
tree | bc284616d7f10312727df0caf1088a07b9344927 /common | |
parent | 5e601c69d07857ebfbd709acba7c448fd0189f5f (diff) |
Add CONFIG_DELAY_CONSOLE to delay console init
This option delays console initialization until after relocation. This
can save time if this init is relatively expensive, since after
relocation the CPU is often running much faster.
This option should be used in conjunction with CONFIG_PRE_CONSOLE_BUFFER
to ensure that all console output is buffered until the console is
ready for it.
This saves about 30ms boot time.
BUG=chromium-os:22938
TEST=build and boot on Kaen
Change-Id: I3a774b418d45e7be9338f9942df445c2c2baa528
Reviewed-on: https://gerrit.chromium.org/gerrit/13207
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/console.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/common/console.c b/common/console.c index 4ab87564cb..af4b5b92d6 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 |