blob: 9b94abe25e7614c5614bff4e0447df2074338a72 [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
Johan Jonker7937f522022-04-16 17:09:50 +020016Rockchip is a SoC solutions provider for tablets & PCs, streaming media
Jagan Tekid0a440c2020-01-10 00:16:22 +053017TV 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
Johan Jonker46d609b2022-04-16 17:09:51 +020024* px30
25 - Rockchip Evb-PX30 (evb-px30)
26 - Engicam PX30.Core C.TOUCH 2.0 (px30-core-ctouch2-px30)
27 - Engicam PX30.Core C.TOUCH 2.0 10.1 (px30-core-ctouch2-of10-px30)
28 - Engicam PX30.Core EDIMM2.2 Starter Kit (px30-core-edimm2.2-px30)
29 - Firefly Core-PX30-JD4 (firefly-px30)
Walter Lozanocddcd972020-05-22 11:14:56 -030030* rk3036
31 - Rockchip Evb-RK3036 (evb-rk3036)
32 - Kylin (kylin_rk3036)
33* rk3128
34 - Rockchip Evb-RK3128 (evb-rk3128)
Johan Jonkere8a74732021-08-20 19:27:58 +020035* rk3188
36 - Radxa Rock (rock)
Walter Lozanocddcd972020-05-22 11:14:56 -030037* rk3229
38 - Rockchip Evb-RK3229 (evb-rk3229)
Jagan Tekid0a440c2020-01-10 00:16:22 +053039* rk3288
Walter Lozanocb17ffd2020-05-22 11:14:55 -030040 - Rockchip Evb-RK3288 (evb-rk3288)
41 - Firefly-RK3288 (firefly-rk3288)
42 - MQmaker MiQi (miqi-rk3288)
43 - Phytec RK3288 PCM-947 (phycore-rk3288)
44 - PopMetal-RK3288 (popmetal-rk3288)
45 - Radxa Rock 2 Square (rock2)
46 - Tinker-RK3288 (tinker-rk3288)
47 - Google Jerry (chromebook_jerry)
48 - Google Mickey (chromebook_mickey)
49 - Google Minnie (chromebook_minnie)
50 - Google Speedy (chromebook_speedy)
51 - Amarula Vyasa-RK3288 (vyasa-rk3288)
Walter Lozanocddcd972020-05-22 11:14:56 -030052* rk3308
53 - Rockchip Evb-RK3308 (evb-rk3308)
54 - Roc-cc-RK3308 (roc-cc-rk3308)
Johan Jonker46d609b2022-04-16 17:09:51 +020055* rk3326
56 - ODROID-GO Advance (odroid-go2)
Jagan Tekid0a440c2020-01-10 00:16:22 +053057* rk3328
Walter Lozanocb17ffd2020-05-22 11:14:55 -030058 - Rockchip Evb-RK3328 (evb-rk3328)
59 - Pine64 Rock64 (rock64-rk3328)
Walter Lozanocddcd972020-05-22 11:14:56 -030060 - Firefly-RK3328 (roc-cc-rk3328)
b.l.huanga2793c42020-06-01 00:02:11 +080061 - Radxa Rockpi E (rock-pi-e-rk3328)
Jagan Tekid0a440c2020-01-10 00:16:22 +053062* rk3368
Walter Lozanocb17ffd2020-05-22 11:14:55 -030063 - GeekBox (geekbox)
64 - PX5 EVB (evb-px5)
65 - Rockchip Sheep (sheep-rk3368)
66 - Theobroma Systems RK3368-uQ7 SoM - Lion (lion-rk3368)
Jagan Tekid0a440c2020-01-10 00:16:22 +053067* rk3399
Walter Lozanocb17ffd2020-05-22 11:14:55 -030068 - 96boards RK3399 Ficus (ficus-rk3399)
69 - 96boards Rock960 (rock960-rk3399)
70 - Firefly-RK3399 (firefly_rk3399)
71 - Firefly ROC-RK3399-PC
72 - FriendlyElec NanoPC-T4 (nanopc-t4-rk3399)
73 - FriendlyElec NanoPi M4 (nanopi-m4-rk3399)
Alexandre Vicenzibc592bd2021-03-26 13:37:10 +010074 - FriendlyElec NanoPi M4B (nanopi-m4b-rk3399)
Walter Lozanocb17ffd2020-05-22 11:14:55 -030075 - FriendlyARM NanoPi NEO4 (nanopi-neo4-rk3399)
76 - Google Bob (chromebook_bob)
Marty E. Plummerb20a8dac2021-12-24 16:43:46 +030077 - Google Kevin (chromebook_kevin)
Walter Lozanocb17ffd2020-05-22 11:14:55 -030078 - Khadas Edge (khadas-edge-rk3399)
79 - Khadas Edge-Captain (khadas-edge-captain-rk3399)
80 - Khadas Edge-V (hadas-edge-v-rk3399)
81 - Orange Pi RK3399 (orangepi-rk3399)
82 - Pine64 RockPro64 (rockpro64-rk3399)
83 - Radxa ROCK Pi 4 (rock-pi-4-rk3399)
84 - Rockchip Evb-RK3399 (evb_rk3399)
85 - Theobroma Systems RK3399-Q7 SoM - Puma (puma_rk3399)
Walter Lozanocddcd972020-05-22 11:14:56 -030086* rv1108
87 - Rockchip Evb-rv1108 (evb-rv1108)
88 - Elgin-R1 (elgin-rv1108)
Jagan Tekid0a440c2020-01-10 00:16:22 +053089
90Building
91--------
92
93TF-A
94^^^^
95
Johan Jonker7937f522022-04-16 17:09:50 +020096TF-A is required when building ARM64 Rockchip SoCs images.
Jagan Tekid0a440c2020-01-10 00:16:22 +053097
Johan Jonker7937f522022-04-16 17:09:50 +020098To build TF-A:
Jagan Tekid0a440c2020-01-10 00:16:22 +053099
Johan Jonker7937f522022-04-16 17:09:50 +0200100.. code-block:: bash
101
102 git clone --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git
Jagan Tekid0a440c2020-01-10 00:16:22 +0530103 cd arm-trusted-firmware
104 make realclean
105 make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
Johan Jonker7937f522022-04-16 17:09:50 +0200106 cd ..
Jagan Tekid0a440c2020-01-10 00:16:22 +0530107
Johan Jonker5bf651e2021-08-20 19:27:59 +0200108Specify the PLAT= with desired Rockchip platform to build TF-A for.
Jagan Tekid0a440c2020-01-10 00:16:22 +0530109
110U-Boot
111^^^^^^
112
Johan Jonker7937f522022-04-16 17:09:50 +0200113.. code-block:: bash
Jagan Tekid0a440c2020-01-10 00:16:22 +0530114
Johan Jonker7937f522022-04-16 17:09:50 +0200115 git clone --depth 1 https://source.denx.de/u-boot/u-boot.git
116 cd u-boot
117
Johan Jonker46d609b2022-04-16 17:09:51 +0200118To build px30 boards:
119
120.. code-block:: bash
121
122 export BL31=../arm-trusted-firmware/build/px30/release/bl31/bl31.elf
123 make evb-px30_defconfig
124 make CROSS_COMPILE=aarch64-linux-gnu-
125
Johan Jonker7937f522022-04-16 17:09:50 +0200126To build rk3288 boards:
Jagan Tekid0a440c2020-01-10 00:16:22 +0530127
Johan Jonker7937f522022-04-16 17:09:50 +0200128.. code-block:: bash
Jagan Tekid0a440c2020-01-10 00:16:22 +0530129
130 make evb-rk3288_defconfig
Johan Jonker7937f522022-04-16 17:09:50 +0200131 make CROSS_COMPILE=arm-linux-gnueabihf-
132
133To build rk3328 boards:
134
135.. code-block:: bash
136
137 export BL31=../arm-trusted-firmware/build/rk3328/release/bl31/bl31.elf
138 make evb-rk3328_defconfig
139 make CROSS_COMPILE=aarch64-linux-gnu-
140
141To build rk3368 boards:
Jagan Tekid0a440c2020-01-10 00:16:22 +0530142
Johan Jonker7937f522022-04-16 17:09:50 +0200143.. code-block:: bash
Jagan Tekid0a440c2020-01-10 00:16:22 +0530144
Johan Jonker7937f522022-04-16 17:09:50 +0200145 export BL31=../arm-trusted-firmware/build/rk3368/release/bl31/bl31.elf
Jagan Tekid0a440c2020-01-10 00:16:22 +0530146 make evb-px5_defconfig
Johan Jonker7937f522022-04-16 17:09:50 +0200147 make CROSS_COMPILE=aarch64-linux-gnu-
148
149To build rk3399 boards:
Jagan Tekid0a440c2020-01-10 00:16:22 +0530150
Johan Jonker7937f522022-04-16 17:09:50 +0200151.. code-block:: bash
Jagan Tekid0a440c2020-01-10 00:16:22 +0530152
Johan Jonker7937f522022-04-16 17:09:50 +0200153 export BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
Jagan Tekid0a440c2020-01-10 00:16:22 +0530154 make evb-rk3399_defconfig
Johan Jonker7937f522022-04-16 17:09:50 +0200155 make CROSS_COMPILE=aarch64-linux-gnu-
Jagan Tekid0a440c2020-01-10 00:16:22 +0530156
157Flashing
158--------
159
Jagan Tekiefe8a882020-10-28 19:03:48 +05301601. Package the image with U-Boot TPL/SPL
161-----------------------------------------
162
Jagan Tekid0a440c2020-01-10 00:16:22 +0530163SD Card
164^^^^^^^
165
Johan Jonker7937f522022-04-16 17:09:50 +0200166All Rockchip platforms (except rk3128 which doesn't use SPL) are now
167supporting a single boot image using binman and pad_cat.
Jagan Tekid0a440c2020-01-10 00:16:22 +0530168
Johan Jonker7937f522022-04-16 17:09:50 +0200169To write an image that boots from a SD card (assumed to be /dev/sda):
170
171.. code-block:: bash
Jagan Tekid0a440c2020-01-10 00:16:22 +0530172
173 sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
174 sync
175
Jagan Teki48b9fb02020-05-24 23:02:13 +0530176eMMC
177^^^^
178
Johan Jonker5bf651e2021-08-20 19:27:59 +0200179eMMC flash would probe on mmc0 in most of the Rockchip platforms.
Jagan Teki48b9fb02020-05-24 23:02:13 +0530180
Johan Jonker7937f522022-04-16 17:09:50 +0200181Create GPT partition layout as defined in $partitions:
182
183.. code-block:: bash
Jagan Teki48b9fb02020-05-24 23:02:13 +0530184
185 mmc dev 0
186 gpt write mmc 0 $partitions
187
Johan Jonker7937f522022-04-16 17:09:50 +0200188Connect the USB-OTG cable between the host and a target device.
Jagan Teki48b9fb02020-05-24 23:02:13 +0530189
Johan Jonker7937f522022-04-16 17:09:50 +0200190Launch fastboot on the target with:
191
192.. code-block:: bash
Jagan Teki48b9fb02020-05-24 23:02:13 +0530193
194 fastboot 0
195
Johan Jonker7937f522022-04-16 17:09:50 +0200196Upon a successful gadget connection the host shows the USB device with:
197
198.. code-block:: bash
Jagan Teki48b9fb02020-05-24 23:02:13 +0530199
200 lsusb
Johan Jonker7937f522022-04-16 17:09:50 +0200201 # Bus 001 Device 020: ID 2207:330c Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode
Jagan Teki48b9fb02020-05-24 23:02:13 +0530202
Johan Jonker7937f522022-04-16 17:09:50 +0200203Program the flash with:
204
205.. code-block:: bash
Jagan Teki48b9fb02020-05-24 23:02:13 +0530206
207 sudo fastboot -i 0x2207 flash loader1 idbloader.img
208 sudo fastboot -i 0x2207 flash loader2 u-boot.itb
209
Johan Jonker7937f522022-04-16 17:09:50 +0200210Note:
211
212For Rockchip 32-bit platforms the U-Boot proper image
Jagan Teki48b9fb02020-05-24 23:02:13 +0530213is u-boot-dtb.img
214
Jagan Teki1a262832020-06-04 20:21:41 +0530215SPI
216^^^
217
Johan Jonker7937f522022-04-16 17:09:50 +0200218The SPI boot method requires the generation of idbloader.img with help of the mkimage tool.
Jagan Teki1a262832020-06-04 20:21:41 +0530219
Johan Jonker7937f522022-04-16 17:09:50 +0200220SPL-alone SPI boot image:
221
222.. code-block:: bash
Jagan Teki1a262832020-06-04 20:21:41 +0530223
224 ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img
225
Johan Jonker7937f522022-04-16 17:09:50 +0200226TPL+SPL SPI boot image:
227
228.. code-block:: bash
Jagan Teki1a262832020-06-04 20:21:41 +0530229
230 ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
231
Johan Jonker7937f522022-04-16 17:09:50 +0200232Copy SPI boot images into SD card and boot from SD:
233
234.. code-block:: bash
Jagan Teki1a262832020-06-04 20:21:41 +0530235
236 sf probe
237 load mmc 1:1 $kernel_addr_r idbloader.img
238 sf erase 0 +$filesize
239 sf write $kernel_addr_r 0 ${filesize}
240 load mmc 1:1 ${kernel_addr_r} u-boot.itb
241 sf erase 0x60000 +$filesize
242 sf write $kernel_addr_r 0x60000 ${filesize}
243
Jagan Tekiefe8a882020-10-28 19:03:48 +05302442. Package the image with Rockchip miniloader
245---------------------------------------------
246
Johan Jonker7937f522022-04-16 17:09:50 +0200247Image package with Rockchip miniloader requires rkbin [1].
248
249.. code-block:: bash
Jagan Tekiefe8a882020-10-28 19:03:48 +0530250
Johan Jonker7937f522022-04-16 17:09:50 +0200251 cd ..
252 git clone --depth 1 https://github.com/rockchip-linux/rkbin
Jagan Tekiefe8a882020-10-28 19:03:48 +0530253
Johan Jonker7937f522022-04-16 17:09:50 +0200254Create idbloader.img:
Jagan Tekiefe8a882020-10-28 19:03:48 +0530255
Johan Jonker7937f522022-04-16 17:09:50 +0200256.. code-block:: bash
Jagan Tekiefe8a882020-10-28 19:03:48 +0530257
Johan Jonker7937f522022-04-16 17:09:50 +0200258 cd u-boot
259 ./tools/mkimage -n px30 -T rksd -d ../rkbin/bin/rk33/px30_ddr_333MHz_v1.16.bin idbloader.img
260 cat ../rkbin/bin/rk33/px30_miniloader_v1.31.bin >> idbloader.img
261 sudo dd if=idbloader.img of=/dev/sda seek=64
Jagan Tekiefe8a882020-10-28 19:03:48 +0530262
Johan Jonker7937f522022-04-16 17:09:50 +0200263Create trust.img:
Jagan Tekiefe8a882020-10-28 19:03:48 +0530264
Johan Jonker7937f522022-04-16 17:09:50 +0200265.. code-block:: bash
Jagan Tekiefe8a882020-10-28 19:03:48 +0530266
Johan Jonker7937f522022-04-16 17:09:50 +0200267 cd ../rkbin
268 ./tools/trust_merger RKTRUST/PX30TRUST.ini
269 sudo dd if=trust.img of=/dev/sda seek=24576
Jagan Tekiefe8a882020-10-28 19:03:48 +0530270
Johan Jonker7937f522022-04-16 17:09:50 +0200271Create uboot.img [2]:
Jagan Tekiefe8a882020-10-28 19:03:48 +0530272
Johan Jonker7937f522022-04-16 17:09:50 +0200273.. code-block:: bash
274
275 cd ../u-boot
276 ../rkbin/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000
277 sudo dd if=uboot.img of=/dev/sda seek=16384
Jagan Tekiefe8a882020-10-28 19:03:48 +0530278
279Note:
Johan Jonker7937f522022-04-16 17:09:50 +0200280
2811. rkbin binaries are regularly updated, so it would be recommended to use the latest version.
2822. 0x200000 is a load address and is an option for some platforms.
Jagan Tekiefe8a882020-10-28 19:03:48 +0530283
Jagan Tekid0a440c2020-01-10 00:16:22 +0530284TODO
285----
286
Johan Jonker5bf651e2021-08-20 19:27:59 +0200287- Add Rockchip idbloader image building
288- Add Rockchip TPL image building
Jagan Tekid0a440c2020-01-10 00:16:22 +0530289- Document SPI flash boot
Jagan Tekid0a440c2020-01-10 00:16:22 +0530290- Add missing SoC's with it boards list
291
292.. Jagan Teki <jagan@amarulasolutions.com>
Jagan Tekiefe8a882020-10-28 19:03:48 +0530293.. Wednesday 28 October 2020 06:47:26 PM IST