blob: 7aa01986e8aeeee58ead7454e32b0a73091a1215 [file] [log] [blame]
Brad Bishop754b8fa2019-08-20 09:16:20 -04001#@TYPE: Machine
Andrew Geissler84ad7c52020-06-27 00:00:16 -05002#@NAME: Generic zynqmp
Brad Bishop754b8fa2019-08-20 09:16:20 -04003#@DESCRIPTION: zynqmp devices
4
Andrew Geissler84ad7c52020-06-27 00:00:16 -05005# CG is the lowest common demoninator, so use this by default
6SOC_VARIANT ?= "cg"
7
8require conf/machine/include/soc-zynqmp.inc
Brad Bishop754b8fa2019-08-20 09:16:20 -04009require conf/machine/include/machine-xilinx-default.inc
10require conf/machine/include/machine-xilinx-qemu.inc
11
12MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
13
Brad Bishop754b8fa2019-08-20 09:16:20 -040014EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-native"
15
Andrew Geissler84ad7c52020-06-27 00:00:16 -050016UBOOT_MACHINE = "xilinx_zynqmp_virt_defconfig"
17SPL_BINARY ?= "spl/boot.bin"
18
19# Default SD image build onfiguration, use qemu-sd to pad
20IMAGE_CLASSES += "image-types-xilinx-qemu"
21IMAGE_FSTYPES += "wic.qemu-sd"
22WKS_FILES ?= "sdimage-bootpart.wks"
23
24SERIAL_CONSOLES ?= "115200;ttyPS0"
25
26# We need a generic one that works with QEMU...
27HDF_MACHINE = "zcu102-zynqmp"
28KERNEL_DEVICETREE = "xilinx/zynqmp-zcu102-rev1.0.dtb"
29
30EXTRA_IMAGEDEPENDS += " \
31 u-boot-zynq-uenv \
32 arm-trusted-firmware \
33 qemu-devicetrees \
34 virtual/boot-bin \
35 virtual/bootloader \
36 u-boot-zynq-scr \
37 "
38
39IMAGE_BOOT_FILES += " \
40 uEnv.txt \
41 atf-uboot.ub \
42 ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \
43 boot.scr \
44 "
45
46# This machine has a QEMU model, runqemu setup:
47QB_MACHINE = "-machine xlnx-zcu102"
48QB_MEM = "-m 4096"
49QB_OPT_APPEND ?= "-nographic -serial mon:stdio -serial null"
50QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@"
51
52# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
53QB_OPT_APPEND_append_qemuboot-xilinx = " \
54 -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \
55 ${@qemu_zynqmp_unhalt(d, True)} \
56 -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \
57 -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \
58 -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000 \
59 "
60
61# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0)
62QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
63QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=5"
64QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
65
66# PMU instance args
67PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
68PMU_FIRMWARE_DEPLOY_DIR ?= "${@ '${TOPDIR}/pmutmp/deploy/images/zynqmp-pmu' if d.getVar('BMULTICONFIG') == 'pmu' else '${TOPDIR}/tmp/deploy/images/${MACHINE}'}"
69PMU_FIRMWARE_IMAGE_NAME ?= "${@ 'pmu-firmware-zynqmp-pmu' if d.getVar('BBMULTICONFIG') == 'pmu' else 'pmu-${MACHINE}'}"
70
71QB_PMU_OPT = " \
72 -M microblaze-fdt \
73 -display none \
74 -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \
75 -kernel ${PMU_ROM} \
76 -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \
77 -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
78 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
79 "
80QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'"
81
82do_write_qemuboot_conf[depends] += "u-boot-zynq-uenv:do_deploy"