blob: 281110d9653947d9a45f14ab9f86d42da7ef87cf [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
5SOC_VARIANT ?= "eg"
6
7require conf/machine/include/tune-zynqmp.inc
8require conf/machine/include/machine-xilinx-overrides.inc
9require conf/machine/include/machine-xilinx-default.inc
Brad Bishop286d45c2018-10-02 15:21:57 -040010require conf/machine/include/machine-xilinx-qemu.inc
Brad Bishop286d45c2018-10-02 15:21:57 -040011
12MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
13
14UBOOT_MACHINE = "xilinx_zynqmp_zcu102_rev1_0_defconfig"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015SPL_BINARY ?= "spl/boot.bin"
Brad Bishop286d45c2018-10-02 15:21:57 -040016
17# Default SD image build onfiguration, use qemu-sd to pad
18IMAGE_CLASSES += "image-types-xilinx-qemu"
19IMAGE_FSTYPES += "wic.qemu-sd"
20WKS_FILES ?= "sdimage-bootpart.wks"
21
22SERIAL_CONSOLE = "115200 ttyPS0"
23SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
24
25KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb"
26
27PREFERRED_PROVIDER_virtual/kernel ?= "linux-xlnx"
28PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx"
Brad Bishop286d45c2018-10-02 15:21:57 -040029
30EXTRA_IMAGEDEPENDS += " \
31 u-boot-zynq-uenv \
32 arm-trusted-firmware \
33 qemu-devicetrees \
Brad Bishop286d45c2018-10-02 15:21:57 -040034 virtual/boot-bin \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035 virtual/bootloader \
Brad Bishop286d45c2018-10-02 15:21:57 -040036 "
37
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080038IMAGE_BOOT_FILES += " \
39 uEnv.txt \
40 atf-uboot.ub \
41 "
Brad Bishop286d45c2018-10-02 15:21:57 -040042
43# This machine has a QEMU model, runqemu setup:
44IMAGE_CLASSES += "qemuboot-xilinx"
45QB_MACHINE = "-machine xlnx-zcu102"
46QB_MEM = "-m 4096"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080047QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null"
Brad Bishop286d45c2018-10-02 15:21:57 -040048QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@"
49
50# Use qemu-xilinx instead of mainline
51PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native"
52
53# Use the multiarch script instead of launching QEMU directly
54QB_SYSTEM_NAME_append = "-multiarch"
55
56# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
57QB_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)
65QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
Brad Bishop26bdd442019-08-16 17:08:17 -040066QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
Brad Bishop286d45c2018-10-02 15:21:57 -040067QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
68
69# PMU instance args
70PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071PMU_FIRMWARE_DEPLOY_DIR ?= "${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu"
72PMU_FIRMWARE_IMAGE_NAME ?= "pmu-firmware-zynqmp-pmu"
73
Brad Bishop286d45c2018-10-02 15:21:57 -040074QB_PMU_OPT = " \
75 -M microblaze-fdt \
76 -display none \
77 -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \
78 -kernel ${PMU_ROM} \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080079 -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \
Brad Bishop286d45c2018-10-02 15:21:57 -040080 -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
81 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
82 "
83QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'"
84
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy"