Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 1 | Get the Source and prebuild binary |
| 2 | ================================== |
| 3 | |
| 4 | > mkdir ~/evb_rk3229 |
| 5 | > cd ~/evb_rk3229 |
| 6 | > git clone git://git.denx.de/u-boot.git |
| 7 | > git clone https://github.com/OP-TEE/optee_os.git |
| 8 | > git clone https://github.com/rockchip-linux/rkbin.git |
| 9 | > git clone https://github.com/rockchip-linux/rkdeveloptool.git |
| 10 | |
| 11 | Compile the OP-TEE |
| 12 | =============== |
| 13 | |
| 14 | > cd optee_os |
| 15 | > make clean |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 16 | > make CROSS_COMPILE=arm-none-eabi- PLATFORM=rockchip-rk322x |
| 17 | Get tee-raw.bin in this step, copy it to U-Boot root dir: |
| 18 | > cp out/arm-plat-rockchip/core/tee-raw.bin ../u-boot/tee.bin |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 19 | |
| 20 | Compile the U-Boot |
| 21 | ================== |
| 22 | |
| 23 | > cd ../u-boot |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 24 | > make evb-rk3229_defconfig |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 25 | > TEE=tee.bin CROSS_COMPILE=arm-linux-gnueabihf- make |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 26 | |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 27 | Get u-boot-rockchip.bin in this step. |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 28 | |
| 29 | Compile the rkdeveloptool |
| 30 | ======================= |
| 31 | Follow instructions in latest README |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 32 | > cd ../rkdeveloptool |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 33 | > autoreconf -i |
| 34 | > ./configure |
| 35 | > make |
| 36 | > sudo make install |
| 37 | |
| 38 | Get rkdeveloptool in you Host in this step. |
| 39 | |
| 40 | Both origin binaries and Tool are ready now, choose either option 1 or |
| 41 | option 2 to deploy U-Boot. |
| 42 | |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 43 | Flash the image to eMMC |
| 44 | ======================= |
| 45 | Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then: |
| 46 | > cd .. |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 47 | > rkdeveloptool/rkdeveloptool db rkbin/rk32/rk322x_loader_v1.04.232.bin |
| 48 | > rkdeveloptool/rkdeveloptool wl 64 u-boot/u-boot-rockchip.bin |
| 49 | > rkdeveloptool/rkdeveloptool rd |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 50 | |
| 51 | Flash the image to SD card |
| 52 | ========================== |
Alex Bee | 6779a14 | 2023-07-18 16:57:14 +0200 | [diff] [blame^] | 53 | > dd if=u-boot/u-boot-rockchip.bin of=/dev/sdb seek=64 |
| 54 | |
| 55 | You should be able to get U-Boot log message with OP-TEE boot info: |
| 56 | |
| 57 | U-Boot TPL 2023.07-00524-gf5346eba55-dirty (Jul 15 2023 - 14:22:51) |
| 58 | Trying to boot from BOOTROM |
| 59 | Returning to boot ROM... |
| 60 | |
| 61 | U-Boot SPL 2023.07-00524-gf5346eba55-dirty (Jul 15 2023 - 14:22:51 +0200) |
| 62 | Trying to boot from MMC1 |
| 63 | I/TC: |
| 64 | I/TC: Non-secure external DT found |
| 65 | I/TC: Switching console to device: /serial@11030000 |
| 66 | I/TC: OP-TEE version: 3.22.0-27-g893a762d1 (gcc version 10.3.1 20210621 (release) (15:10.3-2021.07-4)) #1 Sat Jul 15 12:14:36 UTC 2023 arm |
| 67 | I/TC: WARNING: This OP-TEE configuration might be insecure! |
| 68 | I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html |
| 69 | I/TC: Primary CPU initializing |
| 70 | M/TC: Not protecting region 1: 0x68400000-0x68600000 |
| 71 | I/TC: Primary CPU switching to normal world boot |
| 72 | |
| 73 | |
| 74 | U-Boot 2023.07-00524-gf5346eba55-dirty (Jul 15 2023 - 14:22:51 +0200) |
| 75 | |
| 76 | Model: Rockchip RK3229 Evaluation board |
| 77 | DRAM: 1 GiB (effective 992 MiB) |
| 78 | Core: 113 devices, 16 uclasses, devicetree: separate |
| 79 | MMC: mmc@30000000: 1, mmc@30020000: 0 |
| 80 | Loading Environment from MMC... Card did not respond to voltage select! : -110 |
| 81 | *** Warning - No block device, using default environment |
| 82 | |
| 83 | In: serial@11030000 |
| 84 | Out: serial@11030000 |
| 85 | Err: serial@11030000 |
| 86 | Model: Rockchip RK3229 Evaluation board |
| 87 | Net: |
| 88 | Warning: ethernet@30200000 (eth0) using random MAC address - 72:65:2b:f1:c5:0a |
| 89 | eth0: ethernet@30200000 |
| 90 | Hit any key to stop autoboot: 0 |
| 91 | => |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 92 | |
Kever Yang | e969f91 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 93 | |
| 94 | For more detail, please reference to: |
| 95 | http://opensource.rock-chips.com/wiki_Boot_option |