[meta-xilinx] [PATCH 4/5] zcu102-zynqmp: Setup the use of multiarch QEMU

Nathan Rossi nathan at nathanrossi.com
Wed May 24 08:47:54 PDT 2017


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 <nathan at nathanrossi.com>
---
 conf/machine/include/machine-xilinx-qemu.inc           |  5 +++++
 conf/machine/zcu102-zynqmp.conf                        | 10 +++++++---
 recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb |  5 ++++-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc
index 938d76d461..dd275f3b48 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 15fed4ff5d..3be585fbc1 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-${MACHINE}.elf,cpu-num=0 \
 		-device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \
 		"
@@ -56,3 +59,4 @@ 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} \
 		"
+
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 f48a8d40a0..55b35b53e5 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 \
+		"
 
-- 
2.11.0




More information about the meta-xilinx mailing list