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_MEM = "-m 4096" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 41 | QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 42 | QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" |
| 43 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 44 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) |
| 45 | QB_OPT_APPEND_append_qemuboot-xilinx = " \ |
| 46 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \ |
| 47 | ${@qemu_zynqmp_unhalt(d, True)} \ |
| 48 | -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ |
| 49 | -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 50 | -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 51 | " |
| 52 | |
| 53 | # Attach the rootfs disk image to the second SD interface of QEMU (which is SD0) |
| 54 | QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 55 | QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 56 | QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw" |
| 57 | |
| 58 | # PMU instance args |
| 59 | PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf" |
Andrew Geissler | a9ff2b3 | 2020-10-16 10:11:54 -0500 | [diff] [blame] | 60 | PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}" |
| 61 | PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-zcu102-zynqmp'}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 62 | |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 63 | QB_PMU_OPT = " \ |
| 64 | -M microblaze-fdt \ |
| 65 | -display none \ |
| 66 | -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ |
| 67 | -kernel ${PMU_ROM} \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 68 | -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 69 | -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ |
| 70 | -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ |
| 71 | " |
| 72 | QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'" |
| 73 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 74 | do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy" |