blob: ada8ca7f3c15b8d46f07518dfb91f95e66415661 [file] [log] [blame]
Kever Yang8ef48702016-07-19 21:17:01 +08001Introduction
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
Kever Yangcdfae4e2017-12-15 11:15:05 +080021In order to support Arm Trust Firmware(ATF), we can use either SPL or
22miniloader from rockchip to do:
Kever Yang8ef48702016-07-19 21:17:01 +080023* 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
Kever Yangcdfae4e2017-12-15 11:15:05 +080035 > git clone https://github.com/rockchip-linux/rkbin.git
36 > git clone https://github.com/rockchip-linux/rkdeveloptool.git
Kever Yang8ef48702016-07-19 21:17:01 +080037
38Compile the ATF
39===============
40
41 > cd arm-trusted-firmware
42 > make realclean
43 > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
44
Kever Yangcdfae4e2017-12-15 11:15:05 +080045 Or you can get the bl31.elf directly from Rockchip:
46 cp rkbin/rk33/rk3399_bl31_v1.00.elf ../u-boot/bl31.elf
47
48 Get bl31.elf in this step, copy it to U-Boot root dir:
49 > cp bl31.elf ../u-boot/
50
Kever Yang8ef48702016-07-19 21:17:01 +080051Compile the U-Boot
52==================
53
54 > cd ../u-boot
Kever Yangcdfae4e2017-12-15 11:15:05 +080055 > export ARCH=arm64
56 > export CROSS_COMPILE=aarch64-linux-gnu-
57 > make evb-rk3399_defconfig
58 for firefly-rk3399, use below instead:
59 > make firefly-rk3399_defconfig
60 > make
61 > make u-boot.itb
Kever Yang8ef48702016-07-19 21:17:01 +080062
Kever Yangcdfae4e2017-12-15 11:15:05 +080063 Get spl/u-boot-spl.bin and u-boot.itb in this step.
Kever Yang8ef48702016-07-19 21:17:01 +080064
Kever Yangcdfae4e2017-12-15 11:15:05 +080065Compile the rkdeveloptool
66=======================
67 Follow instructions in latest README
Kever Yang8ef48702016-07-19 21:17:01 +080068 > cd ../rkflashtool
Kever Yangcdfae4e2017-12-15 11:15:05 +080069 > autoreconf -i
70 > ./configure
Kever Yang8ef48702016-07-19 21:17:01 +080071 > make
Kever Yangcdfae4e2017-12-15 11:15:05 +080072 > sudo make install
73
74 Get rkdeveloptool in you Host in this step.
75
76Both origin binaries and Tool are ready now, choose either option 1 or
77option 2 to deploy U-Boot.
78
79Package the image
80=================
Kever Yang8ef48702016-07-19 21:17:01 +080081
Kever Yangcdfae4e2017-12-15 11:15:05 +080082Package the image for U-Boot SPL(option 1)
83--------------------------------
Kever Yang8ef48702016-07-19 21:17:01 +080084 > cd ..
Kever Yangcdfae4e2017-12-15 11:15:05 +080085 > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
86
87 Get idbspl.img in this step.
88
89Package the image for Rockchip miniloader(option 2)
90------------------------------------------
91 > cd ..
92 > cp arm-trusted-firmware/build/rk3399/release/bl31.elf rkbin/rk33
Kever Yang8ef48702016-07-19 21:17:01 +080093 > ./rkbin/tools/trust_merger rkbin/tools/RK3399TRUST.ini
94 > ./rkbin/tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img
Kever Yang8ef48702016-07-19 21:17:01 +080095
Kever Yangcdfae4e2017-12-15 11:15:05 +080096 Get trust.img and uboot.img in this step.
97
98Flash the image to eMMC
99=======================
100
101Flash the image with U-Boot SPL(option 1)
102-------------------------------
Kever Yang8ef48702016-07-19 21:17:01 +0800103Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
Kever Yangcdfae4e2017-12-15 11:15:05 +0800104 > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
105 > rkdeveloptool wl 64 u-boot/idbspl.img
106 > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
107 > rkdeveloptool rd
Kever Yang8ef48702016-07-19 21:17:01 +0800108
Kever Yangcdfae4e2017-12-15 11:15:05 +0800109Flash the image with Rockchip miniloader(option 2)
110----------------------------------------
111Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
112 > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
113 > rkdeveloptool ul rkbin/rk33/rk3399_loader_v1.08.106.bin
114 > rkdeveloptool wl 0x4000 u-boot/uboot.img
115 > rkdeveloptool wl 0x6000 u-boot/trust.img
116 > rkdeveloptool rd
Kever Yang8ef48702016-07-19 21:17:01 +0800117
Kever Yangcdfae4e2017-12-15 11:15:05 +0800118You should be able to get U-Boot log in console/UART2(baurdrate 1500000)
119For more detail, please reference to:
120http://opensource.rock-chips.com/wiki_Boot_option