jaredmcneill / quartz64_uefi

EDK2 UEFI for Rockchip RK3566 and RK3568 based SBCs.
148 stars 60 forks source link

Quartz64: Can't figure out how to boot from NVMe #81

Closed mlyle closed 1 month ago

mlyle commented 1 month ago

Hey -- thanks for an awesome project.

I'm trying to use this to boot NetBSD from NVMe. I have it starting up from an SD card, and I can get to the EFI shell. But I don't see my NVMe devices (I've tried 3 different cards, all blitted with the netbsd arm64.img).

Not sure if this is expected, but typing pci at the shell says pci: Protocol - PciRootBridgeIo not found. and when I look at devices, the only block device I see are sd:

88 D - -  1  1   0 MemoryMapped(0xB,0xFE2B0000,0xFE2B0FFF)/HD(1,GPT,996284FE-9 B71-49F9-864F-5E971B73E880,0x40,0x3FC0)
89 D - -  1  1   0 MemoryMapped(0xB,0xFE2B0000,0xFE2B0FFF)/HD(2,GPT,A654DBB6-9 2EA-4FFB-87C3-30A9D9BABC44,0x4000,0x4000)
8A D - -  1  1   0 MemoryMapped(0xB,0xFE2B0000,0xFE2B0FFF)/HD(3,GPT,9AC222C5-8 EC1-4EC1-A68F-EEC251DA50A9,0x8000,0x8000)

Can you offer any advice? I'm almost certainly not trying the right thing, but I'm not really sure where I'm going wrong.

jaredmcneill commented 1 month ago

The hack in the RK356x UEFI to make the PCIe controller appear ECAM compliant to the OS has the unfortunate side effect that it bends some PCIe rules, and as a result there are some devices that simply don't work. So the first thing I would suggest is to try a different NVMe drive. Not an endorsement, but I have had positive results with drives from WD (https://www.amazon.ca/gp/product/B07YFF8879) and SK Hynix (https://www.amazon.ca/gp/product/B09V1SPXK1) on various boards.

mlyle commented 1 month ago

@jaredmcneill OK, this is good to know. I've actually tried 3 drives so far: a WD Black 1TB, a Sabrent 2230 1TB, and a Crucial P3 Plus 2TB.

Can you please confirm that the message 'pci: Protocol - PciRootBridgeIo not found.' when running PCI at the uefi shell is expected before I buy more drives?

mlyle commented 1 month ago

(Tried one more drive: a Samsung SSD 970 Evo Plus; no luck).

jaredmcneill commented 1 month ago

I tried another drive I had handy, a Patriot P300 (https://www.amazon.ca/gp/product/B082BWY2C2) and it works for me with the latest release:

Screenshot 2024-05-25 at 6 59 46 AM

Can you please confirm that the message 'pci: Protocol - PciRootBridgeIo not found.' when running PCI at the uefi shell is expected before I buy more drives?

IIRC that's a generic error message that means that PCIe failed to init. Let's troubleshoot this some more before you spend more money on drives.

jaredmcneill commented 1 month ago

I just saw on the NetBSD mailing lists that you are using a Quartz64 Model B board. I don't have one, and the QUARTZ64 image has only been tested on Model A.

Looking at the schematics, it seems PCIe power is controlled by a different GPIO pin on the Model B. You will need a build with gRk356xTokenSpaceGuid.PcdPciePowerGpioPin set to 6 (instead of 22) here: https://github.com/jaredmcneill/quartz64_uefi/blob/main/edk2-rockchip/Platform/Pine64/Quartz64/Quartz64.dsc#L476

mlyle commented 1 month ago

Thank you!! I set up and built this with the different GPIO pin. The Sabrent drive I'd prefer to use doesn't work-- PCI root bridge inits but no block devices show up in uEFI. But the Samsung drive works and boots into NetBSD!

mlyle commented 1 month ago

(sorry for not mentioning the B variant!)