coreboot-kgpe-d16/src/lib
Raul E Rangel 6ec3dd2e5c 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 <rrangel@chromium.org>
Change-Id: I997942204603362e51876a9ae25e493fe527437b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-01-25 16:13:39 +00:00
..
gnat Makefile.inc: Add -fno-pie to ADAFLAGS_common 2022-01-23 18:55:16 +00:00
asan.c
b64_decode.c
bmp_logo.c
boot_device.c
bootblock.c
bootmem.c
bootmode.c
bootsplash.c
cb.ads
cbfs.c lib/cbfs: Disable cbfs_preload in romstage when VBOOT_STARTS_IN_ROMSTAGE 2021-12-15 23:26:06 +00:00
cbmem_common.c
cbmem_console.c lib/cbmem_console,console: Resurrect CONSOLE_CBMEM_DUMP_TO_UART 2022-01-25 16:13:39 +00:00
cbmem_stage_cache.c
compute_ip_checksum.c
coreboot_table.c coreboot tables: Add type-c port info to coreboot table 2021-10-04 17:12:48 +00:00
crc_byte.c
decompressor.c
delay.c
device_tree.c src/acpi to src/lib: Fix spelling errors 2021-10-05 18:06:39 +00:00
dimm_info_util.c arch/x86: Refactor the SMBIOS type 17 write function 2021-11-11 09:10:10 +00:00
dp_aux.c src/{drivers,lib}: Remove unused <console/console.h> 2022-01-14 00:29:02 +00:00
edid.c src/acpi to src/lib: Fix spelling errors 2021-10-05 18:06:39 +00:00
edid_fill_fb.c
espi_debug.c
ext_stage_cache.c
fallback_boot.c
fit.c src: Remove unused <cbfs.h> 2022-01-17 15:38:54 +00:00
fit_payload.c src: Remove unused <cbfs.h> 2022-01-17 15:38:54 +00:00
fmap.c src/lib/fmap.c: use le*toh() functions where needed 2021-10-27 14:55:51 +00:00
fw_config.c src/lib: Add FW_CONFIG_SOURCE_VPD 2021-11-08 14:48:05 +00:00
gcc.c
gcov-glue.c
gcov-io.c
gcov-io.h
gcov-iov.h
gpio.c
halt.c
hardwaremain.c ChromeOS: Refactor ACPI CNVS generation 2021-12-23 21:18:25 +00:00
hexdump.c lib/hexdump: remove hexdump32 and use hexdump instead 2021-05-27 15:41:15 +00:00
hexstrtobin.c
hw-time-timer.adb
imd.c
imd_cbmem.c
jpeg.c
jpeg.h
Kconfig lib/prog_loaders, soc/amd/: Make payload_preload use cbfs_preload 2021-11-16 18:20:31 +00:00
Kconfig.cbfs_verification Spell *Boot Guard* with a space for official spelling 2021-12-16 14:17:36 +00:00
libgcc.c
libgcov.c
list.c lib/list: Add list_append 2021-11-03 08:29:16 +00:00
lzma.c
lzmadecode.c
lzmadecode.h
Makefile.inc lib/Makefile.inc: Remove effect-free line 2021-12-23 12:14:17 +00:00
malloc.c
memchr.c
memcmp.c
memcpy.c
memmove.c
memrange.c
memset.c
metadata_hash.c src: Drop "This file is part of the coreboot project" lines 2021-05-10 15:07:33 +00:00
nhlt.c src/acpi to src/lib: Fix spelling errors 2021-10-05 18:06:39 +00:00
primitive_memtest.c
prog_loaders.c src/lib/prog_loaders: Add preload_ramstage 2021-11-16 21:45:36 +00:00
prog_ops.c
program.ld cbmem: Introduce "early" init hooks for console 2021-05-27 23:30:42 +00:00
ramdetect.c
ramtest.c
reg_script.c
region_file.c src/acpi to src/lib: Fix spelling errors 2021-10-05 18:06:39 +00:00
reset.c
rmodule.c
rmodule.ld
romstage_handoff.c
rtc.c lib/rtc: Add sanity check for time and date 2021-05-30 20:24:13 +00:00
selfboot.c selfboot: Add support for selfload in romstage 2021-07-02 00:47:23 +00:00
spd_bin.c
spd_cache.c
stack.c
string.c src: Remove redundant <rules.h> and <commonlib/bsd/compiler.h> 2022-01-12 16:11:05 +00:00
thread.c src: Remove redundant <rules.h> and <commonlib/bsd/compiler.h> 2022-01-12 16:11:05 +00:00
timer.c
timer_queue.c
timestamp.c timestamp: Allow timestamp_add to accept a negative number 2022-01-21 22:42:19 +00:00
ubsan.c
uuid.c
version.c
wrdd.c