[U-Boot] [PATCH 4/4] doc: rockchip: Add global doc for rk3399 build/run

Jagan Teki jagan at amarulasolutions.com
Mon Mar 11 08:20:05 UTC 2019


Since rockchip have an individual doc/README.rockchip, it would
be better to update the same instead of maintaining it separately
in board files.

So, add the documentation for rk3399
- procedure to build
- procedure to boot from SD

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 doc/README.rockchip | 69 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index ec10ebbc26..b8d693bbc9 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -88,8 +88,36 @@ One RV3188 baord is supported:
 
 For example:
 
+1. To build RK3288 board:
+
    CROSS_COMPILE=arm-linux-gnueabi- make O=firefly firefly-rk3288_defconfig all
 
+2. To build RK3399 board:
+
+   (export cross compiler path for aarch64)
+
+   2.1 Compile ATF
+
+       $ git clone https://github.com/ARM-software/arm-trusted-firmware.git
+       $ cd arm-trusted-firmware
+
+       (export cross compiler path for Cortex-M0 MCU likely arm-none-eabi-)
+       $ make realclean
+       $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
+
+       (copy bl31.elf U-Boot root dir)
+       $ cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot
+
+   2.2 Compile U-Boot
+
+       $ cd /path/to/u-boot
+       $ make orangepi-rk3399_defconfig
+       $ make
+       $ make u-boot.itb
+
+       (Get spl/u-boot-spl-dtb.bin, u-boot.itb images and some boards would get
+	spl/u-boot-spl.bin since it doesn't enable CONFIG_SPL_OF_CONTROL)
+
 (or you can use another cross compiler if you prefer)
 
 
@@ -225,6 +253,45 @@ tools/mkimage -n rk3188 -T rksd -d spl/u-boot-spl.bin out
 truncate -s %2048 u-boot.bin
 cat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> out
 
+Booting from an SD card on RK3399
+=================================
+
+To write an image that boots from an SD card (assumed to be /dev/sdc):
+
+1. Prefix rk3399 header to SPL image
+
+   $ cd /path/to/u-boot
+   $ ./tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl-dtb.bin out
+
+2. Write prefixed SPL at 64th sector
+
+   $ sudo dd if=out of=/dev/sdc seek=64
+
+3. Write U-Boot proper at 16384 sector
+
+   $ sudo dd if=u-boot.itb of=/dev/sdc seek=16384
+   $ sync
+
+Put this SD (or micro-SD) card into your board and reset it. You should see
+something like:
+
+U-Boot SPL board init
+Trying to boot from MMC1
+
+
+U-Boot 2019.01-00004-g14db5ee998 (Mar 11 2019 - 13:18:41 +0530)
+
+Model: Orange Pi RK3399 Board
+DRAM:  2 GiB
+MMC:   dwmmc at fe310000: 2, dwmmc at fe320000: 1, sdhci at fe330000: 0
+Loading Environment from MMC... OK
+In:    serial at ff1a0000
+Out:   serial at ff1a0000
+Err:   serial at ff1a0000
+Model: Orange Pi RK3399 Board
+Net:   eth0: ethernet at fe300000
+Hit any key to stop autoboot:  0
+=>
 
 Using fastboot on rk3288
 ========================
@@ -385,5 +452,7 @@ There are some documents about partitions in the links below.
 http://rockchip.wikidot.com/partitions
 
 --
+Jagan Teki <jagan at amarulasolutions.com>
+11 Mar 2019
 Simon Glass <sjg at chromium.org>
 24 June 2015
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list