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 | |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 5 | require conf/machine/include/soc-zynqmp.inc |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 6 | require conf/machine/include/machine-xilinx-default.inc |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 7 | require conf/machine/include/machine-xilinx-qemu.inc |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 8 | |
| 9 | MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost" |
| 10 | |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 11 | UBOOT_MACHINE = "xilinx_zynqmp_virt_defconfig" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 12 | SPL_BINARY ?= "spl/boot.bin" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 13 | |
| 14 | # Default SD image build onfiguration, use qemu-sd to pad |
| 15 | IMAGE_CLASSES += "image-types-xilinx-qemu" |
| 16 | IMAGE_FSTYPES += "wic.qemu-sd" |
| 17 | WKS_FILES ?= "sdimage-bootpart.wks" |
| 18 | |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 19 | SERIAL_CONSOLES ?= "115200;ttyPS0" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 20 | |
| 21 | KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb" |
| 22 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 23 | EXTRA_IMAGEDEPENDS += " \ |
| 24 | u-boot-zynq-uenv \ |
| 25 | arm-trusted-firmware \ |
| 26 | qemu-devicetrees \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 27 | virtual/boot-bin \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | virtual/bootloader \ |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 29 | u-boot-zynq-scr \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 30 | " |
| 31 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | IMAGE_BOOT_FILES += " \ |
| 33 | uEnv.txt \ |
| 34 | atf-uboot.ub \ |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 35 | ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ |
| 36 | boot.scr \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 37 | " |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 38 | |
| 39 | # This machine has a QEMU model, runqemu setup: |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 40 | QB_MACHINE = "-machine xlnx-zcu102" |
| 41 | QB_MEM = "-m 4096" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 42 | QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 43 | QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" |
| 44 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 45 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) |
| 46 | QB_OPT_APPEND_append_qemuboot-xilinx = " \ |
| 47 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \ |
| 48 | ${@qemu_zynqmp_unhalt(d, True)} \ |
| 49 | -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ |
| 50 | -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 51 | -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 52 | " |
| 53 | |
| 54 | # Attach the rootfs disk image to the second SD interface of QEMU (which is SD0) |
| 55 | QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 56 | QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 57 | QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" |
| 58 | |
| 59 | # PMU instance args |
| 60 | PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf" |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 61 | PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu' if d.getVar('BMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}" |
| 62 | PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-zynqmp-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-zcu102-zynqmp'}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 63 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 64 | QB_PMU_OPT = " \ |
| 65 | -M microblaze-fdt \ |
| 66 | -display none \ |
| 67 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ |
| 68 | -kernel ${PMU_ROM} \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 69 | -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 70 | -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ |
| 71 | -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ |
| 72 | " |
| 73 | QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" |
| 74 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 75 | do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" |