Arch Linux Image for VisionFive 2

Probably I need the new u-boot as well from cwt’s repos.

Could you burn this image to an SD and give it a try?

1 Like

I tried the new u-boot, had to also clear the env vars, then reset and boot from mmc

env default -a
saveenv
reset

Then it booted but nvme was still broken

[user@ArchVF2 ~]$ sudo dmesg | grep nvme
[   13.611545] nvme nvme0: pci function 0001:01:00.0
[   13.628048] nvme 0001:01:00.0: enabling device (0000 -> 0002)
[   14.072940] nvme nvme0: Identify Controller failed (16385)
[   14.074685] nvme nvme0: Device not ready; aborting shutdown, CSTS=0x1
[   14.157205] nvme: probe of 0001:01:00.0 failed with error -5
1 Like

@stronnag @sajattack I think I know the problem, there is a driver called phy_jh7110_pcie that was built as a module, from its name I guess it is required to access PCIe devices, e.g. NVMe.

[user@ArchVF2 ~]$ lsmod |grep pcie
phy_jh7110_pcie        12288  2

I will rebuild the kernel and also the cwt22 image.

1 Like

That’s the one. Added it to initramfs and now running off nvme device.

Linux jagular 6.6.20-cwt-5.12.0-1 #1 SMP PREEMPT_DYNAMIC Mon May 20 16:26:37 +07 2024 riscv64 GNU/Linux

Thanks for the clue.

1 Like

Now all working out of the box with 6.6.20-cwt-5.12.0-2

Thank you

2 Likes

I was very excited to hear that you released cwt22, but I did not see the kernel-update.sh script included for upgrading the kernel. So, does this mean that I can only burn a new image, or can I directly use the previous upgrade script after modifying the version parameters?

You just install the packages. That will update the kernel.

I’m very sorry to bother you. I saw the kernel-update.sh in the linux-cwt-starfive-vf2 repository. Thank you again for bringing this image. :smiling_face_with_three_hearts:

Before the upgrade, there was a warning: /boot/initramfs.img may not be complete. As expected, it encountered an error during the boot process.


U-Boot SPL 2021.10 (Mar 14 2024 - 19:21:18 +0800)
LPDDR4: 4G version: g8ad50857.
Trying to boot from SPI

OpenSBI v1.2
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|___/_____|
        | |
        |_|

Platform Name             : StarFive VisionFive V2
Platform Features         : medeleg
Platform HART Count       : 5
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 4000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : pm-reset
Platform Shutdown Device  : pm-reset
Platform Suspend Device   : ---
Firmware Base             : 0x40000000
Firmware Size             : 392 KB
Firmware RW Offset        : 0x40000
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 1
Domain0 HARTs             : 0*,1*,2*,3*,4*
Domain0 Region00          : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region01          : 0x0000000040000000-0x000000004003ffff M: (R,X) S/U: ()
Domain0 Region02          : 0x0000000040040000-0x000000004007ffff M: (R,W) S/U: ()
Domain0 Region03          : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address      : 0x0000000040200000
Domain0 Next Arg1         : 0x0000000042200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 1
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcbx
Boot HART ISA Extensions  : none
Boot HART PMP Count       : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 34
Boot HART MHPM Count      : 2
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10 (Mar 14 2024 - 19:21:18 +0800), Build: jenkins-github_visionfive2-23

CPU:   rv64imacu_zba_zbb
Model: StarFive VisionFive V2
DRAM:  4 GiB
MMC:   sdio0@16010000: 0, sdio1@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

StarFive EEPROM format v2

--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110B1-2310-D004E000-00001875
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:53:14
Ethernet MAC1 address: 6c:cf:39:00:53:15
--------EEPROM INFO--------

In:    serial
Out:   serial
Err:   serial
Model: StarFive VisionFive V2
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
Try booting from MMC1 ...
Failed to load 'vf2_uEnv.txt'
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined
Card did not respond to voltage select! : -110
starfive_pcie pcie@2B000000: Port link up.
starfive_pcie pcie@2B000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
starfive_pcie pcie@2C000000: Port link down.
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10

Device 0: unknown device

Device 0: unknown device
Tring booting distro ...
switch to partitions #0, OK
mmc1 is current device
Try booting from MMC1 ...
406 bytes read in 5 ms (79.1 KiB/s)
Retrieving file: /extlinux/extlinux.conf
520 bytes read in 7 ms (72.3 KiB/s)
1:      Arch Linux
Retrieving file: /initramfs-linux.img
7954311 bytes read in 354 ms (21.4 MiB/s)
Retrieving file: /vmlinuz
9949260 bytes read in 434 ms (21.9 MiB/s)
append: 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=@
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
Failed to load '/dtbs/starfive/jh7110-visionfive-v2.dtb'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
   Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=41c02000
Device tree not found or missing FDT support
### ERROR ### Please RESET the board ###

Nothing to do with the initramfs. The default dtbs has changed.
In the u-boot session:

setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb

then

boot

The board should boot. If it does, you may need, on next reboot, to set the fdtfile again and save the settings.
saveenv

And if you have an older v1.2 board

setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.2a.dtb

Or perhaps you can add the ftdfile setting to /boot/uEnv.txt.

1 Like

“There is no set command here, so I think you meant setenv? However, the boot process still uses the original dtb file.” Here is what I did.

StarFive # setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
StarFive # saveenv                                                       
Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done
OK
StarFive # printenv                                                      
baudrate=115200
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_devs=mmc nvme
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootriscv64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_pci_enum=pci enum
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc0 dhcp 
bootargs=console=tty1 console=ttyS0,115200  debug rootwait  earlycon=sbi
bootcmd=run sdk_boot_env; run distro_boot_env
bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; run boot_pci_enum; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00027:UNDI:003000;setenv bootp_arch 0x1b;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_distro=run load_distro_uenv; sysboot ${bootdev} ${devnum}:${bootpart} fat ${scriptaddr} /${boot_syslinux_conf}; 
bootcmd_mmc0=devnum=0; run mmc_boot
bootdelay=2
bootdir=/boot
bootenv=uEnv.txt
bootenv_mmc=setenv bootdev mmc;if test ${bootmode} = flash; then for mmc_devnum in ${mmc_devnum_l}; do setenv devnum ${mmc_devnum}; run mmc_test_and_boot;done;fi; if test ${bootmode} = sd; then setenv devnum ${sd_devnum};run mmc_test_and_boot;fi; if test ${bootmode} = emmc; then setenv devnum  ${emmc_devnum};run mmc_test_and_boot;fi; 
bootenv_nvme=if test ${bootmode} = flash; then for nvme_devnum in ${nvme_devnum_l}; do setenv devnum ${nvme_devnum};if pci enum; then nvme scan; fi; if nvme dev ${devnum}; then echo Try booting from NVME${devnum} ...; setenv bootdev nvme;setenv sdev_blk nvme${devnum}n1p${rootpart};run load_sdk_uenv; run boot2;fi; done; fi; 
bootenv_sdk=vf2_uEnv.txt
bootmode=flash
bootpart=3
chip_vision=B
chipa_gmac_set=fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_10 <0x0>;fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_100 <0x0>;fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_1000 <0x0>;fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_delay_sel <0x9>;fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_10 <0x0>;fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_100 <0x0>;fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_1000 <0x0>;fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_delay_sel <0x9> 
chipa_set=if test ${chip_vision} = A; then run chipa_gmac_set;fi; 
chipa_set_linux=fdt addr ${fdt_addr_r};run visionfive2_mem_set;run chipa_set;
chipa_set_uboot=fdt addr ${uboot_fdt_addr};run chipa_set;
cma_1g=b000000
cma_2g=20000000
cma_4g=40000000
cma_8g=60000000
cma_ddr1g_set=fdt set ${cma_node} size <0x0 0x${cma_1g}>;fdt set ${cma_node} alloc-ranges <0x0 0x${cma_start} 0x0 0x${cma_1g}>;
cma_ddr2g_set=fdt set ${cma_node} size <0x0 0x${cma_2g}>;fdt set ${cma_node} alloc-ranges <0x0 0x${cma_start} 0x0 0x${cma_2g}>;
cma_ddr4g_set=fdt set ${cma_node} size <0x0 0x${cma_4g}>;fdt set ${cma_node} alloc-ranges <0x0 0x${cma_start} 0x0 0x${cma_4g}>;
cma_ddr8g_set=fdt set ${cma_node} size <0x0 0x${cma_8g}>;fdt set ${cma_node} alloc-ranges <0x0 0x${cma_start} 0x0 0x${cma_8g}>;
cma_node=/reserved-memory/linux,cma
cma_resize=if test ${memory_size} -eq 40000000; then run cma_ddr1g_set;elif test ${memory_size} -eq 80000000; then run cma_ddr2g_set;elif test ${memory_size} -eq 100000000; then run cma_ddr4g_set;elif test ${memory_size} -ge 200000000; then run cma_ddr8g_set;fi; 
cma_start=70000000
cpu_max_vol=1060000
cpu_speed_1250_set=fdt rm /opp-table-0/opp-375000000;fdt rm /opp-table-0/opp-500000000;fdt rm /opp-table-0/opp-750000000;fdt rm /opp-table-0/opp-1500000000;
cpu_speed_1500_set=fdt rm /opp-table-0/opp-312500000;fdt rm /opp-table-0/opp-417000000;fdt rm /opp-table-0/opp-625000000;fdt rm /opp-table-0/opp-1250000000;
cpu_vol_1020_set=fdt set /opp-table-0/opp-1500000000 opp-microvolt <1020000>;
cpu_vol_1040_set=fdt set /opp-table-0/opp-1500000000 opp-microvolt <1040000>;
cpu_vol_1060_set=fdt set /opp-table-0/opp-1500000000 opp-microvolt <1060000>;
cpu_vol_set=if test ${cpu_max_vol} = 1000000; then run cpu_speed_1250_set; else run cpu_speed_1500_set; if test ${cpu_max_vol} = 1060000; then run cpu_vol_1060_set; elif test ${cpu_max_vol} = 1020000; then run cpu_vol_1020_set; else run cpu_vol_1040_set; fi; fi; 
devnum=1
distro_boot_env=echo Tring booting distro ...;for bootdev_s in ${boot_devs}; do run distro_bootenv_${bootdev_s}; done; 
distro_bootcmd=setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
distro_bootenv_mmc=setenv bootdev mmc;if test ${bootmode} = flash; then for mmc_devnum in ${mmc_devnum_l}; do setenv devnum ${mmc_devnum}; run distro_mmc_test_and_boot;done;fi; if test ${bootmode} = sd; then setenv devnum ${sd_devnum};run distro_mmc_test_and_boot;fi; if test ${bootmode} = emmc; then setenv devnum    ${emmc_devnum};run distro_mmc_test_and_boot;fi; 
distro_bootenv_nvme=if test ${bootmode} = flash; then for nvme_devnum in ${nvme_devnum_l}; do setenv devnum ${nvme_devnum};if pci enum; then nvme scan; fi; if nvme dev ${devnum}; then echo Try booting from NVME${devnum} ...; setenv bootdev nvme;run bootcmd_distro; fi; done; fi; 
distro_mmc_test_and_boot=if mmc dev ${devnum}; then echo Try booting from MMC${devnum} ...; run bootcmd_distro;fi;
efi_dtb_prefixes=/ /dtb/ /dtb/current/
emmc_devnum=0
eth0addr=6c:cf:39:00:53:14
eth1addr=6c:cf:39:00:53:15
ethaddr=6c:cf:39:00:53:14
fdt_addr_r=0x46000000
fdt_high=0xffffffffffffffff
fdtaddr=f7fabe20
fdtcontroladdr=f7fabe20
fdtfile=starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
fdtoverlay_addr_r=0x4f000000
initrd_high=0xffffffffffffffff
ipaddr=192.168.120.230
kernel_addr_r=0x40200000
kernel_comp_addr_r=0x5a000000
kernel_comp_size=0x4000000
load_distro_uenv=fatload ${bootdev} ${devnum}:${bootpart} ${loadaddr} /${bootenv}; env import -t ${loadaddr} ${filesize}; 
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
load_sdk_uenv=fatload ${bootdev} ${devnum}:${bootpart} ${loadaddr} ${bootenv_sdk};env import -t ${loadaddr} ${filesize}; 
loadaddr=0x60000000
memory_addr=40000000
memory_size=100000000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmc_devnum_l=1 0
mmc_test_and_boot=if mmc dev ${devnum}; then echo Try booting from MMC${devnum} ...; setenv sdev_blk mmcblk${devnum}p${rootpart};run load_sdk_uenv; run boot2;fi;
netmask=255.255.255.0
nvme_boot=run boot_pci_enum; run nvme_init; if nvme dev ${devnum}; then devtype=nvme; run scan_dev_for_boot_part; fi
nvme_devnum_l=0 0
nvme_init=if ${nvme_need_init}; then setenv nvme_need_init false; nvme scan; fi
partitions=name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};name=loader2,size=4MB,type=${type_guid_gpt_loader2};name=system,size=-,bootable,type=${type_guid_gpt_system};
preboot=run chipa_set_uboot;
pxefile_addr_r=0x45900000
ramdisk_addr_r=0x46100000
rootpart=4
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootriscv64.efi; then echo Found EFI removable media binary efi/boot/bootriscv64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scan_sf_for_scripts=${devtype} read ${scriptaddr} ${script_offset_f} ${script_size_f}; source ${scriptaddr}; echo SCRIPT FAILED: continuing...
script_offset_f=0x1fff000
script_size_f=0x1000
scriptaddr=0x43900000
sd_devnum=1
sdk_boot_env=for bootdev_s in ${boot_devs}; do run bootenv_${bootdev_s}; done;
serial#=VF7110B1-2310-D004E000-00001875
sf_boot=if sf probe ${busnum}; then devtype=sf; run scan_sf_for_scripts; fi
type_guid_gpt_loader1=5B193300-FC78-40CD-8002-E86C45580B47
type_guid_gpt_loader2=2E54B353-1271-4842-806F-E436D6AF6985
type_guid_gpt_system=0FC63DAF-8483-4772-8E79-3D69D8477DE4
uboot_fdt_addr=0xf7fabe20
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
ver=U-Boot 2021.10 (Mar 14 2024 - 19:21:18 +0800)
visionfive2_mem_set=fdt memory ${memory_addr} ${memory_size};run cma_resize; 

Environment size: 9764/65532 bytes
StarFive # boot
switch to partitions #0, OK
mmc1 is current device
Try booting from MMC1 ...
Failed to load 'vf2_uEnv.txt'
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined
Card did not respond to voltage select! : -110
starfive_pcie pcie@2B000000: Port link up.
starfive_pcie pcie@2B000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
starfive_pcie pcie@2C000000: Port link down.
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10

Device 0: unknown device

Device 0: unknown device
Tring booting distro ...
switch to partitions #0, OK
mmc1 is current device
Try booting from MMC1 ...
406 bytes read in 5 ms (79.1 KiB/s)
Retrieving file: /extlinux/extlinux.conf
520 bytes read in 7 ms (72.3 KiB/s)
1:      Arch Linux
Retrieving file: /initramfs-linux.img
7954311 bytes read in 354 ms (21.4 MiB/s)
Retrieving file: /vmlinuz
9949260 bytes read in 434 ms (21.9 MiB/s)
append: 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=@
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
Failed to load '/dtbs/starfive/jh7110-visionfive-v2.dtb'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
   Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=41c02000
Device tree not found or missing FDT support
### ERROR ### Please RESET the board ###
1 Like

Thank you ! It’s Works after edit the uEnv.txt

Wouldn’t be needed if you upgraded the firmware. The u-boot in that contains the changed paths as it was stated in the original debian release notes from starfive!

1 Like

I just update my post for the cwt22.1 release of Arch Linux Image for VisionFive 2.

As the kernel upgraded to version 6.6, the new u-boot firmware is required. However, the u-boot from StarFive’s repo cannot be built using the latest Arch gcc and binutils, so I changed to the mainline u-boot v2024.04 instead.

The u-boot package is already included in the image, please follow the following instruction to flash onboard firmware:

$ sudo pacman -U /root/pkgs/u-boot-starfive-vf2-2024.04-1-riscv64.pkg.tar.zst
$ cat /proc/mtd  # please always check your mtd partition
$ sudo flashcp -v /usr/share/u-boot-starfive-vf2/u-boot-spl.bin.normal.out /dev/mtd0
$ sudo flashcp -v /usr/share/u-boot-starfive-vf2/u-boot.itb /dev/mtd2
2 Likes

Caught this error after trying to upgrade…


:: Proceed with installation? [Y/n] y
(3/3) checking keys in keyring                                                                                                                [#######################################################################################] 100%
(3/3) checking package integrity                                                                                                              [#######################################################################################] 100%
(3/3) loading package files                                                                                                                   [#######################################################################################] 100%
(3/3) checking for file conflicts                                                                                                             [#######################################################################################] 100%
error: failed to commit transaction (conflicting files)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /etc/modprobe.d/soft_3rdpart-modules.conf exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /etc/udev/rules.d/91-soft_3rdpart.rules exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/chagall.bin exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/encoder_defconfig.cfg exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/monet.bin exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/sof/sof-vf2-wm8960-aec.tplg exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/sof/sof-vf2-wm8960-mixer.tplg exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/sof/sof-vf2-wm8960.tplg exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/lib/firmware/sof/sof-vf2.ri exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
linux-cwt-6.6-starfive-vf2-soft_3rdpart: /usr/share/libalpm/hooks/91-soft_3rdpart.hook exists in filesystem (owned by linux-cwt-515-starfive-vf2-soft_3rdpart)
Errors occurred, no packages were upgraded.
reboot your board to use the new kernel

manual removing linux-cwt-515-starfive-vf2-soft_3rdpart package helped… but after upgrade everything were broken.

And now have that…

Try booting from NVME0 ...
Failed to load 'vf2_uEnv.txt'
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined

Device 0: Vendor: 0x144d Rev: FXM7AK1Q Prod: S6F2NA0T748986
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
... is now current device
Try booting from NVME0 ...
Failed to load 'vf2_uEnv.txt'
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined
Tring booting distro ...
Card did not respond to voltage select! : -110
switch to partitions #0, OK
mmc0(part 0) is current device
Try booting from MMC0 ...
** Invalid partition 3 **
Couldn't find partition mmc 0:3
Can't set block device
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
Retrieving file: /extlinux/extlinux.conf
** Invalid partition 3 **
Couldn't find partition mmc 0:3
Can't set block device
Error reading config file

Device 0: Vendor: 0x144d Rev: FXM7AK1Q Prod: S6F2NA0T748986
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
... is now current device
Try booting from NVME0 ...
406 bytes read in 4 ms (98.6 KiB/s)
Retrieving file: /extlinux/extlinux.conf
520 bytes read in 4 ms (127 KiB/s)
1:      Arch Linux
Retrieving file: /initramfs-linux.img
8055633 bytes read in 46 ms (167 MiB/s)
Retrieving file: /vmlinuz
9960971 bytes read in 56 ms (169.6 MiB/s)
append: 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=@
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
Failed to load '/dtbs/starfive/jh7110-visionfive-v2.dtb'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
   Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=41c03000
Device tree not found or missing FDT support
### ERROR ### Please RESET the board ###

Did you upgrade u-boot? Arch Linux Image for VisionFive 2 - #461 by cwt

I found that the package uboot.itb results in the above issue, whereas there is no problem with the official firmware. “Interesting” disparity in file size between the two.

$ ls -l 
total 4080
-rw-r--r-- 1 jrh jrh 1013387 May 23 06:13 u-boot.itb
-rw-r--r-- 1 jrh jrh 3014741 May 28 12:59 visionfive2_fw_payload.img
1 Like