Kever Yang | 7c2a754 | 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 |
| 16 | > make CROSS_COMPILE_ta_arm32=arm-none-eabi- PLATFORM=rockchip-rk322x |
| 17 | Get tee.bin in this step, copy it to U-Boot root dir: |
| 18 | > cp out/arm-plat-rockchip/core/tee-pager.bin ../u-boot/tee.bin |
| 19 | |
| 20 | Compile the U-Boot |
| 21 | ================== |
| 22 | |
| 23 | > cd ../u-boot |
| 24 | > export CROSS_COMPILE=arm-linux-gnueabihf- |
Kever Yang | 7c2a754 | 2019-04-02 20:41:28 +0800 | [diff] [blame] | 25 | > make evb-rk3229_defconfig |
| 26 | > make |
| 27 | > make u-boot.itb |
| 28 | |
| 29 | Get tpl/u-boot-tpl.bin, spl/u-boot-spl.bin and u-boot.itb in this step. |
| 30 | |
| 31 | Compile the rkdeveloptool |
| 32 | ======================= |
| 33 | Follow instructions in latest README |
| 34 | > cd ../rkflashtool |
| 35 | > autoreconf -i |
| 36 | > ./configure |
| 37 | > make |
| 38 | > sudo make install |
| 39 | |
| 40 | Get rkdeveloptool in you Host in this step. |
| 41 | |
| 42 | Both origin binaries and Tool are ready now, choose either option 1 or |
| 43 | option 2 to deploy U-Boot. |
| 44 | |
| 45 | Package the image |
| 46 | ================= |
| 47 | |
| 48 | > cd ../u-boot |
| 49 | > tools/mkimage -n rk322x -T rksd -d tpl/u-boot-spl.bin idbloader.img |
| 50 | > cat spl/u-boot-spl.bin >> idbloader.img |
| 51 | |
| 52 | Get idbloader.img in this step. |
| 53 | |
| 54 | Flash the image to eMMC |
| 55 | ======================= |
| 56 | Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then: |
| 57 | > cd .. |
| 58 | > rkdeveloptool db rkbin/rk32/rk322x_loader_v1.04.232.bin |
| 59 | > rkdeveloptool wl 64 u-boot/idbloader.img |
| 60 | > rkdeveloptool wl 0x4000 u-boot/u-boot.itb |
| 61 | > rkdeveloptool rd |
| 62 | |
| 63 | Flash the image to SD card |
| 64 | ========================== |
| 65 | > dd if=u-boot/idbloader.img of=/dev/sdb seek=64 |
| 66 | > dd if=u-boot/u-boot.itb of=/dev/sdb seek=16384 |
| 67 | |
| 68 | You should be able to get U-Boot log message with OP-TEE boot info. |
| 69 | |
| 70 | For more detail, please reference to: |
| 71 | http://opensource.rock-chips.com/wiki_Boot_option |