diff options
author | Felix Held <felix.held@amd.corp-partner.google.com> | 2020-06-18 15:54:43 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2020-06-19 16:45:55 +0000 |
commit | 9412b3e9bbc1ff066d0ae5967624b339259a73c1 (patch) | |
tree | 4005822dffa35705b35acd091aa69c49d288b338 /src/soc/amd/picasso/uart.c | |
parent | 02f7471b19c57c01d02343be9c09b4a9ea8c6fb9 (diff) | |
download | coreboot-9412b3e9bbc1ff066d0ae5967624b339259a73c1.tar.xz |
soc/amd/picasso/uart: factor out console-related functions
Move uart_platform_base and uart_platform_refclk to their own
compilation unit to avoid preprocessor usage. The newly created
compilation unit is only added to the build when PICASSO_CONSOLE_UART
is selected.
Change-Id: I56911addc8c000a0772156e5166720867cdd26fe
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42517
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/picasso/uart.c')
-rw-r--r-- | src/soc/amd/picasso/uart.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/soc/amd/picasso/uart.c b/src/soc/amd/picasso/uart.c index 42ae8e629b..d892333ca1 100644 --- a/src/soc/amd/picasso/uart.c +++ b/src/soc/amd/picasso/uart.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <acpi/acpigen.h> -#include <console/uart.h> #include <console/console.h> #include <commonlib/helpers.h> #include <device/mmio.h> @@ -9,6 +8,7 @@ #include <amdblocks/acpimmio.h> #include <soc/southbridge.h> #include <soc/gpio.h> +#include <soc/uart.h> static const struct _uart_info { uintptr_t base; @@ -32,17 +32,7 @@ static const struct _uart_info { } }, }; -/* - * Don't provide uart_platform_base and uart_platform_refclk functions if PICASSO_CONSOLE_UART - * isn't selected. Those two functions are used by the console UART driver and need to be - * provided exactly once and only by the UART that is used for console. - * - * TODO: Replace the #if block by factoring out the two functions into a different compilation - * unit. - */ -#if CONFIG(PICASSO_CONSOLE_UART) - -uintptr_t uart_platform_base(int idx) +uintptr_t get_uart_base(int idx) { if (idx < 0 || idx >= ARRAY_SIZE(uart_info)) return 0; @@ -50,13 +40,6 @@ uintptr_t uart_platform_base(int idx) return uart_info[idx].base; } -unsigned int uart_platform_refclk(void) -{ - return CONFIG(PICASSO_UART_48MZ) ? 48000000 : 115200 * 16; -} - -#endif /* PICASSO_CONSOLE_UART */ - void clear_uart_legacy_config(void) { write16((void *)FCH_UART_LEGACY_DECODE, 0); |