Nand is the most complex setup…why not using mmc as boot device? There you can use uenv.txt to configure uboot (i try to do the same in ubifs,but setup is more difficult than only flashing an image).
The default bootmenu entry is always mmc and needs to be changed (via mmc uenv.txt) to use nvme bootentry.
Easiest way is to start from nand (after flashed from sdcard like you did) and booting a kernel+initrd from usb.
Then flash emmc bl2 to boot0 and sdmmc image to userpart.
the sgdisk fix is because image can only contain main GPT at beginning the disk but not the backup GPT at the end of disk (because image creation process cannot know target disk size and 16GB+ image is not a good idea).
the uboot sdmmc.img has no kernel and rootfs, here you have to use the full image ceated by my bpi-router-images repo (these images have kernelversion and userspace name like bookworm in filename). the uboot-file is only a base image with the bootchain which is taken by images repo to add kernel and userspace.
second the image has to be flashed to /dev/mmcblk0 which is the emmc user-part (not sure what the rpmb partition is - not used till now).
didn’t work…can’t boot from MMC…just gives me a system halt…
I can boot though via NAND SPI and then choose MMC which in turn loads the rootfs from NVMe and /boot from MMC:
root@bpi-r4:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 2M 1 disk
mtdblock1 31:1 0 126M 0 disk
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 4M 0 part
├─mmcblk0p2 179:2 0 512K 0 part
├─mmcblk0p3 179:3 0 2M 0 part
├─mmcblk0p4 179:4 0 2M 0 part
├─mmcblk0p5 179:5 0 100M 0 part /boot
└─mmcblk0p6 179:6 0 6.4G 0 part
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
nvme0n1 259:0 0 238.5G 0 disk
├─nvme0n1p1 259:1 0 4M 0 part
├─nvme0n1p2 259:2 0 512K 0 part
├─nvme0n1p3 259:3 0 2M 0 part
├─nvme0n1p4 259:4 0 2M 0 part
├─nvme0n1p5 259:5 0 100M 0 part
└─nvme0n1p6 259:6 0 238.4G 0 part /
drives me nuts though I could live with that setup if I remember all steps I’ve done (o;
If not i guess partconf is not set right,so boot nand till uboot and do this in uboot console:
mmc partconf 0 1 1 0
As i said,if /boot is from mmc you have to adjust /etc/fstab on nvme if you sure rootfs is loaded from nvme (look in bootlog for bootargs and then mount command).
After booting up from nand there are several ways to install Debian, but also, the tool bpir-build has an Ubuntu option to get Ubuntu on NVME.
The advantage here is that there is no need to work with U-Boot commands, there is always a linux (initrd) available. From there it is quite easy to install any distro.
I’ve tested this on R3, in my R4 I do not have an nvme installed yet. U-Boot should be able to use it on R4 also.
I was able to build my SPI FLASH Firmware U-Boot using EFI and then I’ve install Debian 13 Trixie on SSD NVMe.
U-Boot EFI detects the EFI partition on NVMe (of course, U-Boot needs to be last version or with PCIe patches) and then I’m booting GRUB EFI.
In GRUB I’ve added devicetree /boot/… to load the DTB.
Is working very nice.
I’m working o a BASH script which builds the firmware and the rootfs for NVMe, but is not finish yet.
Which dtb? There are some overlays which are probed in the fit approach. Thats why i think extlinux and efi is not the best way…you are fixed to 1 config and if e.g. on R3 the other spi/mmc device is active it does not work.
Which dtb? There are some overlays which are probed in the fit approach. Thats why i think extlinux and efi is not the best way…you are fixed to 1 config and if e.g. on R3 the other spi/mmc device is active it does not work.
Btw. Just a note for others: Debian trixie is not yet released (date 2025-08-09), it is freezed and can be tested,but it is not yet defined as stable.