|
|
Line 1: |
Line 1: |
− |
| |
− | 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 can use u-boot-rockchip instead which may with some patches not get in mainline:
| |
− | <pre>git clone git://git.denx.de/u-boot-rockchip.git</pre>
| |
− |
| |
− |
| |
− |
| |
− | == Rockchip U-Boot ==
| |
− |
| |
− | You can clone the u-boot repository by running:
| |
− | <pre>git clone https://github.com/rockchip-linux/u-boot.git
| |
− | </pre>
| |
− |
| |
− |
| |
− |
| |
− | = Configure U-Boot =
| |
− |
| |
− | First you need to choose a correct defconfig for your board; (defconfig on uboot/configs)
| |
− | <pre>make CROSS_COMPILE=arm-linux-gnueabi- kylin-rk3036_defconfig</pre>
| |
− |
| |
− | 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:
| |
− | <pre>make CROSS_COMPILE=arm-linux-gnueabi- menuconfig</pre>
| |
− |
| |
− |
| |
− |
| |
− | = 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:
| |
− | <pre>sudo apt-get install gcc-arm-linux-gnueabi
| |
− | </pre>
| |
− |
| |
− |
| |
− |
| |
− | == Start Build ==
| |
− | <pre>make CROSS_COMPILE=arm-linux-gnueabi-
| |
− | </pre>
| |
− |
| |
− | In order to support debug in ARM DS-5, you may need add ctags in make command:
| |
− | <pre>CFLAGS='-gdwarf-3'</pre>
| |
− |
| |
− | For trust support, we are using FIT image with 'mkimage' cmd in Makefile and its script defined in defconfig:
| |
− | <pre>make u-boot.itb
| |
− | </pre>
| |
− |
| |
− | == ==
| |
− |
| |
− | == Generate Image: ==
| |
− | <pre>tools/mkimage -n rk3036 -T rksd -d spl/u-boot-spl-nodtb.bin rk3036_idb.img
| |
− | </pre>
| |
− | <pre>cat u-boot.bin >> rk3036_idb.img
| |
− | cp rk3036_idb.img ../out/u-boot/</pre>
| |
− |
| |
− |
| |
− |
| |
− | = 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.
| |
− |
| |
− | <small>(Ensure the board is in maskrom mode. [http://opensource.rock-chips.com/wiki_Rockusb#Maskrom_mode maskrom], Not [http://opensource.rock-chips.com/wiki_Rockusb#Miniloader_Rockusb.C2.A0mode rockusb]! )</small>:
| |
− | <pre>sudo rkdeveloptool db rk3036_loader_v1.07.237.bin
| |
− | sudo rkdeveloptool wl 0x40 out/u-boot/rk3036_idb.img</pre>
| |
| | | |
| | | |