From a02176debb88a6e838c3b5f888010ae138b79127 Mon Sep 17 00:00:00 2001 From: Fred Reitberger Date: Wed, 1 Feb 2023 16:00:54 -0500 Subject: console: Add SimNow console logging The AMD SimNow tool supports fast logging through an IO port. Add a new console to support SimNow logging through port 80. TEST=observe significant speed improvements on SimNow console log Signed-off-by: Fred Reitberger Change-Id: I42a431f48ea14ba4adacbd4a32e15abe7c5e4951 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72751 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Felix Held --- src/include/console/console.h | 2 +- src/include/console/simnow.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/include/console/simnow.h (limited to 'src/include') diff --git a/src/include/console/console.h b/src/include/console/console.h index 6f44d7f95c..c69efcde40 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -72,7 +72,7 @@ enum { CONSOLE_LOG_NONE = 0, CONSOLE_LOG_FAST, CONSOLE_LOG_ALL }; #define HAS_ONLY_FAST_CONSOLES !(CONFIG(SPKMODEM) || CONFIG(CONSOLE_QEMU_DEBUGCON) || \ CONFIG(CONSOLE_SERIAL) || CONFIG(CONSOLE_NE2K) || CONFIG(CONSOLE_USB) || \ CONFIG(EM100PRO_SPI_CONSOLE) || CONFIG(CONSOLE_SPI_FLASH) || \ - CONFIG(CONSOLE_SYSTEM76_EC)) + CONFIG(CONSOLE_SYSTEM76_EC) || CONFIG(CONSOLE_AMD_SIMNOW)) #else static inline int get_log_level(void) { return -1; } diff --git a/src/include/console/simnow.h b/src/include/console/simnow.h new file mode 100644 index 0000000000..9a9d6792b8 --- /dev/null +++ b/src/include/console/simnow.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef CONSOLE_SIMNOW_H +#define CONSOLE_SIMNOW_H + +#include + +void simnow_console_init(void); +void simnow_console_tx_byte(unsigned char data); + +#define __SIMNOW_CONSOLE_ENABLE__ CONFIG(CONSOLE_AMD_SIMNOW) + +#if __SIMNOW_CONSOLE_ENABLE__ +static inline void __simnow_console_init(void) +{ + simnow_console_init(); +} + +static inline void __simnow_console_tx_byte(u8 data) +{ + simnow_console_tx_byte(data); +} +#else +static inline void __simnow_console_init(void) {} +static inline void __simnow_console_tx_byte(u8 data) {} +#endif + +#endif /* CONSOLE_SIMNOW_H */ -- cgit v1.2.3