VF2更新flash spl和ubootQSPL启动sd卡失败

串口信息如下:
U-Boot SPL 2021.10 (Sep 26 2023 - 22:53:52 +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 (Sep 26 2023 - 22:53:52 +0800), Build: jenkins-github_visionfive2-18

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 …
Failed to load ‘/uEnv.txt’

Warning: defaulting to text format

Warning: Input data exceeds 1048576 bytes - truncated

Info: input data size = 1048578 = 0x100002

Failed to load ‘/dtbs/starfive/jh7110-visionfive-v2.dtb’
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
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
fatwrite - write file into a dos filesystem

Usage:
fatwrite <dev[:part]> [ []]
- write file ‘filename’ from the address ‘addr’ in RAM
to ‘dev’ on ‘interface’
Retrieving file: /extlinux/extlinux.conf
Failed to load ‘/extlinux/extlinux.conf’
Error reading config file
Card did not respond to voltage select! : -110

Device 0: unknown device

Device 0: unknown device
StarFive #

设备都装了什么?
我看提示信息, PCI-E 识别失败后,就去启动 MMC1 设备了。MMC1 上面没有找到需要的文件后就启动失败了。MMC1 应该是 emmc 模块吧? MMC1 的 #0 分区被当作存储文件的设备。

mmc1是TF卡,镜像是openwrt

看看数据位置,反正提示是 uEnv.txt 和 extlinux/extlinux.conf 都有问题。
这两个都是在同一个分区里面。提示是在 0 分区里面找的。

PS:好像 VF2 有 TF 卡的兼容问题。有些卡读取不了数据。

其他系统能启动么?

我已经找到原因并恢复正常了,是mtd的spl分区mtd0太小(128kib)导致刷写截断,然后我刷了小于128kib的u-boot-spl.bin.normal.out进去就能启动了,但是如何提高mtd的spl分区大小我依然不清楚

我记得 github 上的工具,或者这个站点的 doc 资料里面有写怎么改 spl 分区的大小。

SPI 分区是在device-tree 里面定义的:

这个可以随便改

谢谢你的提醒!