Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

RockpiE/dev/u-boot

< RockpiE‎ | dev
    ROCK Pi E >  Development >  Build U-Boot

Build ROCK Pi E U-Boot

Below is the instructions of how to build U-Boot for ROCK Pi E on a HOST PC.

Get the source code

You need Git to get multiple git repositories to build the image.

Install Git if you don't have it.

sudo apt-get update
sudo apt-get install git

Clone the source code

git clone -b stable-4.4-rockpie https://github.com/radxa/u-boot.git
git clone -b debian https://github.com/radxa/build.git
git clone -b master https://github.com/radxa/rkbin.git

You will get

build  rkbin  u-boot

Directories usage introductions:

  • build:
    • Some script files and configuration files for building u-boot, kernel and rootfs.
  • rkbin:
    • Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).
  • u-boot:
    • u-boot as the second stage bootloader

Install toolchain from Linaro

wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export PATH=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH

Check if Linaro toolchain is the default choice:

which aarch64-linux-gnu-gcc
/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc

Install other build tools

sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools
sudo apt-get install bc python dosfstools

Build u-boot

Need to checkout branch to stable-4.4-rockpie.

Build u-boot with default rock-pi-e-rk3328_defconfig.

./build/mk-uboot.sh rockpie     #For ROCK Pi E

The generated images will be copied to out/u-boot folder

ls out/u-boot/
idbloader.img  rk3328_loader_ddr333_v1.16.250.bin  trust.img  uboot.img

Troubleshooting

Check ROCK Pi E FAQs first, if it doesn't help, start a new post on the forum https://forum.radxa.com/c/rockpie