From d3e977112a6b07d372e36667dbe8f9c8fe5c30f7 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 9 Dec 2020 21:37:44 +0100 Subject: soc/amd/picasso: move UART console code to common folder Change-Id: Ibc9a4c05bdfc7cd3cd0eada67563386c95d2b50e Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/48515 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/uart/Makefile.inc | 15 +++++++++++++++ src/soc/amd/common/block/uart/uart_console.c | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/soc/amd/common/block/uart/Makefile.inc create mode 100644 src/soc/amd/common/block/uart/uart_console.c (limited to 'src/soc/amd/common/block/uart') diff --git a/src/soc/amd/common/block/uart/Makefile.inc b/src/soc/amd/common/block/uart/Makefile.inc new file mode 100644 index 0000000000..9d968455dd --- /dev/null +++ b/src/soc/amd/common/block/uart/Makefile.inc @@ -0,0 +1,15 @@ +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_UART),y) + +bootblock-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c + +romstage-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c + +verstage_x86-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c + +ramstage-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c + +ifeq ($(CONFIG_DEBUG_SMI),y) +smm-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c +endif + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_UART diff --git a/src/soc/amd/common/block/uart/uart_console.c b/src/soc/amd/common/block/uart/uart_console.c new file mode 100644 index 0000000000..c1c17232fb --- /dev/null +++ b/src/soc/amd/common/block/uart/uart_console.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +/* + * uart_platform_base and uart_platform_refclk are used by the console UART driver and need to + * be provided exactly once and only by the UART that is used for console. + */ + +uintptr_t uart_platform_base(unsigned int idx) +{ + return get_uart_base(idx); +} + +unsigned int uart_platform_refclk(void) +{ + return CONFIG(AMD_SOC_UART_48MZ) ? 48000000 : 115200 * 16; +} -- cgit v1.2.3