Issues with official Ubuntu 23.04 image and fixes for USB and v1.2a Ethernet

Edit: please see this thread for current kernel fixes Daily Ubuntu Kernel Builds - Now With 100% More APT Repo!

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.

9 Likes

Is this the Image that you are referring to?
http://cdimage.ubuntu.com/releases/23.04/release/ubuntu-23.04-preinstalled-server-riscv64+visionfive2.img.xz

3 Likes

Yes, that’s correct.

There are also daily images:
http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/
But the official 23.04 release is a much safer and easier option.

1 Like

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.

5 Likes

It’s nice to see some movement from Ubuntu/canonical on this. A bit low-key but given the issues maybe understandably so.

We are still waiting for it to appear here :disappointed:

1 Like

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.

1 Like

Have they enabled the GPU and does it have the GPU related files installed?
If you run a dmesg are there any references to PVR_K

sudo dmesg|grep RVR_K shows nothing. (I uniquely use it headlessly so this isn’t an issue for me though).

1 Like

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.

2 Likes

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.

As my newer package fixes that for 1.2a so you may want to install that one. It’s in the GH repo listed as “-dirty” (not under releases).

1 Like

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.

5 Likes

This issue ought to sort itself out once u-boot accepts these patches and the board firmware is upgraded.

Probably needs some cleaning on the Linux side as well.

I’d wait at-least until Linux 6.5-rc1 is released for basic support to be in upstream. (This doesn’t apply to me. I’ll still keep on building -next :smiley:)

2 Likes

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.

1 Like

Starfive’s official repo seems have newer version(6.3 rc1) kernel than Esmil’s:GitHub - starfive-tech/linux at JH7110_VisionFive2_upstream

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.

2 Likes

@dns - Try building from my repo here (master branch): GitHub - agreenbhm/linux: Linux kernel source tree. Add whatever you need to the visionfive2_defconfig via menuconfig.

1 Like

You could try to also include my pmic series: [PATCH v3 1/3] dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant - Shengyu Qu
this could help enable cpufreq and increase emmc speed

how do I recognize the v1.2a revision of the VF2 ?