xref: /OK3568_Linux_fs/u-boot/board/rockchip/evb_rk3229/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunGet the Source and prebuild binary
2*4882a593Smuzhiyun==================================
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun  > mkdir ~/evb_rk3229
5*4882a593Smuzhiyun  > cd ~/evb_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===============
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  > cd optee_os
15*4882a593Smuzhiyun  > make clean
16*4882a593Smuzhiyun  > make CROSS_COMPILE_ta_arm32=arm-none-eabi- PLATFORM=rockchip-rk322x
17*4882a593Smuzhiyun  Get tee.bin in this step, copy it to U-Boot root dir:
18*4882a593Smuzhiyun  > cp out/arm-plat-rockchip/core/tee-pager.bin ../u-boot/tee.bin
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunCompile the U-Boot
21*4882a593Smuzhiyun==================
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun  > cd ../u-boot
24*4882a593Smuzhiyun  > export CROSS_COMPILE=arm-linux-gnueabihf-
25*4882a593Smuzhiyun  > export ARCH=arm
26*4882a593Smuzhiyun  > make evb-rk3229_defconfig
27*4882a593Smuzhiyun  > make
28*4882a593Smuzhiyun  > make u-boot.itb
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun  Get tpl/u-boot-tpl.bin, spl/u-boot-spl.bin and u-boot.itb in this step.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunCompile the rkdeveloptool
33*4882a593Smuzhiyun=======================
34*4882a593Smuzhiyun  Follow instructions in latest README
35*4882a593Smuzhiyun  > cd ../rkflashtool
36*4882a593Smuzhiyun  > autoreconf -i
37*4882a593Smuzhiyun  > ./configure
38*4882a593Smuzhiyun  > make
39*4882a593Smuzhiyun  > sudo make install
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun  Get rkdeveloptool in you Host in this step.
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunBoth origin binaries and Tool are ready now, choose either option 1 or
44*4882a593Smuzhiyunoption 2 to deploy U-Boot.
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunPackage the image
47*4882a593Smuzhiyun=================
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun  > cd ../u-boot
50*4882a593Smuzhiyun  > tools/mkimage -n rk322x -T rksd -d tpl/u-boot-spl.bin idbloader.img
51*4882a593Smuzhiyun  > cat spl/u-boot-spl.bin >> idbloader.img
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun  Get idbloader.img in this step.
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunFlash the image to eMMC
56*4882a593Smuzhiyun=======================
57*4882a593SmuzhiyunPower on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
58*4882a593Smuzhiyun  > cd ..
59*4882a593Smuzhiyun  > rkdeveloptool db rkbin/rk32/rk322x_loader_v1.04.232.bin
60*4882a593Smuzhiyun  > rkdeveloptool wl 64 u-boot/idbloader.img
61*4882a593Smuzhiyun  > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
62*4882a593Smuzhiyun  > rkdeveloptool rd
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunFlash the image to SD card
65*4882a593Smuzhiyun==========================
66*4882a593Smuzhiyun  > dd if=u-boot/idbloader.img of=/dev/sdb seek=64
67*4882a593Smuzhiyun  > dd if=u-boot/u-boot.itb of=/dev/sdb seek=16384
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunYou should be able to get U-Boot log message with OP-TEE boot info.
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunFor more detail, please reference to:
72*4882a593Smuzhiyunhttp://opensource.rock-chips.com/wiki_Boot_option
73