Arch Linux Image for VisionFive 2

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

Hi, this image focusing on networking server, I didn’t tried to make GUI worked, however @rvalles on this thread already make it run GUI on X with fbdev.

3 Likes

Thank you… I was new here and didn’t know how to look for the messages, I caught into the thread a little later. I applied this solution and it worked perfectly.

2 Likes

Hello cwt,

where i can find the source for JPU, VENC, and VDEC ?

Best regards
Damian

JPU: https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/codaj12
VENC: https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/wave420l
VDEC: https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/wave511
OpenMAX IL API: https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel/omx-il

2 Likes

Hi, I just tried to rebuild my kernel based on Release VisionFive2 Software v2.11.5 · starfive-tech/VisionFive2 · GitHub, but your driver won’t work due to changes in the GPU kernel driver. Therefore, I tried to rebuild your package with their updated binary file from soft_3rdpart/IMG_GPU/out at cd7b50cd9f9eca66c23ebd19f06a172ce0be591f · starfive-tech/soft_3rdpart · GitHub, but both clinfo and vulkaninfo failed silently.

(In my opinion, updating things while still using the same version number is bad practice anyway.)

As I’m new to GPU-related stuff, it’s possible that I did something wrong. Would you prefer me to upload my new image and try it, or should we wait for their new official Debian image to investigate the issue?

Edit: I just make it works, we need to replace the firmware files too. Here the clinfo and vulkaninfo 0026dad — paste.sr.ht

3 Likes

Cool.

Documenting the steps to get there would be helpful; if anything, it’d help clueless me get accelerated video in arch.

3 Likes

If you use my image, the firmware files are already replaced in cwt12, but if you upgrade the kernel yourself, please replace /lib/firmware/rgx.* with the files in img-gpu-powervr-bin-1.17.6210866.tar.gz from the tag VF2_v2.11.5, and also rebuild the userland driver.

For the userland driver, I already create a pull request for @trissylegs

3 Likes

I’m also trying to figure out a good address for the device tree overlays. 0x47000000 is actually a little close to the initramfs at 0x46100000, allowing it only to be max 15 MiB before spaces overlap.

  • Kernel image: 0x40200000 => 1026 MiB
  • U-Boot script: 0x43900000 => 1081 MiB
  • PXE file: 0x45900000 => 1113 MiB
  • Device tree: 0x46000000 => 1120 MiB
  • initramfs image: 0x46100000 => 1121 MiB
  • uEnv.txt: 0xa0000000 => 2560 MiB
  • uEnv.txt in other boot target: 0xb0000000 => 2816 MiB

I’m not sure about other possibly reserved address spaces (the above list contains all addresses defined in the default U-Boot environment), but what about 0x4f000000 (1264 MiB) to rule out any collision? Is there no value provided by StarFive somewhere, as they do already provide an overlay with their kernel sources :thinking:? I couldn’t find any but information is somewhat scattered.