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

If you’re asking how to tell if you have that revision, it’s printed on the board to the right of the StarFive logo.

2 Likes

@agreenbhm I created a pull request to your repo to enable cpufreq.
Also seems some driver in sf’s branch doesn’t exist in this repo, for example: crypto engine.

1 Like

I have an android phone so I use a Reading Glasses/Reader application to act as a strong magnifying glass to be able to see it - the writing is tiny (“V1.3B” is written on mine).

In that case you shouldn’t have to worry about the DTB. The default Ubuntu configuration is for your board.

1 Like

Merged the PR and am running a build/release now.

1 Like

You would think that, but modifying the Device Tree is still a very useful skill to learn.

Currently the dtb’s for the VF2 do not have a “pps-gpio”. Adding this, when it comes to setting up a NTP (Network Time Protocol) source is the difference between getting time from a GPS in the millisecond range (UART only) and getting it to the microsecond range (UART+PPS) in terms of accuracy and precision. And then things get very interesting because the two NIC’s in the V1.3B and one NIC in the V1.2A support physical layer frequency reference, Synchronous Ethernet.

1.2A
YT8531C (GMAC0 10/100/1000M) Synchronous Ethernet (Sync-E) 
YT8512C (GMAC1 10/100M) unfortunately does NOT support Sync-E

1.3B
YT8531C (GMAC0 10/100/1000M) Synchronous Ethernet (Sync-E) 
YT8531C (GMAC1 10/100/1000M) Synchronous Ethernet (Sync-E)

IEEE 1588 (1588) PTP (Precision Time Protocol) is an interesting technology, and one of the reasons I bought this board. But the reality is that any setup will be in a lower league when compared to something like CERN’s White Rabbit Project which is used for sub-nanosecond time synchronization. But CERN do use atomic reference clocks instead of TCXO’s (Temperature Compensated Xtal/crystal Oscillators) in their hardware, where it is 10 km between nodes.

  • One light-microsecond is about 300 metres (984 feet).

Although it might be somewhat useful for working at radio frequencies, I would see it far more useful when applied to sound.
Sound only travels at a speed of approximately 344 meters (~1130 feet) per second.

  • One audio-millisecond (in dry air at room temperature) sound will travel about 344 mm (13.56 inches)
  • One audio-microsecond (in dry air at room temperature) sound will travel about 0.344 mm (13.56 thousandth of an inch).

I could see this technology used to very cheaply synchronise audio at very large outdoor music venues.

2 Likes

Sounds like you have an interesting use case. However, what I meant was that the default Ubuntu configuration will install the DTB for the 1.3b board when you upgrade the kernel rather than the 1.2a. You can modify the DTB to your liking and when you compile and install the kernel it will install the DTB for your board also. Since I have a 1.2a needed to change the config file I mentioned earlier, otherwise the 1.3b DTB would install every time I upgrade, requiring me to manually fix it.

I have a need to change the device tree to support the full set of U74 PMUs. Unfortunately this is controlled by OpenSBI which sees a different device tree, hardcoded (IIUC) somewhere. I’m hoping this will eventually get fixed so I don’t have to mess with the firmware myself.

Thanks for your help.
I’ve successfully built a kernel based on your source with all the required modules compiled and most of the optional modules for docker to work.

For those who need to do something similar use this shell script from the open source docker project to verify the kernel config and it tells you what modules are missing.
After compiling the kernel and running the script you can eventually get all the required and most of the optional kernel modules compiled for docker to be happy.

Here is my final kernel config

Another pull request sent since I forgot to enable PMIC driver, sorry. @agreenbhm

The latest kernel builds have the Docker changes incorporated. I made a defconfig (visionfive2_docker_defconfig) for this, so if you don’t want the additional modules needed for Docker you can always use the original visionfive2_defconfig.

1 Like

No worries, I’ll get that merged.

You didn’t build kernel modules?

Current build script only seems to package the kernel and not the additional modules. I need to look into it.

Try make modules before build .deb, succeeded in my testing.

Thanks, that did it.

Can we get CONFIG_NET_CLS_CGROUP and CONFIG_XFRM_USER included for docker support.

The kernel you have does work with docker in legacy iptables mode but looks like you need these last two modules to work with netfilter.

2 Likes

Thanks for the info. I’ve updated the config to reflect those changes.

@dns - It doesn’t seem that those options were the complete solution, and I’m yet to find anything definitive about using modern NFTables with Docker rather than legacy IPTables. Do you have an sources you can point me towards to look into this further?

1 Like

It was trial and error, basically running check-config.sh from the docker project against the linux config and one by one adding more modules until it stops complaining.
So the two things it looks like you are missing are CONFIG_NET_CLS_CGROUP and CONFIG_XFRM_USER. I think CONFIG_XFRM_USER may have a few other dependencies that also need to be enabled for that module to compile.

I compile a few more things as modules than you but I’m not sure what ones are important. You can compare my config with your config with diffconfig.