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_console.c | |
parent | 02f7471b19c57c01d02343be9c09b4a9ea8c6fb9 (diff) |
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_console.c')
-rw-r--r-- | src/soc/amd/picasso/uart_console.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/uart_console.c b/src/soc/amd/picasso/uart_console.c new file mode 100644 index 0000000000..3ab2a70920 --- /dev/null +++ b/src/soc/amd/picasso/uart_console.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/uart.h> +#include <soc/uart.h> + +/* + * 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(int idx) +{ + return get_uart_base(idx); +} + +unsigned int uart_platform_refclk(void) +{ + return CONFIG(PICASSO_UART_48MZ) ? 48000000 : 115200 * 16; +} |