VisionFive2 board-some progress

Earlier this year I had no success with FreeBSD on this board.

I noticed that Armbian, OpenBSD, and Ubuntu have no problem running.
I noticed that the u-boot firmware seems to have a lot to do with a successful boot.

It seems that the key to success is to follow the instructions to create the u-boot images.
u-boot documentation

Sometimes those images fail. My last successful build was 11 Sep 2024.
That is currently what I am using on the board spi memory.

The latest FreeBSD 15 CURRENT-riscv-riscv64-GENERICSD snapshot boots just fine (31 Oct 2024):
FreeBSD snapshot

To boot that image add the dtb file to efi partition.
add it to the efi partition here--> starfive/jh7110-starfive-visionfive-2-v1.3b.dtb

The u-boot firmware looks for that directory and filename when attempting to boot.

Ignore the two u-boot partitions on the image and only use the spi to boot.
Also the current u-boot port will not boot--> sysutils/u-boot-starfive-visionfive2

The board boots OK (from sdcard) into FreeBSD 15. There is no video, no network, no usb, no nvme.
 
add it to the efi partition here--> starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
Sure this works as does in root of msdos filesystem but the proper path on the EFI drive is:
/dtb/${VENDOR}/${DTB}
As you can see on FreeBSD Arm Images.

You can see in u-boot with printenv but it does omit the /dtb part of the path.
fdtfile=/rockchip/rock-pi-4.dtb

I hesitated even posting this it is so minor a detail.

I am writing a script to setup u-boot with poudriere image post install so this stuff is fresh in the mind.
 
I find what I said incorrect.
For the dtb files on ESP they will be found if in root dir, /dtb directory or /dtb/vendor directory.

But I have noticed that the loader only finds DTB in the /boot/dtb/ directory.
/boot/dtb/vendor is not in path and it falls back to EFI provided DTB.
So u-boot picks up the DTB on ESP and forwards it to FreeBSD loader.
OK boot
Using DTB provided by EFI at 0x3ce8c000.

If you specify in loader.conf It uses what you tell it. Provided it is in the path.
/boot/loader.conf
Code:
dtbfile_load="YES"
dtbfile_type="dtb"
dtbfile_name="rk3566-radxa-zero-3e.dtb"
OK boot
Using DTB from loaded file '/boot/dtb/rk3566-radxa-zero-3e.dtb'.
You can add the vendor to the path and it works fine.
dtbfile_name="/boot/dtb/rockchip/rk3566-radxa-zero-3e.dtb"
 
The FreeBSD snapshot for generic sdcard is now working with the nics and sdcard for storage.
The basics -- networking, storage, ssh, iscsi --- no usb, nvme or video at this time
Download the --> FreeBSD-15.0-CURRENT-riscv-riscv64-GENERICSD

FreeBSD current generic sdcard

Do not use a usb stick... only the sd card is working at this time.
You must be using a serial connection (for console)... hdmi is working at this time

Copy the dtb file to the EFI partition of the sdcard image --> /dtb/jh7110-starfive-visionfive-2-v1.3b.dtb

The disk (sd card) layout looks like this after booting
Code:
 root@generic:~ # gpart show mmcsd0
     =>       40  122142640  mmcsd0  GPT  (58G)
              40       4056            - free -  (2.0M)
            4096       4096          1   hifive-fsbl  (2.0M)
            8192       8192           2  hifive-bbl  (4.0M)
           16384     110592        3  efi  (54M)
          126976  109670400       4  freebsd-ufs  (52G)
       109797376   1233712       5  freebsd-swap  (5.9G)
       122134528       8152             - free -  (4.0M)
Need to boot from spi-- flip the boot switch to spi boot
The first two partitions on the generic sd card will not work for booting the visionfive2

Interrupt the u-boot normal boot process
Then these commands will boot the sdcard:
Code:
StarFive # mmc list
mmc@16010000: 0
mmc@16020000: 1

StarFive # mmc dev 1
switch to partitions #0, OK
mmc1 is current device

StarFive #  load mmc 1:3 ${fdt_addr_r}      dtb/jh7110-starfive-visionfive-2-v1.3b.dtb
32134 bytes read in 5 ms (6.1 MiB/s)

StarFive #  load mmc 1:3 ${kernel_addr_r} efi/boot/bootriscv64.efi
712636 bytes read in 34 ms (20 MiB/s)

StarFive #  bootefi ${kernel_addr_r} ${fdt_addr_r}

** now should see FreeBSD boot
You will need to have your own riscv repository to load software.
Poudriere is your friend.

You can also build riscv sd card image on amd64.
After buildworld and buildkernel go to release directory and make vm-image
Code:
freebsd@generic:~ % uname -a
FreeBSD generic 15.0-CURRENT FreeBSD 15.0-CURRENT #0 main-n277145-6ee513f4f26d: Thu May 8 04:27:15 UTC 2025 root@releng3.nyi.freebsd.org:/usr/obj/usr/src/riscv.riscv64/sys/GENERIC riscv

freebsd@generic:~ % neofetch
```                        `       freebsd@generic
  ` `.....---.......--.```   -/    ---------------
  +o   .--`         /y:`      +.   OS: FreeBSD 15.0-CURRENT riscv64
   yo`:.            :o      `+-    Uptime: 41 mins
    y/               -/`   -o/     Packages: 7 (pkg)
   .-                  ::/sy+:.    Shell: csh tcsh 6.22.04
   /                     `--  /    Terminal: /dev/pts/0
  `:                          :`   CPU: (4)
freebsd@generic:~ %           :`
   /                          /
   .-                        -.
    --                      -.
     `:`                  `:`
       .--             `--.
          .---.....----.
 
Are there any updates according the both gigabit network ports? Want to use the Board as Firewall for my home network.

I have seen also U-Boot seems to have drivers for the Starfive JH7110. I have also successfully released some patches on the official U-Boot mailing list. Is somebody already working on the network driver? Maybe I can help too. :)
 
The nics work.
I do not use the u-boot from ports.
I compile u-boot from u-boot.org. But since 26 April 2025, the builds fail to boot. Hangs during memory check.
The sdcard seems questionable using Poudriere. I notice a a strange error when Poudriere completes and attempts to create the repository.
Code:
mmcsd0: Error indicated: 4 Failed
I do not see much activity or follow up to make some ports work on riscv.
A basic firewall is possible at this time.
 
Are there any updates according the both gigabit network ports? Want to use the Board as Firewall for my home network.

I have seen also U-Boot seems to have drivers for the Starfive JH7110. I have also successfully released some patches on the official U-Boot mailing list. Is somebody already working on the network driver? Maybe I can help too. :)
I think freebsd-riscv mailing list is more development focused if you could work on some driver... just my opinion, nothing bad with forums per se.
 
Is something wrong with u-boot from ports? Or do you need more recent or development version for some reason?
I do not use the u-boot from ports due to other other operating systems I use on this board. Also, wanted to understand how u-boot works and builds.
I wish the visionfive2 had a replacement for the u-boot.
I am really surprised how how other boards can use a replacement to u-boot. I am speaking of a uefi replacement:
edk2-rk3588
That uefi replacement makes it easy to use the OrangePi 5 Plus and other rk3588 based boards.
The starfive edk2 is poor quality and needs major help starfive-tech edk2
 
Good news. Compiled u-boot u-boot.org today and it now works with FreeBSD 15. Also, no longer need to create/store boot commands for FreeBSD. The normal u-boot boot command now boots.
Code:
bootcmd=bootflow scan

Code:
U-Boot 2025.07 (Jul 25 2025 - 10:02:46 +0300)

CPU:   sifive,u74-mc
Model: StarFive VisionFive 2 v1.3B
DRAM:  8 GiB
Core:  159 devices, 29 uclasses, devicetree: board
WDT:   Not starting watchdog@13070000
MMC:   mmc@16010000: 0, mmc@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
OK
 
Back
Top