Starfive2无法boot起来

GitHub - starfive-tech/Tools 下载的Tools中并没有create_sbl,按照readme,也能编译一个u-boot-spl.bin.normal.out文件,然后通过软件技术参考手册重新编译的visionfive2_fw_payload.img和u-boot-spl.bin.normal.out文件,通过“恢复Bootloader”的方式更新后,无法boot起来。
在论坛上,找到一个官方提供的visionfive2_fw_payload.img和u-boot-spl.bin.normal.out文件,下载后,能正常boot起来。
我需要在M模式下配置寄存器,要改opensbi程序或者uboot程序,请问有谁遇到过吗?

Net: eth0: ethernet@16030000, eth1: ethernet@16040000
switch to partitions #0, OK
mmc1 is current device
found device 1
bootmode flash device 1
Can’t set block device
Failed to load ‘/boot/uEnv.txt’
Hit any key to stop autoboot: 2 1 0
Can’t set block device
Importing environment from mmc1 …

Warning: Input data exceeds 1048576 bytes - truncated

Info: input data size = 1048578 = 0x100002

Error: “boot2” not defined

Can’t set block device

Warning: defaulting to text format

switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:2…
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
823 bytes read in 8 ms (99.6 KiB/s)
U-Boot menu
1: Debian GNU/Linux bookworm/sid 5.15.0-starfive
2: Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
Enter choice: 1: Debian GNU/Linux bookworm/sid 5.15.0-starfive
Retrieving file: /boot/initrd.img-5.15.0-starfive
9684953 bytes read in 425 ms (21.7 MiB/s)
Retrieving file: /boot/vmlinuz-5.15.0-starfive
8015200 bytes read in 353 ms (21.7 MiB/s)
append: root=/dev/mmcblk1p3 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
Retrieving file: /boot/dtbs/starfive/starfive_visionfive2.dtb
Failed to load ‘/boot/dtbs/starfive/starfive_visionfive2.dtb’
kernel_comp_addr_r or kernel_comp_size is not provided!
2: Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
Retrieving file: /boot/initrd.img-5.15.0-starfive
9684953 bytes read in 425 ms (21.7 MiB/s)
Retrieving file: /boot/vmlinuz-5.15.0-starfive
8015200 bytes read in 353 ms (21.7 MiB/s)
append: root=/dev/mmcblk1p3 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single
Retrieving file: /boot/dtbs/starfive/starfive_visionfive2.dtb
Failed to load ‘/boot/dtbs/starfive/starfive_visionfive2.dtb’
kernel_comp_addr_r or kernel_comp_size is not provided!
SCRIPT FAILED: continuing…
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
** Unable to read file ubootefi.var **
Failed to load EFI variables
Scanning mmc 1:3…
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
ethernet@16030000 Waiting for PHY auto negotiation to complete… TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete… TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16030000 Waiting for PHY auto negotiation to complete…

create_spl已被废弃,现已被开源的spl_tool取代:Tools/spl_tool at master · starfive-tech/Tools · GitHub
按照错误信息来看似乎你给uboot提供的配置信息不全?
官方的配置信息有这些,都塞进uenv.txt了

setenv fdt_high 0xffffffffffffffff; setenv initrd_high 0xffffffffffffffff;
setenv scriptaddr 0x88100000; setenv script_offset_f 0x1fff000; setenv script_size_f 0x1000;
setenv kernel_addr_r 0x84000000; setenv kernel_comp_addr_r 0x90000000; setenv kernel_comp_size 0x10000000;
setenv fdt_addr_r 0x88000000; setenv ramdisk_addr_r 0x88300000;
2 Likes

谢谢,刚刚重新拉了一下最新的u-boot代码,kernel_comp_addr_r和kernel_comp_size在配置文件了增加了,编译加载后,又遇到了新的错误:
U-Boot menu
1: Debian GNU/Linux bookworm/sid 5.15.0-starfive
2: Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
Enter choice: 1: Debian GNU/Linux bookworm/sid 5.15.0-starfive
Retrieving file: /boot/initrd.img-5.15.0-starfive
9684953 bytes read in 426 ms (21.7 MiB/s)
Retrieving file: /boot/vmlinuz-5.15.0-starfive
8015200 bytes read in 352 ms (21.7 MiB/s)
append: root=/dev/mmcblk1p3 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
Retrieving file: /boot/dtbs/starfive/starfive_visionfive2.dtb
Failed to load ‘/boot/dtbs/starfive/starfive_visionfive2.dtb’
Uncompressing Kernel Image
Device tree not found or missing FDT support

ERROR ### Please RESET the board

你确认设备树名字对吗?官方设备树不是这个名字

谢谢,我把设备树文件名称更改成jh7110-visionfive-v2.dtb,修改后就好了,厉害!

2 Likes