How to build u-boot spi images

Hi, I’ve received my rock5 yesterday and so far I’m very pleased with that little monster.
Currently I’m trying to boot from a intel optane NVMe, which gives a little bit of trouble, but let me recap:
Booting from SD with a modified dtb (for pcie3 2x2) works nice and i can access both SSDs. Booting from SPI however does not work; My guess is that pcie3 is configured for 4x and so the actual data disk is not seen.
So I’ve checked out https://github.com/radxa/u-boot/tree/stable-5.10-rock5 and patched the dts accordingly. After installing the rktools and the cross compiler u-boot builds, but that is where I’m stuck right now. The official SPI image from here https://wiki.radxa.com/Rock5/install/spi

$ file rock-5b-spi-image-g49da44e116d.img
rock-5b-spi-image-g49da44e116d.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,1), end-CHS (0x3ff,254,63), startsector 1, 32767 sectors, extended partition table (last)

does look quite different to what my u-boot looks

$ file uboot.img
uboot.img: Device Tree Blob version 17, size=2560, boot CPU=0, string block size=197, DT structure block size=2000

So the big question now is: how do i get from my custom u-boot image to an image ready to be flashed to SPI?

Any help is much appreciated!
Thanks & best!

1 Like

getting closer:

$ losetup loop0 rock-5b-spi-image-g49da44e116d.img
$ fdisk -l /dev/loop0
Disk /dev/loop0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E42BCB16-3C32-4BF8-8DBE-6E34100702F8

Device Start End Sectors Size Type
/dev/loop0p1 64 7167 7104 3.5M Linux filesystem
/dev/loop0p2 7168 7679 512 256K Linux filesystem
/dev/loop0p3 7680 8063 384 192K Linux filesystem
/dev/loop0p4 8064 8127 64 32K Linux filesystem
/dev/loop0p5 8128 8191 64 32K Linux filesystem
/dev/loop0p6 8192 16383 8192 4M Linux filesystem
/dev/loop0p7 16384 32734 16351 8M Linux filesystem

now i only need to figure what goes where.

Turns out this is well documented here https://wiki.radxa.com/Rock3/install/spi
I have a working SPI image now that detects the other SSD and boots from it.
The Linux on the SSD doesn’t like things so much, but that’s different problem xD
If anyone is interested here is the SPI image https://www.sendspace.com/file/4z3ixl

2 Likes

Looks like the “file” utility is a bit behind on recognizing GPT images.