diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-07-09 20:22:21 -0400 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2011-07-12 11:36:20 +0200 |
commit | a68555f48d06b4c8d55f7e4ca208805bec3d5512 (patch) | |
tree | 132a21ab3f20d2ca5ce967705d4d92c3c0dbe476 /src/arch/x86/lib/romstage_console.c | |
parent | 537cacfa04c9dc56cd608012a73d95ab342d2f81 (diff) |
Do full flush on uart8250 only at end of printk.
The previous code does a full flush of the uart after every character.
Unfortunately, this can cause transmission delays on some serial
ports.
This patch changes the code so that it does a flush at the end of
every printk instead of at the end of every character. This reduces
the time it takes to transmit serial messages (up to 9% on my Asrock
e350m1 board). It also makes the transmission time more consistent
which is important when performing timing tests via serial
transmissions.
Change-Id: I6b28488b905da68c6d68d7c517cc743cde567d70
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Reviewed-on: http://review.coreboot.org/90
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-by: Sven Schnelle <svens@stackframe.org>
Diffstat (limited to 'src/arch/x86/lib/romstage_console.c')
-rw-r--r-- | src/arch/x86/lib/romstage_console.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/arch/x86/lib/romstage_console.c b/src/arch/x86/lib/romstage_console.c index a5f2e2b074..8adb3ba93d 100644 --- a/src/arch/x86/lib/romstage_console.c +++ b/src/arch/x86/lib/romstage_console.c @@ -48,6 +48,19 @@ static void console_tx_byte(unsigned char byte) #endif } +static void console_tx_flush(void) +{ +#if CONFIG_CONSOLE_SERIAL8250MEM + uart8250_mem_tx_flush(CONFIG_OXFORD_OXPCIE_BASE_ADDRESS + 0x1000); +#endif +#if CONFIG_CONSOLE_SERIAL8250 + uart8250_tx_flush(CONFIG_TTYS0_BASE); +#endif +#if CONFIG_CONSOLE_NE2K + ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT); +#endif +} + int do_printk(int msg_level, const char *fmt, ...) { va_list args; @@ -60,8 +73,8 @@ int do_printk(int msg_level, const char *fmt, ...) va_start(args, fmt); i = vtxprintf(console_tx_byte, fmt, args); va_end(args); -#if CONFIG_CONSOLE_NE2K - ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT); -#endif + + console_tx_flush(); + return i; } |