{"id":3126,"date":"2023-07-05T21:25:02","date_gmt":"2023-07-06T04:25:02","guid":{"rendered":"https:\/\/rglinuxtech.com\/?p=3126"},"modified":"2023-07-05T21:25:02","modified_gmt":"2023-07-06T04:25:02","slug":"arm64-rock-pi-n10-finally-booting-from-nvme","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=3126","title":{"rendered":"ARM64 &#8211; Rock Pi N10 &#8211; Finally Booting From NVME.."},"content":{"rendered":"<p>I had managed to get Fedora running on my Rock Pi N10 some considerable time ago, but still was frustrated by the &#8211; apparent &#8211; lack of support for NVME, despite the slot for one in the chassis, and u-boot commands included..\u00a0 I had posted this question to the RADXA Forum, but did not get a useful response..<\/p>\n<p>As is often the case with SOC systems, there is a lot of confusing\/contradictory info online &#8211; more &#8216;opinion&#8217; than &#8216;fact&#8217;..<\/p>\n<p>Conclusions&#8230;.<br \/>\nMention 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&#8230;<br \/>\nThe only boot devices recognised by _hardware_ are MMC &#8211; SDCard or eMMC &#8211; and u-boot must reside on on of these.<br \/>\nThe early version of u-boot provided with the device did not include the nvme command set, but later versions did..<br \/>\nAs is the case with many SOC systems, the N10 is sensitive to NVME brands.. I found that one of the so-called &#8216;low power&#8217; examples worked correctly..<\/p>\n<p><code>0:01:00.0\/nvme\/nvme0<br \/>\nHardware Class: disk<br \/>\nModel: \"Lite-On LITEON CA3-8D256\"<br \/>\nVendor: pci 0x14a4 \"Lite-On Technology Corporation\"<br \/>\nDevice: pci 0x2300 \"LITEON CA3-8D256\"<\/code><\/p>\n<p>Oddly, the M.2 NVME retaining screw is non-standard, with a M2.5 thread, instead of the usual M2 or M3..<\/p>\n<p>There are recent versions of u-boot for the N10 available from OpenSUSE, by downloading and extracting from the RPMs at: <a href=\"https:\/\/download.opensuse.org\/distribution\/leap\/15.5\/repo\/oss\/aarch64\/\" target=\"_blank\" rel=\"noopener\">https:\/\/download.opensuse.org\/distribution\/leap\/15.5\/repo\/oss\/aarch64\/<\/a><br \/>\nThe one I used was: <code>u-boot-rock-pi-n10-rk3399pro-2022.01-193.2.aarch64.rpm<\/code>, which I extracted using <code>ark<\/code>..<\/p>\n<p>To install on SDCard (as root)<br \/>\n<code>dd if=idbloader.img of=\/dev\/sdX seek=64<br \/>\ndd if=u-boot.itb of=\/dev\/sdX seek=16384<\/code><\/p>\n<p>I found that the 2022 version worked correctly, but the later 2023 version did not:<br \/>\n<code>...........<br \/>\nUnknown command 'if' - try 'help'<br \/>\nUnknown command 'then' - try 'help'<br \/>\nUnknown command 'fi' - try 'help'<br \/>\n...............<\/code><\/p>\n<p>The usual u-boot &#8216;nvme&#8217; 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..<\/p>\n<p>So:<br \/>\n<code>=&gt; nvme scan<br \/>\n=&gt; nvme info<br \/>\n=&gt; nvme part<br \/>\nno nvme partition table available<\/code><\/p>\n<p>Solution:<br \/>\n<code>=&gt; run boot_pci_enum<br \/>\n=&gt; run nvme_init<br \/>\n=&gt; nvme info<br \/>\nDevice 0: Vendor: 0x1987 Rev: EDFM60.1 Prod: 1348073319C700256779<br \/>\nType: Hard Disk<br \/>\nCapacity: 244198.3 MB = 238.4 GB (500118192 x 512)<br \/>\n=&gt; nvme part<br \/>\nPartition Map for NVMe device 0 -- Partition Type: EFI<br \/>\nPart Start LBA End LBA Name<br \/>\nAttributes<br \/>\nType GUID<br \/>\nPartition GUID<br \/>\n1 0x00001000 0x00003fff \"\"<br \/>\nattrs: 0x0000000000000000<br \/>\ntype: 0fc63daf-8483-4772-8e79-3d69d8477de4<br \/>\nguid: 69600cd4-e142-49b8-a0c0-897898f2eb94<br \/>\n2 0x00004000 0x000fdfff \"efi\"<br \/>\nattrs: 0x0000000000000000<br \/>\ntype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b<br \/>\nguid: 164e1f9f-7f74-4447-9409-bf4537df5f4b<br \/>\n3 0x000fe000 0x1dcf2fff \"rootfs\"<br \/>\nattrs: 0x0000000000000000<br \/>\ntype: 0fc63daf-8483-4772-8e79-3d69d8477de4<br \/>\nguid: b188625f-e60c-4b52-961c-79feda4fdc28<\/code><\/p>\n<p>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 &#8216;force&#8217; boot from SDCard by &#8220;repeatedly pressing reset&#8221; but his never worked on my system, after many attempts&#8230; 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..<\/p>\n<p>I cloned the F38 system from the eMMC to the new NVME, and to an old 16GB SDCard&#8230; and then changed fstab to point to the SDCard partitions, rebooted, and erased the entire eMMC using <code># blkdiscard -sf \/dev\/mmcblkX<\/code> Care is needed here, as I found that booting from eMMC versus SDCard _reversed_ the mmcblk1 and mmcblk0 references..<\/p>\n<p>Then I inserted the blank SDCard with u-boot, and booted to the u-boot commands, for more testing..<br \/>\nI 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&#8230;<\/p>\n<p>I then copied this u-boot to the (empty) eMMC, removed the SDCard, and the system booted into Fedora 38 on the NVME drive..<\/p>\n<p><code>Fedora Linux 38 (Thirty Eight)<br \/>\nKernel 6.4.2 on an aarch64 (ttyS2)<br \/>\nWeb console: https:\/\/rgrockn10:9090\/ or https:\/\/192.168.0.22:9090\/<br \/>\n# cat \/etc\/fstab<br \/>\n\/dev\/nvme0n1p1 \/boot\/efi vfat umask=0077,shortname=winnt 0 2<br \/>\n\/dev\/nvme0n1p2 \/ ext4 defaults 1 1<\/code><\/p>\n<p>When compiling the Linux kernel, the system does get rather hot &#8211; despite the large passive heatsink &#8211; and really needs a fan..<br \/>\n<code># sensors<br \/>\ncpu_thermal-virtual-0<br \/>\nAdapter: Virtual device<br \/>\ntemp1: +70.0\u00b0C<\/code><\/p>\n<p><em>Robert Gadsdon.. July 5th 2023.<\/em><br \/>\n<em>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..<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had managed to get Fedora running on my Rock Pi N10 some considerable time ago, but still was frustrated by the &#8211; apparent &#8211; lack of support for NVME, despite the slot for one in the chassis, and u-boot commands included..\u00a0 I had posted this question to the RADXA Forum, but did not get a useful <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=3126\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1132,1131,10,2029,11,15,2576,19,2577,937],"tags":[1135,1133,2580,2539,2578,2579,1175,372],"class_list":["post-3126","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-arm64","category-fedora","category-fixed","category-hacks","category-linux-2","category-nvme","category-opinion","category-rock-pi-n10","category-u-boot-2","tag-aarch64","tag-arm64","tag-boot-from-nvme","tag-fedora-38","tag-nvme","tag-rock-pi-n10","tag-success","tag-u-boot"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3126"}],"version-history":[{"count":13,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3126\/revisions"}],"predecessor-version":[{"id":3139,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/3126\/revisions\/3139"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}