Updated u-boot to mainline 2021.04 on eMMC

An update on my actions to run mainline u-boot on the n10c. - Success…

[ 79.720461] reboot: Restarting system

U-Boot TPL 2021.04 (Apr 30 2021 - 12:55:51)
Trying to boot from BOOTROM
Returning to boot ROM…

U-Boot SPL 2021.04 (Apr 30 2021 - 12:55:51 +0000)
Trying to boot from MMC2
NOTICE: BL31: v2.4(release):v2.4-467-g2e0e51f42
NOTICE: BL31: Built : 12:34:41, Apr 30 2021

U-Boot 2021.04 (Apr 30 2021 - 12:55:51 +0000)

SoC: Rockchip rk3399
Reset cause: RST
Model: Radxa ROCK Pi N10
DRAM: 3.9 GiB
PMIC: RK8090 (on=0x40, off=0x00)
MMC: mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC… *** Warning - bad CRC, using default environment

stdio_add_devices: Video device failed (ret=-22)
In: serial@ff1a0000
Out: serial@ff1a0000
Err: serial@ff1a0000
Model: Radxa ROCK Pi N10
Net: eth0: ethernet@fe300000
Hit any key to stop autoboot: 0
=>
=>
=> help
? - alias for ‘help’
base - print or set address offset
bdinfo - print Board Info structure
blkcache - block cache diagnostics and control
boot - boot default, i.e., run ‘bootcmd’
bootd - boot default, i.e., run ‘bootcmd’
bootefi - Boots an EFI payload from memory
bootelf - Boot from an ELF image in memory
booti - boot Linux kernel ‘Image’ format from memory
bootm - boot application image from memory
bootp - boot image via network using BOOTP/TFTP protocol
bootvx - Boot vxWorks from an ELF image
bootz - boot Linux zImage image from memory
cmp - memory compare
coninfo - print console devices and information
cp - memory copy
crc32 - checksum calculation
dhcp - boot image via network using DHCP/TFTP protocol
dm - Driver model low level access
echo - echo args to console
editenv - edit environment variable
env - environment handling commands
exit - exit script
ext2load - load binary file from a Ext2 filesystem
ext2ls - list files in a directory (default /)
ext4load - load binary file from a Ext4 filesystem
ext4ls - list files in a directory (default /)
ext4size - determine a file’s size
false - do nothing, unsuccessfully
fastboot - run as a fastboot usb or udp device
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls - list files in a directory (default /)
fatmkdir - create a directory
fatrm - delete a file
fatsize - determine a file’s size
fatwrite - write file into a dos filesystem
fdt - flattened device tree utility commands
fstype - Look up a filesystem type
fstypes - List supported filesystem types
go - start application at address ‘addr’
gpt - GUID Partition Table
gzwrite - unzip and write memory to block device
help - print command description/usage
iminfo - print header information for application image
imxtract - extract a part of a multi-image
itest - return true/false on integer compare
lcdputs - print string on video framebuffer
ln - Create a symbolic link
load - load binary file from a filesystem
loadb - load binary file over serial line (kermit mode)
loads - load S-Record file over serial line
loadx - load binary file over serial line (xmodem mode)
loady - load binary file over serial line (ymodem mode)
loop - infinite loop on address range
ls - list files in a directory (default /)
lzmadec - lzma uncompress a memory region
md - memory display
mdio - MDIO utility commands
mii - MII utility commands
mm - memory modify (auto-incrementing address)
mmc - MMC sub system
mmcinfo - display MMC info
mw - memory write (fill)
nfs - boot image via network using NFS protocol
nm - memory modify (constant address)
nvme - NVM Express sub-system
panic - Panic with optional message
part - disk partition related commands
pci - list and access PCI Configuration Space
ping - send ICMP ECHO_REQUEST to network host
pinmux - show pin-controller muxing
printenv - print environment variables
pxe - commands to get and boot from pxe files
random - fill memory with random pattern
reset - Perform RESET of the CPU
run - run commands in an environment variable
save - save file to a filesystem
saveenv - save environment variables to persistent storage
setcurs - set cursor position within screen
setenv - set environment variables
sf - SPI flash sub-system
showvar - print local hushshell variables
size - determine a file’s size
sleep - delay execution for some time
source - run script from memory
sysboot - command to get and boot from syslinux files
test - minimal test like /bin/sh
tftpboot - boot image via network using TFTP protocol
time - run commands and summarize execution time
true - do nothing, successfully
unlz4 - lz4 uncompress a memory region
unzip - unzip a memory region
usb - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
=>

What I discovered is that now I’m running mainline, pressing space on the serial line actually works to stop boot. This was not the case on the 2017 u-boot.

Steps to do this are using these 2 reference documents:

Start with a Ubuntu 18.04 system

add the extra dev packages

apt-get update
apt-get install flex bison libsdl2-dev libssl-dev u-boot-tools git
apt-get install dtc python python-dev ia32-libs lib32ncurses5 lib32z1 swig xz
apt-get install gcc-arm-none-eabi

Cross Compiler

dir=pwd
get gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz from https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/aarch64-linux-gnu
mkdir toolchain
cd toolchain
tar xf …/gcc-linaro-6.3.1-2017.02-i686_aarch64-linux-gnu.tar.xz
export PATH=${dir}/toolchain/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin:$PATH
export CROSS_COMPILE=aarch64-linux-gnu-

ATF

git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
cd ${dir}/trusted-firmware-a
make distclean
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31

u-boot

get v2021.04.tar.gz from https://github.com/u-boot/u-boot/releases
tar xf v2021.04.tar.gz
export BL31=${dir}/trusted-firmware-a/build/rk3399/release/bl31/bl31.elf
make distclean
make rock-pi-n10-rk3399pro_defconfig
make

there will be a ~9MB file in this directory.
-rw-rw-r-- 1 x x 9309292 Apr 30 12:56 u-boot-rockchip.bin

you will need to follow the instructions - https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html#flashing to flash this to your SD or eMMC.

Happy u-booting

1 Like