U-boot not working

I’m building u-boot and the first stage loader as per the instructions on the wiki :
https://wiki.radxa.com/Rock3/dev/Debian#Build_u-boot

When I write the generated idbloader.img and u-boot.itb files to the SDCard, they don’t boot.
I have validated that the idbloader.img is not the issue by writing it to the SDCard of the supplied debian image.

It seems that the uboot image building method from the wiki doesn’t work. Please advise how to make it work.

Here is the output of the u-boot from the repo from the wiki :
U-Boot SPL board init
U-Boot SPL 2017.09-gf95bc56c33-210525 #flatmax (Dec 06 2021 - 14:57:58)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
## Verified-boot: 0
## Checking uboot 0x00a00000 … sha256+ OK
## Checking fdt 0x00b231c8 … sha256+ OK

Here is the output from uboot as supplied in the debian image :
U-Boot SPL board init
U-Boot SPL 2017.09-gf95bc56c33d-210525 #stephen (Nov 11 2021 - 00:43:56)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
## Verified-boot: 0
## Checking atf-1 0x00040000 … sha256+ OK
## Checking uboot 0x00a00000 … sha256+ OK
## Checking fdt 0x00b240c0 … sha256+ OK
## Checking atf-2 0xfdcc9000 … sha256+ OK
## Checking atf-3 0xfdcd0000 … sha256+ OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 216.545 ms

I have found a hack for the time being. I have copied the boot loaders from the debian SDCARD image like so :
dd if=/dev/sdc of=/tmp/idbloader.img skip=64 count=16320 bs=512
dd if=/dev/sdc of=/tmp/uboot.img skip=16384 count=8192 bs=512
dd if=/dev/sdc of=/tmp/trust.img skip=24576 count=8192 bs=512

But this really needs to be fixed in the build system you provide. Once that is done I will be updating the buildroot.rockchip builder for your board.

For ROCK 3A U-Boot.
We need two files, idbloader.img and u-boot.itb.
You can find them in out/u-boot directory.

ls out/u-boot/
idbloader.img  rk356x_spl_loader_ddr1056_v1.06.110.bin  spi  u-boot.itb

You can use these two commands to write u-boot image to SD card, which would lead you to u-boot shell.

sudo dd if=./idbloader.img of=/dev/sdc bs=512 seek=64
sudo dd if=./u-boot.itb of=/dev/sdc bs=512 seek=16384

By the way, the latest u-boot commit is https://github.com/radxa/u-boot/commit/fd3d0a5310494dcbba510406e1e2d66806c1b901.

For the partition, see https://wiki.radxa.com/Rock3/partitions

Have you tried to build and boot from the rockhip-bsp ? It didn’t work for me. For example, the uboot outputs don’t seem to load as indicated above and also the debian base image doesn’t build.

The u-boot.img is generated using these buildroot configure commands : https://github.com/flatmax/buildroot.rockchip/blob/master/configs/rock3a_defconfig#L30-L52

How do we generate idbloader.img for the rock 3a ? This isn’t clear.

See https://github.com/radxa/build/blob/debian/mk-uboot.sh line 335.

./tools/mkimage -n rk356x -T rksd -d ../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.06.bin:spl/u-boot-spl.bin idbloader.img

I cloned and rebuilt u-boot fd3d0a5310494dcbba510406e1e2d66806c1b901
I got the output files :
$ ls -l idbloader.img u-boot.img
-rw-rw-r-- 1 flatmax flatmax 292864 Dec 8 15:12 idbloader.img
-rw-rw-r-- 1 flatmax flatmax 1288192 Dec 8 15:12 u-boot.img

I wrote to the sdcard in the same way which gave me a bootable SDCard with the ripped files from the debian release. It still doesn’t boot :
U-Boot SPL board init
U-Boot SPL 2017.09-gfd3d0a5310-210525 #flatmax (Dec 08 2021 - 15:12:04)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
## Verified-boot: 0
## Checking firmware@1 0x00a00000 … OK
## Checking fdt@1 0x00b23ac0 … OK

OK I got it now.
The files are output to :
$ ls -l out/u-boot/idbloader.img out/u-boot/u-boot.itb
-rw-rw-r-- 1 flatmax flatmax 292864 Dec 8 15:12 out/u-boot/idbloader.img
-rw-rw-r-- 1 flatmax flatmax 1398784 Dec 8 15:12 out/u-boot/u-boot.itb

When I write those to disk, uboot loads as expected.
Thank you for your support.

Matt

1 Like