From 326a499f6fd81bb4a48618cc6fbe3340f4adb37e Mon Sep 17 00:00:00 2001 From: Kangheui Won Date: Mon, 5 Oct 2020 19:35:22 +1100 Subject: amd/picasso/psp_verstage: use cbmem console psp_verstage uses separate printk implementation, which does not include code to add console output to cbmem. Add cbmemc_init and cbmemc_tx_byte to add console output to cbmem. BUG=b:159220781 TEST=build BRANCH=zork Change-Id: I63ba5814903565c372dbeb50004565a371dad730 Signed-off-by: Kangheui Won Reviewed-on: https://review.coreboot.org/c/coreboot/+/46059 Reviewed-by: Edward O'Callaghan Reviewed-by: Rob Barnes Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/psp_verstage/printk.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/soc/amd') diff --git a/src/soc/amd/picasso/psp_verstage/printk.c b/src/soc/amd/picasso/psp_verstage/printk.c index 2f9d30a29e..a99d8bc35d 100644 --- a/src/soc/amd/picasso/psp_verstage/printk.c +++ b/src/soc/amd/picasso/psp_verstage/printk.c @@ -2,12 +2,13 @@ #include #include +#include #include #include void console_hw_init(void) { - // Nothing to init for svc_debug_print + __cbmemc_init(); } int do_printk(int msg_level, const char *fmt, ...) @@ -24,14 +25,16 @@ int do_printk(int msg_level, const char *fmt, ...) int do_vprintk(int msg_level, const char *fmt, va_list args) { - int i, log_this; + int i, cnt, log_this; char buf[256]; log_this = console_log_level(msg_level); if (log_this < CONSOLE_LOG_FAST) return 0; - i = vsnprintf(buf, sizeof(buf), fmt, args); + cnt = vsnprintf(buf, sizeof(buf), fmt, args); + for (i = 0; i < cnt; i++) + __cbmemc_tx_byte(buf[i]); svc_debug_print(buf); return i; } -- cgit v1.2.3