blob: 144cb98ef9416c2d5bf79e35e704886e666cb747 [file] [log] [blame]
Jagan Tekid0a440c2020-01-10 00:16:22 +05301.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
3
4ROCKCHIP
5========
6
7About this
8----------
9
10This document describes the information about Rockchip supported boards
11and it's usage steps.
12
13Rockchip boards
14---------------
15
16Rockchip is SoC solutions provider for tablets & PCs, streaming media
17TV boxes, AI audio & vision, IoT hardware.
18
Johan Jonker5bf651e2021-08-20 19:27:59 +020019A wide range of Rockchip SoCs with associated boards are supported in
Jagan Tekid0a440c2020-01-10 00:16:22 +053020mainline U-Boot.
21
Johan Jonker5bf651e2021-08-20 19:27:59 +020022List of mainline supported Rockchip boards:
Jagan Tekid0a440c2020-01-10 00:16:22 +053023
Walter Lozanocddcd972020-05-22 11:14:56 -030024* rk3036
25 - Rockchip Evb-RK3036 (evb-rk3036)
26 - Kylin (kylin_rk3036)
27* rk3128
28 - Rockchip Evb-RK3128 (evb-rk3128)
Johan Jonkere8a74732021-08-20 19:27:58 +020029* rk3188
30 - Radxa Rock (rock)
Walter Lozanocddcd972020-05-22 11:14:56 -030031* rk3229
32 - Rockchip Evb-RK3229 (evb-rk3229)
Jagan Tekid0a440c2020-01-10 00:16:22 +053033* rk3288
Walter Lozanocb17ffd2020-05-22 11:14:55 -030034 - Rockchip Evb-RK3288 (evb-rk3288)
35 - Firefly-RK3288 (firefly-rk3288)
36 - MQmaker MiQi (miqi-rk3288)
37 - Phytec RK3288 PCM-947 (phycore-rk3288)
38 - PopMetal-RK3288 (popmetal-rk3288)
39 - Radxa Rock 2 Square (rock2)
40 - Tinker-RK3288 (tinker-rk3288)
41 - Google Jerry (chromebook_jerry)
42 - Google Mickey (chromebook_mickey)
43 - Google Minnie (chromebook_minnie)
44 - Google Speedy (chromebook_speedy)
45 - Amarula Vyasa-RK3288 (vyasa-rk3288)
Walter Lozanocddcd972020-05-22 11:14:56 -030046* rk3308
47 - Rockchip Evb-RK3308 (evb-rk3308)
48 - Roc-cc-RK3308 (roc-cc-rk3308)
Jagan Tekid0a440c2020-01-10 00:16:22 +053049* rk3328
Walter Lozanocb17ffd2020-05-22 11:14:55 -030050 - Rockchip Evb-RK3328 (evb-rk3328)
51 - Pine64 Rock64 (rock64-rk3328)
Walter Lozanocddcd972020-05-22 11:14:56 -030052 - Firefly-RK3328 (roc-cc-rk3328)
b.l.huanga2793c42020-06-01 00:02:11 +080053 - Radxa Rockpi E (rock-pi-e-rk3328)
Jagan Tekid0a440c2020-01-10 00:16:22 +053054* rk3368
Walter Lozanocb17ffd2020-05-22 11:14:55 -030055 - GeekBox (geekbox)
56 - PX5 EVB (evb-px5)
57 - Rockchip Sheep (sheep-rk3368)
58 - Theobroma Systems RK3368-uQ7 SoM - Lion (lion-rk3368)
Jagan Tekid0a440c2020-01-10 00:16:22 +053059* rk3399
Walter Lozanocb17ffd2020-05-22 11:14:55 -030060 - 96boards RK3399 Ficus (ficus-rk3399)
61 - 96boards Rock960 (rock960-rk3399)
62 - Firefly-RK3399 (firefly_rk3399)
63 - Firefly ROC-RK3399-PC
64 - FriendlyElec NanoPC-T4 (nanopc-t4-rk3399)
65 - FriendlyElec NanoPi M4 (nanopi-m4-rk3399)
Alexandre Vicenzibc592bd2021-03-26 13:37:10 +010066 - FriendlyElec NanoPi M4B (nanopi-m4b-rk3399)
Walter Lozanocb17ffd2020-05-22 11:14:55 -030067 - FriendlyARM NanoPi NEO4 (nanopi-neo4-rk3399)
68 - Google Bob (chromebook_bob)
69 - Khadas Edge (khadas-edge-rk3399)
70 - Khadas Edge-Captain (khadas-edge-captain-rk3399)
71 - Khadas Edge-V (hadas-edge-v-rk3399)
72 - Orange Pi RK3399 (orangepi-rk3399)
73 - Pine64 RockPro64 (rockpro64-rk3399)
74 - Radxa ROCK Pi 4 (rock-pi-4-rk3399)
75 - Rockchip Evb-RK3399 (evb_rk3399)
76 - Theobroma Systems RK3399-Q7 SoM - Puma (puma_rk3399)
Walter Lozanocddcd972020-05-22 11:14:56 -030077* rv1108
78 - Rockchip Evb-rv1108 (evb-rv1108)
79 - Elgin-R1 (elgin-rv1108)
Jagan Tekid0a440c2020-01-10 00:16:22 +053080
81Building
82--------
83
84TF-A
85^^^^
86
87TF-A would require to build for ARM64 Rockchip SoCs platforms.
88
89To build TF-A::
90
91 git clone https://github.com/ARM-software/arm-trusted-firmware.git
92 cd arm-trusted-firmware
93 make realclean
94 make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
95
Johan Jonker5bf651e2021-08-20 19:27:59 +020096Specify the PLAT= with desired Rockchip platform to build TF-A for.
Jagan Tekid0a440c2020-01-10 00:16:22 +053097
98U-Boot
99^^^^^^
100
101To build rk3328 boards::
102
103 export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
104 make evb-rk3328_defconfig
105 make
106
107To build rk3288 boards::
108
109 make evb-rk3288_defconfig
110 make
111
112To build rk3368 boards::
113
114 export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
115 make evb-px5_defconfig
116 make
117
118To build rk3399 boards::
119
120 export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
121 make evb-rk3399_defconfig
122 make
123
124Flashing
125--------
126
Jagan Tekiefe8a882020-10-28 19:03:48 +05301271. Package the image with U-Boot TPL/SPL
128-----------------------------------------
129
Jagan Tekid0a440c2020-01-10 00:16:22 +0530130SD Card
131^^^^^^^
132
Johan Jonker5bf651e2021-08-20 19:27:59 +0200133All Rockchip platforms, except rk3128 (which doesn't use SPL) are now
Jagan Tekid0a440c2020-01-10 00:16:22 +0530134supporting single boot image using binman and pad_cat.
135
136To write an image that boots from an SD card (assumed to be /dev/sda)::
137
138 sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
139 sync
140
Jagan Teki48b9fb02020-05-24 23:02:13 +0530141eMMC
142^^^^
143
Johan Jonker5bf651e2021-08-20 19:27:59 +0200144eMMC flash would probe on mmc0 in most of the Rockchip platforms.
Jagan Teki48b9fb02020-05-24 23:02:13 +0530145
146Create GPT partition layout as defined in configurations::
147
148 mmc dev 0
149 gpt write mmc 0 $partitions
150
151Connect the USB-OTG cable between host and target device.
152
153Launch fastboot at target::
154
155 fastboot 0
156
157Upon successful gadget connection,host show the USB device like::
158
159 lsusb
160 Bus 001 Device 020: ID 2207:330c Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode
161
162Program the flash::
163
164 sudo fastboot -i 0x2207 flash loader1 idbloader.img
165 sudo fastboot -i 0x2207 flash loader2 u-boot.itb
166
Johan Jonker5bf651e2021-08-20 19:27:59 +0200167Note: for Rockchip 32-bit platforms the U-Boot proper image
Jagan Teki48b9fb02020-05-24 23:02:13 +0530168is u-boot-dtb.img
169
Jagan Teki1a262832020-06-04 20:21:41 +0530170SPI
171^^^
172
173Generating idbloader for SPI boot would require to input a multi image
174image format to mkimage tool instead of concerting (like for MMC boot).
175
176SPL-alone SPI boot image::
177
178 ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img
179
180TPL+SPL SPI boot image::
181
182 ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
183
184Copy SPI boot images into SD card and boot from SD::
185
186 sf probe
187 load mmc 1:1 $kernel_addr_r idbloader.img
188 sf erase 0 +$filesize
189 sf write $kernel_addr_r 0 ${filesize}
190 load mmc 1:1 ${kernel_addr_r} u-boot.itb
191 sf erase 0x60000 +$filesize
192 sf write $kernel_addr_r 0x60000 ${filesize}
193
Jagan Tekiefe8a882020-10-28 19:03:48 +05301942. Package the image with Rockchip miniloader
195---------------------------------------------
196
197Image package with Rockchip miniloader requires robin [1].
198
199Create idbloader.img
200
201.. code-block:: none
202
203 cd u-boot
204 ./tools/mkimage -n px30 -T rksd -d rkbin/bin/rk33/px30_ddr_333MHz_v1.15.bin idbloader.img
205 cat rkbin/bin/rk33/px30_miniloader_v1.22.bin >> idbloader.img
206 sudo dd if=idbloader.img of=/dev/sda seek=64
207
208Create trust.img
209
210.. code-block:: none
211
212 cd rkbin
213 ./tools/trust_merger RKTRUST/PX30TRUST.ini
214 sudo dd if=trust.img of=/dev/sda seek=24576
215
216Create uboot.img
217
218.. code-block:: none
219
220 rbink/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000
221 sudo dd if=uboot.img of=/dev/sda seek=16384
222
223Note:
2241. 0x200000 is load address and it's an optional in some platforms.
2252. rkbin binaries are kept on updating, so would recommend to use the latest versions.
226
Jagan Tekid0a440c2020-01-10 00:16:22 +0530227TODO
228----
229
Johan Jonker5bf651e2021-08-20 19:27:59 +0200230- Add Rockchip idbloader image building
231- Add Rockchip TPL image building
Jagan Tekid0a440c2020-01-10 00:16:22 +0530232- Document SPI flash boot
Jagan Tekid0a440c2020-01-10 00:16:22 +0530233- Add missing SoC's with it boards list
234
Jagan Tekiefe8a882020-10-28 19:03:48 +0530235[1] https://github.com/rockchip-linux/rkbin
236
Jagan Tekid0a440c2020-01-10 00:16:22 +0530237.. Jagan Teki <jagan@amarulasolutions.com>
Jagan Tekiefe8a882020-10-28 19:03:48 +0530238.. Wednesday 28 October 2020 06:47:26 PM IST