Build steps to build OpenSBI v1.8.1 and U-Boot v2026.04 for VisionFive 2
NOTE:
The build steps are a little bit tricky currently. But they are working and tested on real hardware.
Prerequisites for Vision Five 2 8GiB DDR-RAM variant:
Currently the official sources from U-Boot only supports the 4GiB RAM variant from the board. For supporting of the 8GiB DDR-RAM variant of the board containing the RAM-IC BiWin BMWZCX32H2A-64G-X (soldered on my model), there is a modification in the device tree source required.
Just change the DDR RAM size from 4GiB to 8GiB in the device tree source dts/upstream/src/riscv/starfive/jh7110-common.dtsi from the U-Boot sources in the memory node:
4GiB DDR-RAM:
memory@40000000 {
device_type = "memory";
reg = <0x0 0x40000000 0x1 0x0>;
bootph-pre-ram;
};
8GiB DDR-RAM:
memory@40000000 {
device_type = "memory";
reg = <0x0 0x40000000 0x2 0x0>;
bootph-pre-ram;
};
Now the 8GiB should be supported by U-Boot and also returned from U-Boot’s EFI environment memory map query.
Build OpenSBI (first stage):
$ git clone https://github.com/riscv-software-src/opensbi.git
$ cd opensbi
$ git checkout v1.8.1
$ make distclean
$ export CROSS_COMPILE=riscv64-unknown-linux-gnu-
$ make PLATFORM=generic
After successful built, the following files should be created:
opensbi/build/platform/generic/firmware/fw_dynamic.bin
Build U-Boot:
$ git clone https://github.com/u-boot/u-boot.git
$ cd u-boot
$ git checkout v2026.04
$ make mrproper
$ export CROSS_COMPILE=riscv64-unknown-linux-gnu-
$ export OPENSBI=/path/to/openspi/fw_dynamic.bin
$ make starfive_visionfive2_defconfig
$ make
After successful built, the following files should be created:
u-boot/u-boot.bin
u-boot/dts/upstream/src/riscv/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
Build OpenSBI (second stage):
$ cd opensbi
$ make distclean
$ make PLATFORM=generic FW_PAYLOAD_PATH=/path/to/u-boot/u-boot.bin FW_FDT_PATH=/path/to/u-boot/jh7110-starfive-visionfive-2-v1.3b.dtb FW_TEXT_START=0x40000000
Create FIT image (with U-Boot’s mkimage):
- Create the file visionfive2-uboot-fit-image.its with the following content:
/dts-v1/;
/ {
description = "U-boot-spl FIT image for JH7110 VisionFive2";
#address-cells = <2>;
images {
firmware {
description = "u-boot";
data = /incbin/("fw_payload.bin");
type = "firmware";
arch = "riscv";
os = "u-boot";
load = <0x0 0x40000000>;
entry = <0x0 0x40000000>;
compression = "none";
};
};
configurations {
default = "config-1";
config-1 {
description = "U-boot-spl FIT config for JH7110 VisionFive2";
firmware = "firmware";
};
};
};
- Copy the OpenSBI/U-Boot binary fw_payload.bin into the same directory as the file visionfive2-uboot-fit-image.its
- Create the FIT image (firmware.itb):
$ cd u-boot
$ ./tools/mkimage -f /path/to/visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware firmware.itb
The following files should be created which containing the final firmware images:
u-boot/spl/u-boot-spl.bin.normal.out
u-boot/firmware.itb
Prepare/Format SD card:
$ sudo sgdisk --clear --set-alignment=2 --new=1:4096:8191 --change-name=1:spl --typecode=1:2E54B353-1271-4842-806F-E436D6AF6985 --new=2:8192:16383 --change-name=2:uboot --typecode=2:BC13C2FF-59E6-4262-A352-B275FD6F7172 --new=3:16384:1654784 --change-name=3:system --typecode=3:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/sdx
Create FAT32 file system:
$ sudo mkfs.vfat -F 32 /dev/sdx3
Copy new built firmware onto SD card:
$ sudo dd if=u-boot-spl.bin.normal.out of=/dev/sdx1
$ sudo dd if=firmware.itb of=/dev/sdx2
To update the SPI flash is currently not described here. See U-Boot documentation for update the new firmware onto the SPI flash, or ask it here.