RK3036-U-Boot

From Rockchip open source Document
Revision as of 08:32, 8 December 2017 by Admin (talk | contribs)
Jump to: navigation, search

U-Boot Guide

Download U-Boot

Upstream U-Boot

You can clone the u-boot repository by running:

git clone git://git.denx.de/u-boot.git

Alternatively you can use u-boot-rockchip instead which may with some patches not get in mainline:

git clone git://git.denx.de/u-boot-rockchip.git

 

Rockchip U-Boot

You can clone the u-boot repository by running:

git clone https://github.com/rockchip-linux/u-boot.git

 

Configure U-Boot

First you need to choose a correct defconfig for your board; (defconfig on uboot/configs)

make CROSS_COMPILE=arm-linux-gnueabi- kylin-rk3036_defconfig

You may need to change the U-Boot function/feature support by modify the defconfig file or,

there is also menuconfig to play with settings if you feel like it:

make CROSS_COMPILE=arm-linux-gnueabi- menuconfig

 

Build U-Boot

Get a toolchain

If you haven't done so before, get a suitable toolchain installed and add it to your PATH.

In Ubuntu 16.04, you can use below command to install cross compiler for armv7:

sudo apt-get install gcc-arm-linux-gnueabi

 

Start Build

make CROSS_COMPILE=arm-linux-gnueabi-

In order to support debug in ARM DS-5, you may need add ctags in make command:

CFLAGS='-gdwarf-3'

For trust support, we are using FIT image with 'mkimage' cmd in Makefile and its script defined in defconfig:

make u-boot.itb

 

Generate Image:

tools/mkimage -n rk3036 -T rksd -d spl/u-boot-spl-nodtb.bin  rk3036_idb.img 
cat u-boot.bin >> rk3036_idb.img 
cp rk3036_idb.img  ../out/u-boot/

 

Install U-Boot

Rockchip SoCs's bootrom need special format named IDBlock at special offset 0x40 block for boot, so we need to package SPL(or Rockchip miniloader)  in IDB format.

Rockchip bootrom supports SPL back to bootrom and bootrom load the U-Boot, so the SPL for Rockchip SoCs can option to back to bootrom, usually decided by if the IRAM is enough for driver to load U-Boot. 

(Ensure the board is in maskrom mode. maskrom, Not rockusb! ):

#you can get the rk3036_loader_x.bin from rkbin/rk30/
sudo rkdeveloptool db rk3036_loader_x.bin   
sudo rkdeveloptool wl 0x40 out/u-boot/rk3036_idb.img