Some searching led me to this post on the pine64 forums for building U-Boot for their rock64 board. I don't use their defconfig file, but this is a RK3399 board and bl31 ought to be the same.
The "where" seems to be to git clone something called "rkbin". Then go into the bin/rk33 directory and look for a bl31 that has been built for the rk3399, and lo and behold I find this:
rk3399_bl31_v1.35.elfWhat I do to aid and abet myself in the future is:
cd u-boot mkdir rkbin cd rkbin cp xyz/rk3399_bl31_v1.35.elf . cp rk3399_bl31_v1.35.elf ../bl31.elfI am pretty sure if I do a "make clean" it will delete my bl31.elf file and I will wonder where to go find it. (At this time it would be in /u1/Projects/Rockchip/rkbin/bin/rk33)
I keep telling myself I will only be building U-boot this one last time, but that is never true, so I add this line near the top of the makefile.
CROSS_COMPILE=aarch64-linux-gnu-And I type "make" and it takes less than 2 minutes to do a full build.
dd if=./idbloader.img of=/dev/sdcard seek=64 dd if=./u-boot.itb of=/dev/sdcard seek=16384For my convenience, I add this entry to the Makefile, down near the end or it preempts the "all" target:
# Added by tjt sdcard: dd if=/dev/zero of=/dev/sdh count=40000 dd if=./idbloader.img of=/dev/sdh seek=64 #dd if=./u-boot.itb of=/dev/sdh seek=16384 syncMuch to my surprise, idbloader.img has appeared in the U-Boot directory.
I try it, and get this:
U-Boot TPL 2022.01-00450-g25711b07ca-dirty (Jan 24 2022 - 22:07:22) sdram_init: DDR3 - 666MHz failed! rk3399_dmc_init DRAM init failed -22 Missing DTBI repeat the experiment, putting only the idbloader.img file on the card and get the same error messages, so I need to figure out how the DTB should be added to that file.
The lines that generate idbloader.img are these:
./tools/mkimage -E -B 0x8 -f u-boot.its -p 0x0 u-boot.itb >/dev/null && cat /dev/null ./tools/mkimage -n "rk3399" -T rksd -d tpl/u-boot-tpl.bin tpl/u-boot-tpl-rockchip.bin cat tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin > idbloader.img
Tom's electronics pages / tom@mmto.org