Attention is currently required from: Jason Glenesk, Marshall Dawson, Felix Held. Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61610 )
Change subject: soc/amd/common/psp_verstage: Add UART support to PSP console ......................................................................
soc/amd/common/psp_verstage: Add UART support to PSP console
This will allow PSP verstage to write logs to the serial console. We are no longer dependent on using a serial enabled PSP boot loader.
Ideally we would delete this psp printk and use the standard printk. Since picasso doesn't currently support mapping the UART though, I'll keep it for now.
BUG=b:215599230 TEST=Boot guybrush and verify PSP logs are output on serial console
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: Ibd77cc754fae5baccebe7adc5ae0790c79236d26 --- M src/soc/amd/common/psp_verstage/printk.c 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/61610/1
diff --git a/src/soc/amd/common/psp_verstage/printk.c b/src/soc/amd/common/psp_verstage/printk.c index c56f78c..526b8e7 100644 --- a/src/soc/amd/common/psp_verstage/printk.c +++ b/src/soc/amd/common/psp_verstage/printk.c @@ -4,11 +4,13 @@ #include <console/console.h> #include <console/cbmem_console.h> #include <console/streams.h> +#include <console/uart.h> #include <stdarg.h>
void console_hw_init(void) { __cbmemc_init(); + __uart_init(); }
int printk(int msg_level, const char *fmt, ...) @@ -33,8 +35,13 @@ return 0;
cnt = vsnprintf(buf, sizeof(buf), fmt, args); - for (i = 0; i < cnt; i++) + for (i = 0; i < cnt; i++) { __cbmemc_tx_byte(buf[i]); + + if (buf[i] == '\n') + __uart_tx_byte('\r'); + __uart_tx_byte(buf[i]); + } svc_debug_print(buf); return i; }