Arch Linux Image for VisionFive 2

yay is good.

Try rua, it’s an AUR package manager built in rust. It’s been reliable for me.

1 Like

First of all, many thanks for providing this Arch image. While not being a foremost Arch Linux user, this is the first image that actually let’s me do the things I want with my set of of Vision 2’s. Eagerly awaiting the arrival of an Ubuntu image to standardize ARM/RISCV64 and AMD64. :slight_smile:

For now on question; I have it running/booting from SD. It is possible to have it boot from EMMC and what steps should I take for it?

Thanks in advance!

For both the emmc and nvme TO BOOT, I heard there needs to be more work done with regards to supporting pcie within the earlier boot stage components. not linux modules. We’re talking uboot and opensbi. WIP. Not done yet.

Look at the Connectivity/PCIE section here:
https://rvspace.org/en/project/JH7110_Upstream_Plan

I believe you can still chroot /mnt the emmc if you want once linux is booted from the sdcard, linux supports the emmc/nvme. I’m chroot’ing to /mnt my nvme and it’s working well.

1 Like

Why chroot?

Just pass root=whatever to the kernel, where whatever is your nvme root fs device. Works for me.

2 Likes

Got X working with shirok1’s PKGBUILDs.

Mesa uses llvmpipe, so not accelerated. vulkaninfo works, but vkcube does not.

X is somewhat usable now, but I believe still unaccelerated. It is much faster than before (and I’m typing this on my VisionFive2!) but by virtue of NOT using glamor.

weston-simple-egl just segfaults here. I’ve never had much luck with Wayland.

Please could you share how your entry to point to your nvme looks like?

Did you use the uboot-update afterwards?
I’m afraid it will crush some dtb settings. cwt warned me it might do this.

Here are all my block devices:
myBlockDevices.json (22.5 KB)

I believe what I want to be booting to is this:
“uuid”: “d65e91f4-ea2f-444f-bf86-d95f1096a83d”

I’m thinking:
root=LABEL=rootpart

Gets changed to
root=UUID=d65e91f4-ea2f-444f-bf86-d95f1096a83d

BEFORE:

 $ cat /boot/boot/extlinux/extlinux.conf 
TIMEOUT 30

DEFAULT visionfive2
 
MENU TITLE starfive visionfive2 boot options

LABEL visionfive2
      MENU LABEL visionfive2
      LINUX ../../vmlinuz-5.15.0-vf2-260+
      INITRD ../../initrd.img-5.15.0-vf2-260+
      FDTDIR ../../dtb-5.15.0-vf2-260+
      APPEND root=LABEL=rootpart rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 apparmor=0

AFTER CHANGE:

 $ cat /boot/boot/extlinux/extlinux.conf 
TIMEOUT 30

DEFAULT visionfive2
 
MENU TITLE starfive visionfive2 boot options

LABEL visionfive2
      MENU LABEL visionfive2
      LINUX ../../vmlinuz-5.15.0-vf2-260+
      INITRD ../../initrd.img-5.15.0-vf2-260+
      FDTDIR ../../dtb-5.15.0-vf2-260+
      APPEND root=UUID=d65e91f4-ea2f-444f-bf86-d95f1096a83d rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 apparmor=0

Is that ok? Do I need to do uboot-update afterwards?

Looks good, although I prefer labels.

UUIDs can be the FSs or the partitions… it gets confusing. The syntax is root=PARTUUID= for partitions. I do not know which one you’ve got.

As for uboot-update, I never used it nor do I have any idea what it does. I assume it’s a random non-standard script someone wrote.

My entry looks like:

label Arch-cwt9-rvalles
        menu label Arch Linux 5.15.2-rt20-cwt9-rvalles
        linux /boot/vmlinux-5.15.2-rt20-cwt9-rvalles
        initrd /boot/initrd.img-5.15.2-rt20-cwt9-rvalles
        fdtdir /boot/dtbs/
        append root=LABEL=arch-root rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1

On blkid, the partition looks like:

/dev/nvme0n1p2: LABEL="arch-root" UUID="54267cf7-aa6c-4107-b9db-e16ca639d770" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="arch-root" PARTUUID="915706c8-c4df-440a-9092-bf9cb2f7eb9d"

1 Like

The cwt10 image has been uploaded to my Google Drive and Naver MYBOX. This image raw file is much smaller than its predecessor, with a size of approximately 2.5GB which can be burned onto a 4GB micro SD card.

2 Likes

Hi, I was trying to flash the Arch Linux image for the VisionFive 2, however I noticed that the device just gets stuck and never actually boots. Is there any additional step to get it working?
I don’t have a USB TTL right now to check where the boot process fails, but I did have tested the Debian 69 image and it was working as expected.

Did you set your DIP switch to SD mode?
My image should be able to boot in SD mode. If you can boot debian69, that means you firmware on the board is from v2.6.0 or v2.8.0, but my latest image requires v2.10.4 which already on the image itself, so change DIP switch to SD mode should boot it.

However, during the boot it may stuck in some process, but eventually it will pass, and able to boot anyway.

3 Likes

Thanks, I have changed the boot switches and now the device now seems to boot as expected, I even get hdmi output. But now both ethernet ports never get an IP address assigned, is there a way to interact with system without using TTL?

If both ports cannot get IP, try doing following commands as root (please recheck filename and path as I write this from memory):

cd /boot/dtbs
rm -rf sifive starfive
cp -a 5.15.2-cwt10+/* . 
reboot

Writing the img file to a sdcard and expanding the last partition, my board cannot boot.

This is what I get from the serial console:

## Warning: defaulting to text format
Can't set block device
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Retrieving file: /boot/extlinux/extlinux.conf
Can't set block device
Error reading config file
StarFive # 

EDIT: Silly me, like others I forgot to update the boot switches. Mine were set to (0, 0), moving it to (1, 0) for SDIO 3.0 (Boot Mode Settings) solved this issue, it’s now loading the kernel.

Now it stays stuck during the kernel boot:

bootmode sd device 1
Card did not respond to voltage select! : -110
Hit any key to stop autoboot:  0 
Failed to load 'vf2_uEnv.txt'
Importing environment from mmc1 ...
## Info: input data size = 482 = 0x1E2
406 bytes read in 4 ms (98.6 KiB/s)
## Warning: defaulting to text format
## Error: "boot2" not defined
48025 bytes read in 9 ms (5.1 MiB/s)
48025 bytes written in 12 ms (3.8 MiB/s)
Retrieving file: /extlinux/extlinux.conf
967 bytes read in 6 ms (157.2 KiB/s)
U-Boot menu
1:      Arch Linux Minimal 5.15.2-cwt10+
2:      Arch Linux Minimal 5.15.2-cwt10+ (Single User)
Enter choice: 1:        Arch Linux Minimal 5.15.2-cwt10+
Retrieving file: /initrd.img-5.15.2-cwt10+
9399651 bytes read in 399 ms (22.5 MiB/s)
Retrieving file: /vmlinuz-5.15.2-cwt10+
10602229 bytes read in 450 ms (22.5 MiB/s)
append: root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 rootflags=defaults,discard=async,compress=lzo,user_subvol_rm_allowed,subvol=arch-minimal
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
48025 bytes read in 8 ms (5.7 MiB/s)
   Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=41cb9000
## Flattened Device Tree blob at 48000000
   Booting using the fdt blob at 0x48000000
   Using Device Tree in place at 0000000048000000, end 000000004800eb98

Starting kernel ...

clk u5_dw_i2c_clk_core already disabled
clk u5_dw_i2c_clk_apb already disabled
[    0.550785] L2CACHE: DataError @ 0x00000000.080400B8
[    0.556345] L2CACHE: DataFail @ 0x00000000.08040140
[    1.366782] starfive-cpufreq soc:starfive,jh7110-cpufreq: Failed to get regulator for cpu!
[    1.375937] starfive-cpufreq soc:starfive,jh7110-cpufreq: Failed to init starfive cpu dvfs info
[    1.387504] jh7110-sec 16000000.crypto: Unable to request sec_m dma channel in DMA channel
[    1.396650] jh7110-sec 16000000.crypto: Cannot initial dma chan
[    1.508603] debugfs: Directory '16008000.sec_dma' with parent 'dmaengine' already present!
[    1.521160] seeed_panel 2-0045: Unknown Atmel firmware revision: 0x00
[    1.549760] imx219 6-0010: failed to read chip id 219
[    2.056045] usb usb2-port2: over-current condition
[    2.192221] usb usb2-port4: over-current condition
[    2.312344] mailbox_test soc:mailbox_client@0: invalid resource
[    2.318327] mailbox_test soc:mailbox_client@0: invalid resource
[    2.324976] starfive-i2s 120b0000.i2stx_4ch0: designware: i2s master mode supported
[    2.333439] cdns-dsi 295d0000.mipi: starfive dsi bind end

Hi @gyscos, is it still stuck at boot? It has happened to me a few times, pressing the reset button for more than 3 seconds usually helps.

Still stuck in the exact same condition.
Replacing dtbs/{starfive,sifive} with what’s in dtbs/5.15.2-cwt10+ (note: only the starfive/jh7110-visionfive-v2.dtb seems to actually differ) makes no noticeable difference.

I tried updating the kernel line to use the nvme partition as root, no difference. Might try to add some debug option to find out what’s blocking.
EDIT: Here’s the entire boot output using verbose debug ignore_loglevel options:
boot.txt (32.1 KB)

cwt10+. Works well for me. Running with root on nvme. How do I apply the dtb overlay that’s included? I want to enable another uart. I’ve seen FTDOVERLAY and FTD extlinux commands mentioned but I can’t find any documentation.

1 Like

Does the latest image support framebuffer? It works just fine and I can ssh into it, but when I connect an HDMI monitor, I get no tty console. Do I need to apply some patches to the kernel?

I find it works with an HD monitor but only if it’s plugged in at boot. If you connect after boot then nothing. Also I have a 7" monitor and it doesn’t seem to work with that.

After a bit of trial and error I added fdtoverlay_addr_r=0x47000000 to uEnv.txt - the address is a guess and I added fdtoverlays /dtbs/starfive/vf2-overlay/vf2-overlay-uart3-i2c.dtbo to the label block in extlinux.conf. That loads without errors and /dev/ttyS3 works (GPIO60 & GPIO63).

1 Like

It is working nice, except for the graphical mode. I even added icewm and xfce4 and lightdm, but it does not show the display manager login on the screen, only text characters. What should I do to get graphical mode working? Using a regular 60Hz 1920x1080 monitor that I successfully used with other riscv images.

1 Like