Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> |
| 3 | |
| 4 | ROCKCHIP |
| 5 | ======== |
| 6 | |
| 7 | About this |
| 8 | ---------- |
| 9 | |
| 10 | This document describes the information about Rockchip supported boards |
| 11 | and it's usage steps. |
| 12 | |
| 13 | Rockchip boards |
| 14 | --------------- |
| 15 | |
| 16 | Rockchip is SoC solutions provider for tablets & PCs, streaming media |
| 17 | TV boxes, AI audio & vision, IoT hardware. |
| 18 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 19 | A wide range of Rockchip SoCs with associated boards are supported in |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 20 | mainline U-Boot. |
| 21 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 22 | List of mainline supported Rockchip boards: |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 23 | |
Walter Lozano | cbd75f6 | 2020-05-22 11:14:56 -0300 | [diff] [blame] | 24 | * rk3036 |
| 25 | - Rockchip Evb-RK3036 (evb-rk3036) |
| 26 | - Kylin (kylin_rk3036) |
| 27 | * rk3128 |
| 28 | - Rockchip Evb-RK3128 (evb-rk3128) |
Johan Jonker | 734dcdc | 2021-08-20 19:27:58 +0200 | [diff] [blame] | 29 | * rk3188 |
| 30 | - Radxa Rock (rock) |
Walter Lozano | cbd75f6 | 2020-05-22 11:14:56 -0300 | [diff] [blame] | 31 | * rk3229 |
| 32 | - Rockchip Evb-RK3229 (evb-rk3229) |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 33 | * rk3288 |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 34 | - 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 Lozano | cbd75f6 | 2020-05-22 11:14:56 -0300 | [diff] [blame] | 46 | * rk3308 |
| 47 | - Rockchip Evb-RK3308 (evb-rk3308) |
| 48 | - Roc-cc-RK3308 (roc-cc-rk3308) |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 49 | * rk3328 |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 50 | - Rockchip Evb-RK3328 (evb-rk3328) |
| 51 | - Pine64 Rock64 (rock64-rk3328) |
Walter Lozano | cbd75f6 | 2020-05-22 11:14:56 -0300 | [diff] [blame] | 52 | - Firefly-RK3328 (roc-cc-rk3328) |
b.l.huang | d9c3417 | 2020-06-01 00:02:11 +0800 | [diff] [blame] | 53 | - Radxa Rockpi E (rock-pi-e-rk3328) |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 54 | * rk3368 |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 55 | - GeekBox (geekbox) |
| 56 | - PX5 EVB (evb-px5) |
| 57 | - Rockchip Sheep (sheep-rk3368) |
| 58 | - Theobroma Systems RK3368-uQ7 SoM - Lion (lion-rk3368) |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 59 | * rk3399 |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 60 | - 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 Vicenzi | a99d70c | 2021-03-26 13:37:10 +0100 | [diff] [blame] | 66 | - FriendlyElec NanoPi M4B (nanopi-m4b-rk3399) |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 67 | - FriendlyARM NanoPi NEO4 (nanopi-neo4-rk3399) |
| 68 | - Google Bob (chromebook_bob) |
Marty E. Plummer | 6d36e92 | 2021-12-24 16:43:46 +0300 | [diff] [blame^] | 69 | - Google Kevin (chromebook_kevin) |
Walter Lozano | 22186f3 | 2020-05-22 11:14:55 -0300 | [diff] [blame] | 70 | - Khadas Edge (khadas-edge-rk3399) |
| 71 | - Khadas Edge-Captain (khadas-edge-captain-rk3399) |
| 72 | - Khadas Edge-V (hadas-edge-v-rk3399) |
| 73 | - Orange Pi RK3399 (orangepi-rk3399) |
| 74 | - Pine64 RockPro64 (rockpro64-rk3399) |
| 75 | - Radxa ROCK Pi 4 (rock-pi-4-rk3399) |
| 76 | - Rockchip Evb-RK3399 (evb_rk3399) |
| 77 | - Theobroma Systems RK3399-Q7 SoM - Puma (puma_rk3399) |
Walter Lozano | cbd75f6 | 2020-05-22 11:14:56 -0300 | [diff] [blame] | 78 | * rv1108 |
| 79 | - Rockchip Evb-rv1108 (evb-rv1108) |
| 80 | - Elgin-R1 (elgin-rv1108) |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 81 | |
| 82 | Building |
| 83 | -------- |
| 84 | |
| 85 | TF-A |
| 86 | ^^^^ |
| 87 | |
| 88 | TF-A would require to build for ARM64 Rockchip SoCs platforms. |
| 89 | |
| 90 | To build TF-A:: |
| 91 | |
| 92 | git clone https://github.com/ARM-software/arm-trusted-firmware.git |
| 93 | cd arm-trusted-firmware |
| 94 | make realclean |
| 95 | make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 |
| 96 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 97 | Specify the PLAT= with desired Rockchip platform to build TF-A for. |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 98 | |
| 99 | U-Boot |
| 100 | ^^^^^^ |
| 101 | |
| 102 | To build rk3328 boards:: |
| 103 | |
| 104 | export BL31=/path/to/arm-trusted-firmware/to/bl31.elf |
| 105 | make evb-rk3328_defconfig |
| 106 | make |
| 107 | |
| 108 | To build rk3288 boards:: |
| 109 | |
| 110 | make evb-rk3288_defconfig |
| 111 | make |
| 112 | |
| 113 | To build rk3368 boards:: |
| 114 | |
| 115 | export BL31=/path/to/arm-trusted-firmware/to/bl31.elf |
| 116 | make evb-px5_defconfig |
| 117 | make |
| 118 | |
| 119 | To build rk3399 boards:: |
| 120 | |
| 121 | export BL31=/path/to/arm-trusted-firmware/to/bl31.elf |
| 122 | make evb-rk3399_defconfig |
| 123 | make |
| 124 | |
| 125 | Flashing |
| 126 | -------- |
| 127 | |
Jagan Teki | 43ed7a0 | 2020-10-28 19:03:48 +0530 | [diff] [blame] | 128 | 1. Package the image with U-Boot TPL/SPL |
| 129 | ----------------------------------------- |
| 130 | |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 131 | SD Card |
| 132 | ^^^^^^^ |
| 133 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 134 | All Rockchip platforms, except rk3128 (which doesn't use SPL) are now |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 135 | supporting single boot image using binman and pad_cat. |
| 136 | |
| 137 | To write an image that boots from an SD card (assumed to be /dev/sda):: |
| 138 | |
| 139 | sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64 |
| 140 | sync |
| 141 | |
Jagan Teki | 7e01363 | 2020-05-24 23:02:13 +0530 | [diff] [blame] | 142 | eMMC |
| 143 | ^^^^ |
| 144 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 145 | eMMC flash would probe on mmc0 in most of the Rockchip platforms. |
Jagan Teki | 7e01363 | 2020-05-24 23:02:13 +0530 | [diff] [blame] | 146 | |
| 147 | Create GPT partition layout as defined in configurations:: |
| 148 | |
| 149 | mmc dev 0 |
| 150 | gpt write mmc 0 $partitions |
| 151 | |
| 152 | Connect the USB-OTG cable between host and target device. |
| 153 | |
| 154 | Launch fastboot at target:: |
| 155 | |
| 156 | fastboot 0 |
| 157 | |
| 158 | Upon successful gadget connection,host show the USB device like:: |
| 159 | |
| 160 | lsusb |
| 161 | Bus 001 Device 020: ID 2207:330c Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode |
| 162 | |
| 163 | Program the flash:: |
| 164 | |
| 165 | sudo fastboot -i 0x2207 flash loader1 idbloader.img |
| 166 | sudo fastboot -i 0x2207 flash loader2 u-boot.itb |
| 167 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 168 | Note: for Rockchip 32-bit platforms the U-Boot proper image |
Jagan Teki | 7e01363 | 2020-05-24 23:02:13 +0530 | [diff] [blame] | 169 | is u-boot-dtb.img |
| 170 | |
Jagan Teki | dd39760 | 2020-06-04 20:21:41 +0530 | [diff] [blame] | 171 | SPI |
| 172 | ^^^ |
| 173 | |
| 174 | Generating idbloader for SPI boot would require to input a multi image |
| 175 | image format to mkimage tool instead of concerting (like for MMC boot). |
| 176 | |
| 177 | SPL-alone SPI boot image:: |
| 178 | |
| 179 | ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img |
| 180 | |
| 181 | TPL+SPL SPI boot image:: |
| 182 | |
| 183 | ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img |
| 184 | |
| 185 | Copy SPI boot images into SD card and boot from SD:: |
| 186 | |
| 187 | sf probe |
| 188 | load mmc 1:1 $kernel_addr_r idbloader.img |
| 189 | sf erase 0 +$filesize |
| 190 | sf write $kernel_addr_r 0 ${filesize} |
| 191 | load mmc 1:1 ${kernel_addr_r} u-boot.itb |
| 192 | sf erase 0x60000 +$filesize |
| 193 | sf write $kernel_addr_r 0x60000 ${filesize} |
| 194 | |
Jagan Teki | 43ed7a0 | 2020-10-28 19:03:48 +0530 | [diff] [blame] | 195 | 2. Package the image with Rockchip miniloader |
| 196 | --------------------------------------------- |
| 197 | |
| 198 | Image package with Rockchip miniloader requires robin [1]. |
| 199 | |
| 200 | Create idbloader.img |
| 201 | |
| 202 | .. code-block:: none |
| 203 | |
| 204 | cd u-boot |
| 205 | ./tools/mkimage -n px30 -T rksd -d rkbin/bin/rk33/px30_ddr_333MHz_v1.15.bin idbloader.img |
| 206 | cat rkbin/bin/rk33/px30_miniloader_v1.22.bin >> idbloader.img |
| 207 | sudo dd if=idbloader.img of=/dev/sda seek=64 |
| 208 | |
| 209 | Create trust.img |
| 210 | |
| 211 | .. code-block:: none |
| 212 | |
| 213 | cd rkbin |
| 214 | ./tools/trust_merger RKTRUST/PX30TRUST.ini |
| 215 | sudo dd if=trust.img of=/dev/sda seek=24576 |
| 216 | |
| 217 | Create uboot.img |
| 218 | |
| 219 | .. code-block:: none |
| 220 | |
| 221 | rbink/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000 |
| 222 | sudo dd if=uboot.img of=/dev/sda seek=16384 |
| 223 | |
| 224 | Note: |
| 225 | 1. 0x200000 is load address and it's an optional in some platforms. |
| 226 | 2. rkbin binaries are kept on updating, so would recommend to use the latest versions. |
| 227 | |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 228 | TODO |
| 229 | ---- |
| 230 | |
Johan Jonker | 3ad88ec | 2021-08-20 19:27:59 +0200 | [diff] [blame] | 231 | - Add Rockchip idbloader image building |
| 232 | - Add Rockchip TPL image building |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 233 | - Document SPI flash boot |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 234 | - Add missing SoC's with it boards list |
| 235 | |
Jagan Teki | 43ed7a0 | 2020-10-28 19:03:48 +0530 | [diff] [blame] | 236 | [1] https://github.com/rockchip-linux/rkbin |
| 237 | |
Jagan Teki | 338b86c | 2020-01-10 00:16:22 +0530 | [diff] [blame] | 238 | .. Jagan Teki <jagan@amarulasolutions.com> |
Jagan Teki | 43ed7a0 | 2020-10-28 19:03:48 +0530 | [diff] [blame] | 239 | .. Wednesday 28 October 2020 06:47:26 PM IST |