Mainline U-Boot works with LPDDR4 patch series

Final update: all the required support is now in mainline u-boot, including the device trees from Nick @numbqq . Build and install with

git clone https://gitlab.denx.de/u-boot/u-boot.git
cd u-boot
git clone https://github.com/ARM-software/arm-trusted-firmware.git atf
make -C atf CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
cp atf/build/rk3399/release/bl31/bl31.elf bl31.elf
make khadas-edge-rk3399_defconfig
make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl-dtb.bin tpl-spl.img
cat spl/u-boot-spl-dtb.bin >>tpl-spl.img
dd if=tpl-spl.img of=/dev/mmcblk0 seek=64 conv=fsync
dd if=u-boot.itb of=/dev/mmcblk0 seek=16384 conv=fsync

Here’s a log of completely unpatched, mainline u-boot successfully booting an Edge from uSD:

U-Boot TPL 2019.10-rc1-00159-g163bc1e4da (Aug 10 2019 - 14:44:38)
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2019.10-rc1-00159-g163bc1e4da (Aug 10 2019 - 14:44:38 +0100)
Trying to boot from MMC1


U-Boot 2019.10-rc1-00159-g163bc1e4da (Aug 10 2019 - 14:44:38 +0100)

Model: Khadas Edge
DRAM:  3.9 GiB
Cannot find regulator pwm init_voltage
MMC:   dwmmc@fe310000: 2, dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Model: Khadas Edge
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
182 bytes read in 9 ms (19.5 KiB/s)
1:      Linux
Retrieving file: /boot/Image
17600520 bytes read in 748 ms (22.4 MiB/s)
append: root=179:1 rw console=uart8250,mmio32,0xff1a0000 init=/bin/bash
Retrieving file: /boot/rk3399-khadas-edge.dtb
55654 bytes read in 10 ms (5.3 MiB/s)
## Flattened Device Tree blob at 01f00000
   Booting using the fdt blob at 0x1f00000
   Loading Device Tree to 00000000f5f14000, end 00000000f5f24965 ... OK

Starting kernel ...

[    1.332916] rockchip-drm display-subsystem: failed to bind ff940000.hdmi (ops dw_hdmi_rockchip_ops): -517
[    1.342949] rk_gmac-dwmac fe300000.ethernet: phy regulator is not available yet, deferred probing
[    1.649012] rk_gmac-dwmac fe300000.ethernet: cannot get clock clk_mac_speed
bash: cannot set terminal process group (-1): Not a tty
bash: no job control in this shell
bash-4.4# 

Only remaining issue is that there may still be a problem with the 2GB Edge boards — presumably a slightly different lpddr4 configuration to the 4GB models?

1 Like