From 3119a03a3db979541a5a20884e393c3b0868f9b5 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Fri, 14 Apr 2017 00:05:20 +1000 Subject: qemuboot-xilinx.bbclass: Rework qemu-xilinx setup This change reworks how the meta-xilinx layer enables and provides the custom version of QEMU based on Xilinx's fork of QEMU. The existing implementation relied on the single sysroot which was changed in oe-core such that now recipes have their own sysroots (RSS support). Additionally oe-core now provides the QEMU binaries to the runqemu script via the 'qemu-helper-native' recipes sysroot as opposed to the image sysroot. These rework changes allow for a single machine to select the targeted QEMU version as well as to provide the qemuboot config specific to the targeted QEMU version. The selection of QEMU version is now handled by PREFERRED_PROVIDER mechanics with the meta-xilinx layer providing an additional recipe that is equivalent to qemu-helper-native and which also provides said target allowing for the machine to select via the use of PREFERRED_PROVIDER_qemu-helper-native. This recipe (qemu-xilinx-helper-native) however instead provides the sysroot populated with qemu-xilinx instead of qemu. Additionally the XILINX_QEMUBOOT variable is replaced with the qemuboot-xilinx.bbclass, this provides the overrides for setting up qemu-xilinx specific QB_* args. Additionally this bbclass points runqemu at the qemu-xilinx-helper-native sysroot for QEMU binaries. These changes also work towards making the meta-xilinx layer better handle multiple qemuboot.conf variants as well as handling different QEMU versions. This change also removes the 'qemu-system-xilinx' MACHINE_FEATURES, this is due to MACHINE_FEATURES no longer being available for native recipes. Additionally there is no longer any logic that needs to know this any way. Signed-off-by: Nathan Rossi Reviewed-by: Alistair Francis --- conf/machine/include/machine-xilinx-qemu.inc | 39 ++++---------------------- conf/machine/ml605-qemu-microblazeel.conf | 1 + conf/machine/qemu-zynq7.conf | 1 + conf/machine/s3adsp1800-qemu-microblazeeb.conf | 1 + conf/machine/zcu102-zynqmp.conf | 8 ++++-- 5 files changed, 14 insertions(+), 36 deletions(-) (limited to 'conf') diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc index 2701df20..938d76d4 100644 --- a/conf/machine/include/machine-xilinx-qemu.inc +++ b/conf/machine/include/machine-xilinx-qemu.inc @@ -1,4 +1,8 @@ -EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native" +# This include is used to setup default QEMU and qemuboot config for meta-xilinx +# machines. + +# depend on qemu-helper-native, which will depend on QEMU +EXTRA_IMAGEDEPENDS += "qemu-helper-native" def qemu_default_dtb(d): if d.getVar("IMAGE_BOOT_FILES", True): @@ -30,42 +34,11 @@ def qemu_target_binary(d): ta = "microblaze" elif ta == "arm": ta = "aarch64" - if qemuboot_xilinx_enabled(d): - return "qemu-xilinx/qemu-system-%s" % ta return "qemu-system-%s" % ta -def qemuboot_xilinx_enabled(d): - if bb.utils.contains("MACHINE_FEATURES", "qemu-system-xilinx", True, False, d): - if d.getVar("XILINX_QEMUBOOT", True) == "1": - return True - return False - -# For runqemu, default setup across all machines in meta-xilinx -IMAGE_CLASSES += "qemuboot" +# For qemuboot, default setup across all machines in meta-xilinx QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" QB_DEFAULT_FSTYPE ?= "cpio" - -XILINX_QEMUBOOT[doc] = "Set this variable to '1' to enable the generation of qemuboot.conf which uses the Xilinx QEMU." -XILINX_QEMUBOOT ??= "" - -# Dependencies for native Xilinx QEMU -XILINX_QEMU_DEPENDS ?= "qemu-xilinx-native" -# If the machine supports the Xilinx QEMU, add the dependencies -EXTRA_IMAGEDEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-system-xilinx', '${XILINX_QEMU_DEPENDS}', '', d)}" - -# Add an override for when booting with the Xilinx QEMU -MACHINEOVERRIDES .= "${@':qemuboot-xilinx' if qemuboot_xilinx_enabled(d) else ''}" - -# This is ignored if using Xilinx's QEMU fork QB_DTB ?= "${@qemu_default_dtb(d)}" - -# ZynqMP machines need special "-hw-dtb" device trees for the Xilinx QEMU -XILINX_QEMU_DEPENDS_append_zynqmp = " qemu-devicetrees" - -QB_DEFAULT_KERNEL_qemuboot-xilinx = "none" QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" -# Default machine targets for Xilinx QEMU (FDT Generic) -QB_MACHINE_qemuboot-xilinx_aarch64 = "-machine arm-generic-fdt" -QB_MACHINE_qemuboot-xilinx_arm = "-machine arm-generic-fdt-plnx" -QB_MACHINE_qemuboot-xilinx_microblaze = "-machine microblaze-generic-fdt" diff --git a/conf/machine/ml605-qemu-microblazeel.conf b/conf/machine/ml605-qemu-microblazeel.conf index a0ef7d3e..731f26f3 100644 --- a/conf/machine/ml605-qemu-microblazeel.conf +++ b/conf/machine/ml605-qemu-microblazeel.conf @@ -17,6 +17,7 @@ SERIAL_CONSOLE = "115200 ttyS0" FILESOVERRIDES_append_pn-init-ifupdown = ":qemuarm" # This machine is a targeting a QEMU model, runqemu setup: +IMAGE_CLASSES += "qemuboot" QB_MEM = "-m 256" QB_MACHINE = "-machine petalogix-ml605" QB_OPT_APPEND = "-nographic -serial mon:stdio" diff --git a/conf/machine/qemu-zynq7.conf b/conf/machine/qemu-zynq7.conf index 6073211c..0fe99e27 100644 --- a/conf/machine/qemu-zynq7.conf +++ b/conf/machine/qemu-zynq7.conf @@ -17,6 +17,7 @@ IMAGE_BOOT_FILES += "${MACHINE}.dtb" FILESOVERRIDES_append_pn-init-ifupdown = ":qemuarm" # This machine is a targeting a QEMU model, runqemu setup: +IMAGE_CLASSES += "qemuboot" QB_MEM = "-m 1024" QB_MACHINE = "-machine xilinx-zynq-a9" QB_OPT_APPEND = "-nographic -serial null -serial mon:stdio" diff --git a/conf/machine/s3adsp1800-qemu-microblazeeb.conf b/conf/machine/s3adsp1800-qemu-microblazeeb.conf index 2577faab..16bf4d46 100644 --- a/conf/machine/s3adsp1800-qemu-microblazeeb.conf +++ b/conf/machine/s3adsp1800-qemu-microblazeeb.conf @@ -16,6 +16,7 @@ SERIAL_CONSOLE = "115200 ttyUL0" MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove = "device-tree" # This machine is a targeting a QEMU model, runqemu setup: +IMAGE_CLASSES += "qemuboot" QB_MEM = "-m 256" QB_MACHINE = "-machine petalogix-s3adsp1800" QB_OPT_APPEND = "-nographic -serial mon:stdio" diff --git a/conf/machine/zcu102-zynqmp.conf b/conf/machine/zcu102-zynqmp.conf index c55b536c..2e3c1367 100644 --- a/conf/machine/zcu102-zynqmp.conf +++ b/conf/machine/zcu102-zynqmp.conf @@ -7,7 +7,7 @@ require conf/machine/include/machine-xilinx-default.inc require conf/machine/include/machine-xilinx-board.inc require conf/machine/include/machine-xilinx-qemu.inc -MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost mali qemu-system-xilinx" +MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost mali" UBOOT_MACHINE = "xilinx_zynqmp_zcu102_revB_defconfig" @@ -20,16 +20,18 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx" EXTRA_IMAGEDEPENDS += "\ arm-trusted-firmware \ + qemu-devicetrees \ " # This machine has a QEMU model, runqemu setup: +IMAGE_CLASSES += "qemuboot-xilinx" QB_MACHINE = "-machine xlnx-zcu102" QB_MEM = "-m 2048" QB_OPT_APPEND = "-nographic -serial mon:stdio -serial null" QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" -# Xilinx QEMU options, default to using Xilinx QEMU -XILINX_QEMUBOOT ?= "1" +# Use qemu-xilinx instead of mainline +PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" # Reset and unhalt CPU0, load the boot media. QB_OPT_APPEND_append_qemuboot-xilinx = " \ -- cgit v1.2.3-54-g00ecf