zcu102: Add support for running Xilinx's QEMU
@@ -8,7 +8,7 @@ require conf/machine/include/machine-xilinx-default.inc
require conf/machine/include/machine-xilinx-board.inc
require conf/machine/include/machine-xilinx-qemu.inc
-MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost mali"
+MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost mali qemu-system-xilinx"
UBOOT_MACHINE = "xilinx_zynqmp_zcu102_revB_defconfig"
@@ -30,3 +30,20 @@ QB_OPT_APPEND = "-nographic -serial mon:stdio -serial null"
QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@"
QB_SLIRP_OPT = "-netdev user,id=net0 -net nic -net nic -net nic -net nic,netdev=net0"
+# Xilinx QEMU options
+QB_OPT_APPEND_append_qemuboot-xilinx = " -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/zcu102-arm.dtb "
+
+# Reset and unhalt CPU0
+QB_OPT_APPEND_append_qemuboot-xilinx = " -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 "
+
+# Load the boot media
+QB_OPT_APPEND_append_qemuboot-xilinx = " -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware-${MACHINE}.elf,cpu-num=0 \
+ -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \
+ "
+
+# Load the kernel image so the user can run 'booti 0x80000 0x6000000 0x4000000' to boot the kernel
+QB_DEFAULT_FSTYPE_qemuboot-xilinx = "cpio.gz.u-boot"
+QB_ROOTFS_OPT_qemuboot-xilinx = " -device loader,addr=0x6000000,file=@ROOTFS@,force-raw=true"
+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} \
+ "
