QEMU raspi4b gains working PCIe and real GENET networking
A revived patch series finally brings end-to-end Ethernet and a usable PCIe root complex to Raspberry Pi 4B emulation.
QEMU's Raspberry Pi 4B machine can now bring up a working PCIe root complex and pass real network traffic through the on-board GENET Ethernet controller, according to a patch series posted to the QEMU development list by Marcelo Manzo.
Until now, guests on the raspi4b model lacked usable PCIe enumeration and had no functional Broadcom GENET path, so DHCP, SSH, and bulk transfers were off the table for that board profile. Manzo's series wires a BCM2838 PCIe host bridge into the SoC peripherals, maps its config space and MMIO window correctly, and completes a full GENET model: register blocks, MDIO/PHY emulation (including vendor shadow registers), transmit and receive DMA rings, migration state, and interrupt routing through the GIC.
With the pieces in place, the PCIe link comes up and devices behind it enumerate, and GENET carries live traffic under both older and newer guest kernels (Debian 11 with 5.15, and Debian 13 with 6.18), including DHCP, SSH, and bulk downloads.
Most of the GENET implementation comes from Sergey Kambalin's 2024 series, which never landed; Manzo carried it forward with authorship preserved and adapted it to current QEMU APIs. Along the way he fixed defects that had blocked real use: PCIe config reads that always looked like "no device," a missing MMCFG init that left extended config access on an uninitialized region, bridge window programming that never updated the root port's address space, a PCI MMIO alias mapped without the CPU-to-PCI offset the device tree expects, an MDIO autonegotiation restart bit that never cleared (spinning the guest PHY driver at boot), TX ring enable logic that only ever activated ring 0, and an RX checksum path that made guests reject valid packets.
Peter Maydell reviewed the work. The result is the first end-to-end networking story for QEMU's Pi 4B model that matches what guests actually expect from the hardware.