First Bitstream Build
Complete guide to building and booting Linux on Microwatt with the VCU-118 FPGA.
Prerequisites: This guide assumes you are using the official PowerCommons WSL images and have followed all instructions in the Development Environment section.
Overview
Build and boot Linux on VCU-118 in four steps:
- Build Buildroot (cross-compiler + userspace)
- Build Linux kernel (with Microwatt patches)
- Build FPGA bitstream (Microwatt + DDR4 + QSPI)
- Flash and boot
Clone Repositories
cd ~/projects
# Microwatt with VCU-118 support
git clone https://codeberg.org/PowerCommons/microwatt.git
cd microwatt
git checkout xilinx-vcu-118-dram
cd ..
# Linux kernel (upstream v6.12)
git clone --depth=1 --branch v6.12 \
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
# PowerCommons kernel patches
git clone https://codeberg.org/PowerCommons/linux-powercommons.git
# Buildroot for userspace
git clone https://github.com/shenki/buildroot -b microwatt buildroot-microwatt
Step 1: Build Buildroot
Build the cross-compiler and root filesystem:
cd ~/projects/buildroot-microwatt
make ppc64le_microwatt_defconfig
make -j$(nproc)
Build time: ~30 minutes
Output:
- Cross-compiler:
output/host/bin/powerpc64le-buildroot-linux-gnu-gcc - Root filesystem:
output/images/rootfs.cpio
Step 2: Build Linux Kernel
Apply PowerCommons Patches
cd ~/projects/linux
git am ~/projects/linux-powercommons/patches/microwatt-vcu118/*.patch
This applies the RCU fix and device tree updates needed for Microwatt on VCU-118. See the Microwatt Kernel RCU Fix blog post for details on why this is needed.
Configure Kernel
make ARCH=powerpc microwatt_defconfig
Set Initramfs Path
Edit .config and set the path to your rootfs.cpio:
CONFIG_INITRAMFS_SOURCE="/home/powercommons/projects/buildroot-microwatt/output/images/rootfs.cpio"
Build Kernel
export PATH="/home/powercommons/projects/buildroot-microwatt/output/host/bin:$PATH"
make ARCH=powerpc CROSS_COMPILE=powerpc64le-buildroot-linux-gnu- -j$(nproc) zImage
Build time: ~5 minutes
Output: arch/powerpc/boot/dtbImage.microwatt.elf
Step 3: Build FPGA Bitstream
Generate LiteDRAM Core
cd ~/projects/microwatt/litedram/gen-src
python3 generate.py xilinx-vcu-118
Build Bitstream
cd ~/projects/microwatt
fusesoc library add microwatt .
fusesoc run --target=xilinx-vcu-118 microwatt --no_bram --spi_flash_offset=33554432
Parameters:
--no_bram: Boot from external flash instead of internal BRAM--spi_flash_offset=33554432: Linux kernel location at 32MB offset
Build time: ~45 minutes
Output: build/microwatt_0/xilinx-vcu-118-vivado/microwatt_0.bit
Step 4: Flash and Boot
Program Bitstream
openFPGALoader -b vcu118 --write-flash ~/projects/microwatt/build/microwatt_0/xilinx-vcu-118-vivado/microwatt_0.bit
Program Linux Kernel (at 32MB offset)
openFPGALoader -b vcu118 --write-flash -o 0x2000000 ~/projects/linux/arch/powerpc/boot/dtbImage.microwatt.elf
Connect Serial Console
tio /dev/ttyUSB0 -b 115200
Power Cycle
Power cycle the VCU-118 board. You should see:
Welcome to Microwatt !
Soc signature: f00daa5500010001
Soc features: UART DRAM SPIFLASH
DRAM: 2047 MB
CLK: 125 MHz
SPI FLASH ID: 20bb21 Micron 1G [quad IO mode]
LiteDRAM built from LiteX f55ea7075
Initializing SDRAM @0x40000000...
Memtest OK
Trying flash...
Booting from DRAM at 1700000
[... Linux boot messages ...]
Welcome to Buildroot
microwatt login:
Login with root (no password).
Troubleshooting
| Problem | Solution |
|---|---|
| SPI FLASH ID: 000000 | Check STARTUPE3 DO/DI wiring. See QSPI blog post |
| Kernel crashes in rcu_process_callbacks | Apply the PowerCommons patches. See RCU fix blog post |
| “Can’t open blockdev” | Set CONFIG_INITRAMFS_SOURCE to your rootfs.cpio path |
| DDR4 training fails | Check clock stability and reset sequencing |
Repository Links
- Microwatt: codeberg.org/PowerCommons/microwatt (branch:
xilinx-vcu-118-dram) - Kernel Patches: codeberg.org/PowerCommons/linux-powercommons
- Buildroot: github.com/shenki/buildroot (branch:
microwatt)