README
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 can use either SPL or
22miniloader from rockchip to do:
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.git
36 > git clone https://github.com/rockchip-linux/rkdeveloptool.git
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 Get bl31.elf in this step, copy it to U-Boot root dir:
45 > cp bl31.elf ../u-boot/
46
47Compile the U-Boot
48==================
49
50 > cd ../u-boot
51 > export ARCH=arm64
52 > export CROSS_COMPILE=aarch64-linux-gnu-
53 > make evb-rk3399_defconfig
54 for firefly-rk3399, use below instead:
55 > make evb-firefly_defconfig
56 > make
57 > make u-boot.itb
58
59 Get spl/u-boot-spl.bin and u-boot.itb in this step.
60
61Compile the rkdeveloptool
62=======================
63 Follow instructions in latest README
64 > cd ../rkdeveloptool
65 > autoreconf -i
66 > ./configure
67 > make
68 > sudo make install
69
70 Get rkdeveloptool in you Host in this step.
71
72Both origin binaries and Tool are ready now, choose either option 1 or
73option 2 to deploy U-Boot.
74
75Package the image
76=================
77
78Package the image for U-Boot SPL(option 1)
79--------------------------------
80 > cd ..
81 > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
82
83 Get idbspl.img in this step.
84
85Package the image for Rockchip miniloader(option 2)
86------------------------------------------
87 > cd ..
88 > cp arm-trusted-firmware/build/rk3399/release/bl31.elf rkbin/rk33
89 > ./rkbin/tools/trust_merger rkbin/tools/RK3399TRUST.ini
90 > ./rkbin/tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img
91
92 Get trust.img and uboot.img in this step.
93
94Flash the image to eMMC
95=======================
96
97Flash the image with U-Boot SPL(option 1)
98-------------------------------
99Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
100 > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
101 > rkdeveloptool wl 64 u-boot/idbspl.img
102 > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
103 > rkdeveloptool rd
104
105Flash the image with Rockchip miniloader(option 2)
106----------------------------------------
107Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
108 > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
109 > rkdeveloptool ul rkbin/rk33/rk3399_loader_v1.08.106.bin
110 > rkdeveloptool wl 0x4000 u-boot/uboot.img
111 > rkdeveloptool wl 0x6000 u-boot/trust.img
112 > rkdeveloptool rd
113
114You should be able to get U-Boot log message in console/UART2 now.
115For more detail, please reference to:
116http://opensource.rock-chips.com/wiki_Boot_option
117