With the release of Ubuntu 23.04 last week, Canonical is now providing pre-built images for the VF2. There are a few issues with this image. 1: There is no USB support, and 2: Ethernet doesn’t work on the v1.2a revision of the VF2.
I have compiled a kernel and modules for the board that fix USB support, located here: GitHub - agreenbhm/linux: Linux kernel source tree. This is mainly just taking the defconfig for VF2 from the Starfive 5.15 kernel repo and applying code and config patches from Esmil’s fixes (located here GitHub - esmil/linux at jh7110-6.2.y). If you install the 3 .deb files it will get the new kernel and kmods installed and configured as default. USB should work after a reboot.
For Ethernet: from what I understand, the problem has to do with a change in Ethernet on the SoC between v1.2a and v1.3b revisions of the VF2, as the v1.2a apparently had some bugs in the Ethernet component. The DTB that loads by default with the Ubuntu images is for the v1.3b variant. When booting with this DTB, Ethernet just doesn’t work for me at all. To fix: simply replace the references to the DTB either in Grub or in the /boot directory to point to the proper v1.2a DTB, which is included in my kernel .deb files. Alternatively, that DTB appears to be included with the official Ubuntu image as well (just not in the /boot directory); instead, it’s located here: /usr/lib/firmware/6.2.0-19-generic/device-tree/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb. You could just reference that DTB instead from Grub or /boot symlinks if you’re not installing my kernel.
I submit a bug report over the weekend about the DTB issue so hopefully that’ll be addressed in the official build at some point. I think the guy who made the USB fixes is a Canonical employee so hopefully those fixes will be merged soon too.
I wonder if I’m missing a detail, I installed your debs, made the symlink suggested, and rebooted with network attached to the 1 GbE port (which worked with my previous Arch install). Unfortunately it’s not being picked up:
ubuntu@unbuntu:~$ uname -a
Linux unbuntu 6.2.10-g3dfd8c597147 #8 SMP Mon Apr 24 20:11:39 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux
ubuntu@unbuntu:~$ ls -l /boot/dtb
lrwxrwxrwx 1 root root 89 Mar 20 14:54 /boot/dtb -> /usr/lib/linux-image-6.2.10-g3dfd8c597147/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb
ubuntu@unbuntu:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
3: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 6c:cf:39:00:27:a9 brd ff:ff:ff:ff:ff:ff
inet6 fe80::6ecf:39ff:fe00:27a9/64 scope link
valid_lft forever preferred_lft forever
4: end1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 6c:cf:39:00:27:aa brd ff:ff:ff:ff:ff:ff
UPDATE: AFAICT, your new image still referred to the v1.3 dtb but forcing /boot/dtb-6.2.10-g3dfd8c597147 -> /usr/lib/linux-image-6.2.10-g3dfd8c597147/starfive/jh7110-starfive-visionfive-2-v1.2a.dtb seems to have done the trick. Thanks.
For whatever reason the v1.3b DTB is always installed as the DTB. In the latest packages I posted I ended up just overwriting the 1.3b DTB with the 1.2a one so I wouldn’t have to manually swap each time.
Right, it seems it does that every time it decides to update the initrd (which is frequently). That’s a bit unfortunate, but worst I can get in through the serial console and turn it back.
Doesn’t look like I’m able to edit my OP, but I’ve found the source of the issue with the DTB. There is a file, “/etc/flash-kernel/machine” that contains the model information for the board. Looks like the Ubuntu release set it to “StarFive VisionFive 2 v1.3B”. If you have the 1.2A variant, just update that file accordingly. Future kernel installs will install the proper DTB.
Thanks for providing the new kernel.
I would like to use docker and I need bridge and br_netfilter to be compiled.
Having
Could you include this module or give me some advice on what git repo and branches you use so I can compile this myself.
I just completed merging Esmil’s changes into the master branch of the main Linux repo. I’ve set Github Actions to run daily to merge upstream changes into my repo and then build .deb packages with the latest kernel. You can find that here: Releases · agreenbhm/linux · GitHub. Currently this is based on all changes as of an hour ago, which is somewhere between 6.3 and 6.4.