blob: edd932cd34775627f4f2edf6a7910ca0c3eec140 [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_MACHINE = "-machine xlnx-zcu102"
41QB_MEM = "-m 4096"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null"
Brad Bishop286d45c2018-10-02 15:21:57 -040043QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@"
44
Brad Bishop286d45c2018-10-02 15:21:57 -040045# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
46QB_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 Geissler84ad7c52020-06-27 00:00:16 -050051 -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \
Brad Bishop286d45c2018-10-02 15:21:57 -040052 "
53
54# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0)
55QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
Brad Bishop26bdd442019-08-16 17:08:17 -040056QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
Brad Bishop286d45c2018-10-02 15:21:57 -040057QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
58
59# PMU instance args
60PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
Andrew Geissler84ad7c52020-06-27 00:00:16 -050061PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu' if d.getVar('BMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}"
62PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-zynqmp-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-zcu102-zynqmp'}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080063
Brad Bishop286d45c2018-10-02 15:21:57 -040064QB_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 Bishop1a4b7ee2018-12-16 17:11:34 -080069 -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \
Brad Bishop286d45c2018-10-02 15:21:57 -040070 -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
71 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
72 "
73QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'"
74
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080075do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy"