blob: 2c890cfb821928389843728ce72fab899014c813 [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001#@TYPE: Machine
2#@NAME: zcu102-zynqmp
3#@DESCRIPTION: Machine support for ZCU102 Evaluation Board.
4
Andrew Geissler84ad7c52020-06-27 00:00:16 -05005require conf/machine/include/soc-zynqmp.inc
Brad Bishop286d45c2018-10-02 15:21:57 -04006require conf/machine/include/machine-xilinx-default.inc
Brad Bishop286d45c2018-10-02 15:21:57 -04007require conf/machine/include/machine-xilinx-qemu.inc
Brad Bishop286d45c2018-10-02 15:21:57 -04008
9MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
10
Andrew Geissler84ad7c52020-06-27 00:00:16 -050011UBOOT_MACHINE = "xilinx_zynqmp_virt_defconfig"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012SPL_BINARY ?= "spl/boot.bin"
Brad Bishop286d45c2018-10-02 15:21:57 -040013
14# Default SD image build onfiguration, use qemu-sd to pad
15IMAGE_CLASSES += "image-types-xilinx-qemu"
16IMAGE_FSTYPES += "wic.qemu-sd"
17WKS_FILES ?= "sdimage-bootpart.wks"
18
Andrew Geissler84ad7c52020-06-27 00:00:16 -050019SERIAL_CONSOLES ?= "115200;ttyPS0"
Brad Bishop286d45c2018-10-02 15:21:57 -040020
21KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb"
22
Brad Bishop286d45c2018-10-02 15:21:57 -040023EXTRA_IMAGEDEPENDS += " \
24 u-boot-zynq-uenv \
25 arm-trusted-firmware \
26 qemu-devicetrees \
Brad Bishop286d45c2018-10-02 15:21:57 -040027 virtual/boot-bin \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028 virtual/bootloader \
Andrew Geissler84ad7c52020-06-27 00:00:16 -050029 u-boot-zynq-scr \
Brad Bishop286d45c2018-10-02 15:21:57 -040030 "
31
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032IMAGE_BOOT_FILES += " \
33 uEnv.txt \
34 atf-uboot.ub \
Andrew Geissler84ad7c52020-06-27 00:00:16 -050035 ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \
36 boot.scr \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037 "
Brad Bishop286d45c2018-10-02 15:21:57 -040038
39# This machine has a QEMU model, runqemu setup:
Brad Bishop286d45c2018-10-02 15:21:57 -040040QB_MEM = "-m 4096"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null"
Brad Bishop286d45c2018-10-02 15:21:57 -040042QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@"
43
Brad Bishop286d45c2018-10-02 15:21:57 -040044# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
45QB_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 Geissler84ad7c52020-06-27 00:00:16 -050050 -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \
Brad Bishop286d45c2018-10-02 15:21:57 -040051 "
52
53# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0)
54QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
Brad Bishop26bdd442019-08-16 17:08:17 -040055QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
Brad Bishop286d45c2018-10-02 15:21:57 -040056QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
57
58# PMU instance args
59PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
Andrew Geisslera9ff2b32020-10-16 10:11:54 -050060PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}"
61PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-microblaze-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-zcu102-zynqmp'}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062
Brad Bishop286d45c2018-10-02 15:21:57 -040063QB_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 Bishop1a4b7ee2018-12-16 17:11:34 -080068 -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \
Brad Bishop286d45c2018-10-02 15:21:57 -040069 -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
70 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
71 "
72QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'"
73
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy"