1 Xilinx Versal Virt (``xlnx-versal-virt``)
2 =========================================
4 Xilinx Versal is a family of heterogeneous multi-core SoCs
5 (System on Chip) that combine traditional hardened CPUs and I/O
6 peripherals in a Processing System (PS) with runtime programmable
7 FPGA logic (PL) and an Artificial Intelligence Engine (AIE).
10 https://www.xilinx.com/products/silicon-devices/acap/versal.html
12 The family of Versal SoCs share a single architecture but come in
13 different parts with different speed grades, amounts of PL and
16 The Xilinx Versal Virt board in QEMU is a model of a virtual board
17 (does not exist in reality) with a virtual Versal SoC without I/O
18 limitations. Currently, we support the following cores and devices:
20 Implemented CPU cores:
22 - 2 ACPUs (ARM Cortex-A72)
26 - Interrupt controller (ARM GICv3)
28 - An RTC (Versal built-in)
29 - 2 GEMs (Cadence MACB Ethernet MACs)
30 - 8 ADMA (Xilinx zDMA) channels
32 - OCM (256KB of On Chip Memory)
35 QEMU does not yet model any other devices, including the PL and the AI Engine.
37 Other differences between the hardware and the QEMU model:
39 - QEMU allows the amount of DDR memory provided to be specified with the
40 ``-m`` argument. If a DTB is provided on the command line then QEMU will
41 edit it to include suitable entries describing the Versal DDR memory ranges.
43 - QEMU provides 8 virtio-mmio virtio transports; these start at
44 address ``0xa0000000`` and have IRQs from 111 and upwards.
48 If the user provides an Operating System to be loaded, we expect users
49 to use the ``-kernel`` command line option.
51 Users can load firmware or boot-loaders with the ``-device loader`` options.
53 When loading an OS, QEMU generates a DTB and selects an appropriate address
54 where it gets loaded. This DTB will be passed to the kernel in register x0.
56 If there's no ``-kernel`` option, we generate a DTB and place it at 0x1000
57 for boot-loaders or firmware to pick it up.
59 If users want to provide their own DTB, they can use the ``-dtb`` option.
60 These DTBs will have their memory nodes modified to match QEMU's
61 selected ram_size option before they get passed to the kernel or FW.
63 When loading an OS, we turn on QEMU's PSCI implementation with SMC
64 as the PSCI conduit. When there's no ``-kernel`` option, we assume the user
65 provides EL3 firmware to handle PSCI.
69 Direct Linux boot of a generic ARM64 upstream Linux kernel:
73 $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \
74 -serial mon:stdio -display none \
75 -kernel arch/arm64/boot/Image \
77 -device virtio-rng-device,bus=virtio-mmio-bus.0 \
78 -drive if=none,index=0,file=hd0.qcow2,id=hd0,snapshot \
79 -drive file=qemu_sd.qcow2,if=sd,index=0,snapshot \
80 -device virtio-blk-device,drive=hd0 -append root=/dev/vda
82 Direct Linux boot of PetaLinux 2019.2:
86 $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \
87 -serial mon:stdio -display none \
88 -kernel petalinux-v2019.2/Image \
89 -append "rdinit=/sbin/init console=ttyAMA0,115200n8 earlycon=pl011,mmio,0xFF000000,115200n8" \
90 -net nic,model=cadence_gem,netdev=net0 -netdev user,id=net0 \
91 -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \
92 -object rng-random,filename=/dev/urandom,id=rng0
94 Boot PetaLinux 2019.2 via ARM Trusted Firmware (2018.3 because the 2019.2
95 version of ATF tries to configure the CCI which we don't model) and U-boot:
99 $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \
100 -serial stdio -display none \
101 -device loader,file=petalinux-v2018.3/bl31.elf,cpu-num=0 \
102 -device loader,file=petalinux-v2019.2/u-boot.elf \
103 -device loader,addr=0x20000000,file=petalinux-v2019.2/Image \
104 -nic user -nic user \
105 -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \
106 -object rng-random,filename=/dev/urandom,id=rng0
108 Run the following at the U-Boot prompt:
113 fdt addr $fdtcontroladdr
114 fdt move $fdtcontroladdr 0x40000000
115 fdt set /timer clock-frequency <0x3dfd240>
116 setenv bootargs "rdinit=/sbin/init maxcpus=1 console=ttyAMA0,115200n8 earlycon=pl011,mmio,0xFF000000,115200n8"
117 booti 20000000 - 40000000
118 fdt addr $fdtcontroladdr
120 Boot Linux as DOM0 on Xen via U-Boot:
124 $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \
125 -serial stdio -display none \
126 -device loader,file=petalinux-v2019.2/u-boot.elf,cpu-num=0 \
127 -device loader,addr=0x30000000,file=linux/2018-04-24/xen \
128 -device loader,addr=0x40000000,file=petalinux-v2019.2/Image \
129 -nic user -nic user \
130 -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \
131 -object rng-random,filename=/dev/urandom,id=rng0
133 Run the following at the U-Boot prompt:
138 fdt addr $fdtcontroladdr
139 fdt move $fdtcontroladdr 0x20000000
140 fdt set /timer clock-frequency <0x3dfd240>
141 fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/uart@ff000000 dom0_mem=640M bootscrub=0 maxcpus=1 timer_slop=0"
142 fdt set /chosen xen,dom0-bootargs "rdinit=/sbin/init clk_ignore_unused console=hvc0 maxcpus=1"
143 fdt mknode /chosen dom0
144 fdt set /chosen/dom0 compatible "xen,multiboot-module"
145 fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000>
146 booti 30000000 - 20000000
148 Boot Linux as Dom0 on Xen via ARM Trusted Firmware and U-Boot:
152 $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \
153 -serial stdio -display none \
154 -device loader,file=petalinux-v2018.3/bl31.elf,cpu-num=0 \
155 -device loader,file=petalinux-v2019.2/u-boot.elf \
156 -device loader,addr=0x30000000,file=linux/2018-04-24/xen \
157 -device loader,addr=0x40000000,file=petalinux-v2019.2/Image \
158 -nic user -nic user \
159 -device virtio-rng-device,bus=virtio-mmio-bus.0,rng=rng0 \
160 -object rng-random,filename=/dev/urandom,id=rng0
162 Run the following at the U-Boot prompt:
167 fdt addr $fdtcontroladdr
168 fdt move $fdtcontroladdr 0x20000000
169 fdt set /timer clock-frequency <0x3dfd240>
170 fdt set /chosen xen,xen-bootargs "console=dtuart dtuart=/uart@ff000000 dom0_mem=640M bootscrub=0 maxcpus=1 timer_slop=0"
171 fdt set /chosen xen,dom0-bootargs "rdinit=/sbin/init clk_ignore_unused console=hvc0 maxcpus=1"
172 fdt mknode /chosen dom0
173 fdt set /chosen/dom0 compatible "xen,multiboot-module"
174 fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000>
175 booti 30000000 - 20000000