FreeBSD on Zynq-7000 / Zedboard

I'm working on porting FreeBSD to the Zedboard and other Xilinx Zynq-7000 platforms. The Zynq-7000 is an interesting platform combing a Xilinx 7-series FPGA fabric with a dual-core ARM Cortex-A9 "Application Processor Unit" (System-on-a-Chip).

The Zedboard is an evaluation board for the Zynq-7000. It is manufactured by Digilent. More information on the Zedboard can be found at

The information on this page is migrating to the FreeBSD wiki at


The Zynq port is now running on the new MicroZed board. It runs the same Zedboard SD card image with a few file changes in the boot partition. I describe below how to make the changes.


The Zynq FreeBSD port is now running on Parallella! I describe below how to modify the Zedboard SD card image to boot on Parallela.

Pre-built SD card image

If you'd like to test-drive FreeBSD on a Zedboard, download the following gzip'ed SD card image file and transfer it to an SD card of 1GB or larger. (This wipes out all previous data on the SD card if you hadn't guessed.).

Download: freebsd-zedboard-071514.img.gz. It's about 100MB.

These are md5 sums for the image:

MD5 (freebsd-zedboard-071514.img) = f0ca597e04da19b3f34c6cd29761662e
MD5 (freebsd-zedboard-071514.img.gz) = 47bbef2c3eaa6f70d3de7f33e63fd2d1
Uncompress and copy the image to the SD card. On my machine, the SD card shows up as /dev/da0. Be sure that is the same on your machine before cut and pasting this.
# gunzip freebsd-zedboard-071514.img.gz
# dd if=freebsd-zedboard-071514.img of=/dev/da0 bs=32768

Boot It

Power down the Zedboard. Insert the SD card in the SD slot and be sure the Zedboard's configuration mode jumpers are set for booting from SD card before powering up. (If you've already been booting the Linux image from the SD card shipped with the Zedboard, this shouldn't need to change.)

The USB-UART connected to connect J14 acts as the FreeBSD console (device uart1). This is the same console as the stock Linux image. The Zedboard should automatically boot U-boot and then the FreeBSD kernel.

The FreeBSD kernel has drivers for the UARTs, SDIO, Gig Ethernet, and a USB host driver for the USB OTG connected at J13. There is also a GPIO driver which allows reading of switches and buttons and controlling the LEDs.

Please send any feedback to me via E-mail

Other Zynq Boards:


To run this image on a MicroZed, you need to change a few files in the image. Download microzed_extrafiles.tgz and extract the files. Then mount the SD card partitions on your machine and copy the files over:
# mkdir /mnt/boot /mnt/armroot
# mount -t msdosfs /dev/da0s1 /mnt/boot
# mount /dev/da0s2a /mnt/armroot

# tar xzvf microzed_extrafiles.tgz
# cp microzed_extrafiles/{BOOT.BIN,uEnv.txt,microzed.dtb} /mnt/boot
# cp rc.conf /mnt/armroot/rc.conf

# umount /mnt/boot
# umount /mnt/armroot

Note: At boot-up, the USB-Host interface on MicroZed is held in reset by a Zynq GPIO signal (PS_MIO7). The quick-and-dirty way to release it from reset is as follows:

# gpioctl -c 7 OUT
# gpioctl 7 1
I'll try to come up with a start-up script for /etc/rc.d to automate this.


To run this image on a Parallella, you need to replace all the files in the boot partition. Download parallella_freebsd.tgz. It contains the new boot files for FreeBSD on Parallella.

Mount the SD card boot partition on your machine:

# mkdir /mnt/boot
# mount -t msdosfs /dev/da0s1 /mnt/boot
Remove all the files in the boot partition:
# rm /mnt/boot/*
Copy your Parallella board's bitstream to the partition. There are several different bitstreams for the various board configurations. See section 3 of this guide to creating an SD card.
# cp parallella_????.bit.bin /mnt/boot/parallella.bit.bin
Extract the files from parallella_freebsd.tgz into the boot partition:
# tar xzvf parallella_freebsd.tgz -C /mnt/boot
Unmount the boot partition
# umount /mnt/boot

Note: Changing the hostname from zedboard to parallella is an exercise left to the reader. :-)

Source Code

Zynq/Zedboard support is now in the FreeBSD kernel source. Most of the relevant code is in sys/arm/xilinx and the GigEthernet driver is in sys/dev/cadence.

I've applied this patch to the source to fix some bugs in the GigEthernet driver: patch.all.txt.

Building an SD Image

Note: Tim Kientzle's crochet-freebsd tool can now build ZedBoard images.

Here's how I create the SD image from the source.

Build world and kernel

From within the source directory:
make TARGET_ARCH=armv6 KERNCONF=ZEDBOARD buildworld buildkernel

Create SD card image

dd if=/dev/zero of=SDCARD.img count=1048576
mdconfig -f SDCARD.img -u 0

gpart create -s MBR md0
gpart add -s64m -t \!14 md0
gpart set -a active -i 1 md0
newfs_msdos -F 16 /dev/md0s1

gpart add -t freebsd md0
gpart create -s BSD md0s2
gpart add -t freebsd-ufs md0s2
newfs /dev/md0s2a
tunefs -n enable /dev/md0s2a

Mount filessystems

mkdir /mnt/boot /mnt/armroot
mount -t msdosfs /dev/md0s1 /mnt/boot
mount /dev/md0s2a /mnt/armroot

Populate root and boot partitions

From within the source directory:
make TARGET_ARCH=armv6 KERNCONF=ZEDBOARD DESTDIR=/mnt/armroot installworld distribution installkernel
Download and extract these files: zedboard_extrafiles.tgz. (microzed_extrafiles.tgz for the MicroZed.)

Copy these files to the boot partition:

cp BOOT.BIN ubldr zedboard.dtb uEnv.txt /mnt/boot

Final tweaks

Copy these files to the root partition (also in zedboard_extrafiles.tgz):
mkdir /mnt/armroot/boot/msdos
cp rc.conf fstab /mnt/armroot/etc

Unmount file systems

umount /mnt/boot
umount /mnt/armroot
mdconfig -d -u 0

Copy to an SD card

dd if=SDCARD.img of=/dev/da0 bs=32768

Building u-boot

I no longer use a modified u-boot for FreeBSD on Zynq. The stock u-boot from Xilinx can boot FreeBSD using the uEnv.txt file in zedboard_extrafiles.tgz.

The official repository for Xilinx port of u-boot is on github here. Follow the instructions to build the zynq_zed configuration of u-boot.

Thomas Skibo

E-mail Me