summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2022-02-03 15:35:02 -0700
committerRaul Rangel <rrangel@chromium.org>2022-02-08 16:18:47 +0000
commitc168f115e4eef82cef44d0c757fb03c6cb97fb95 (patch)
tree3d205c5087dd2b9735abed24810c39cbb0a9229f
parent83bc4084160310330d6bf198ffdcc980b30dc429 (diff)
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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61610 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
-rw-r--r--src/soc/amd/common/psp_verstage/printk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/soc/amd/common/psp_verstage/printk.c b/src/soc/amd/common/psp_verstage/printk.c
index c56f78c298..526b8e7a09 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 @@ int vprintk(int msg_level, const char *fmt, va_list args)
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;
}