ARM64 – Rock Pi N10 – Finally Booting From NVME..
I had managed to get Fedora running on my Rock Pi N10 some considerable time ago, but still was frustrated by the – apparent – lack of support for NVME, despite the slot for one in the chassis, and u-boot commands included.. I had posted this question to the RADXA Forum, but did not get a useful response..
As is often the case with SOC systems, there is a lot of confusing/contradictory info online – more ‘opinion’ than ‘fact’..
Conclusions….
Mention of SPI boot was incorrect. Apparently the very early demo-dev units did have this capability, but none of the production units did, as it was superseded by the requirement for eMMC hardware support…
The only boot devices recognised by _hardware_ are MMC – SDCard or eMMC – and u-boot must reside on on of these.
The early version of u-boot provided with the device did not include the nvme command set, but later versions did..
As is the case with many SOC systems, the N10 is sensitive to NVME brands.. I found that one of the so-called ‘low power’ examples worked correctly..
0:01:00.0/nvme/nvme0
Hardware Class: disk
Model: "Lite-On LITEON CA3-8D256"
Vendor: pci 0x14a4 "Lite-On Technology Corporation"
Device: pci 0x2300 "LITEON CA3-8D256"
Oddly, the M.2 NVME retaining screw is non-standard, with a M2.5 thread, instead of the usual M2 or M3..
There are recent versions of u-boot for the N10 available from OpenSUSE, by downloading and extracting from the RPMs at: https://download.opensuse.org/distribution/leap/15.5/repo/oss/aarch64/
The one I used was: u-boot-rock-pi-n10-rk3399pro-2022.01-193.2.aarch64.rpm
, which I extracted using ark
..
To install on SDCard (as root)
dd if=idbloader.img of=/dev/sdX seek=64
dd if=u-boot.itb of=/dev/sdX seek=16384
I found that the 2022 version worked correctly, but the later 2023 version did not:
...........
Unknown command 'if' - try 'help'
Unknown command 'then' - try 'help'
Unknown command 'fi' - try 'help'
...............
The usual u-boot ‘nvme’ commands by themselves produced no result, and this was due to the fact that the NVME subsystem required initiation of PCI/NVME by u-boot first..
So:
=> nvme scan
=> nvme info
=> nvme part
no nvme partition table available
Solution:
=> run boot_pci_enum
=> run nvme_init
=> nvme info
Device 0: Vendor: 0x1987 Rev: EDFM60.1 Prod: 1348073319C700256779
Type: Hard Disk
Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
=> nvme part
Partition Map for NVMe device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00001000 0x00003fff ""
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
guid: 69600cd4-e142-49b8-a0c0-897898f2eb94
2 0x00004000 0x000fdfff "efi"
attrs: 0x0000000000000000
type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
guid: 164e1f9f-7f74-4447-9409-bf4537df5f4b
3 0x000fe000 0x1dcf2fff "rootfs"
attrs: 0x0000000000000000
type: 0fc63daf-8483-4772-8e79-3d69d8477de4
guid: b188625f-e60c-4b52-961c-79feda4fdc28
The test system I set up consisted of u-boot on a blank SDCard, with the entire EFI/ROOT Fedora 38 system on the NVME drive, but first I had to eradicate the old eMMC installation, as the N10 would _always_ boot from this, if it found it.. There were suggestions to ‘force’ boot from SDCard by “repeatedly pressing reset” but his never worked on my system, after many attempts… One incentive to make the change to NVME was that my N10 system only had a 16GB eMMC, which is not really large enough for a modern distro with KDE/Plasma etc..
I cloned the F38 system from the eMMC to the new NVME, and to an old 16GB SDCard… and then changed fstab to point to the SDCard partitions, rebooted, and erased the entire eMMC using # blkdiscard -sf /dev/mmcblkX
Care is needed here, as I found that booting from eMMC versus SDCard _reversed_ the mmcblk1 and mmcblk0 references..
Then I inserted the blank SDCard with u-boot, and booted to the u-boot commands, for more testing..
I had expected to have to customise the u-boot parameters to reference the NVME correctly, but in fact the OpenSuse version included all necessary commands/tests for this, and the boot process found EFI/GRUB on the NVME, and I was able to boot the latest kernel (6.4.2) successfully…
I then copied this u-boot to the (empty) eMMC, removed the SDCard, and the system booted into Fedora 38 on the NVME drive..
Fedora Linux 38 (Thirty Eight)
Kernel 6.4.2 on an aarch64 (ttyS2)
Web console: https://rgrockn10:9090/ or https://192.168.0.22:9090/
# cat /etc/fstab
/dev/nvme0n1p1 /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/nvme0n1p2 / ext4 defaults 1 1
When compiling the Linux kernel, the system does get rather hot – despite the large passive heatsink – and really needs a fan..
# sensors
cpu_thermal-virtual-0
Adapter: Virtual device
temp1: +70.0°C
Robert Gadsdon.. July 5th 2023.
Credit is due to OpenSUSE, for producing workable and up-to-date u-boot versions, and EFI/GRUB-capable install images, for so many SOC systems..
Comments
ARM64 – Rock Pi N10 – Finally Booting From NVME.. — No Comments