Pironman 5 + WD_BLACK SN770: booting Raspberry Pi OS from NVMe with U-Boot and PCIe Gen 1

I got Raspberry Pi OS to boot with its root filesystem on the internal
WD_BLACK SN770 1 TB in my Pironman 5, using the original PCIe ribbon cable.

The microSD starts U-Boot. U-Boot then loads the Linux kernel and initramfs
from the NVMe, and Linux mounts the NVMe as its root filesystem. The microSD
stays inserted for this setup.

Hardware and software

  • Raspberry Pi 5 + SunFounder Pironman 5
  • WD_BLACK SN770 1 TB, PCI ID 15b7:5017
  • U-Boot main commit: 3257d2b37be49c8570b31c0f56adfef15671f76b
  • Raspberry Pi OS 64-bit, kernel: 6.18.65+rpt-rpi-2712

What worked

  1. Build U-Boot from the commit above with rpi_arm64_defconfig.
  2. Put the U-Boot binary on the microSD boot partition. In its config.txt,
    point kernel= to that binary (eg at the end of this texte my .bin call u-boot-main-pi5.bin) and set dtparam=pciex1 and
    dtparam=pciex1_gen=1.
  3. Use the CONFIG_PREBOOT below to scan the NVMe, load kernel_2712.img
    and initramfs_2712 from its FAT partition, and start Linux with booti.

Verified after boot:

  • / → /dev/nvme0n1p2
  • /boot/firmware → /dev/nvme0n1p1

On my setup, PCIe Gen 2 was unstable. An earlier U-Boot v2026.10-based
build could see the SSD on PCIe, but the NVMe scan timed out on the
administrative Set Features command.

Tested CONFIG_PREBOOT

CONFIG_PREBOOT=“pci enum; nvme scan; if part uuid nvme 0:2 nvme_root && fatload nvme 0:1 ${kernel_addr_r} kernel_2712.img; then setenv kernel_comp_addr_r 0x18000000; setenv kernel_comp_size ${filesize}; if fatload nvme 0:1 ${ramdisk_addr_r} initramfs_2712; then setenv initrd_size ${filesize}; setenv bootargs root=PARTUUID=${nvme_root} rootfstype=ext4 rootwait rw console=tty1; booti ${kernel_addr_r} ${ramdisk_addr_r}:${initrd_size} ${fdt_addr}; fi; fi”

compilation U-BOOT sequence

cd ~/u-boot-main-pi5
make rpi_arm64_defconfig

sed -i -E ‘/^(CONFIG_(BOOTDELAY|USE_PREBOOT|PREBOOT|HUSH_PARSER|FAT_WRITE)=|# CONFIG_(USE_PREBOOT|HUSH_PARSER|FAT_WRITE) is not set$)/d’ .config

cat >> .config <<‘EOF’
CONFIG_BOOTDELAY=-1
CONFIG_USE_PREBOOT=y
CONFIG_HUSH_PARSER=y
CONFIG_FAT_WRITE=y
CONFIG_PREBOOT=“pci enum; nvme scan; if part uuid nvme 0:2 nvme_root && fatload nvme 0:1 ${kernel_addr_r} kernel_2712.img; then setenv kernel_comp_addr_r 0x18000000; setenv kernel_comp_size ${filesize}; if fatload nvme 0:1 ${ramdisk_addr_r} initramfs_2712; then setenv initrd_size ${filesize}; setenv bootargs root=PARTUUID=${nvme_root} rootfstype=ext4 rootwait rw console=tty1; booti ${kernel_addr_r} ${ramdisk_addr_r}:${initrd_size} ${fdt_addr}; fi; fi”
EOF

make olddefconfig &&
grep -x ‘CONFIG_NVME_PCI=y’ .config &&
make -j2 &&
cp u-boot.bin u-boot-main-pi5.bin

use the u-boot-main-pi5.bin as kernel parameter