[PATCH v2 0/4] m68k: Add support for QEMU virt machine

Kuan-Wei Chiu
2025-12-26T23:03:49Z

Add support for the QEMU 'virt' machine on the m68k architecture. The
QEMU virt machine models a generic system utilizing Goldfish virtual
peripherals and is capable of emulating various classic 68k CPUs.

Currently, U-Boot's m68k architecture support focuses on ColdFire
variants. Expand this to include the classic M680x0 architecture,
implementing the necessary exception vectors, startup code, and a
bootinfo parser compatible with the QEMU interface. A driver for the
Goldfish TTY is also added to enable serial console output.

The implementation has been verified on QEMU targeting the M68040 CPU,
confirming successful hardware initialization and boot to the U-Boot
command shell. Additionally, the CI configuration was verified locally
using gitlab-ci-local "qemu_m68k_virt test.py", resulting in
PASS qemu_m68k_virt test.py.
---
Changes in v2:
- Refactor Goldfish TTY driver to use priv data for the RX buffer and
ensure single-byte reads.
- Rename arch/m68k/cpu/m68040 to arch/m68k/cpu/m680x0 to separate the
architecture family from the specific CPU model.
- Introduce M680x0 Kconfig symbol and separate MAINTAINERS entries for
the architecture and the board.
- Regenerate qemu-m68k_defconfig using make savedefconfig and add the
board to the documentation index.
- Add a new patch to enable CI testing on GitLab and Azure Pipelines.
- Update SPDX identifiers to GPL-2.0-or-later.
- Sort headers alphabetically.
- Fix tabs vs spaces.

v1: https://lore.kernel.org/u-boot/20251218185252.957388-1-visitorckw@gmail.com/

Kuan-Wei Chiu (4):
serial: Add Goldfish TTY driver
m68k: Add support for M68040 CPU
board: Add QEMU m68k virt board support
CI: Add test jobs for QEMU m68k virt machine

.azure-pipelines.yml | 4 +
.gitlab-ci.yml | 7 ++
MAINTAINERS | 12 +++
arch/m68k/Kconfig | 24 ++++++
arch/m68k/Makefile | 1 +
arch/m68k/config.mk | 10 ++-
arch/m68k/cpu/m680x0/Makefile | 6 ++
arch/m68k/cpu/m680x0/cpu.c | 77 +++++++++++++++++++
arch/m68k/cpu/m680x0/start.S | 73 ++++++++++++++++++
arch/m68k/cpu/m680x0/u-boot.lds | 47 ++++++++++++
arch/m68k/include/asm/bootinfo.h | 31 ++++++++
arch/m68k/lib/Makefile | 9 +--
board/emulation/qemu-m68k/Kconfig | 12 +++
board/emulation/qemu-m68k/MAINTAINERS | 8 ++
board/emulation/qemu-m68k/Makefile | 5 ++
board/emulation/qemu-m68k/qemu-m68k.c | 84 +++++++++++++++++++++
configs/qemu-m68k_defconfig | 12 +++
doc/board/emulation/index.rst | 1 +
doc/board/emulation/qemu-m68k.rst | 38 ++++++++++
drivers/serial/Kconfig | 8 ++
drivers/serial/Makefile | 1 +
drivers/serial/serial_goldfish.c | 104 ++++++++++++++++++++++++++
include/configs/qemu-m68k.h | 18 +++++
include/goldfish_tty.h | 18 +++++
24 files changed, 602 insertions(+), 8 deletions(-)
create mode 100644 arch/m68k/cpu/m680x0/Makefile
create mode 100644 arch/m68k/cpu/m680x0/cpu.c
create mode 100644 arch/m68k/cpu/m680x0/start.S
create mode 100644 arch/m68k/cpu/m680x0/u-boot.lds
create mode 100644 arch/m68k/include/asm/bootinfo.h
create mode 100644 board/emulation/qemu-m68k/Kconfig
create mode 100644 board/emulation/qemu-m68k/MAINTAINERS
create mode 100644 board/emulation/qemu-m68k/Makefile
create mode 100644 board/emulation/qemu-m68k/qemu-m68k.c
create mode 100644 configs/qemu-m68k_defconfig
create mode 100644 doc/board/emulation/qemu-m68k.rst
create mode 100644 drivers/serial/serial_goldfish.c
create mode 100644 include/configs/qemu-m68k.h
create mode 100644 include/goldfish_tty.h

--
2.52.0.358.g0dd7633a29-goog