* [PATCH v2 1/3] serial: goldfish: Add debug uart support
@ 2026-03-09 10:51 Daniel Palmer
2026-03-09 10:51 ` [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart Daniel Palmer
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Daniel Palmer @ 2026-03-09 10:51 UTC (permalink / raw)
To: visitorckw; +Cc: u-boot, Daniel Palmer
Add debug support for the goldfish tty so it can be used for
early debugging. This will be really useful when adding support
for relocation to the m68k qemu virt machine.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
drivers/serial/Kconfig | 8 ++++++++
drivers/serial/serial_goldfish.c | 18 ++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b84cb9ec781d..f6a696e6c94c 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 4ac2cfb62315..91dc040fcf26 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
--
2.51.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart
2026-03-09 10:51 [PATCH v2 1/3] serial: goldfish: Add debug uart support Daniel Palmer
@ 2026-03-09 10:51 ` Daniel Palmer
2026-03-10 5:58 ` Kuan-Wei Chiu
2026-03-09 10:51 ` [PATCH v2 3/3] doc: board: virt: m68k: Detail how to use " Daniel Palmer
2026-03-10 6:07 ` [PATCH v2 1/3] serial: goldfish: Add debug uart support Kuan-Wei Chiu
2 siblings, 1 reply; 8+ messages in thread
From: Daniel Palmer @ 2026-03-09 10:51 UTC (permalink / raw)
To: visitorckw; +Cc: u-boot, Daniel Palmer
Once the stack is ready we can init the debug uart to help
with debugging so do that.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
arch/m68k/cpu/m680x0/start.S | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/m68k/cpu/m680x0/start.S b/arch/m68k/cpu/m680x0/start.S
index 0802ca1fca2c..fdfcd66f7785 100644
--- a/arch/m68k/cpu/m680x0/start.S
+++ b/arch/m68k/cpu/m680x0/start.S
@@ -42,6 +42,11 @@ ENTRY(_start)
/* Setup initial stack pointer */
move.l #CFG_SYS_INIT_SP_ADDR, %sp
+ /* Setup the debug uart if enabled */
+#ifdef CONFIG_DEBUG_UART
+ bsr.l debug_uart_init
+#endif
+
/*
* Allocate Global Data (GD)
* board_init_f_alloc_reserve(top) returns the new top of stack in %d0
--
2.51.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] doc: board: virt: m68k: Detail how to use debug uart
2026-03-09 10:51 [PATCH v2 1/3] serial: goldfish: Add debug uart support Daniel Palmer
2026-03-09 10:51 ` [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart Daniel Palmer
@ 2026-03-09 10:51 ` Daniel Palmer
2026-03-10 6:07 ` [PATCH v2 1/3] serial: goldfish: Add debug uart support Kuan-Wei Chiu
2 siblings, 0 replies; 8+ messages in thread
From: Daniel Palmer @ 2026-03-09 10:51 UTC (permalink / raw)
To: visitorckw; +Cc: u-boot, Daniel Palmer
Add a paragraph to explain how to get the address of the goldfish
tty and use it as the debug uart. I think the address is actually
fixed right now but it might change in the future.
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
doc/board/emulation/qemu-m68k.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/doc/board/emulation/qemu-m68k.rst b/doc/board/emulation/qemu-m68k.rst
index 6c4de54cf6a8..2f2e6bd6444a 100644
--- a/doc/board/emulation/qemu-m68k.rst
+++ b/doc/board/emulation/qemu-m68k.rst
@@ -31,6 +31,16 @@ The minimal QEMU command line to get U-Boot up and running is:
Note that the `-nographic` option is used to redirect the console to stdio,
which connects to the emulated Goldfish TTY device.
+Debugging U-Boot
+----------------
+
+If you need early debugging output enable `CONFIG_DEBUG_UART_GOLDFISH`.
+The base address for the UART can be found by activating the QEMU monitor,
+running `info qtree`, and then looking for the goldfish tty device and
+taking the mmio address.
+
+Baud rate doesn't matter.
+
Hardware Support
----------------
The following QEMU virt peripherals are supported in U-Boot:
--
2.51.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart
2026-03-09 10:51 ` [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart Daniel Palmer
@ 2026-03-10 5:58 ` Kuan-Wei Chiu
2026-03-10 8:31 ` Angelo Dureghello
0 siblings, 1 reply; 8+ messages in thread
From: Kuan-Wei Chiu @ 2026-03-10 5:58 UTC (permalink / raw)
To: Daniel Palmer; +Cc: u-boot, Angelo Dureghello
+Cc Angelo since this touches arch/m68k/
On Mon, Mar 09, 2026 at 07:51:09PM +0900, Daniel Palmer wrote:
> Once the stack is ready we can init the debug uart to help
> with debugging so do that.
>
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> ---
> arch/m68k/cpu/m680x0/start.S | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/m68k/cpu/m680x0/start.S b/arch/m68k/cpu/m680x0/start.S
> index 0802ca1fca2c..fdfcd66f7785 100644
> --- a/arch/m68k/cpu/m680x0/start.S
> +++ b/arch/m68k/cpu/m680x0/start.S
> @@ -42,6 +42,11 @@ ENTRY(_start)
> /* Setup initial stack pointer */
> move.l #CFG_SYS_INIT_SP_ADDR, %sp
>
> + /* Setup the debug uart if enabled */
> +#ifdef CONFIG_DEBUG_UART
> + bsr.l debug_uart_init
> +#endif
> +
> /*
> * Allocate Global Data (GD)
> * board_init_f_alloc_reserve(top) returns the new top of stack in %d0
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] serial: goldfish: Add debug uart support
2026-03-09 10:51 [PATCH v2 1/3] serial: goldfish: Add debug uart support Daniel Palmer
2026-03-09 10:51 ` [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart Daniel Palmer
2026-03-09 10:51 ` [PATCH v2 3/3] doc: board: virt: m68k: Detail how to use " Daniel Palmer
@ 2026-03-10 6:07 ` Kuan-Wei Chiu
2026-03-10 16:25 ` Tom Rini
2 siblings, 1 reply; 8+ messages in thread
From: Kuan-Wei Chiu @ 2026-03-10 6:07 UTC (permalink / raw)
To: Daniel Palmer, Tom Rini; +Cc: u-boot
On Mon, Mar 09, 2026 at 07:51:08PM +0900, Daniel Palmer wrote:
> Add debug support for the goldfish tty so it can be used for
> early debugging. This will be really useful when adding support
> for relocation to the m68k qemu virt machine.
>
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> ---
> drivers/serial/Kconfig | 8 ++++++++
> drivers/serial/serial_goldfish.c | 18 ++++++++++++++++++
> 2 files changed, 26 insertions(+)
For the series:
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Hi Tom,
Would you take this patchset directly, or would you prefer a pull
request?
Regards,
Kuan-Wei
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart
2026-03-10 5:58 ` Kuan-Wei Chiu
@ 2026-03-10 8:31 ` Angelo Dureghello
0 siblings, 0 replies; 8+ messages in thread
From: Angelo Dureghello @ 2026-03-10 8:31 UTC (permalink / raw)
To: Kuan-Wei Chiu, Daniel Palmer; +Cc: u-boot
Acked-by: Angelo Dureghello <angelo@kernel-space.org>
On 3/10/26 06:58, Kuan-Wei Chiu wrote:
> +Cc Angelo since this touches arch/m68k/
>
> On Mon, Mar 09, 2026 at 07:51:09PM +0900, Daniel Palmer wrote:
>> Once the stack is ready we can init the debug uart to help
>> with debugging so do that.
>>
>> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
>> ---
>> arch/m68k/cpu/m680x0/start.S | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/m68k/cpu/m680x0/start.S b/arch/m68k/cpu/m680x0/start.S
>> index 0802ca1fca2c..fdfcd66f7785 100644
>> --- a/arch/m68k/cpu/m680x0/start.S
>> +++ b/arch/m68k/cpu/m680x0/start.S
>> @@ -42,6 +42,11 @@ ENTRY(_start)
>> /* Setup initial stack pointer */
>> move.l #CFG_SYS_INIT_SP_ADDR, %sp
>>
>> + /* Setup the debug uart if enabled */
>> +#ifdef CONFIG_DEBUG_UART
>> + bsr.l debug_uart_init
>> +#endif
>> +
>> /*
>> * Allocate Global Data (GD)
>> * board_init_f_alloc_reserve(top) returns the new top of stack in %d0
>> --
>> 2.51.0
>>
-- Angelo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] serial: goldfish: Add debug uart support
2026-03-10 6:07 ` [PATCH v2 1/3] serial: goldfish: Add debug uart support Kuan-Wei Chiu
@ 2026-03-10 16:25 ` Tom Rini
2026-03-11 4:08 ` Kuan-Wei Chiu
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2026-03-10 16:25 UTC (permalink / raw)
To: Kuan-Wei Chiu; +Cc: Daniel Palmer, u-boot
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]
On Tue, Mar 10, 2026 at 02:07:53PM +0800, Kuan-Wei Chiu wrote:
> On Mon, Mar 09, 2026 at 07:51:08PM +0900, Daniel Palmer wrote:
> > Add debug support for the goldfish tty so it can be used for
> > early debugging. This will be really useful when adding support
> > for relocation to the m68k qemu virt machine.
> >
> > Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> > ---
> > drivers/serial/Kconfig | 8 ++++++++
> > drivers/serial/serial_goldfish.c | 18 ++++++++++++++++++
> > 2 files changed, 26 insertions(+)
>
> For the series:
>
> Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
>
> Hi Tom,
> Would you take this patchset directly, or would you prefer a pull
> request?
I will apply this to next directly, after it's been posted for about 2
weeks to allow for other reviews.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] serial: goldfish: Add debug uart support
2026-03-10 16:25 ` Tom Rini
@ 2026-03-11 4:08 ` Kuan-Wei Chiu
0 siblings, 0 replies; 8+ messages in thread
From: Kuan-Wei Chiu @ 2026-03-11 4:08 UTC (permalink / raw)
To: Tom Rini; +Cc: Daniel Palmer, u-boot
On Tue, Mar 10, 2026 at 10:25:34AM -0600, Tom Rini wrote:
> On Tue, Mar 10, 2026 at 02:07:53PM +0800, Kuan-Wei Chiu wrote:
> > On Mon, Mar 09, 2026 at 07:51:08PM +0900, Daniel Palmer wrote:
> > > Add debug support for the goldfish tty so it can be used for
> > > early debugging. This will be really useful when adding support
> > > for relocation to the m68k qemu virt machine.
> > >
> > > Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> > > ---
> > > drivers/serial/Kconfig | 8 ++++++++
> > > drivers/serial/serial_goldfish.c | 18 ++++++++++++++++++
> > > 2 files changed, 26 insertions(+)
> >
> > For the series:
> >
> > Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> > Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> >
> > Hi Tom,
> > Would you take this patchset directly, or would you prefer a pull
> > request?
>
> I will apply this to next directly, after it's been posted for about 2
> weeks to allow for other reviews.
Sure. Thanks!
I just wanted to clarify who would be picking it up after the review
period, so it doesn't fall through the cracks.
Regards,
Kuan-Wei
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-11 4:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 10:51 [PATCH v2 1/3] serial: goldfish: Add debug uart support Daniel Palmer
2026-03-09 10:51 ` [PATCH v2 2/3] m68k: m680x0: Initialise the debug uart Daniel Palmer
2026-03-10 5:58 ` Kuan-Wei Chiu
2026-03-10 8:31 ` Angelo Dureghello
2026-03-09 10:51 ` [PATCH v2 3/3] doc: board: virt: m68k: Detail how to use " Daniel Palmer
2026-03-10 6:07 ` [PATCH v2 1/3] serial: goldfish: Add debug uart support Kuan-Wei Chiu
2026-03-10 16:25 ` Tom Rini
2026-03-11 4:08 ` Kuan-Wei Chiu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox