Jump to content
  • 0

Booting ROCK Pi 4(A/B/C) with mainline u-boot in SPI, NVMe and Armbian v20.11.x


piter75
 Share

Question

With Armbian v20.11 one can write mainline u-boot image to board's SPI and enjoy booting nvme drives without any mmc devices.

Prerequisities: ROCK Pi 4(A/B/C) v1.4 or 1.3 with SPI soldered in (v1.3 comes without SPI flash from the factory).

 

  1. If you already have Radxa's u-boot written to SPI you need to short pins 23 and 25 for Armbian to boot
  2. Boot fresh image of Armbian v20.11.x for ROCK Pi 4(A/B/C)
  3. Add the following lines to /boot/armbianEnv.txt
    • overlays=spi-jedec-nor
    • param_spinor_spi_bus=1
  4. Reboot
  5. If you shorted 23-25 pins in 1.) then:
    • disconnect them after the ROCK Pi 4 fully boot's 
    • enable spi-nor by executing (as root):
      echo spi1.0 > /sys/bus/spi/drivers/spi-nor/bind
    • verify that the SPI mtd interface is enabled by running
      ls /dev/mtdblock0
    • if the last command does not list any file then something went wrong between 3.) and 5.)
  6. Run nand-sata-install
    • choose option: "Boot from SPI - system on SATA, USB or NVMe"
    • choose NVMe partition, eg. /dev/nvme0n1p1
    • accept erasing of the choosen partition with "Yes"
    • choose fs type (tested with ext4)
    • wait a few minutes for rootfs transfer to chosen partition
    • choose writing SPI bootloader with "Yes"
    • confirm that you want to flash it with "Yes"
    • wait ~60 seconds for writing
    • choose Exit
  7. Reboot
  8. Enjoy Armbian booting with SPI / NVMe

 

Why bother with mainline u-boot?

It is known to boot some NVMe drives that legacy u-boot from Radxa has issues with, eg. SAMSUNG 970 EVO Plus and SAMSUNG PM981.

This does not mean that all NVMe drives are supported, YMMV.

 

Which NVMe drives are known to be working?

Corsair MP510 240GB/480GB/960GB

Gigabyte SSD M.2 2280 PCIe x2 Model:GP-GSM2NE8128GNTD

HP SSD EX900 M.2 NVMe 120GB. Model: 2YY42AA#ABB
Intel SSD 660p Model:SSDPEKNW512GB
Kingston A1000 SSD 240GB (PHISON PS5008-E8-10)

Kingston A2000 M.2 2280 PCIe NVMe

PNY 250GB XLR8 CS3030 M.2 NVMe SSD PCIe Gen3 x4

Sabrent Rocket 256GB NVMe PCIe M.2 2280

Samsung 970 EVO Plus SSD 250GB M.2 2280, PCIe 3.0 x4, NVMe, 3500/2300 MB/s

Samsung PM981 256GB

XPG SX6000 Lite 128GB (ASX6000LNP-128GT-C)

 

Why not using Radxa's u-boot SPI image?

Ambian's u-boot configuration is incompatible with Radxa's SPI image :(

 

Why Armbian is using u-boot that is incompatible with Radxa's?

It uses mainline u-boot with Open Source TPL/SPL/proper and BL31 from Rockchip packaged into u-boot and we may switch to using open source ATF instead of the BL31 in the future.

 

Can I boot Radxa's images with Armbian's u-boot written to SPI?

Yes. Armbian's SPI u-boot is compatible with Radxa's images available here: https://github.com/radxa/rock-pi-images-released/releases

It may not be compatible with some older images (released before July 2020) because of the device tree filename change.

Link to comment
Share on other sites

Recommended Posts

  • 0
11 minutes ago, lanefu said:

Hmm. when I doubt just blame


Haha. Well, it's possible that its my fault. I tend to enforce cleaning activities to save some space. If we need focal image(s) for those boards, someone just add them (best is that person that needs it send a PR) and ping me for remake.

Link to comment
Share on other sites

Order Armbian Linux merch!

  • 0
11 minutes ago, Igor said:

I tend to enforce cleaning activities to save some space

+1 We need to do that from time to time.

 

9 minutes ago, Igor said:

If we need focal image(s) for those boards, someone just add them

I am not particularly missing them ;p

Link to comment
Share on other sites

  • 0
Am 9.3.2021 um 20:51 schrieb madmailman:

Never-mind! It seems to be a problem with the Focal (4.4.y) image. I downloaded the Focal (5.10.y) image and it's worked as described. Which also means that the XPG SX6000 Lite 128GB PCIe 3D NAND PCIe Gen3x4 M.2 2280 NVMe (ASX6000LNP-128GT-C) works well with this setup. Its a cheap and cheerful NVME purchased from Amazon.

 

Now I just need to get nfs server working to share data between my Macs and other servers (ubuntu and Raspbian). I've found a few hundred tutorials and they are all just a little different and so far none have worked. :-/

 

Thanks for the great work on this!

 

 

i have the same when i use a 4.4.y Image after adding the line "param_spinor_spi_bus=1" and reboot -> Kernel Crash

i tried two different 4.4.y Images instead of the 5.10.x because of the behaviour with the reboot Problem booting from nvme

Link to comment
Share on other sites

  • 0

Hi,

 

can you add an additional SPI NOR Flash chip, please? I have a 32MBit MX25L25645 SPI Nor flash.

 

Boot log:

 

U-Boot 2020.10-armbian (May 06 2021 - 19:22:15 +0000)

SoC: Rockchip rk3399
Reset cause: POR
Model: Radxa ROCK Pi 4B
DRAM:  3.9 GiB
PMIC:  RK808
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from SPIFlash... unrecognized JEDEC id bytes: c2, 20, 19
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

 

PS: Maybe it's also not such a good idea to white-list individual Flash chips, since this breaks users' setup by default when there is no real reason to do so. Imho it is a better idea to blacklist chips, if they are known to not work.

 

Thanks and best regards!

Link to comment
Share on other sites

  • 0

My friends Rockpi4 has lost audio output, it got less and less and then it was gone. Still warranty, Allnet reacted PERFECTLY, sent replacement within days.

I am the one to install it. Easy job, same computer, fully installed M.2 HD. So I thought...

When I ran Nand-Sata-install it asked me if I am ok with formatting the HD, I said of course NO - and got thrown out.

So I had to swallow it and do it all  again, keyboard-layout, editor, his software, bring in the backup of data (lots of music) etc.

 

Can't it accept a NO and still do it's job i.e. write to SPI?

Is this a valid suggestion?

Link to comment
Share on other sites

  • 0
On 8/15/2021 at 11:13 PM, Joaho said:

Can't it accept a NO and still do it's job i.e. write to SPI?

Is this a valid suggestion?

You have probably used the option "Boot from SPI - system on SATA, USB or NVMe" which transfers the current system to SSD and needs to clean it.

There is another option - better suited for your case - "Install/Update the bootloader to SPI Flash". It does not touch the existing partitions only writes to SPI Flash.

Link to comment
Share on other sites

  • 0
On 11/30/2020 at 3:53 AM, piter75 said:
 

With Armbian v20.11 one can write mainline u-boot image to board's SPI and enjoy booting nvme drives without any mmc devices.

Prerequisities: ROCK Pi 4(A/B/C) v1.4 or 1.3 with SPI soldered in (v1.3 comes without SPI flash from the factory).

 

  1. If you already have Radxa's u-boot written to SPI you need to short pins 23 and 25 for Armbian to boot
  2. Boot fresh image of Armbian v20.11.x for ROCK Pi 4(A/B/C)
  3. Add the following lines to /boot/armbianEnv.txt
    • overlays=spi-jedec-nor
    • param_spinor_spi_bus=1
  4. Reboot
  5. If you shorted 23-25 pins in 1.) then:
    • disconnect them after the ROCK Pi 4 fully boot's 
    • enable spi-nor by executing (as root):
      echo spi1.0 > /sys/bus/spi/drivers/spi-nor/bind
    • verify that the SPI mtd interface is enabled by running
      ls /dev/mtdblock0
    • if the last command does not list any file then something went wrong between 3.) and 5.)
  6. Run nand-sata-install
    • choose option: "Boot from SPI - system on SATA, USB or NVMe"
    • choose NVMe partition, eg. /dev/nvme0n1p1
    • accept erasing of the choosen partition with "Yes"
    • choose fs type (tested with ext4)
    • wait a few minutes for rootfs transfer to chosen partition
    • choose writing SPI bootloader with "Yes"
    • confirm that you want to flash it with "Yes"
    • wait ~60 seconds for writing
    • choose Exit
  7. Reboot
  8. Enjoy Armbian booting with SPI / NVMe

 

Why bother with mainline u-boot?

It is known to boot some NVMe drives that legacy u-boot from Radxa has issues with, eg. SAMSUNG 970 EVO Plus and SAMSUNG PM981.

This does not mean that all NVMe drives are supported, YMMV.

 

Which NVMe drives are known to be working?

Corsair MP510 240GB/480GB/960GB

Gigabyte SSD M.2 2280 PCIe x2 Model:GP-GSM2NE8128GNTD

HP SSD EX900 M.2 NVMe 120GB. Model: 2YY42AA#ABB
Intel SSD 660p Model:SSDPEKNW512GB
Kingston A1000 SSD 240GB (PHISON PS5008-E8-10)

Kingston A2000 M.2 2280 PCIe NVMe

PNY 250GB XLR8 CS3030 M.2 NVMe SSD PCIe Gen3 x4

Sabrent Rocket 256GB NVMe PCIe M.2 2280

Samsung 970 EVO Plus SSD 250GB M.2 2280, PCIe 3.0 x4, NVMe, 3500/2300 MB/s

Samsung PM981 256GB

XPG SX6000 Lite 128GB (ASX6000LNP-128GT-C)

 

 

 

Two questions:

1. In addition to the above NVME SSDs, how do I know whether other NVME SSD, say ADATA XPG SX8200 Pro 256GB, can  be used ?

2. Does the above steps still work for Armbian v21.08 ?

Thanks

Link to comment
Share on other sites

  • 0
On 9/11/2021 at 6:31 AM, wureka said:

In addition to the above NVME SSDs, how do I know whether other NVME SSD, say ADATA XPG SX8200 Pro 256GB, can  be used ?

 

If this device is not along known to work ones, nobody knows until its plugged. None of those vendors (Radxa / Adata) are supporting us, so we don't have devices you are asking about in the lab. Also even hardware would be on the table, who will cover the time for testing? I don't need to know this to waste my precious time ...

 

On 9/11/2021 at 6:31 AM, wureka said:

Does the above steps still work for Armbian v21.08 ?


No idea. There is almost no interest from community to improve testings which means we can only run basic testing and what you are asking is certainly not. It would require manual testing, which is simply too expensive if we pay everything. For you and the vendor of your choice.
 

Download and test. I would need to do the same. Then report. It might help someone.

Link to comment
Share on other sites

  • 0


Hi.
Thanks for this guide.
I tried it with Armbian 21.08.1 and can confirm that Patriot Scorch M2 PS256GPM280SSDR (PCIe Gen3 x2) works well.
I always get the warning message:

*** Warning - bad CRC, using default environment


But I can boot my Rock Pi only from the 1-st partition.
In case of installing Armbian to the non 1-st NVME partiotion i get 'Filed to load ...' errors.
2.thumb.jpeg.d0496f6940fc32895fc69d2150daf2ef.jpeg

Link to comment
Share on other sites

  • 0

Since Armbian no longer provides precompiled image I have to build my own image with the following command `/compile.sh docker BOARD=rockpi-4b BRANCH=current RELEASE=bullseye BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no`.

 

I then flashed this image to a microSD card and was hoping to update my U-Boot on SPI. Instead I got the following message once I updated SPI with `nand-sata-install`:

Quote

U-Boot TPL 2021.07-armbian (Feb 25 2022 - 06:35:14)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2021.07-armbian (Feb 25 2022 - 06:35:14 +0000)
Trying to boot from SPI

The system stuck on the last line. I then tried to `dpkg -i linux-u-boot-current-rockpi-4b_21.08.1_arm64.deb` and reinstalled SPI bootloader. This actually get me a little bit further:

Quote

U-Boot TPL 2020.10-armbian (Aug 08 2021 - 18:04:03)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.10-armbian (Aug 08 2021 - 18:04:03 +0200)
Trying to boot from SPI
NOTICE:  BL31: v1.3(debug):42583b6
NOTICE:  BL31: Built : 07:55:13, Oct 15 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    If lpddr4 need support multi frequency,
INFO:    please update loader!
INFO:    Current ctl index[0] freq=400MHz
INFO:    Current ctl index[1] freq=800MHz
INFO:    plat_rockchip_pmu_init(1190): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9

Then the system also stops here.

 

Hopefully this can be fixed soon.

Link to comment
Share on other sites

  • 0
11 hours ago, Excalibur said:

Hopefully this can be fixed soon.

The truth is I did not test the SPI booting lately. Will give it a shot as soon as I find some spare time.

 

4 hours ago, mo123 said:

How do you build Armbian for RK3399, RockPi4 with edge 5.15/16 kernel instead of current that is 5.10?

It's not merged into master yet: https://github.com/armbian/build/pull/3489

Link to comment
Share on other sites

  • 0
On 11/29/2020 at 8:53 PM, piter75 said:
 

With Armbian v20.11 one can write mainline u-boot image to board's SPI and enjoy booting nvme drives without any mmc devices.

Prerequisities: ROCK Pi 4(A/B/C) v1.4 or 1.3 with SPI soldered in (v1.3 comes without SPI flash from the factory).

 

  1. If you already have Radxa's u-boot written to SPI you need to short pins 23 and 25 for Armbian to boot
  2. Boot fresh image of Armbian v20.11.x for ROCK Pi 4(A/B/C)
  3. Add the following lines to /boot/armbianEnv.txt
    • overlays=spi-jedec-nor
    • param_spinor_spi_bus=1
  4. Reboot
  5. If you shorted 23-25 pins in 1.) then:
    • disconnect them after the ROCK Pi 4 fully boot's 
    • enable spi-nor by executing (as root):
      echo spi1.0 > /sys/bus/spi/drivers/spi-nor/bind
    • verify that the SPI mtd interface is enabled by running
      ls /dev/mtdblock0
    • if the last command does not list any file then something went wrong between 3.) and 5.)
  6. Run nand-sata-install
    • choose option: "Boot from SPI - system on SATA, USB or NVMe"
    • choose NVMe partition, eg. /dev/nvme0n1p1
    • accept erasing of the choosen partition with "Yes"
    • choose fs type (tested with ext4)
    • wait a few minutes for rootfs transfer to chosen partition
    • choose writing SPI bootloader with "Yes"
    • confirm that you want to flash it with "Yes"
    • wait ~60 seconds for writing
    • choose Exit
  7. Reboot
  8. Enjoy Armbian booting with SPI / NVMe

 

Why bother with mainline u-boot?

It is known to boot some NVMe drives that legacy u-boot from Radxa has issues with, eg. SAMSUNG 970 EVO Plus and SAMSUNG PM981.

This does not mean that all NVMe drives are supported, YMMV.

 

Which NVMe drives are known to be working?

Corsair MP510 240GB/480GB/960GB

Gigabyte SSD M.2 2280 PCIe x2 Model:GP-GSM2NE8128GNTD

HP SSD EX900 M.2 NVMe 120GB. Model: 2YY42AA#ABB
Intel SSD 660p Model:SSDPEKNW512GB
Kingston A1000 SSD 240GB (PHISON PS5008-E8-10)

Kingston A2000 M.2 2280 PCIe NVMe

PNY 250GB XLR8 CS3030 M.2 NVMe SSD PCIe Gen3 x4

Sabrent Rocket 256GB NVMe PCIe M.2 2280

Samsung 970 EVO Plus SSD 250GB M.2 2280, PCIe 3.0 x4, NVMe, 3500/2300 MB/s

Samsung PM981 256GB

XPG SX6000 Lite 128GB (ASX6000LNP-128GT-C)

 

Why not using Radxa's u-boot SPI image?

Ambian's u-boot configuration is incompatible with Radxa's SPI image :(

 

Why Armbian is using u-boot that is incompatible with Radxa's?

It uses mainline u-boot with Open Source TPL/SPL/proper and BL31 from Rockchip packaged into u-boot and we may switch to using open source ATF instead of the BL31 in the future.

 

Can I boot Radxa's images with Armbian's u-boot written to SPI?

Yes. Armbian's SPI u-boot is compatible with Radxa's images available here: https://github.com/radxa/rock-pi-images-released/releases

It may not be compatible with some older images (released before July 2020) because of the device tree filename change.

 

 

Sorry for stupid question,

"Boot fresh image of Armbian v20.11.x for ROCK Pi 4(A/B/C)"

Where to find a fresh image of armbian for rocckpi 4B+ ????

 

I tried the download page on the armbian web site => not found (i can't see the image for Rockpi 4B, there is only Rockpi 4A)

I tried to build a custom image on ubuntu 20.04 from https://github.com/armbian/build

It does not work.

Running sudo ./compile.sh  having rockpi4B selected from the menu return the following error:

[ error ] ERROR in function download_and_verify [ main.sh:589 -> main.sh:434 -> general.sh:1545 -> general.sh:1788 -> general.sh:0 ]
[ error ] verification failed
[ o.k. ] Process terminated

 

Running sudo ./compile.sh docker return the following errors:

W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/sh -c apt-get update && apt-get -y install        joe        software-properties-common        gnupg        gnupg1        gpgv1        curl     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

 

 

What can I do?

 

 

 

 

 

 

Link to comment
Share on other sites

  • 0
34 minutes ago, camelator said:

Thank you for your answer,

so there is no other way to get armbian for rockpi 4B? I have to change my OS and compile the image by myself?

 

It is. Try here: https://armbian.systemonachip.net/archive/ but also get a bit more familiar with a build system. 

Official fresh images when someone takes responsibility for https://docs.armbian.com/Release_Board-Maintainers/ those boards. Until then ...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...