From 9a6dd68323cf425d7056f1de367bbfbb19cec407 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 9 Mar 2026 11:27:35 -0600 Subject: [PATCH 1/4] doc: Use sys.path.append for pytests Signed-off-by: Tom Rini --- Makefile | 3 +-- doc/conf.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5df869213b6..88543808ff5 100644 --- a/Makefile +++ b/Makefile @@ -2759,8 +2759,7 @@ DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs PHONY += $(DOC_TARGETS) $(DOC_TARGETS): scripts_basic FORCE - $(Q)PYTHONPATH=$(srctree)/test/py/tests:$(srctree)/test/py \ - $(MAKE) $(build)=doc $@ + $(Q)$(MAKE) $(build)=doc $@ PHONY += checkstack ubootrelease ubootversion diff --git a/doc/conf.py b/doc/conf.py index 84d028feda8..bf60fe14315 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -34,6 +34,8 @@ if os.environ.get("READTHEDOCS", "") == "True": # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('sphinx')) +sys.path.append(os.path.abspath('../test/py/tests')) +sys.path.append(os.path.abspath('../test/py')) from load_config import loadConfig # -- General configuration ------------------------------------------------ From cbfb9b3f2248ff30724a12583981e3e7523272d6 Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Mon, 9 Mar 2026 19:51:08 +0900 Subject: [PATCH 2/4] serial: goldfish: Add debug uart support 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 Reviewed-by: Kuan-Wei Chiu Tested-by: Kuan-Wei Chiu --- 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 b84cb9ec781..f6a696e6c94 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 + +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 From 2df4926ca4f215d9b1a91d0c02c6fef49c845837 Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Mon, 9 Mar 2026 19:51:09 +0900 Subject: [PATCH 3/4] m68k: m680x0: Initialise the debug uart Once the stack is ready we can init the debug uart to help with debugging so do that. Signed-off-by: Daniel Palmer Acked-by: Angelo Dureghello --- 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 0802ca1fca2..fdfcd66f778 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 From c15a08b730e3399c26622c8cb083bf521039606a Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Mon, 9 Mar 2026 19:51:10 +0900 Subject: [PATCH 4/4] doc: board: virt: m68k: Detail how to use debug uart 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 --- 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 6c4de54cf6a..2f2e6bd6444 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: