Skip to contentSkip to conversation

StarFive VisionFive 2: NVME not responding randomly

DISCUSSION Martin Husemann 3 participants 5 messages Nov 17 – Nov 20

lore
Share & tools
lore
#0 lore raw

Hi folks,

I boot my StarFive VisionFive 2 from NVME usually, but "sometimes" (which is actually qite often) u-boot does not recognize the NVME and can't read the partition.

Full boot lo of a working boot below. When it doesn't work it says:

[..]
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
<------- all normal untill here, now the difference starts:
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
Cannot persist EFI variables without system partition
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'nvme 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)

I tried everything obvious: software reset, reset button, removing power for a minute - nothing made a difference. Sometime later it just works again.

I can build a debug version, but would like to hear some hints what debug stuff I should enable for that, or any hints where to look.

Thanks,

Martin

working boot:

U-Boot SPL 2026.10 (Nov 12 2026 - 10:42:43 +0100)
DDR version: dc2e84f0.
Trying to boot from SPI

OpenSBI v1.9
____ _____ ____ _____

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

Platform Name : StarFive VisionFive 2 v1.3B
Platform Features : medeleg
Platform HART Count : 4
Platform HART Protection : pmp
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 : ---
Platform CPPC Device : ---
Firmware Base : 0x40000000
Firmware Size : 357 KB
Firmware RW Offset : 0x40000
Firmware RW Size : 101 KB
Firmware Heap Offset : 0x4d000
Firmware Heap Size : 49 KB (total), 0 KB (reserved), 15 KB (used), 32 KB (free)
Firmware Scratch Size : 4096 B (total), 504 B (used), 3592 B (free)
Runtime SBI Version : 3.0
Standard SBI Extensions : rfnc,ipi,base,hsm,srst,pmu,dbcn,fwft,legacy,dbtr,sse,time
Experimental SBI Extensions : none

Domain0 Name : root
Domain0 Boot HART : 3
Domain0 HARTs : 0x1*,0x2*,0x3*,0x4*
Domain0 Region00 : 0x0000000040040000-0x000000004005ffff M: (F,R,W) S/U: ()
Domain0 Region01 : 0x0000000040000000-0x000000004003ffff M: (F,R,X) S/U: ()
Domain0 Region02 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
Domain0 Region03 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region04 : 0x000000000c000000-0x000000000fffffff M: (I,R,W) S/U: (R,W)
Domain0 Region05 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
Domain0 Next Address : 0x0000000040200000
Domain0 Next Arg1 : 0x00000000402e5628
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes

Boot HART ID : 3
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcbx
Boot HART ISA Extensions : zihpm,sdtrig,f,d
Boot HART PMP Count : 8
Boot HART PMP Granularity : 12 bits
Boot HART PMP Address Bits : 34
Boot HART MHPM Info : 2 (0x00000018)
Boot HART Debug Triggers : 8 triggers
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109

U-Boot 2026.10 (Nov 12 2026 - 10:42:43 +0100)

CPU:   sifive,u74-mc
Model: StarFive VisionFive 2 v1.3B
DRAM:  8 GiB
Core:  159 devices, 30 uclasses, devicetree: board
WDT:   Not starting watchdog@13070000
MMC:   mmc@16010000: 0, mmc@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-2253-D008E000-00004536
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:46:cc
Ethernet MAC1 address: 6c:cf:39:00:46:cd
--------EEPROM INFO--------

In:    serial@10000000
Out:   serial@10000000
Err:   serial@10000000
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000

starting USB...
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430
 Hit any key to stop autoboot: 2 Hit any key to stop autoboot: 0 StarFive # nvme detail
Blk device 0: Optional Admin Command Support:
Namespace Management/Attachment: no
Firmware Commit/Image download: yes
Format NVM: yes
Security Send/Receive: yes
Blk device 0: Optional NVM Command Support:
Reservation: yes
Save/Select field in the Set/Get features: no
Write Zeroes: yes
Dataset Management: yes
Write Uncorrectable: yes
Blk device 0: Format NVM Attributes:
Support Cryptographic Erase: yes
Support erase a particular namespace: Yes
Support format a particular namespace: No
Blk device 0: LBA Format Support:
Blk device 0: End-to-End DataProtect Capabilities:
As last eight bytes: No
As first eight bytes: No
Support Type3: No
Support Type2: No
Support Type1: No
Blk device 0: Metadata capabilities:
As part of a separate buffer: No
As part of an extended data LBA: No
StarFive # nvme info
Device 0: Vendor: 0x144d Rev: 5B2QGXA7 Prod: S5GYNX0T302900W
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
StarFive # nvme part
Partition Map for nvme device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000040 0x0002003f "NvmeEFI"

	attrs:	0x0000000000000000
	type:	c12a7328-f81f-11d2-ba4b-00a0c93ec93b
		(EFI System Partition)
	guid:	f0fa7669-f18e-4335-9267-9bee56f2db5f
  2	0x00020040	0x0142003f	"NvmeSwap"
	attrs:	0x0000000000000000
	type:	49f48d32-b10e-11dc-b99b-0019d1879648
		(49f48d32-b10e-11dc-b99b-0019d1879648)
	guid:	7f8fc315-f7e6-467a-8811-79c272b1e331
  3	0x01420040	0x3a38600e	"NvmeRoot"
	attrs:	0x0000000000000000
	type:	49f48d5a-b10e-11dc-b99b-0019d1879648
		(49f48d5a-b10e-11dc-b99b-0019d1879648)
	guid:	689f41fa-13d8-43c9-b409-4acddeec0476

StarFive #

(and it would have booted from the EFI partition hapilly if I hadn't interrupted it here)

#1 lore raw

Hi Martin,

Quoted 200 lines · Martin Husemann

Hi folks,

I boot my StarFive VisionFive 2 from NVME usually, but "sometimes" (which is actually qite often) u-boot does not recognize the NVME and can't read the partition.

Full boot lo of a working boot below. When it doesn't work it says:

[..]
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
<------- all normal untill here, now the difference starts:
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
Cannot persist EFI variables without system partition
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'nvme 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)

I tried everything obvious: software reset, reset button, removing power for a minute - nothing made a difference. Sometime later it just works again.

I can build a debug version, but would like to hear some hints what debug stuff I should enable for that, or any hints where to look.

Thanks,

Martin

working boot:

U-Boot SPL 2026.10 (Nov 12 2026 - 10:42:43 +0100)
DDR version: dc2e84f0.
Trying to boot from SPI

OpenSBI v1.9
____ _____ ____ _____

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

Platform Name : StarFive VisionFive 2 v1.3B
Platform Features : medeleg
Platform HART Count : 4
Platform HART Protection : pmp
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 : ---
Platform CPPC Device : ---
Firmware Base : 0x40000000
Firmware Size : 357 KB
Firmware RW Offset : 0x40000
Firmware RW Size : 101 KB
Firmware Heap Offset : 0x4d000
Firmware Heap Size : 49 KB (total), 0 KB (reserved), 15 KB (used), 32 KB (free)
Firmware Scratch Size : 4096 B (total), 504 B (used), 3592 B (free)
Runtime SBI Version : 3.0
Standard SBI Extensions : rfnc,ipi,base,hsm,srst,pmu,dbcn,fwft,legacy,dbtr,sse,time
Experimental SBI Extensions : none

Domain0 Name : root
Domain0 Boot HART : 3
Domain0 HARTs : 0x1*,0x2*,0x3*,0x4*
Domain0 Region00 : 0x0000000040040000-0x000000004005ffff M: (F,R,W) S/U: ()
Domain0 Region01 : 0x0000000040000000-0x000000004003ffff M: (F,R,X) S/U: ()
Domain0 Region02 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
Domain0 Region03 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region04 : 0x000000000c000000-0x000000000fffffff M: (I,R,W) S/U: (R,W)
Domain0 Region05 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
Domain0 Next Address : 0x0000000040200000
Domain0 Next Arg1 : 0x00000000402e5628
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes

Boot HART ID : 3
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcbx
Boot HART ISA Extensions : zihpm,sdtrig,f,d
Boot HART PMP Count : 8
Boot HART PMP Granularity : 12 bits
Boot HART PMP Address Bits : 34
Boot HART MHPM Info : 2 (0x00000018)
Boot HART Debug Triggers : 8 triggers
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109

U-Boot 2026.10 (Nov 12 2026 - 10:42:43 +0100)

CPU:   sifive,u74-mc
Model: StarFive VisionFive 2 v1.3B
DRAM:  8 GiB
Core:  159 devices, 30 uclasses, devicetree: board
WDT:   Not starting watchdog@13070000
MMC:   mmc@16010000: 0, mmc@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-2253-D008E000-00004536
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:46:cc
Ethernet MAC1 address: 6c:cf:39:00:46:cd
--------EEPROM INFO--------

In:    serial@10000000
Out:   serial@10000000
Err:   serial@10000000
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000

starting USB...
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430

Hit any key to stop autoboot: 2
Hit any key to stop autoboot: 0
StarFive # nvme detail
Blk device 0: Optional Admin Command Support:
Namespace Management/Attachment: no
Firmware Commit/Image download: yes
Format NVM: yes
Security Send/Receive: yes
Blk device 0: Optional NVM Command Support:
Reservation: yes
Save/Select field in the Set/Get features: no Write Zeroes: yes
Dataset Management: yes
Write Uncorrectable: yes
Blk device 0: Format NVM Attributes:
Support Cryptographic Erase: yes
Support erase a particular namespace: Yes
Support format a particular namespace: No
Blk device 0: LBA Format Support:
Blk device 0: End-to-End DataProtect Capabilities:
As last eight bytes: No
As first eight bytes: No
Support Type3: No
Support Type2: No
Support Type1: No
Blk device 0: Metadata capabilities:
As part of a separate buffer: No
As part of an extended data LBA: No
StarFive # nvme info
Device 0: Vendor: 0x144d Rev: 5B2QGXA7 Prod: S5GYNX0T302900W
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
StarFive # nvme part
Partition Map for nvme device 0 -- Partition Type: EFI

Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000040 0x0002003f "NvmeEFI"

	attrs:	0x0000000000000000
	type:	c12a7328-f81f-11d2-ba4b-00a0c93ec93b
		(EFI System Partition)
	guid:	f0fa7669-f18e-4335-9267-9bee56f2db5f
  2	0x00020040	0x0142003f	"NvmeSwap"
	attrs:	0x0000000000000000
	type:	49f48d32-b10e-11dc-b99b-0019d1879648
		(49f48d32-b10e-11dc-b99b-0019d1879648)
	guid:	7f8fc315-f7e6-467a-8811-79c272b1e331
  3	0x01420040	0x3a38600e	"NvmeRoot"
	attrs:	0x0000000000000000
	type:	49f48d5a-b10e-11dc-b99b-0019d1879648
		(49f48d5a-b10e-11dc-b99b-0019d1879648)
	guid:	689f41fa-13d8-43c9-b409-4acddeec0476
Quoted 4 lines

StarFive #

(and it would have booted from the EFI partition hapilly if I hadn't interrupted it here)

My understanding of PCIe on JH-7110 SoC is there's a hardware design flaw and the "fix" is a delay-and-wait that was rejected by Linux upstream. This presents more readily with *some* NVMe drives. It was a hot topic for discussion and based on that I selected Samsung 970 EVOPlus 500GB and 250GB models and I've never had an issue appear with the 250GB on which I do all my RISC-V development as with a Home Assistant Yellow baseboard hosting the Milk-V Mars CM Lite (JH-7110 SoC) system-on-module.

Is this the issue you're experiencing? What exact make/model is that NVMe module?

-E

#2 lore raw
Quoted 11 lines · E Shattow

My understanding of PCIe on JH-7110 SoC is there's a hardware design flaw and the "fix" is a delay-and-wait that was rejected by Linux upstream. This presents more readily with *some* NVMe drives. It was a hot topic for discussion and based on that I selected Samsung 970 EVOPlus 500GB and 250GB models and I've never had an issue appear with the 250GB on which I do all my RISC-V development as with a Home Assistant Yellow baseboard hosting the Milk-V Mars CM Lite (JH-7110 SoC) system-on-module.

Is this the issue you're experiencing? What exact make/model is that NVMe module?

That sounds like it. I can try another NVME for testing.

This one is:

vendor 144d product a80a (rev. 0x00)
Samsung SSD 980 PRO 500GB, firmware 5B2QGXA7, serial S5GYNX0T302900W NVMe 1.3

Martin

#3 lore raw
In reply to E Shattow
Quoted 45 lines · E Shattow

Hi Martin,

Quoted 42 lines · Martin Husemann

Hi folks,

I boot my StarFive VisionFive 2 from NVME usually, but "sometimes" (which is actually qite often) u-boot does not recognize the NVME and can't read the partition.

Full boot lo of a working boot below. When it doesn't work it says:

[..]
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
<------- all normal untill here, now the difference starts:
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
Cannot persist EFI variables without system partition
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'nvme 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)

I tried everything obvious: software reset, reset button, removing power for a minute - nothing made a difference. Sometime later it just works again.

I can build a debug version, but would like to hear some hints what debug stuff I should enable for that, or any hints where to look.

Thanks,

Martin

...

Quoted 11 lines

My understanding of PCIe on JH-7110 SoC is there's a hardware design flaw and the "fix" is a delay-and-wait that was rejected by Linux upstream. This presents more readily with *some* NVMe drives. It was a hot topic for discussion and based on that I selected Samsung 970 EVOPlus 500GB and 250GB models and I've never had an issue appear with the 250GB on which I do all my RISC-V development as with a Home Assistant Yellow baseboard hosting the Milk-V Mars CM Lite (JH-7110 SoC) system-on-module.

Is this the issue you're experiencing? What exact make/model is that NVMe module?

I don't think these are likely the same. The issue E referring to is probably mentioned in this patch[1], which says,

Quoted 3 lines

As the Starfive JH7110 hardware can't keep two inbound post write in order all the time, such as MSI messages and NVMe completions. If the NVMe completion update later than the MSI, an NVMe IRQ handle will miss.

and its follow-up[2] adds,

Quoted 4 lines

Not any two of inbound post requests can`t be kept in order in JH7110 SoC, the only one case we found is NVMe completions with MSI interrupts. To be more precise, they are the pending status in nvme_completion struct and nvme_irq handler in nvme/host/pci.c.

So it's the order between writes for MSI interrupts, and writes for MSI completions, that could be broken.

However, IIRC, U-Boot's NVMe driver always polls for updates to the NVMe command ring, which is natural since we don't have any interrupting facilities at all, so it's impossible for us to suffer from any kinds of ordering issues related to interrupts.

Quoted 1 line

-E

Signature · 7 lines
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.

[1]: https://lore.kernel.org/linux-pci/[email protected]/
[2]: https://lore.kernel.org/linux-pci/ZQ0PR01MB0981BC562E837B232B419AC28229A@ZQ0PR01MB0981.CHNPR01.prod.partner.outlook.cn/
#4 lore raw
In reply to Martin Husemann
Quoted 33 lines · Martin Husemann

Hi folks,

I boot my StarFive VisionFive 2 from NVME usually, but "sometimes" (which is actually qite often) u-boot does not recognize the NVME and can't read the partition.

Full boot lo of a working boot below. When it doesn't work it says:

[..]
USB XHCI 1.00
Bus xhci_pci: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff6f4430
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
<------- all normal untill here, now the difference starts:
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
Cannot persist EFI variables without system partition
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Invalid partition 1 **
Couldn't find partition nvme 0:1
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'nvme 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)

Quoted 2 lines

I tried everything obvious: software reset, reset button, removing power for a minute - nothing made a difference. Sometime later it just works again.

Does this series[1] work for you?

Quoted 6 lines

I can build a debug version, but would like to hear some hints what debug stuff I should enable for that, or any hints where to look.

Thanks,

Martin

Signature · 6 lines
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.

[1]: https://lore.kernel.org/u-boot/[email protected]/