Difference between revisions of "RK3036-U-Boot"

From Rockchip open source Document
Jump to: navigation, search
(Created page with " U-Boot Guide = Download U-Boot = == Upstream U-Boot == You can clone the u-boot repository by running: <pre>git clone git://git.denx.de/u-boot.git</pre> Alternatively you...")
 
 
(2 intermediate revisions by the same user not shown)
Line 57: Line 57:
 
</pre>
 
</pre>
  
== &nbsp; ==
+
== Generate Image ==
 
 
== Generate Image: ==
 
 
<pre>tools/mkimage -n rk3036 -T rksd -d spl/u-boot-spl-nodtb.bin  rk3036_idb.img  
 
<pre>tools/mkimage -n rk3036 -T rksd -d spl/u-boot-spl-nodtb.bin  rk3036_idb.img  
 
</pre>
 
</pre>
Line 74: Line 72:
  
 
<small>(Ensure the board is in&nbsp;maskrom mode.&nbsp;[http://opensource.rock-chips.com/wiki_Rockusb#Maskrom_mode maskrom],&nbsp;Not&nbsp;[http://opensource.rock-chips.com/wiki_Rockusb#Miniloader_Rockusb.C2.A0mode rockusb]! )</small>:
 
<small>(Ensure the board is in&nbsp;maskrom mode.&nbsp;[http://opensource.rock-chips.com/wiki_Rockusb#Maskrom_mode maskrom],&nbsp;Not&nbsp;[http://opensource.rock-chips.com/wiki_Rockusb#Miniloader_Rockusb.C2.A0mode rockusb]! )</small>:
<pre>sudo rkdeveloptool db rk3036_loader_v1.07.237.bin
+
<pre>#you can get the rk3036_loader_x.bin from rkbin/rk30/
 +
sudo rkdeveloptool db rk3036_loader_x.bin  
 
sudo rkdeveloptool wl 0x40&nbsp;out/u-boot/rk3036_idb.img</pre>
 
sudo rkdeveloptool wl 0x40&nbsp;out/u-boot/rk3036_idb.img</pre>

Latest revision as of 09:21, 8 December 2017

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