From c9b8ff6881cc94cf10b57e3d184cf39125facee6 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 30 May 2017 21:30:28 +1000 Subject: zcu102-zynqmp: Setup the use of multiarch QEMU Setup the qemuboot variables and qemu-xilinx-helper-native environment to use the multiarch script to start a QEMU multiarch instance with the MicroBlaze PMU. Signed-off-by: Nathan Rossi Tested-by: Alistair Francis --- conf/machine/include/machine-xilinx-qemu.inc | 5 +++++ conf/machine/zcu102-zynqmp.conf | 22 +++++++++++++++++++--- .../qemu/qemu-xilinx-helper-native_1.0.bb | 5 ++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc index 938d76d4..dd275f3b 100644 --- a/conf/machine/include/machine-xilinx-qemu.inc +++ b/conf/machine/include/machine-xilinx-qemu.inc @@ -36,6 +36,11 @@ def qemu_target_binary(d): 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 ?= "${@qemu_target_binary(d)}" QB_DEFAULT_FSTYPE ?= "cpio" diff --git a/conf/machine/zcu102-zynqmp.conf b/conf/machine/zcu102-zynqmp.conf index 054a1790..526fbf25 100644 --- a/conf/machine/zcu102-zynqmp.conf +++ b/conf/machine/zcu102-zynqmp.conf @@ -41,10 +41,13 @@ QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MA # Use qemu-xilinx instead of mainline PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" -# Reset and unhalt CPU0, load the boot media. +# Use the multiarch script instead of launching QEMU directly +QB_SYSTEM_NAME_append = "-multiarch" + +# Setup hw-dtb, unhalt, atf and u-boot loading QB_OPT_APPEND_append_qemuboot-xilinx = " \ - -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/zcu102-arm.dtb \ - -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 \ + -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \ + ${@qemu_zynqmp_unhalt(d, True)} \ -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ " @@ -55,4 +58,17 @@ QB_ROOTFS_OPT_qemuboot-xilinx = " -device loader,addr=0x6000000,file=@ROOTFS@,fo QB_OPT_APPEND_append_qemuboot-xilinx = " \ -device loader,addr=0x4000000,file=${DEPLOY_DIR_IMAGE}/${QB_DTB} \ -device loader,addr=0x80000,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} \ + -pmu-args '${QB_PMU_OPT}' \ + " + +PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf" +QB_PMU_OPT = " \ + -M microblaze-fdt \ + -display none \ + -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ + -kernel ${PMU_ROM} \ + -device loader,file=${DEPLOY_DIR_IMAGE}/pmu-${MACHINE}.elf \ + -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ + -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ " + diff --git a/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb index f48a8d40..55b35b53 100644 --- a/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb +++ b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb @@ -21,5 +21,8 @@ PROVIDES += "qemu-helper-native" # replace qemu with qemu-xilinx DEPENDS_remove = "qemu-native" -DEPENDS_append = " qemu-xilinx-native" +DEPENDS_append = " \ + qemu-xilinx-native \ + qemu-xilinx-multiarch-helper-native \ + " -- cgit v1.2.3-54-g00ecf