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 |
| 10 | require conf/machine/include/machine-xilinx-board.inc |
| 11 | require conf/machine/include/machine-xilinx-qemu.inc |
| 12 | include conf/machine/include/zynqmp-pmu-config.inc |
| 13 | |
| 14 | MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost" |
| 15 | |
| 16 | UBOOT_MACHINE = "xilinx_zynqmp_zcu102_rev1_0_defconfig" |
| 17 | SPL_BINARY = "spl/boot.bin" |
| 18 | |
| 19 | # Default SD image build onfiguration, use qemu-sd to pad |
| 20 | IMAGE_CLASSES += "image-types-xilinx-qemu" |
| 21 | IMAGE_FSTYPES += "wic.qemu-sd" |
| 22 | WKS_FILES ?= "sdimage-bootpart.wks" |
| 23 | |
| 24 | SERIAL_CONSOLE = "115200 ttyPS0" |
| 25 | SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" |
| 26 | |
| 27 | KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb" |
| 28 | |
| 29 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx" |
| 30 | PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx" |
| 31 | PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware" |
| 32 | |
| 33 | EXTRA_IMAGEDEPENDS += " \ |
| 34 | u-boot-zynq-uenv \ |
| 35 | arm-trusted-firmware \ |
| 36 | qemu-devicetrees \ |
| 37 | virtual/pmu-firmware \ |
| 38 | virtual/boot-bin \ |
| 39 | " |
| 40 | |
| 41 | IMAGE_BOOT_FILES += "uEnv.txt atf-uboot.ub ${KERNEL_IMAGETYPE}-zynqmp-zcu102-rev1.0.dtb" |
| 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" |
| 47 | QB_OPT_APPEND = "-nographic -serial mon:stdio -serial null" |
| 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" |
| 66 | QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=3" |
| 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" |
| 71 | QB_PMU_OPT = " \ |
| 72 | -M microblaze-fdt \ |
| 73 | -display none \ |
| 74 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ |
| 75 | -kernel ${PMU_ROM} \ |
| 76 | -device loader,file=${DEPLOY_DIR_IMAGE}/pmu-firmware-${MACHINE}.elf \ |
| 77 | -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ |
| 78 | -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ |
| 79 | " |
| 80 | QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" |
| 81 | |