From 6ec3dd2e5c31eb94f9ef4212975ad6fff0d88826 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 21 Jan 2022 13:34:21 -0700 Subject: lib/cbmem_console,console: Resurrect CONSOLE_CBMEM_DUMP_TO_UART Chromebooks normally run with non-serial enabled firmware because writing to the UART console is very slow. This unfortunately makes debugging boot errors more difficult. We tend to rely on port 80s and/or the vboot recovery code. When CONSOLE_CBMEM_DUMP_TO_UART is selected it will dump the entire cbmem console to the UART whenever `vboot_reboot()` is called. We don't incur any boot time penalty in the happy path, but still retain the ability to access the logs when an error occurs. The previous implementation was using a hard coded UART index and `get_uart_baudrate` was always returning 0 since `CONFIG_TTYS0_BAUD` wasn't defined. This change makes it so the UART console properties are available when CONSOLE_CBMEM_DUMP_TO_UART is set. This results in the following .config diff: +CONFIG_UART_FOR_CONSOLE=0 +CONFIG_TTYS0_BASE=0x3f8 +CONFIG_TTYS0_LCS=3 +CONFIG_CONSOLE_SERIAL_115200=y +CONFIG_TTYS0_BAUD=115200 This functionality is especially helpful on Guybrush. PSP Verstage is run on S0i3 resume. Today, if there is an error, the cbmem console is lost since it lives in the PSP SRAM. BUG=b:213828947, b:215599230 TEST=Build non-serial guybrush FW and verify no serial output happens in happy path. Inject a vboot error and perform an S0i3 suspend/resume. Verify CBMEM console gets dumped to the correct UART. Signed-off-by: Raul E Rangel Change-Id: I997942204603362e51876a9ae25e493fe527437b Reviewed-on: https://review.coreboot.org/c/coreboot/+/61305 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner Reviewed-by: Angel Pons --- src/console/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/console') diff --git a/src/console/Kconfig b/src/console/Kconfig index 60b27c459471..f80d2e49722e 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 -- cgit v1.2.3