summaryrefslogtreecommitdiffstats
path: root/conf/machine/include
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@xilinx.com>2017-01-17 13:31:02 -0800
committerNathan Rossi <nathan@nathanrossi.com>2017-01-18 17:14:13 +1000
commitff08d861e2c509495ad972f669136ac193553496 (patch)
tree6ec7b50cf98fcc4a06b298b9daa3c969e4f79cd5 /conf/machine/include
parentf2d2dfdd262b796205086f871819cebf2611eb0f (diff)
downloadmeta-xilinx-ff08d861e2c509495ad972f669136ac193553496.tar.gz
machine-xilinx-qemu.inc: Add support for starting Xilinx's QEMU
This patch adds support to the general include file to boot Xilinx's QEMU machines. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'conf/machine/include')
-rw-r--r--conf/machine/include/machine-xilinx-qemu.inc33
1 files changed, 33 insertions, 0 deletions
diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc
index 25bf7dec..0e5c4bf7 100644
--- a/conf/machine/include/machine-xilinx-qemu.inc
+++ b/conf/machine/include/machine-xilinx-qemu.inc
@@ -15,6 +15,9 @@ def qemu_default_dtb(d):
15def qemu_default_serial(d): 15def qemu_default_serial(d):
16 if d.getVar("SERIAL_CONSOLE", True): 16 if d.getVar("SERIAL_CONSOLE", True):
17 speed, console = d.getVar("SERIAL_CONSOLE", True).split(" ", 1) 17 speed, console = d.getVar("SERIAL_CONSOLE", True).split(" ", 1)
18 # zynqmp uses earlycon and stdout (in dtb)
19 if "zynqmp" in d.getVar("MACHINEOVERRIDES", True).split(":"):
20 return ""
18 return "console=%s,%s earlyprintk" % (console, speed) 21 return "console=%s,%s earlyprintk" % (console, speed)
19 return "" 22 return ""
20 23
@@ -24,12 +27,42 @@ def qemu_target_binary(d):
24 ta = "microblaze" 27 ta = "microblaze"
25 elif ta == "arm": 28 elif ta == "arm":
26 ta = "aarch64" 29 ta = "aarch64"
30 if qemuboot_xilinx_enabled(d):
31 return "qemu-xilinx/qemu-system-%s" % ta
27 return "qemu-system-%s" % ta 32 return "qemu-system-%s" % ta
28 33
34def qemuboot_xilinx_enabled(d):
35 if bb.utils.contains("MACHINE_FEATURES", "qemu-system-xilinx", True, False, d):
36 if d.getVar("XILINX_QEMUBOOT", True) == "1":
37 return True
38 return False
39
29# For runqemu, default setup across all machines in meta-xilinx 40# For runqemu, default setup across all machines in meta-xilinx
30IMAGE_CLASSES += "qemuboot" 41IMAGE_CLASSES += "qemuboot"
31QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" 42QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}"
32QB_DEFAULT_FSTYPE ?= "cpio" 43QB_DEFAULT_FSTYPE ?= "cpio"
44
45XILINX_QEMUBOOT[doc] = "Set this variable to '1' to enable the generation of qemuboot.conf which uses the Xilinx QEMU."
46XILINX_QEMUBOOT ?= ""
47
48# Dependencies for native Xilinx QEMU
49XILINX_QEMU_DEPENDS ?= "qemu-xilinx-native"
50# If the machine supports the Xilinx QEMU, add the dependencies
51EXTRA_IMAGEDEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'qemu-system-xilinx', '${XILINX_QEMU_DEPENDS}', '', d)}"
52
53# Add an override for when booting with the Xilinx QEMU
54MACHINEOVERRIDES .= "${@':qemuboot-xilinx' if qemuboot_xilinx_enabled(d) else ''}"
55
56# This is ignored if using Xilinx's QEMU fork
33QB_DTB ?= "${@qemu_default_dtb(d)}" 57QB_DTB ?= "${@qemu_default_dtb(d)}"
58
59# ZynqMP machines need special "-hw-dtb" device trees for the Xilinx QEMU
60XILINX_QEMU_DEPENDS_append_zynqmp = " qemu-devicetrees"
61
62QB_DEFAULT_KERNEL_qemuboot-xilinx = "none"
34QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" 63QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}"
35 64
65# Default machine targets for Xilinx QEMU (FDT Generic)
66QB_MACHINE_qemuboot-xilinx_aarch64 = "-machine arm-generic-fdt"
67QB_MACHINE_qemuboot-xilinx_arm = "-machine arm-generic-fdt-plnx"
68QB_MACHINE_qemuboot-xilinx_microblaze = "-machine microblaze-generic-fdt"