aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/picasso/uart.c')
-rw-r--r--src/soc/amd/picasso/uart.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/soc/amd/picasso/uart.c b/src/soc/amd/picasso/uart.c
index 6439efb251..f523bce162 100644
--- a/src/soc/amd/picasso/uart.c
+++ b/src/soc/amd/picasso/uart.c
@@ -30,6 +30,16 @@ static const struct _uart_info {
} },
};
+/*
+ * Don't provide uart_platform_base and uart_platform_refclk functions if PICASSO_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_UART)
+
uintptr_t uart_platform_base(int idx)
{
if (idx < 0 || idx >= ARRAY_SIZE(uart_info))
@@ -38,6 +48,13 @@ 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_UART */
+
void clear_uart_legacy_config(void)
{
write16((void *)FCH_UART_LEGACY_DECODE, 0);
@@ -75,11 +92,6 @@ void set_uart_config(int idx)
}
}
-unsigned int uart_platform_refclk(void)
-{
- return CONFIG(PICASSO_UART_48MZ) ? 48000000 : 115200 * 16;
-}
-
static const char *uart_acpi_name(const struct device *dev)
{
switch (dev->path.mmio.addr) {