diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/console/Kconfig | 2 | ||||
-rw-r--r-- | src/lib/cbmem_console.c | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/console/Kconfig b/src/console/Kconfig index 60b27c4594..f80d2e4972 100644 --- a/src/console/Kconfig +++ b/src/console/Kconfig @@ -47,7 +47,7 @@ config FIXED_UART_FOR_CONSOLE specific UART has to be used (e.g. when the platform code performs dangerous configurations). -if CONSOLE_SERIAL +if CONSOLE_SERIAL || CONSOLE_CBMEM_DUMP_TO_UART comment "I/O mapped, 8250-compatible" depends on DRIVERS_UART_8250IO diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 8e190d7264..2faa5d5801 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -171,16 +171,27 @@ POSTCAR_CBMEM_INIT_HOOK(cbmemc_reinit) void cbmem_dump_console_to_uart(void) { u32 cursor; + unsigned int console_index; + if (!current_console) return; - uart_init(0); - if (current_console->cursor & OVERFLOW) + console_index = get_uart_for_console(); + + uart_init(console_index); + if (current_console->cursor & OVERFLOW) { for (cursor = current_console->cursor & CURSOR_MASK; - cursor < current_console->size; cursor++) - uart_tx_byte(0, current_console->body[cursor]); - for (cursor = 0; cursor < (current_console->cursor & CURSOR_MASK); cursor++) - uart_tx_byte(0, current_console->body[cursor]); + cursor < current_console->size; cursor++) { + if (current_console->body[cursor] == '\n') + uart_tx_byte(console_index, '\r'); + uart_tx_byte(console_index, current_console->body[cursor]); + } + } + for (cursor = 0; cursor < (current_console->cursor & CURSOR_MASK); cursor++) { + if (current_console->body[cursor] == '\n') + uart_tx_byte(console_index, '\r'); + uart_tx_byte(console_index, current_console->body[cursor]); + } } #endif |