Arch Linux Image for VisionFive 2

I noticed in top:

cwt14 dtbs/starfive/jh7110-visionfive-v2.dtb

MiB Mem :   3888.2 total,   3042.2 free,    447.3 used,    462.9 buff/cache     

cwt13 dtbs/starfive/jh7110-visionfive-v2.dtb

The version from cwt14 has md5sum:

md5sum  /mnt/b/dtbs/starfive/jh7110-visionfive-v2.dtb 
b72a69fbdbb44c896bd82a250c6cdc11  /mnt/b/dtbs/starfive/jh7110-visionfive-v2.dtb

The version from cwt13 has md5sum:

md5sum  /boot/dtbs/starfive/jh7110-visionfive-v2.dtb
71dda991078940fc13cddf4d2f64eaac  /boot/dtbs/starfive/jh7110-visionfive-v2.dtb

Hmmm… strange, here on both of my boards:

[vf2-a] Linux VF2-A 5.15.2-cwt-3.1.5-1 #1 SMP PREEMPT Sun Jul 2 23:54:37 +07 2023 riscv64 GNU/Linux
[vf2-a] top - 18:50:20 up 2 days,  8:44,  2 users,  load average: 1.70, 2.10, 2.50
[vf2-a] Tasks: 145 total,   1 running, 144 sleeping,   0 stopped,   0 zombie
[vf2-a] %Cpu(s): 33.3 us, 16.7 sy,  0.0 ni, 50.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
[vf2-a] MiB Mem :   7904.2 total,   3810.0 free,   2495.7 used,   2554.3 buff/cache
[vf2-a] MiB Swap:   3952.0 total,   3952.0 free,      0.0 used.   5408.5 avail Mem
---------------------------------------------------------------------------------------------------------------
[vf2-b] Linux VF2-B 5.15.2-rt17-cwt-rt-3.1.5-1 #1 SMP PREEMPT_RT Sun Jul 9 01:49:38 +07 2023 riscv64 GNU/Linux
[vf2-b] top - 18:50:21 up  4:24,  1 user,  load average: 0.58, 0.68, 0.83
[vf2-b] Tasks: 198 total,   1 running, 197 sleeping,   0 stopped,   0 zombie
[vf2-b] %Cpu(s):  0.0 us, 25.0 sy,  0.0 ni, 75.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
[vf2-b] MiB Mem :   7922.2 total,   6403.1 free,    322.9 used,   1285.1 buff/cache
[vf2-b] MiB Swap:   3961.0 total,   3961.0 free,      0.0 used.   7599.3 avail Mem
---------------------------------------------------------------------------------------------------------------

Booted CWT14 from SD Card, works great.

Putting the switch to SD while having a NVMe attached boots as well. However the NVMe does not show up. Do I need to boot debian to write to NVMe?

No, normally you should have /dev/nvme* and lspci should show the nvme device.

Does your dmesg show anything related to pcie?

Hmm, no can’t see anything related to PCIe. I will try another NVMe.

[    2.256224] nvme nvme0: pci function 0001:01:00.0
[    2.256311] nvme 0001:01:00.0: enabling device (0000 -> 0002)
[   62.433678] nvme nvme0: I/O 25 QID 0 timeout, disable controller
[   62.439120] nvme nvme0: Removing after probe failure status: -4

You should try / see something like:

$ lspci 
0000:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0000:01:00.0 USB controller: VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)
0001:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0001:01:00.0 Non-Volatile memory controller: Transcend Information, Inc. Device 5766 (rev 01)

(last line above)

1 Like
0000:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0000:01:00.0 USB controller: VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)
0001:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0001:01:00.0 Non-Volatile memory controller: Toshiba Corporation XG4 NVMe SSD Controller (rev 01)

Stuck for 60 seconds.

[    3.833556] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 100000Hz, actual 100000HZ div = 990)
[   62.481407] pcie_plda 2c000000.pcie: AXI fetch error
[   62.481475] nvme nvme0: I/O 17 QID 0 timeout, disable controller
[   62.486503] pcie_plda 2c000000.pcie: AXI fetch error
[   62.491615] pcie_plda 2c000000.pcie: AXI fetch error

[    2.272148] nvme nvme0: pci function 0001:01:00.0
[    2.272234] nvme 0001:01:00.0: enabling device (0000 -> 0002)
[   62.433523] nvme nvme0: I/O 17 QID 0 timeout, disable controller
[   62.438967] nvme nvme0: Removing after probe failure status: -4

EDIT I think the Image is working correctly. The NVMe seems to be in SED OPAL mode.

May be you can disable OPAL?

https://wiki.archlinux.org/title/Self-encrypting_drives

Sadly sedutil does not work on riscv64. Will have to find a pc to revert.

I assume its a power supply issue.

Powering with 5V 2.4A gives me NVMe probe timeout but 4 devices shown with lspci. Probably to weak and unstable voltage.

[    2.272208] nvme nvme0: pci function 0001:01:00.0
[    2.272273] nvme 0001:01:00.0: enabling device (0000 -> 0002)
[   62.433598] nvme nvme0: I/O 13 QID 0 timeout, disable controller
[   62.439038] nvme nvme0: Removing after probe failure status: -4
0000:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0000:01:00.0 USB controller: VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)
0001:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
0001:01:00.0 Non-Volatile memory controller: Toshiba Corporation XG4 NVMe SSD Controller (rev 01)

Powering with 15V 2.6A

00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design (rev 02)
01:00.0 USB controller: VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)

and no output on dmesg | grep nvm.

BUG!

Hey guys, I just found a bug in the kernel package. The command in the hook file (/usr/share/libalpm/hooks/90-linux.hook) will rebuild the initrd image (/boot/initramfs-linux.img), but it won’t include the GPU firmware files.

I will rebuild the kernel packages to fix it tomorrow.
To check if your initrd image contains the GPU firmware, run the following command:

lsinitcpio /boot/initramfs-linux.img  |grep rgx

The expected output should be:

usr/lib/firmware/rgx.fw.36.50.54.182
usr/lib/firmware/rgx.sh.36.50.54.182

If it shows nothing, please run the following command:

/usr/bin/mkinitcpio -k 5.15.2-cwt-3.1.5-1 -g /boot/initramfs-linux.img

Update: quick fix below

4 Likes
FILES=(/lib/firmware/rgx.fw.36.50.54.182  /lib/firmware/rgx.sh.36.50.54.182)

has always worked for me, using each of your kernel packages

1 Like

is there a way to install the GNOME desktop environment?
on x86, i just setup sudo pacman -S gnome and the meta-package installs everything, from wayland to gdm and all.
But in the metapack from the arch repository gdm is missing. Actually gdm is not available at all, even if I wanted to install it apart.
How should I proceed?

I haven’t tried other desktops environment. Are there any that are supposed to work?

thank you :slight_smile:

The Gnome desktop is not packaged for Arch/riscv64.
In any case, various GPU components are not mature enough to run Gnome and its applications.
There are other options, described in some detail in this thread (e.g. xfce, wayfire
Arch Linux Image for VisionFive 2 - #232 by stronnag and subsequent posts).

1 Like

Would rsync -x help?

-x, --one-file-system
This tells rsync to avoid crossing a filesystem boundary when recursing. This does not limit the user’s ability to specify items to copy from multiple filesystems, just rsync’s recursion through the hierarchy of each directory that the user specified, and also the analogous recursion on the receiving side during deletion. Also keep in mind that rsync treats a lqbindrq mount to the same device as being on the same filesystem.
If this option is repeated, rsync omits all mount-point directories from the copy. Otherwise, it includes an empty directory at each mount-point it encounters (using the attributes of the mounted directory because those of the underlying mount-point directory are inaccessible).
If rsync has been told to collapse symlinks (via --copy-links or --copy-unsafe-links), a symlink to a directory on another device is treated like a mount-point. Symlinks to non-directories are unaffected by this option.

If your board firmware is already upgraded to the latest version, then you can dd the new image cwt14 directly to NVMe SSD, shutdown, set the dip switch to flash mode, remove the micro SD, and then power on. The board will be booted from NVMe.

Quick Fix

Comment out one line in /etc/mkinitcpio.d/linux.preset:

#ALL_config="/etc/mkinitcpio.conf"

And then rebuild the initrd image:

/usr/bin/mkinitcpio -p linux -k $(uname -r)

It is a known issue as stated in the Arch Wiki.

hi @stronnag

i went through your answer, article and tips, but I couldn’t make it work.

First of all, the lightdm doesn’t start, with a disappointing error 1/FAILURE. I don’t know how you managed the greetd/{tuigreet, gtkgreetd}, but pacman on my cwt14 build can’t even find the packages.

Then for wayfire on AUR: if I get it and makepkg, it fails:
==> ERROR: wayfire is not available for the 'riscv64' architecture.
I took the “official” aur: https://aur.archlinux.org/wayfire.git
is there another one for VF2?

xfce installs fine, but won’t start.
At least this gives a clear error (as user or sudo):

$ startxfce4
/usr/bin/startxfce4: Starting X server


X.Org X Server 1.21.1.8
X Protocol Version 11, Revision 0
Current Operating System: Linux ArchVF2 5.15.2-cwt-3.1.5-1 #1 SMP PREEMPT Sun Jul 2 23:54:37 +07 2023 riscv64
Kernel command line: root="LABEL=VF2" rw console=tty1 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 rootflags=defaults,discard=async,compress=lzo,user_subvol_rm_allowed,subvol=@
 
Current version of pixman: 0.42.2
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Jul 15 15:17:52 2023
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) 
Fatal server error:
(EE) no screens found(EE) 
(EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) 
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

note that the initramfs is built with the rgx support:

lsinitcpio /boot/initramfs-linux.img  |grep rgx
usr/lib/firmware/rgx.fw.36.50.54.182
usr/lib/firmware/rgx.sh.36.50.54.182

and the latest mesa aur from

are installed, as well as the other prerequisites in your article.

Noticed this in dmesg. I think the new ddk is incompatible with old mesa.

[ 1511.395324] PVR_K:  3305: (FAIL) PVRSRVConnectKM: Incompatible driver DDK version (1.17) / client DDK version (1.19)

new patch set from cordlandwehr :smiley: https://github.com/riscv/meta-riscv/pull/421/files

1 Like