1Introduction
2============
3
4RK3399 key features we might use in U-Boot:
5* CPU: ARMv8 64bit Big-Little architecture,
6*      Big: dual-core Cortex-A72
7*      Little: quad-core Cortex-A53
8* IRAM: 200KB
9* DRAM: 4GB-128MB dual-channel
10* eMMC: support eMMC 5.0/5.1, suport HS400, HS200, DDR50
11* SD/MMC: support SD 3.0, MMC 4.51
12* USB: USB3.0 typc-C port *2 with dwc3 controller
13*      USB2.0 EHCI host port *2
14* Display: RGB/HDMI/DP/MIPI/EDP
15
16evb key features:
17* regulator: pwm regulator for CPU B/L
18* PMIC: rk808
19* debug console: UART2
20
21In order to support Arm Trust Firmware(ATF), we need to use the
22miniloader from rockchip which:
23* do DRAM init
24* load and verify ATF image
25* load and verify U-Boot image
26
27Here is the step-by-step to boot to U-Boot on rk3399.
28
29Get the Source and prebuild binary
30==================================
31
32  > mkdir ~/evb_rk3399
33  > cd ~/evb_rk3399
34  > git clone https://github.com/ARM-software/arm-trusted-firmware.git
35  > git clone https://github.com/rockchip-linux/rkbin
36  > git clone https://github.com/rockchip-linux/rkflashtool
37
38Compile the ATF
39===============
40
41  > cd arm-trusted-firmware
42  > make realclean
43  > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
44
45Compile the U-Boot
46==================
47
48  > cd ../u-boot
49  > make CROSS_COMPILE=aarch64-linux-gnu- evb-rk3399_defconfig all
50
51Compile the rkflashtool
52=======================
53
54  > cd ../rkflashtool
55  > make
56
57Package the image for miniloader
58================================
59  > cd ..
60  > cp arm-trusted-firmware/build/rk3399/release/bl31.bin rkbin/rk33
61  > ./rkbin/tools/trust_merger rkbin/tools/RK3399TRUST.ini
62  > ./rkbin/tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img
63  > mkdir image
64  > mv trust.img ./image/
65  > mv uboot.img ./image/rk3399evb-uboot.bin
66
67Flash the image
68===============
69Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
70
71  > ./rkflashtool/rkflashloader rk3399evb
72
73You should be able to get U-Boot log message in console/UART2 now.
74