From 25a847b50f6bd38a79d1cca405a250b07a3bb793 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Mon, 27 Apr 2026 09:57:10 -0400 Subject: [PATCH] raspberrypi.conf: add QB_ variables for runqemu Add the relevant QB_ variables sufficient to get the QEMU raspi1ap model running with runqemu. The dwc_otg.fiq_fsm_enable setting is necessary to get USB devices (both disk and net) working. Without this, boot hangs. The initcall_blacklist=bcm2835_pm_driver_init is needed to workaround other boot issues. Seems like the PM HW emulation isn't present in the QEMU model. Adding the QB_ fields, etc to raspberrypi.conf, is adding support to raspberrypi-cm, which doesn't have an emulated board, and adding some of the wrong fields to raspberrypi0. So, remove the include and put the contents in the relevant files. Signed-off-by: Jon Mason --- conf/machine/raspberrypi-cm.conf | 9 ++++++++- conf/machine/raspberrypi.conf | 18 ++++++++++++++++++ conf/machine/raspberrypi0.conf | 9 ++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/conf/machine/raspberrypi-cm.conf b/conf/machine/raspberrypi-cm.conf index 365d030..cfc7380 100644 --- a/conf/machine/raspberrypi-cm.conf +++ b/conf/machine/raspberrypi-cm.conf @@ -3,6 +3,13 @@ #@DESCRIPTION: Machine configuration for the RaspberryPi Compute Module (CM1) MACHINEOVERRIDES =. "raspberrypi:" -include conf/machine/raspberrypi.conf +DEFAULTTUNE ?= "arm1176jzfshf" + +require conf/machine/include/tune-arm1176jzf-s.inc +include conf/machine/include/rpi-base.inc + +SDIMG_KERNELIMAGE ?= "kernel.img" +UBOOT_MACHINE = "rpi_config" +SERIAL_CONSOLES ?= "115200;ttyAMA0" ARMSTUB ?= "armstub.bin" diff --git a/conf/machine/raspberrypi.conf b/conf/machine/raspberrypi.conf index 05263d7..7c4973f 100644 --- a/conf/machine/raspberrypi.conf +++ b/conf/machine/raspberrypi.conf @@ -12,3 +12,21 @@ UBOOT_MACHINE = "rpi_config" SERIAL_CONSOLES ?= "115200;ttyAMA0" ARMSTUB ?= "armstub.bin" + +# +# Below are variables ONLY needed for running with Yocto/OE's runqemu script +# +IMAGE_CLASSES += "qemuboot" + +QB_SYSTEM_NAME = "qemu-system-arm" +QB_MACHINE = "-machine raspi1ap" +QB_MEM = "-m 512" +QB_DTB = "bcm2708-rpi-b-plus.dtb" +QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@" +QB_KERNEL_ROOT = "/dev/sda" +# The dwc_otg.fiq_fsm_enable setting is necessary to get USB devices (both disk and net) working. Without this, boot hangs +# The initcall_blacklist=bcm2835_pm_driver_init is needed to workaround boot issues. Seems like the PM HW emulation isn't present +QB_KERNEL_CMDLINE_APPEND = "rootwait initcall_blacklist=bcm2835_pm_driver_init earlycon=pl011,0x20201000 dwc_otg.fiq_fsm_enable=0" +QB_RNG = "" +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0" +QB_DEFAULT_FSTYPE = "ext3" diff --git a/conf/machine/raspberrypi0.conf b/conf/machine/raspberrypi0.conf index 597918a..6bcfce8 100644 --- a/conf/machine/raspberrypi0.conf +++ b/conf/machine/raspberrypi0.conf @@ -3,6 +3,13 @@ #@DESCRIPTION: Machine configuration for the RaspberryPi Zero board (https://www.raspberrypi.org/blog/raspberry-pi-zero) MACHINEOVERRIDES =. "raspberrypi:" -include conf/machine/raspberrypi.conf +DEFAULTTUNE ?= "arm1176jzfshf" +require conf/machine/include/tune-arm1176jzf-s.inc +include conf/machine/include/rpi-base.inc + +SDIMG_KERNELIMAGE ?= "kernel.img" +UBOOT_MACHINE = "rpi_config" SERIAL_CONSOLES ?= "115200;ttyAMA0" + +ARMSTUB ?= "armstub.bin"