linux-build: Mainline u-boot problem: focal-minimal-rock64-0.10.12-1184-arm64 fails to boot on 1GB Rock64 v2.0

This seems to be more of a bug in the mainline u-boot portion, but there doesn’t seem to be an issue tracker on that repo.

I get the following on serial console when I attempt to boot:

U-Boot TPL 2020.01-ayufan-2013-gdb96b24f (Apr 13 2020 - 08:43:36)
data training error
col error
data training error
LPDDR3, 800MHz
BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB

It hangs there forever. Note that it says 4GB of memory and 800 MHz, there, but this is a 1GB model. Related?

For reference, here’s the bootloader portion of the latest stable build, which boots fine. Notice it shows 786 MHz and 1GB, not 800 MHz and 4GB. I’m guessing this is the root of the problem, but I’m not familiar enough with u-boot to troubleshoot further.

DDR version 1.13 20180428
ID:0x805 Y
In
LPDDR3
786MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=32 Size=1024MB
ddrconfig:1
OUT

U-Boot SPL 2017.09-rockchip-ayufan-1065-g95f6152134 (Aug 26 2019 - 12:40:32)
board_init_sdmmc_pwr_en
setup_ddr_param  1
booted from SD
Trying to boot from MMC2
NOTICE:  BL31: v1.3(debug):9d3f591
NOTICE:  BL31: Built : 14:39:02, Jan 17 2018
NOTICE:  BL31:Rockchip release version: v1.3
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
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


U-Boot 2017.09-rockchip-ayufan-1065-g95f6152134 (Aug 26 2019 - 12:41:04 +0000)

Model: Pine64 Rock64
DRAM:  1022 MiB
MMC:   rksdmmc@ff520000: 0, rksdmmc@ff500000: 1
SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial@ff130000
Out:   serial@ff130000
Err:   serial@ff130000
Model: Pine64 Rock64
misc_init_r
cpuid=55524b50303930343200000000021c29
serial=9935ded23386afc
Net:   eth0: ethernet@ff540000
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
mmc_init: -95, time 10
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:7...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
1055 bytes read in 21 ms (48.8 KiB/s)
select kernel
1:      kernel-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
2:      kernel-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310-memtest
Enter choice: 1:        kernel-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
Retrieving file: /boot/initrd.img-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
6335322 bytes read in 309 ms (19.6 MiB/s)
Retrieving file: /boot/vmlinuz-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
20545544 bytes read in 953 ms (20.6 MiB/s)
append: rw panic=10 init=/sbin/init coherent_pool=1M ethaddr=ba:53:8f:68:92:c4 eth1addr=ba:53:8f:68:92:e4 serial=9935ded23386afc cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 root=LABEL=linux-root rootwait rootfstype=ext4
Retrieving file: /boot/dtbs/4.4.190-1233-rockchip-ayufan-gd3f1be0ed310/rockchip/rk3328-rock64.dtb
73636 bytes read in 89 ms (807.6 KiB/s)
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
   Loading Ramdisk to 3d8f7000, end 3df01b5a ... OK
   Loading Device Tree to 000000003d8e2000, end 000000003d8f6fa3 ... OK

Starting kernel ...

About this issue

Most upvoted comments

U-Boot TPL 2022.04-armbian (Jul 01 2022 - 15:56:43)
data training error
col error
data training error
LPDDR3, 800MHz
BW=16 Col=12 Bk=8 CS0 Row=16 CS=1 Die BW=8 Size=4096MB

A bit unrelated, but I compiled a U-Boot tagged v2022.04 with Armbian’s build system yesterday and it looks like they haven’t fixed it in about two years or so? 😦 (I’m using a RK3328+1G DDR3 motherboard) Edit: Seems like it’s because the old version used the rk ddr blob and the mainline won’t try another memory version?