Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 1 | #@TYPE: Machine |
| 2 | #@NAME: zcu102-zynqmp |
| 3 | #@DESCRIPTION: Machine support for ZCU102 Evaluation Board. |
| 4 | |
| 5 | SOC_VARIANT ?= "eg" |
| 6 | |
| 7 | require conf/machine/include/tune-zynqmp.inc |
| 8 | require conf/machine/include/machine-xilinx-overrides.inc |
| 9 | require conf/machine/include/machine-xilinx-default.inc |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 10 | require conf/machine/include/machine-xilinx-qemu.inc |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 11 | |
| 12 | MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost" |
| 13 | |
| 14 | UBOOT_MACHINE = "xilinx_zynqmp_zcu102_rev1_0_defconfig" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | SPL_BINARY ?= "spl/boot.bin" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 16 | |
| 17 | # Default SD image build onfiguration, use qemu-sd to pad |
| 18 | IMAGE_CLASSES += "image-types-xilinx-qemu" |
| 19 | IMAGE_FSTYPES += "wic.qemu-sd" |
| 20 | WKS_FILES ?= "sdimage-bootpart.wks" |
| 21 | |
| 22 | SERIAL_CONSOLE = "115200 ttyPS0" |
| 23 | SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" |
| 24 | |
| 25 | KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb" |
| 26 | |
| 27 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx" |
| 28 | PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 29 | |
| 30 | EXTRA_IMAGEDEPENDS += " \ |
| 31 | u-boot-zynq-uenv \ |
| 32 | arm-trusted-firmware \ |
| 33 | qemu-devicetrees \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 34 | virtual/boot-bin \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | virtual/bootloader \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 36 | " |
| 37 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 38 | IMAGE_BOOT_FILES += " \ |
| 39 | uEnv.txt \ |
| 40 | atf-uboot.ub \ |
| 41 | " |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 42 | |
| 43 | # This machine has a QEMU model, runqemu setup: |
| 44 | IMAGE_CLASSES += "qemuboot-xilinx" |
| 45 | QB_MACHINE = "-machine xlnx-zcu102" |
| 46 | QB_MEM = "-m 4096" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 47 | QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 48 | QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" |
| 49 | |
| 50 | # Use qemu-xilinx instead of mainline |
| 51 | PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native" |
| 52 | |
| 53 | # Use the multiarch script instead of launching QEMU directly |
| 54 | QB_SYSTEM_NAME_append = "-multiarch" |
| 55 | |
| 56 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) |
| 57 | QB_OPT_APPEND_append_qemuboot-xilinx = " \ |
| 58 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \ |
| 59 | ${@qemu_zynqmp_unhalt(d, True)} \ |
| 60 | -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ |
| 61 | -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ |
| 62 | " |
| 63 | |
| 64 | # Attach the rootfs disk image to the second SD interface of QEMU (which is SD0) |
| 65 | QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 66 | QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 67 | QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" |
| 68 | |
| 69 | # PMU instance args |
| 70 | PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 71 | PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu" |
| 72 | PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu" |
| 73 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 74 | QB_PMU_OPT = " \ |
| 75 | -M microblaze-fdt \ |
| 76 | -display none \ |
| 77 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ |
| 78 | -kernel ${PMU_ROM} \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 79 | -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 80 | -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ |
| 81 | -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ |
| 82 | " |
| 83 | QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" |
| 84 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 85 | do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" |