diff options
| author | Nathan Rossi <nathan@nathanrossi.com> | 2017-04-14 00:05:20 +1000 |
|---|---|---|
| committer | Nathan Rossi <nathan@nathanrossi.com> | 2017-04-28 00:22:19 +1000 |
| commit | 3119a03a3db979541a5a20884e393c3b0868f9b5 (patch) | |
| tree | fc381dbc0a395875e3aa4542bd71fce9abea1ef4 /conf/machine/include | |
| parent | a765a5bdbf0da72704bbe88171571ecc82668a0a (diff) | |
| download | meta-xilinx-3119a03a3db979541a5a20884e393c3b0868f9b5.tar.gz | |
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 <nathan@nathanrossi.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Diffstat (limited to 'conf/machine/include')
| -rw-r--r-- | conf/machine/include/machine-xilinx-qemu.inc | 39 |
1 files changed, 6 insertions, 33 deletions
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 @@ | |||
| 1 | EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native" | 1 | # This include is used to setup default QEMU and qemuboot config for meta-xilinx |
| 2 | # machines. | ||
| 3 | |||
| 4 | # depend on qemu-helper-native, which will depend on QEMU | ||
| 5 | EXTRA_IMAGEDEPENDS += "qemu-helper-native" | ||
| 2 | 6 | ||
| 3 | def qemu_default_dtb(d): | 7 | def qemu_default_dtb(d): |
| 4 | if d.getVar("IMAGE_BOOT_FILES", True): | 8 | if d.getVar("IMAGE_BOOT_FILES", True): |
| @@ -30,42 +34,11 @@ def qemu_target_binary(d): | |||
| 30 | ta = "microblaze" | 34 | ta = "microblaze" |
| 31 | elif ta == "arm": | 35 | elif ta == "arm": |
| 32 | ta = "aarch64" | 36 | ta = "aarch64" |
| 33 | if qemuboot_xilinx_enabled(d): | ||
| 34 | return "qemu-xilinx/qemu-system-%s" % ta | ||
| 35 | return "qemu-system-%s" % ta | 37 | return "qemu-system-%s" % ta |
| 36 | 38 | ||
| 37 | def qemuboot_xilinx_enabled(d): | 39 | # For qemuboot, default setup across all machines in meta-xilinx |
| 38 | if bb.utils.contains("MACHINE_FEATURES", "qemu-system-xilinx", True, False, d): | ||
| 39 | if d.getVar("XILINX_QEMUBOOT", True) == "1": | ||
| 40 | return True | ||
| 41 | return False | ||
| 42 | |||
| 43 | # For runqemu, default setup across all machines in meta-xilinx | ||
| 44 | IMAGE_CLASSES += "qemuboot" | ||
| 45 | QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" | 40 | QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" |
| 46 | QB_DEFAULT_FSTYPE ?= "cpio" | 41 | QB_DEFAULT_FSTYPE ?= "cpio" |
| 47 | |||
| 48 | XILINX_QEMUBOOT[doc] = "Set this variable to '1' to enable the generation of qemuboot.conf which uses the Xilinx QEMU." | ||
| 49 | XILINX_QEMUBOOT ??= "" | ||
| 50 | |||
| 51 | # Dependencies for native Xilinx QEMU | ||
| 52 | XILINX_QEMU_DEPENDS ?= "qemu-xilinx-native" | ||
| 53 | # If the machine supports the Xilinx QEMU, add the dependencies | ||
| 54 | EXTRA_IMAGEDEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-system-xilinx', '${XILINX_QEMU_DEPENDS}', '', d)}" | ||
| 55 | |||
| 56 | # Add an override for when booting with the Xilinx QEMU | ||
| 57 | MACHINEOVERRIDES .= "${@':qemuboot-xilinx' if qemuboot_xilinx_enabled(d) else ''}" | ||
| 58 | |||
| 59 | # This is ignored if using Xilinx's QEMU fork | ||
| 60 | QB_DTB ?= "${@qemu_default_dtb(d)}" | 42 | QB_DTB ?= "${@qemu_default_dtb(d)}" |
| 61 | |||
| 62 | # ZynqMP machines need special "-hw-dtb" device trees for the Xilinx QEMU | ||
| 63 | XILINX_QEMU_DEPENDS_append_zynqmp = " qemu-devicetrees" | ||
| 64 | |||
| 65 | QB_DEFAULT_KERNEL_qemuboot-xilinx = "none" | ||
| 66 | QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" | 43 | QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" |
| 67 | 44 | ||
| 68 | # Default machine targets for Xilinx QEMU (FDT Generic) | ||
| 69 | QB_MACHINE_qemuboot-xilinx_aarch64 = "-machine arm-generic-fdt" | ||
| 70 | QB_MACHINE_qemuboot-xilinx_arm = "-machine arm-generic-fdt-plnx" | ||
| 71 | QB_MACHINE_qemuboot-xilinx_microblaze = "-machine microblaze-generic-fdt" | ||
