xref: /OK3568_Linux_fs/u-boot/board/theobroma-systems/lion_rk3368/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunHere is the step-by-step to boot to U-Boot on RK3368-uQ7
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunGet the Source and build ATF
4*4882a593Smuzhiyun============================
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  > git clone git://git.theobroma-systems.com/arm-trusted-firmware.git
7*4882a593Smuzhiyun  > cd arm-trusted-firmware
8*4882a593Smuzhiyun  > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3368 bl31
9*4882a593Smuzhiyun  > cp build/rk3368/release/bl31.bin ../u-boot/bl31-rk3368.bin
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunConfigure U-Boot
12*4882a593Smuzhiyun================
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  > cd ../u-boot
15*4882a593Smuzhiyun  > make lion-rk3368_defconfig
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunBuild the TPL/SPL stage
18*4882a593Smuzhiyun=======================
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun  > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm
21*4882a593Smuzhiyun  > tools/mkimage -n rk3368 -T rksd -d tpl/u-boot-tpl.bin spl-3368.img
22*4882a593Smuzhiyun  > cat spl/u-boot-spl-dtb.bin >> spl-3368.img
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunBuild the full U-Boot and a FIT image including the ATF
25*4882a593Smuzhiyun=======================================================
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun  > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm u-boot.itb
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunFlash the image
30*4882a593Smuzhiyun===============
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunCopy the SPL to offset 32k and the FIT image containing the payloads
33*4882a593Smuzhiyun(U-Boot proper, ATF, devicetree) to offset 256k card.
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunSD-Card
36*4882a593Smuzhiyun-------
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun  > dd if=spl-3368.img of=/dev/sdb seek=64
39*4882a593Smuzhiyun  > dd if=u-boot.itb of=/dev/sdb seek=512
40*4882a593Smuzhiyun
41*4882a593SmuzhiyuneMMC
42*4882a593Smuzhiyun----
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunrkdeveloptool allows to flash the on-board eMMC via the USB OTG interface with
45*4882a593Smuzhiyunhelp of the Rockchip loader binary.
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun  > git clone https://github.com/rockchip-linux/rkdeveloptool
48*4882a593Smuzhiyun  > cd rkdeveloptool
49*4882a593Smuzhiyun  > autoreconf -i && && ./configure && make
50*4882a593Smuzhiyun  > git clone https://github.com/rockchip-linux/rkbin.git
51*4882a593Smuzhiyun  > ./rkdeveloptool db rkbin/rk33/rk3368_loader_v2.00.256.bin
52*4882a593Smuzhiyun  > ./rkdeveloptool wl 64 ../spl.img
53*4882a593Smuzhiyun  > ./rkdeveloptool wl 512 ../u-boot.itb
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunIf everything went according to plan, you should see the following
57*4882a593Smuzhiyunoutput on UART0:
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun<debug_uart> U-Boot TPL board init
60*4882a593SmuzhiyunTrying to boot from BOOTROM
61*4882a593SmuzhiyunReturning to boot ROM...
62*4882a593SmuzhiyunTrying to boot from MMC1
63*4882a593SmuzhiyunNOTICE:  BL31: v1.3(release):v1.2-1320-gbf43a443
64*4882a593SmuzhiyunNOTICE:  BL31: Built : 18:04:47, Jul  5 2017
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunU-Boot 2017.07-00158-g2395e99858 (Jul 18 2017 - 21:03:31 +0200)
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunModel: Theobroma Systems RK3368-uQ7 SoM
70*4882a593SmuzhiyunDRAM:  2 GiB
71*4882a593SmuzhiyunMMC:   dwmmc@ff0c0000: 1, dwmmc@ff0f0000: 0
72*4882a593SmuzhiyunUsing default environment
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunIn:    serial@ff180000
75*4882a593SmuzhiyunOut:   serial@ff180000
76*4882a593SmuzhiyunErr:   serial@ff180000
77*4882a593SmuzhiyunNet:
78*4882a593SmuzhiyunWarning: ethernet@ff290000 (eth0) using random MAC address - d2:69:35:7e:d0:1e
79*4882a593Smuzhiyuneth0: ethernet@ff290000
80*4882a593SmuzhiyunHit any key to stop autoboot:  2
81