summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-04-14 13:25:32 -0600
committerTom Rini <[email protected]>2026-04-14 13:25:32 -0600
commit8f6a5932aaec6f3fbe5fad1b28aa2322374a42f6 (patch)
treeef5f6df9d910d6f00a464b08d5bba4a15675a801 /drivers
parent5a998ab00758a0cc757d39335d515694c60e7062 (diff)
parentc15a08b730e3399c26622c8cb083bf521039606a (diff)
Merge patch series "serial: goldfish: Add debug uart support"
This series from Daniel Palmer <[email protected]> improves debug UART support on QEMU on M68K by adding debug uart support to the serial driver. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/Kconfig8
-rw-r--r--drivers/serial/serial_goldfish.c18
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index c86c883e0cb..5f8b98f0704 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -510,6 +510,14 @@ config DEBUG_UART_XTENSA_SEMIHOSTING
start up driver model. The driver will be available until the real
driver model serial is running.
+config DEBUG_UART_GOLDFISH
+ bool "Goldfish TTY"
+ help
+ Select this to enable the debug UART using the Goldfish TTY driver.
+ This provides basic serial output from the console without needing to
+ start up driver model. The driver will be available until the real
+ driver model serial is running.
+
endchoice
config DEBUG_UART_BASE
diff --git a/drivers/serial/serial_goldfish.c b/drivers/serial/serial_goldfish.c
index 4ac2cfb6231..91dc040fcf2 100644
--- a/drivers/serial/serial_goldfish.c
+++ b/drivers/serial/serial_goldfish.c
@@ -115,3 +115,21 @@ U_BOOT_DRIVER(serial_goldfish) = {
.priv_auto = sizeof(struct goldfish_tty_priv),
.flags = DM_FLAG_PRE_RELOC,
};
+
+#ifdef CONFIG_DEBUG_UART_GOLDFISH
+
+#include <debug_uart.h>
+
+static inline void _debug_uart_init(void)
+{
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+ void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
+
+ __raw_writel(ch, base + GOLDFISH_TTY_PUT_CHAR);
+}
+
+DEBUG_UART_FUNCS
+#endif