cbmem: add and use a function to dump console buffer
The new function can be compiled in only when serial console is disabled. When invoked, this function initializes the serial interface and dumps the contents of the CBMEM console buffer to serial output. BRANCH=none BUG=chromium:475347 TEST=compiled for different platforms with and without serial console enabled. No actual test of this function yet. Change-Id: Ia8d16649dc9d09798fa6970f2cfd893438e00dc5 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: a38a8254dd788ad188ba2509b9ae117d6f699579 Original-Change-Id: Ib85759a2727e31ba1ca21da7e6c346e434f83b52 Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/265293 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9984 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
committed by
Patrick Georgi
parent
5bdbd004e6
commit
6e20e2f168
@ -19,6 +19,7 @@
|
||||
|
||||
#include <console/console.h>
|
||||
#include <console/cbmem_console.h>
|
||||
#include <console/uart.h>
|
||||
#include <cbmem.h>
|
||||
#include <arch/early_variables.h>
|
||||
#include <symbols.h>
|
||||
@ -236,5 +237,21 @@ void cbmemc_reinit(void)
|
||||
init_console_ptr(cbm_cons_p, size, flags);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART)
|
||||
void cbmem_dump_console(void)
|
||||
{
|
||||
struct cbmem_console *cbm_cons_p;
|
||||
int cursor;
|
||||
|
||||
cbm_cons_p = current_console();
|
||||
if (!cbm_cons_p)
|
||||
return;
|
||||
|
||||
uart_init(0);
|
||||
for (cursor = 0; cursor < cbm_cons_p->buffer_cursor; cursor++)
|
||||
uart_tx_byte(0, cbm_cons_p->buffer_body[cursor]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Call cbmemc_reinit() at CAR migration time. */
|
||||
CAR_MIGRATE(cbmemc_reinit)
|
||||
|
Reference in New Issue
Block a user