1*4882a593SmuzhiyunGet the Source and prebuild binary 2*4882a593Smuzhiyun================================== 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun > mkdir ~/gva_rk3229 5*4882a593Smuzhiyun > cd ~/gva_rk3229 6*4882a593Smuzhiyun > git clone git://git.denx.de/u-boot.git 7*4882a593Smuzhiyun > git clone https://github.com/OP-TEE/optee_os.git 8*4882a593Smuzhiyun > git clone https://github.com/rockchip-linux/rkbin.git 9*4882a593Smuzhiyun > git clone https://github.com/rockchip-linux/rkdeveloptool.git 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunCompile the OP-TEE 12*4882a593Smuzhiyun(For Android Things Project, use the image bellow. 13*4882a593Smuzhiyun<android root>/vendor/bsp/rockchip/security/optee/os/trust_with_ta.img) 14*4882a593Smuzhiyun=============== 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun > cd optee_os 17*4882a593Smuzhiyun > make clean 18*4882a593Smuzhiyun > make CROSS_COMPILE_ta_arm32=arm-none-eabi- PLATFORM=rockchip-rk322x 19*4882a593Smuzhiyun Get tee.bin in this step, copy it to U-Boot root dir: 20*4882a593Smuzhiyun > cp out/arm-plat-rockchip/core/tee-pager.bin ../u-boot/tee.bin 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunCompile the U-Boot 23*4882a593Smuzhiyun(For Android Things Project, use Android build system.) 24*4882a593Smuzhiyun================== 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun > cd ../u-boot 27*4882a593Smuzhiyun > export CROSS_COMPILE=arm-linux-gnueabihf- 28*4882a593Smuzhiyun > export ARCH=arm 29*4882a593Smuzhiyun > make gva-rk3229_defconfig 30*4882a593Smuzhiyun > make u-boot-dtb.bin 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun Get u-boot-dtb.bin in this step. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunCompile the rkdeveloptool 35*4882a593Smuzhiyun======================= 36*4882a593Smuzhiyun Follow instructions in latest README 37*4882a593Smuzhiyun > cd ../rkdeveloptool 38*4882a593Smuzhiyun > sudo apt-get install libudev-dev libusb-1.0-0-dev dh-autoreconf 39*4882a593Smuzhiyun > autoreconf -i 40*4882a593Smuzhiyun > ./configure 41*4882a593Smuzhiyun > make 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun Get rkdeveloptool in you Host in this step. 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunBoth origin binaries and Tool are ready now, choose either option 1 or 46*4882a593Smuzhiyunoption 2 to deploy U-Boot. 47*4882a593Smuzhiyun 48*4882a593SmuzhiyunPackage the image 49*4882a593Smuzhiyun(For Android Things Project, use Android build system.) 50*4882a593Smuzhiyun================= 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun > cd ../u-boot 53*4882a593Smuzhiyun > rkbin/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x61000000 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun Get uboot.img in this step. 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunFlash the image to eMMC 58*4882a593Smuzhiyun(For Android Things Project that supports AB update, 59*4882a593Smuzhiyunplease follow google's documents.) 60*4882a593Smuzhiyun======================= 61*4882a593SmuzhiyunPower on(or reset with RESET KEY) with MASKROM KEY preesed, and then: 62*4882a593Smuzhiyun > cd .. 63*4882a593Smuzhiyun > rkdeveloptool db rkbin/rk32/rk322x_loader_v1.04.232.bin 64*4882a593Smuzhiyun > rkdeveloptool wl 0x4000 uboot.img 65*4882a593Smuzhiyun > rkdeveloptool wl 0x6000 trust.img 66*4882a593Smuzhiyun > rkdeveloptool rd 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunYou should be able to get U-Boot log message with OP-TEE boot info. 69*4882a593Smuzhiyun 70*4882a593SmuzhiyunFor more detail, please reference to: 71*4882a593Smuzhiyunhttp://opensource.rock-chips.com/wiki_Boot_option 72