starfive-tech / VisionFive2

438 stars 78 forks source link

Boot from NVMe is broken with "upstream" u-boot and "upstream" kernel #72

Closed misuzu closed 11 months ago

misuzu commented 11 months ago

Here is my setup:

The problem:

I have my EFI partition on an SD card and the root ext4 filesystem on an NVMe drive. This setup works fine, the u-boot loads systemd-boot, it then loads the kernel, it does its thing, mounts root filesystem and starts systemd.

But, if I copy my EFI partition to an NVMe drive and eject the SD card or just run pci enum and then boot in u-boot, the Linux kernel won't be able to initialize NVMe.

tl;dr - initialize NVMe drive in the u-boot - kernel won't find it, don't initialize NVMe drive in the u-boot - everything fine.

Here are the logs: efi_on_sdcard.log (working)

efi_on_nvme.log (fails)

sdcard-to-nvme_cut_diff.txt (the difference between the two, minus time)

The OS image and the u-boot files for testing can be found here.

misuzu commented 11 months ago

Looks like the issue is gone with https://github.com/starfive-tech/linux/commit/67e8df01b875afd312a7d2ab77f56a62f39dd6d9 and https://github.com/misuzu/u-boot/commit/0850e3a5b9d02cc5d9c06dbd22e97a16c67285e8