Compile U-Boot; Compile The Boot Script; Compile The Linux Kernel - Cherry Theobroma Systems PUMA SOM-RK3399-Q7 User Manual

Powerful system-on-module
Hide thumbs Also See for Theobroma Systems PUMA SOM-RK3399-Q7:
Table of Contents

Advertisement

4.5 Compile U-Boot

U-Boot is used as the bootloader on the RK3399-Q7 module.
Download the source code using:
git clone https://git.theobroma-systems.com/puma-u-boot.git
The U-Boot build process uses the files generated in the previous steps Copy the previously generated files rk3399m0.bin
from the Cortex-M0 firmware and bl31.bin from the ATF to the puma-u-boot directory. Recent U-Boot releases expect the
bl31.bin file under the name bl31-rk3399.bin . To support all variants, the file is copied twice:
cp rk3399-cortex-m0/rk3399m0.bin puma-u-boot
cp arm-trusted-firmware/build/rk3399/release/bl31.bin puma-u-boot/bl31.bin
cp arm-trusted-firmware/build/rk3399/release/bl31.bin puma-u-boot/bl31-rk3399.bin
Then you are ready to compile U-Boot:
cd puma-u-boot
export ARCH=arm64
export
CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-
linux-gnu-
make puma-rk3399_defconfig
make -j4
tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin spl_sd.img
tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin spl_spi.img
make u-boot.itb
cd
..
The resulting bootloader consists of three files: spl_sd.img , spl_spi.img and u-boot.itb , but only one of the spl files
is used at a time. The file spl_sd.img is only used when booting from SD-card or eMMC, while spl_spi.img is only used
when booting from SPI NOR flash.

4.6 Compile the Boot Script

The U-Boot boot sequence is controlled by a file called boot.scr . This file is generated from a plain-text file called boot.cmd .
Download the repository and generate boot.scr using:
git clone https://git.theobroma-systems.com/som-tools.git
cd som-tools
make -C boot-script
cd
..

4.7 Compile the Linux Kernel

The kernel source code can be cloned with:
git clone https://git.theobroma-systems.com/puma-linux.git
Compile using:
cd puma-linux
export ARCH=arm64
export
CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin/aarch64-
linux-gnu-
make puma-rk3399_defconfig
make -j4 rockchip/rk3399-puma.dtb Image
PUMA RK3399-Q7 User Manual
© Theobroma Systems Design und Consulting GmbH
v1.7
Page 21

Advertisement

Table of Contents
loading

Table of Contents