Installing Xen Support on Xilinx ZynqMP
Published at July 15, 2025 · Last Modified at November 29, 2025 · 3 min read · Tags: xen zephyr linux zynq
Installing Xen Support on Xilinx ZynqMP
Published at July 15, 2025 · Last Modified at November 29, 2025 · 3 min read · Tags: xen zephyr linux zynq
This post explains how to boot Xen + Linux Dom0 from an SD card on the Xilinx ZCU102 Rev 1.1 board. The setup uses a Yocto-generated rootfs but loads Xen manually (outside Yocto recipes) so it’s easy to test different Xen versions, change boot parameters, and debug domain configurations without rebuilding the entire Yocto image.
The diagram below shows the runtime architecture:
Everything else (file systems, network, logging, firmware, etc.) stays in Dom0.
The following U-Boot script is used to load Xen, Linux, and the device tree blob (DTB) from the SD card. It also demonstrates how to patch the FDT in memory before booting.
setenv xen_addr 0x80000
fatload mmc 0:1 ${xen_addr} xen
setenv fdt_addr 0x1000000
fatload mmc 0:1 ${fdt_addr} system.dtb
fatload mmc 0:1 0x2000000 Image
booti ${xen_addr} - ${fdt_addr}
# Modify FDT in RAM if needed
fdt add
fdt addr ${fdt_addr}
fdt resize
fdt print /chosen
fdt set /chosen bootargs "root=/dev/mmcblk0p2 rw quiet loglevel=0"
fdt set /axi/usb@ff9d0000 status "disabled"
booti ${xen_addr} - ${fdt_addr}
Convert your boot.cmd into a bootable U-Boot script image:
mkimage -A arm -T script -C none -n "Xen boot script" -d boot.cmd boot.scr
If you’re running a minimal Linux system (e.g. via Yocto), network configuration is likely managed by systemd-networkd.
Create or edit:
/etc/systemd/network/10-eth0-static.network
[Match]
Name=eth0
[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
Check for any .network files with DHCP=yes. If found, rename or remove them to prevent conflicts.
systemctl enable systemd-networkd
systemctl restart systemd-networkd
In order for U-Boot and Xen to cooperate, the DTB must be modified to include a chosen node with Xen-specific fields.
Edit the file zynqmp-zcu102-revA.dts and replace or add the following section:
chosen {
#address-cells = <2>;
#size-cells = <1>;
stdout-path = "serial0:115200n8";
bootargs = "earlycon console=dtuart";
xen,dom0-bootargs = "console=hvc0 root=/dev/mmcblk0p2 rw earlycon";
module@0 {
compatible = "multiboot,module", "multiboot,kernel";
reg = <0x00000000 0x02000000 0x02000000>;
};
};
This tells Xen how to find the kernel and pass the correct boot arguments to Linux running as Dom0.
The kernel and DTS sources are usually located under Yocto’s tmp/work-shared directory.
However, it is recommended to extract them into a standalone repository for ease of modification, version control, and iterative compilation.
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- dtbs
xen.ubThe xen.ub is a multi-image that bundles Xen, Linux, and the modified device tree into a single U-Boot-friendly file.
It’s typically placed under:
tmp/deploy/images/zcu102-zynqmp/
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- dtbs
cp ./arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dtb ./tmp/deploy/images/zcu102-zynqmp/system.dtb
mkimage -A arm64 -T multi -C none -n "Xen Image" -d xen:Image:system.dtb xen.ub
Use fdisk to create two partitions on the SD card:
sudo fdisk /dev/sdX
# Use 'n' to create partitions, and 't' to set type (e.g., type c for FAT32)
mkfs.vfat /dev/sdX1
mkfs.ext4 /dev/sdX2
Copy the following to the FAT32 partition:
xen.ubboot.scrImage (Linux kernel)system.dtbTo run your boot script manually from the U-Boot shell:
load mmc 0:1 ${loadaddr} boot.scr
source ${loadaddr}
This is useful for debugging or testing different configurations without reflashing the board.