How can I flash SPI so that I can boot from NVMe?
#1
I've done several searches and there is one SPI package that appears to enable NVMe boot, but the repo was archived by the developer.

Is there any way to set this up so NVMe is the default boot drive? Without using the emmc at all?

Thanks
  Reply
#2
(08-10-2021, 04:11 PM)codingpanic Wrote: I've done several searches and there is one SPI package that appears to enable NVMe boot, but the repo was archived by the developer.

Is there any way to set this up so NVMe is the default boot drive? Without using the emmc at all?

Thanks
If you're talking about this thread:
https://forum.pine64.org/showthread.php?tid=8439

then you can still download the binary images here or build from source (I think this is PCM720's most recent code but older code is archived elsewhere too):
https://github.com/pcm720/u-boot-build-scripts/releases

I have not tried to flash my SPI yet, but I dowloaded the images and I also built them myself natively on my Pinebook Pro (compile takes several hours IIRC). My native build binaries were a little smaller than PCM720's cross compile. Even though I did my own build I think I'll use PCM720's binary images, if I ever flash my SPI, because other users have had success with them. My native build is untested and I don't really want to risk the compiler differences.

I'm running Manjaro, which can boot from NVMe but it requires the eMMC to be retained and installed in the PPB with U-boot code intact (U-boot code is written to the "tracks" before the boot partition) so, if you want to remove the eMMC entirely, you'll need to flash your SPI memory, as you've indicated. The Manjaro U-boot redirects to the NVMe boot partition when a valid /boot is not found on the eMMC. Both / and /boot are on the NVMe drive however and are not required to be present on eMMC at all (though it's been handy for me too keep / and /boot on my eMMC as a backup). If the eMMC is repartitioned, the first partition must begin after offset to avoid overwriting the U-boot loader area.

Unfortunately Manjaro NVMe boot broke when Manjaro updated the kernel to 5.13 and I have not solved the problem. I edited my pacman.conf file to ignore kernel updates and so I've "pinned" my kernel to 5.12.

Here's my long thread where I tried to isolate the problem and learned to build a test kernel but there's more info there about NVMe boot on Manjaro:
https://forum.manjaro.org/t/nvme-support...04-1/63774

There's no Manjaro Kernel build howto for Pinbook Pro that I could find and the process is a little different on the Pinebook Pro so my thread is good for learning though my stuggles with a custom kernel package build too.
  Reply
#3
(08-11-2021, 12:30 AM)calinb Wrote:
(08-10-2021, 04:11 PM)codingpanic Wrote: I've done several searches and there is one SPI package that appears to enable NVMe boot, but the repo was archived by the developer.

Is there any way to set this up so NVMe is the default boot drive? Without using the emmc at all?

Thanks
If you're talking about this thread:
https://forum.pine64.org/showthread.php?tid=8439

then you can still download the binary images here or build from source (I think this is PCM720's most recent code but older code is archived elsewhere too):
https://github.com/pcm720/u-boot-build-scripts/releases

I have not tried to flash my SIP yet, but I dowloaded the images and I also built them myself natively on my Pinebook Pro (compile takes several hours IIRC). My native build binaries were a little smaller than PCM720's cross compile. Even though I did my own build I think I'll use PCM720's binary images, if I ever flash my SIP, because other users have had success with them. My native build is untested and I don't really want to risk the compiler differences.

I'm running Manjaro, which can boot from NVMe but it requires the eMMC to be retained and installed in the PPB with U-boot code intact (U-boot code is written to the "tracks" before the boot partition) so, if you want to remove the eMMC entirely, you'll need to flash your SIP memory, as you've indicated. The Manjaro U-boot redirects to the NVMe boot partition when a valid /boot is not found on the eMMC. Both / and /boot are on the NVMe drive however and are not required to be present on eMMC at all (though it's been handy for me too keep / and /boot on my eMMC as a backup). If the eMMC is repartitioned, the first partition must begin after offset to avoid overwriting the U-boot loader area.

Unfortunately Manjaro NVMe boot broke when Manjaro updated the kernel to 5.13 and I have not solved the problem. I edited my pacman.conf file to ignore kernel updates and so I've "pinned" my kernel to 5.12.

Here's my long thread where I tried to isolate the problem and learned to build a test kernel but there's more info there about NVMe boot on Manjaro:
https://forum.manjaro.org/t/nvme-support...04-1/63774

There's no Manjaro Kernel build howto for Pinbook Pro that I could find and the process is a little different on the Pinebook Pro so my thread is good for learning though my stuggles with a custom kernel package build too.

I think I may try this firmware on eMMC, that way I can at least boot NVMe directly. This way I dont regrest flashing my SPI. If I do have problems, I can always disable the eMMC and boot off SD card. 

Thanks!
  Reply
#4
(08-11-2021, 05:07 AM)codingpanic Wrote: I think I may try this firmware on eMMC, that way I can at least boot NVMe directly. This way I dont regrest flashing my SPI. If I do have problems, I can always disable the eMMC and boot off SD card. 

Thanks!

Yes. Also, given that I'm finding my eMMC to be a good place to store /boot and / backup images from NVMe SSD while I tinker with my kernel on NVME, I decided to wait before attempting to flash my SPI. I have the same functionality and no risk by simply using the NVMe-enabled Manjaro boot loader on my eMMC.


As long as I preserve the Manjaro U-boot loader on eMMC (the 32.0MB before the first partition), I suspect the Manjaro U-boot loader will work with other distros installed to my NVMe SSD too, but I've not tried anything but Manjaro on my NVMe SSD so far.

Code:
$ sudo parted -l
...
Model: MMC DA4064 (sd/mmc)
Disk /dev/mmcblk2: 62.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:  

Number  Start   End     Size    Type     File system  Flags
1      32.0MB  256MB   224MB   primary  fat16        lba
2      256MB   62.5GB  62.3GB  primary  ext4
You might already know about this thread, but here's more info:



https://forum.manjaro.org/t/nvme-support...04-1/63774


My Manjaro U-boot seems to have the functionality of Nadia's patch and I don't recall if pcm720's code requires it (I read that long thread over a month ago).


Also, be sure to check to see if you're are really booting from NVMe (/boot and / are reported by lsblk as mounted on my Manjaro system, though I guess boot might not be mounted on other systems after boot so maybe boot logs or dmesg would reveal where they booted from):

Code:
$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk2      179:0    0  58.2G  0 disk  
├─mmcblk2p1  179:1    0 213.6M  0 part  
└─mmcblk2p2  179:2    0    58G  0 part  
mmcblk2boot0 179:32   0     4M  1 disk  
mmcblk2boot1 179:64   0     4M  1 disk  
zram0        252:0    0   5.7G  0 disk [SWAP]
nvme0n1      259:0    0 931.5G  0 disk  
├─nvme0n1p1  259:1    0 213.6M  0 part /boot
└─nvme0n1p2  259:2    0 931.3G  0 part /
Please let us know how things go for you! Big Grin
  Reply
#5
>the Manjaro U-boot loader on eMMC (the 32.0MB before the first partition)
Err, no.... baked into the cpu, specifically rk3399 family, the boot rom,,
the boot rom has only a small amount of memory, loads idbloader at sector 64,
as a raw read (based on byte signature),, this activates and enumerates mem on board
So now there is enough memory to load uboot, at 8M
If it is bsp uboot, there is trust.img at 12 M, if mainline trust is enfolded into u-boot.itb
None of this goes past 16M, perhaps the space 16M to 32M is for
a future ESP (efi system partition)
Please note that uboot on SPI is a bit different, idbloader 'expanded' and offset zero,
I vaguely remember uboot at 6M
But the SPI code is a complete image so you don't have to bother with this
  Reply
#6
(08-10-2021, 04:11 PM)codingpanic Wrote: I've done several searches and there is one SPI package that appears to enable NVMe boot, but the repo was archived by the developer.

Is there any way to set this up so NVMe is the default boot drive? Without using the emmc at all?

Thanks

So, to anyone else wondering about this, all I had to do was this:
1. Upgrade emmc install of Manjaro to latest. 
2. Install NVMe SSD
3. Flash Manjaro latest to NVMe (only tested with Manjaro so far)
4. Edit /etc/fstab on the NVMe drive to not use UUID of the / and /boot drives, but the Linux Device /dev/nvme0n1pX
5. Reboot, and you are running on the NVMe as / and /boot
6. You definitely want to tune the drive for power consumption as well!

I realize there was lots of work that has led up to this point, but it was surprisingly painless, and the performance is great!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Selling PineBook PRO with ISO Keyboard + NVME firefox-58 7 198 Yesterday, 09:47 AM
Last Post: barneburger
  Selling PineBook PRO with ANSI Keyboard + NVME woodeen 1 61 11-26-2021, 03:34 PM
Last Post: luca22
  2021.10 u-boot broken on emmc clonex10100 2 378 11-21-2021, 06:24 PM
Last Post: PakoSt
  Boot from NVME theboz1@verizon.net 2 285 10-22-2021, 07:58 PM
Last Post: theboz1@verizon.net
  PBP can't boot any OS from SD after reinstall Comoq 1 301 09-28-2021, 06:26 AM
Last Post: tophneal
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 120 119,985 09-11-2021, 02:16 PM
Last Post: calinb
  My pbp is a sleek, black, flat brick, and won't boot from any kind of media rotwang 15 3,878 08-24-2021, 04:25 PM
Last Post: bkenn
  U-Boot, video console, and visual artifacts dsimic 15 3,717 07-28-2021, 09:37 AM
Last Post: dsimic
  boot order straightwalker 6 1,269 07-22-2021, 12:31 AM
Last Post: wdt
Tongue Hello my frend. How to fix my boot problem? carinosa 6 1,375 07-04-2021, 04:01 AM
Last Post: jiyong

Forum Jump:


Users browsing this thread: 2 Guest(s)