From 322e23dc213d51a12345ca705b3776f189dc413f Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 15 Dec 2021 13:52:16 -0800 Subject: Initial restructure/split of meta-xilinx-bsp Create a new meta-xilinx-core, move core functionality to the core, keeping board specific files in the bsp layer. zynqmp-generic changed from require to include, so if meta-xilinx-bsp is not available it will not fail. Signed-off-by: Mark Hatle --- .../conf/machine/include/machine-xilinx-qemu.inc | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc (limited to 'meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc') diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc new file mode 100644 index 00000000..c2093ca6 --- /dev/null +++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc @@ -0,0 +1,55 @@ +# This include is used to setup default QEMU and qemuboot config for meta-xilinx +# machines. + +# Use the xilinx specific version for these users +IMAGE_CLASSES += "qemuboot-xilinx" + +# depend on qemu-helper-native, which will depend on QEMU +EXTRA_IMAGEDEPENDS += "qemu-helper-native" + +PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" +PREFERRED_PROVIDER_qemu = "qemu-xilinx" +PREFERRED_PROVIDER_qemu-native = "qemu-xilinx-native" +PREFERRED_PROVIDER_nativesdk-qemu = "nativesdk-qemu-xilinx" + +def qemu_default_dtb(d): + if d.getVar("IMAGE_BOOT_FILES", True): + dtbs = d.getVar("IMAGE_BOOT_FILES", True).split(" ") + # IMAGE_BOOT_FILES has extra renaming info in the format ';' + # Note: Wildcard sources work here only because runqemu expands them at run time + dtbs = [f.split(";")[0] for f in dtbs] + dtbs = [f for f in dtbs if f.endswith(".dtb")] + if len(dtbs) != 0: + return dtbs[0] + return "" + +def qemu_default_serial(d): + if d.getVar("SERIAL_CONSOLES", True): + first_console = d.getVar("SERIAL_CONSOLES", True).split(" ")[0] + speed, console = first_console.split(";", 1) + # zynqmp uses earlycon and stdout (in dtb) + if "zynqmp" in d.getVar("MACHINEOVERRIDES", True).split(":"): + return "" + return "console=%s,%s earlyprintk" % (console, speed) + return "" + +def qemu_target_binary(d): + ta = d.getVar("TARGET_ARCH", True) + if ta == "microblazeeb": + ta = "microblaze" + elif ta == "arm": + ta = "aarch64" + return "qemu-system-%s" % ta + +def qemu_zynqmp_unhalt(d, multiarch): + if multiarch: + return "-global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true" + return "-device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4" + +# For qemuboot, default setup across all machines in meta-xilinx +QB_SYSTEM_NAME:aarch64 ?= "${@qemu_target_binary(d)}-multiarch" +QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}" +QB_DEFAULT_FSTYPE ?= "cpio" +QB_DTB ?= "${@qemu_default_dtb(d)}" +QB_KERNEL_CMDLINE_APPEND ?= "${@qemu_default_serial(d)}" + -- cgit v1.2.3-54-g00ecf