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 is my setup:
u-boot from https://github.com/misuzu/u-boot/commits/visionfive2 It's https://github.com/u-boot/u-boot/commit/a169438411f9277cc689c14078151aa1d1caae3c but with https://github.com/misuzu/u-boot/commit/9c29cddf93ba6122d92f285d3d015944ffa08c70 for the u-boot to actually work, USB patch (also tried without it - same issue) and https://github.com/misuzu/u-boot/commit/355b187cda897494d7a1436b6897999f633a5fc9 to make it boot from NVMe.
Linux kernel from https://github.com/starfive-tech/linux/commit/64a6c57ec372c44d0f25416c9614657e274fccff
systemd-boot as bootloader
NixOS
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 thenboot
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.