SPI + NVMe booting(beta)

when all works in NVME, can i modify hw_intfc.conf
-intfc:uart4=on
-intfc:spi1=off
-#intfc:dtoverlay=spi1-flash

yes, it woks…but uart4 is lost
both serial ports are really lost, uart2 do something in the boot even though fiq has been removed

edit:
pin 23, 24 ground and boot from sdcard, uart4 works

What are benefits of booting from SPI and not from uSD or eMMC?

From my point of view, the only benefit is saving some cost for the eMMC/uSD and maybe cooler. Actually spi booting is much slower than eMMC.

But I guess it is possible to purchase quite cheap, fast, little capacity SD + quite big NVMe SSD and boot from SD. And it would be pretty reliable and easier to maintain than flashing SPI with possibility of bricking Pi. Or am I wrong and SPI has some big-big advantages in particular cases?

The SPI flash is easy to manage since we can disable it on the GPIO header, so actually you can not brick the PI because of software.

@jack @radxa

Are there sources available somewhere for PCIe support in u-boot?

I tested the u-boot on my Rock Pi 4B, and noticed that my 16GB Optane drive
crashes the u-boot. I wonder if I could find a way to fix it. The same drive
works fine on every linux distro.

Hi ayufanpl! I’m your fun from Pine64 community and enjoying your custom build rom, welcome to radxa forum.

I’m surprised you can use Optane ssd in ARM64 SBC, I thought Optane only supported in Intel chipset. But I’m looking forward someone can make it work in RK3399

It behaves exactly the same as regular nvme drive. I bought this el cheapo (sometimes it is possible to find them for like 5$ when on discount) to try have something to test easily, and do not use Samsungs P961 and maybe brick it :slight_smile:

These Optanes are x2 only, so max around 600MB/s. Still quite good.

That’s great, optane has very low latency and high durability, I’ll trying to get one for test. And FYI Optane M15 will be out soon, and it’s PCIE 4x and much higher IOPS.

The source code is not public yet since it’s buggy. We will push it to github after some cleaning if it’s helpful to you.

Thanks, this would be awesome. I could cross check that with other PCIE implementations. I think pushing additional branch on https://github.com/radxa/u-boot would be helpful.

I hope that we switch as well to mainline u-boot.

Hi, @ayufanpl

We have pushed one additional branch that supports SPI NVME booting. See

repository: https://github.com/radxa/u-boot.git
branch : rk3399-pie-gms-express-baseline
2 Likes

Thanks. This is awesome. I will not have time to look at this, this week, but will look next one.

1 Like

Cool! I’ll try to build my own u-boot!

In the meantime I can report the Intel 660p 1TB NVMe SSD as working for SPI + NVMe boot.

(Yes, I’m 2 months late ;))

Update: It seem’s I’m having issues rebooting. After I type:

root@localhost:~# reboot

systemd does its thing and then the machine hangs at:

[  OK  ] Stopped LVM2 metadata daemon.
[   34.280526] dw_wdt: unexpected close, system will reboot soon
[   34.563789] reboot: Restarting system

But it does not actually reboot. This worked before (with eMMC-boot). I don’t know if this an issue from the new u-boot or something else.

I don’t know how to quote your comment

“From my point of view, the only benefit is saving some cost for the eMMC/uSD and maybe cooler. Actually spi booting is much slower than eMMC.”

Hi. I was very intrigued by your comment. Does it mean that I am making a futile effort to try to boot from nvme? I thought the operating system would run faster from nvme.

It is more than cost, but IO NVME can provide, and not burning out SD cards. Using software like home-assistant can / does burn out SD cards, where NVME drives are designed to be used as hard drives. Please understand that these SBCs are used as small servers or dev devices where IO and IOPS matter.

This is the only way i got the Rock Pi to boot with spi+nvme. I recommend adding this topic link to this page: https://wiki.radxa.com/Rockpi4/Linux_system_runs_on_M.2_NVME_SSD @jack. Im using a rebranded intel 6000p 128gb.

1 Like

SPI + NVME boot does not work with Samsung 970EVOPlus, at least with current SW & instructions.

Instruction sucks also. Especially this part there "Put the M.2 NVME SSD into M.2 NVMe SSD Reader Adapter, and then insert them to PC. "

Why it does not instruct to copy existing image from SD to NVME. I tried that first. Boot did not worked. Then I used BalenaEtcher in my Mint. Still the same problem.

It is not big problem if I will not get SPI boot to work. I would like to get at least only boot part in SD card but I do not know how to proceed exactly for Rock PI. I have done that for Raspberry PI once. Idea is to avoid SD card wear out problem.

Procedure is explained here:
https://samhobbs.co.uk/2013/10/speed-up-your-pi-by-booting-to-a-usb-flash-drive

if SD boot is OK, Just use Armbian. SD wear out is addressed on multiple levels and boot/having rootfs from whatever is supported since early days:
https://docs.armbian.com/User-Guide_Getting-Started/#how-to-install-to-emmc-nand-sata-usb

… bootloader stays at SD card but since its mainly read, write only when upgrading kernel … its alright.

I want to have Ubuntu. I tested to create dummy files after boot from SD card in / and /home directories. Those files seems to be written in SSD afterall. So, I assume that all writing after boot will happen on SSD now.

root@rockpi:/# sudo lsblk -o name,mountpoint,label,size,uuid
NAME MOUNTPOINT LABEL SIZE UUID
mtdblock0 4M
mmcblk0 14.7G
├─mmcblk0p1 3.9M
├─mmcblk0p2 4M
├─mmcblk0p3 4M
├─mmcblk0p4 boot 112M 1121-C996
└─mmcblk0p5 ubt-bionic 14.6G 9d4f00d3-3731-4dac-a791-7dbd9cb156e2
nvme0n1 931.5G
├─nvme0n1p1 3.9M
├─nvme0n1p2 4M
├─nvme0n1p3 4M
├─nvme0n1p4 /boot boot 112M 1121-C996
└─nvme0n1p5 / ubt-bionic 931.4G 9d4f00d3-3731-4dac-a791-7dbd9cb156e2
root@rockpi:/#