Arch Linux Image for VisionFive 2

@LeoHa I tested using an old Cisco Catalyst 2950 switch. It is connected via a 1 Gbps SFP fiber uplink, and all of its UTP ports are 10/100. Here are the results:

  • When I plug the right port on VF2 (1 Gbps) into this switch, the kernel reports that the link is up with 100 Mbps/Full, but I cannot obtain an IP address.
  • When I plug the left port on VF2 (100 Mbps) into this switch, the kernel reports that the link is up with 100 Mbps/Full and I successfully obtain an IP address.

However, when I plug either port on VF2 into another 10/100/1000 switch, both ports can successfully obtain an IP address.

I believe the changes in the driver between v2.6.0 and v2.8.0 may be the cause of this problem.

2 Likes

I am also having issues with cwt6, the ethernet ports are unable to obtain an IP address.
Even when assigning addresses manually, no traffic is able to pass via the onboard ports.

It looks like there is a problem with the dtbs provided in the cwt6 image.
If I replace the /boot/boot/dtbs folder with the cwt5 version, everything appears to work fine.

dtbs on cwt5 was the same as dtbs provided from debian 69. may be it can be fixed with the next debian image that build on v2.8.0.

The dtbs have differing checksums:

sha256sum cwt{5,6}-boot/boot/dtbs/starfive/jh7110-visionfive-v2.dtb
f9f6a29d26c38f9c83bad5a9cd7850c397915de2e58a00bb4e940ab636999104  cwt5-boot/boot/dtbs/starfive/jh7110-visionfive-v2.dtb
1686c1f5f58de96802dd0378daf6b0e065709504e721183cfb676c0a62b595a0  cwt6-boot/boot/dtbs/starfive/jh7110-visionfive-v2.dtb

(Those are from the boot partitions of the full Archlinux image files)

run dtc -I dtb -O dts on each and diff the outputs to learn how they are different

yes, for cwt5 I used device tree blobs from Debian 69. But for cwt6, I used what was produced at the end of the kernel build. I will try using dtc as suggested by @tommythorn

Oh no you most definitely want to use the one from debian69. Itā€™s essential to describing the hardware for the VisionFive 2

but how did they produce their blob? I thought it was the result of make dtbs_install at the end of kernel building.

I just tried your latest archlinux image ArchLinux-VF2_515_v2.8.0-cwt6.img.

sudo umount /dev/sdb4
sudo wipefs --all /dev/sdb
xz -d -v ArchLinux-VF2_515_v2.8.0-cwt6.img.xz
sudo dd if=ArchLinux-VF2_515_v2.8.0-cwt6.img of=/dev/sdb bs=4M status=progress conv=fdatasync
sudo gparted /dev/sdb

Plugged the sdcard into the VF2 SBC.
Powered up the board. Solid red appeared then later the blinking green led.
I see the ethernet ports lighting up orange, but I have no ethernet on either port to ssh into.

Ah sorry good point if your are using their kernel source tree then it should have been fine. Curious that they arenā€™t the same.

@tommythorn
@Tomswan Tom Swan is here? Are you the author of some Turbo Assembler and C++ books? OMG! LEGEND.

Anyway have you tried this experimental sid debian one?

Itā€™s different from the engineering delivery images. Both ethernet ports work on this image.
Unlike the other Engineering Release that use snapshots from the archive, this image the apt-get update/upgrade do get the latest packages from the actual ports repo, not from the snapshots repo.
I was able to install the classical build tools and my favourite programmerā€™s text editor without issues.

sudo apt-get install aptitude emacs-nox build-essential git gitk
sudo apt-get install curl clang-tools-15 llvm-15-tools lld-15
#install rust nightly
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
#customize default for everything except nightly (not stable).

git clone https://github.com/rust-lang/rust-mode.git rust-mode

###################
cat /home/user/.emacs
(global-set-key (kbd "M-,") 'tags-loop-continue) ; Alt+a
(add-to-list 'load-path "/home/user/rust-mode/")
(autoload 'rust-mode "rust-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
(require 'rust-mode)
####################

######append this to your /home/user/.bashrc
export PS1="\u@\h \D{%F_%T_%Z} : \w\n $ "

if ! [[ "$PATH" =~ "$HOME/.cargo/bin:" ]]
then
    PATH="$HOME/.cargo/bin:$PATH"
fi
export PATH
############

After the filesystem gets settled, which takes a while, the filesystem blazes on this image.

nmcli works.

root@vf2-YOW:/home/linux# nmcli
end0: connected to Wired connection 1
        "end0"
        ethernet (starfive-eth-plat), 6C:CF:39:00:36:43, hw, mtu 1500
        ip4 default
        inet4 192.168.2.53/24
        route4 192.168.2.0/24 metric 100
        route4 default via 192.168.2.1 metric 100

end1: unavailable
        "end1"
        ethernet (starfive-eth-plat), 6C:CF:39:00:36:44, hw, mtu 1500

lo: unmanaged
        "lo"
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
        servers: 192.168.2.1 207.164.234.129
        domains: home
        interface: end0
1 Like

I did, but I ran into many issues (like apt install cargo didnā€™t work) which I assume are curtsy of sid so I had to abandon it. I have yet to find a solution that gives me perf but Iā€™m rooting for the successor to Debian69.
ADD: it was also a showstopper that the 1 GbE interface wasnā€™t working (unlike in Debian69).

It was but one issue.

the rust ring crate fails to build which is important for security iirc.

cargo install sccache
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installV8Og13/release/build/ring-9205b437b9a0a202/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/linux/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sccache v0.3.3`, intermediate artifacts can be found at `/tmp/cargo-installV8Og13`

@tommythorn @und @omac777 I just diff debian69, cwt5, cwt6, and my testing cwt8. The cwt6 is pretty much alike debian69, which is weird.

--- db69.dts    2023-02-05 15:27:57.585005129 +0700
+++ cwt6.dts    2023-02-05 15:28:34.325784835 +0700
@@ -1272,6 +1272,11 @@
                                };
                        };

+                       tinker_ft5406@38 {
+                               compatible = "tinker_ft5406";
+                               reg = <0x38>;
+                       };
+
                        panel_radxa@19 {
                                compatible = "starfive_jadard";
                                reg = <0x19>;
@@ -1286,6 +1291,16 @@
                                        };
                                };
                        };
+
+                       gt9xx@14 {
+                               compatible = "goodix,gt9xx";
+                               reg = <0x14>;
+                               touch-gpio = <0x25 0x1e 0x08>;
+                               reset-gpio = <0x25 0x1f 0x00>;
+                               max-x = <0x320>;
+                               max-y = <0x500>;
+                               tp-size = <0x2398>;
+                       };
                };

                i2c@12030000 {
@@ -2423,6 +2438,6 @@
        gpio-restart {
                compatible = "gpio-restart";
                gpios = <0x25 0x23 0x00>;
-               priority = <0xe0>;
+               priority = <0xa0>;
        };
 };

As you can see, nothing about ethernet port. However if I diff cwt5 and cwt6:

--- cwt5.dts    2023-02-05 15:30:55.654784092 +0700
+++ cwt6.dts    2023-02-05 15:28:34.325784835 +0700
@@ -1291,6 +1291,16 @@
                                        };
                                };
                        };
+
+                       gt9xx@14 {
+                               compatible = "goodix,gt9xx";
+                               reg = <0x14>;
+                               touch-gpio = <0x25 0x1e 0x08>;
+                               reset-gpio = <0x25 0x1f 0x00>;
+                               max-x = <0x320>;
+                               max-y = <0x500>;
+                               tp-size = <0x2398>;
+                       };
                };

                i2c@12030000 {
@@ -1601,10 +1611,10 @@
                        ethernet-phy@0 {
                                rxc_dly_en = <0x01>;
                                tx_delay_sel_fe = <0x05>;
-                               tx_delay_sel = <0x0a>;
-                               tx_inverted_10 = <0x01>;
-                               tx_inverted_100 = <0x01>;
-                               tx_inverted_1000 = <0x01>;
+                               tx_delay_sel = <0x09>;
+                               tx_inverted_10 = <0x00>;
+                               tx_inverted_100 = <0x00>;
+                               tx_inverted_1000 = <0x00>;
                        };
                };

@@ -1641,10 +1651,10 @@

                        ethernet-phy@1 {
                                tx_delay_sel_fe = <0x05>;
-                               tx_delay_sel = <0x00>;
+                               tx_delay_sel = <0x09>;
                                rxc_dly_en = <0x00>;
-                               tx_inverted_10 = <0x01>;
-                               tx_inverted_100 = <0x01>;
+                               tx_inverted_10 = <0x00>;
+                               tx_inverted_100 = <0x00>;
                                tx_inverted_1000 = <0x00>;
                        };
                };
@@ -2385,7 +2395,7 @@

        memory@40000000 {
                device_type = "memory";
-               reg = <0x00 0x40000000 0x01 0x00>;
+               reg = <0x00 0x40000000 0x02 0x00>;
        };

        reserved-memory {
@@ -2428,6 +2438,6 @@
        gpio-restart {
                compatible = "gpio-restart";
                gpios = <0x25 0x23 0x00>;
-               priority = <0xe0>;
+               priority = <0xa0>;
        };
 };

And then diff cwt5 and my still testing cwt8:

--- cwt5.dts    2023-02-05 15:30:55.654784092 +0700
+++ cwt8.dts    2023-02-05 15:34:05.465812225 +0700
@@ -1291,6 +1291,16 @@
                                        };
                                };
                        };
+
+                       gt9xx@14 {
+                               compatible = "goodix,gt9xx";
+                               reg = <0x14>;
+                               touch-gpio = <0x25 0x1e 0x08>;
+                               reset-gpio = <0x25 0x1f 0x00>;
+                               max-x = <0x320>;
+                               max-y = <0x500>;
+                               tp-size = <0x2398>;
+                       };
                };

                i2c@12030000 {
@@ -2428,6 +2438,6 @@
        gpio-restart {
                compatible = "gpio-restart";
                gpios = <0x25 0x23 0x00>;
-               priority = <0xe0>;
+               priority = <0xa0>;
        };
 };

So, may be cwt8 is a good candidate for my next release.

1 Like

Thanks, Iā€™ll give cwt8 a try. Is perf working in that perchance?

perf is enabled, but cwt8 is an extremely experimental. I built it with llvm/clang + patched it to 5.15.2 + rt20. I can upload just the kernel tonight, so you guys can extract it on cwt6, and see how it perform.

2 Likes

FYI, Iā€™ll not have time for a few days so certainly donā€™t do this on my behalf.
PS: Curious about the clang direction. I tested SPECint2k6 with gcc vs clang and gcc clearly won.

1 Like

same here. Please donā€™t be in a rush cwt. I would just prefer another image to try and test it for you. I can wait. Iā€™m pre-occupied with my 7-year old son anyways.

3 Likes

aha! Totally understand you, mine 4 yo daughter and 1 yo son.

2 Likes