Shouldn't the SPI flash show in lsblk?

New Rock 5A. Installed a 500 GB SSD NVME, copied into it the contents of the SD card with dd. Everything seems ok.
But if I issue the lsblk command I don’t see the SPI flash memory…

~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk1 179:0 0 29.7G 0 disk
├─mmcblk1p1 179:1 0 16M 0 part /config
└─mmcblk1p2 179:2 0 29.7G 0 part /
zram0 254:0 0 3.9G 0 disk [SWAP]
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 16M 0 part
└─nvme0n1p2 259:2 0 29.7G 0 part

On some page I have read that it should appear as mtdblock* …
Is something broken in my setup ? Thanks.

Fred

Do you have the SPI connected inside the eMMC socket? Have you tried reseating it?

Yes. Removed and reseated. No changes…:unamused:

Fred

Actually, what I would like to do is to flash the SPI module with the boot code that would allow the 5A to boot from the SSD NVME. I have already dd’ed the SD card into the SSD.
Could please somebody detail the steps to do this ?
Thanks.

Fred

If the system doesn’t see the SPI this seems a bit difficult to do. Do you have an eMMC module to test whether the socket isn’t broken? Or maybe the SPI module itself is broken (if the board recognized the eMMC but did not recognize the SPI)?

Tried with an eMMC module. It gets listed as mmcblk0, so the socket is ok.
But now I have a doubt… The reference to mtdblock* was found in a message relating to Rock 5B, not 5A…
Could please somebody with a 5A, and the SPI flash module installed, post here the output of lsblk ?
Thanks.

Fred

To be able to access the SPI flash as mtd device a proper device tree node is needed (on 5B it took weeks for this to be added): https://github.com/radxa/kernel/commit/cb09ad15af757db12fc64c2477a6572aaa4b8095

As such this also a software thing.

Edit: if this is the current kernel branch the OS image you’re using relies on, then it’s missing.

2 Likes

Does that GitHub commit apply only to 5B, or is it valid also for the 5A ?
The OS installed is the Debian downloadable from the Radxa site.

Fred

Only 5B if my assumption above was correct that ‘this is the current kernel branch the OS image you’re using relies on’.

@RadxaYuntian can you please clarify and if that’s the case add the respective DT node for 5A as well?

We plan to move to rkr4.1 release soon but the official release is still on rkr3.4 at the moment.

Go back to the original question. You need to enable the SPI flash overlay within rsetup, otherwise eMMC boot will be broken by default. On RK3588S SPI FC and eMMC are mux’ed together, so this is the only way to maintain compatibility for both.

Wrt the overlay I sent a PR since it starts with a misleading comment

Ah, now I understand. You ship 5A with a SPI module in the eMMC socket that already contains a proper u-boot + config?

A bit sad/scary that none of this stuff seems to be documented. At least I couldn’t find any useful information about 5A at all. But at least the wiki threw me over to https://wiki.radxa.com/Rock/FAQ almost immediately (just in case you’re wondering why people still use rock:rock as logon credentials and so on :wink: )

1 Like

You submitted the PR in your own fork. But I have fixed the comment so don’t worry.

SPI is empty as usual.

Documentation effort has been moved to docs.radxa.com. I still have to fight my own editors for including hot garbage in this new site.

3 Likes

i have the exact same problem…spi is empty/doesnt boot nvme!

Which obviously doesn’t make up for a great user experience.

Have you thought about doing something similiar to RPi Trading Ltd. in the sense of making each different board you design recognizable by the bootloader? The RPi folks use an eFuse or GPIO status or whatever but at least something unique ThreadX (their ‘firmware’ that brings up the hardware) recognizes when booting to be able to load correct kernel and DT.

Wouldn’t it be possible to follow a similar approach using some static GPIO pins on each board to code the specific board+revision so you might end up in a few years with a generic u-boot that can be flashed at the factory to SPI?

As Yuntian explained you need to call rsetup, choose overlays and there “Enable SPI flash”. After a reboot it should be there as an mtd device so you can flash u-boot according to some documentation somewhere (unfortunately Radxa’s documentation efforts are still underwhelming).

I think we are currently using some ADC as board ID, and talked about using EEPROM to record BOM ID.

All sounds great (like shipping working and tested bootloader on SPI) until someone wants to take X amount of time to implement it, then it becomes a low priority item.

This uses system installed u-boot package to update bootloader on various storage locations. The package itself won’t upgrade anything so any bootloader update MUST be a explicit human decision.

This page is only online today to go along with ROCK 3C’s new image, which also see improved SPI boot support.

Could please somebody elaborate about these choices in the Device Tree Configuration menu:

    [ ] Enable spidev on SPI0-M1 over CS0
    [ ] Enable spidev on SPI0-M2 over CS0
    [ ] Enable spidev on SPI4-M2 over CS0

I am attempting to load into the SPI flash the boot code to allow booting from the SSD NVME on my 5A.

Thanks

Fred

Hello the option that you must select is

Enable SPI flash

If it is not showed update your system using sudo apt update and then sudo apt upgrade after that restart your Rock 5A and check if a new device appears when you use the command lsblk

Here is all steps that I follow to boot from NVME on my Rock 5A - 8GB

Thanks. I enabled the SPI flash, then, still using rsetup, made the choice “Update SPI Bootloader”.
rsetup presented me the choice of selecting which bootloader to install, and Rock-5A was the only choice.
I accepted of course that, but this was the output:

1168+0 records in
1168+0 records out
598016 bytes (598 kB, 584 KiB) copied, 0.0759653 s, 7.9 MB/s
2787+0 records in
2787+0 records out
1426944 bytes (1.4 MB, 1.4 MiB) copied, 0.172408 s, 8.3 MB/s
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
libmtd: error!: "/dev/mtdblock0" is not a character device
flash_erase: error!: mtd_get_dev_info failed

What now?

Fred

1 Like

SUCCESS ! Disregard my previous post. Instead of using rsetup to flash the SPI with a new bootloader, I followed the instructions given by MX-Eng here:

That worked, and now my 5A does boot from the NVME SSD.
Thanks to all who gave advice.

Fred