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