From d6aaa8a9406e1b2b1545c804fd64807543fa6808 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 14 Nov 2017 23:15:23 +1000 Subject: zcu102-zynqmp: Setup runqemu to boot from an SD image This sets up the zcu102-zynqmp machine to by default generate a padded SD card image for which runqemu can use to boot from. This image includes all the components that are expected from to boot and mirrors the same requirements that the real board has. The QEMU args are changed to default to the SD boot mode and only U-Boot SPL is passed in as a ROM image to boot the QEMU instance. This setup mimics the boot flow of the physical target where the Boot ROM loads U-Boot SPL and the PMU Firmware from the boot.bin. Signed-off-by: Nathan Rossi Signed-off-by: Manjukumar Matha --- conf/machine/zcu102-zynqmp.conf | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/conf/machine/zcu102-zynqmp.conf b/conf/machine/zcu102-zynqmp.conf index 41e9e119..80b6d6f3 100644 --- a/conf/machine/zcu102-zynqmp.conf +++ b/conf/machine/zcu102-zynqmp.conf @@ -13,6 +13,11 @@ MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost" UBOOT_MACHINE = "xilinx_zynqmp_zcu102_rev1_0_defconfig" SPL_BINARY = "spl/boot.bin" +# Default SD image build onfiguration, use qemu-sd to pad +IMAGE_CLASSES += "image-types-xilinx-qemu" +IMAGE_FSTYPES += "wic.qemu-sd" +WKS_FILES ?= "sdimage-bootpart.wks" + SERIAL_CONSOLE = "115200 ttyPS0" SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" @@ -23,11 +28,14 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx" PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware" EXTRA_IMAGEDEPENDS += " \ + u-boot-zynq-uenv \ arm-trusted-firmware \ qemu-devicetrees \ virtual/pmu-firmware \ " +IMAGE_BOOT_FILES += "uEnv.txt atf-uboot.ub ${KERNEL_IMAGETYPE}-zynqmp-zcu102-rev1.0.dtb" + # This machine has a QEMU model, runqemu setup: IMAGE_CLASSES += "qemuboot-xilinx" QB_MACHINE = "-machine xlnx-zcu102" @@ -41,23 +49,19 @@ PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" # Use the multiarch script instead of launching QEMU directly QB_SYSTEM_NAME_append = "-multiarch" -# Setup hw-dtb, unhalt, atf and u-boot loading +# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) QB_OPT_APPEND_append_qemuboot-xilinx = " \ -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 \ + -device loader,addr=0xfffc0000,file=${DEPLOY_DIR_IMAGE}/u-boot-spl.bin,cpu-num=0 \ " -# 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} \ - -pmu-args '${QB_PMU_OPT}' \ - " +# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0) +QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd" +QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=3" +QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" +# PMU instance args PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf" QB_PMU_OPT = " \ -M microblaze-fdt \ @@ -68,4 +72,5 @@ QB_PMU_OPT = " \ -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ " +QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" -- cgit v1.2.3-54-g00ecf