1*a13110a9SKlaus GogerIntroduction
2*a13110a9SKlaus Goger============
3*a13110a9SKlaus Goger
4*a13110a9SKlaus GogerThe RK3399-Q7 (Puma) is a system-on-module featuring the Rockchip
5*a13110a9SKlaus GogerRK3399 in a Qseven-compatible form-factor.
6*a13110a9SKlaus Goger
7*a13110a9SKlaus GogerRK3399-Q7 features:
8*a13110a9SKlaus Goger	* CPU: ARMv8 64bit Big-Little architecture,
9*a13110a9SKlaus Goger		* Big: dual-core Cortex-A72
10*a13110a9SKlaus Goger		* Little: quad-core Cortex-A53
11*a13110a9SKlaus Goger		* IRAM: 200KB
12*a13110a9SKlaus Goger	* DRAM: 4GB-128MB dual-channel
13*a13110a9SKlaus Goger	* eMMC: onboard eMMC
14*a13110a9SKlaus Goger	* SD/MMC
15*a13110a9SKlaus Goger	* GbE (onboard Micrel KSZ9031) Gigabit ethernet PHY
16*a13110a9SKlaus Goger	* USB:
17*a13110a9SKlaus Goger		* USB3.0 dual role port
18*a13110a9SKlaus Goger		* 2x USB3.0 host, 1x USB2.0 host via onboard USB3.0 hub
19*a13110a9SKlaus Goger	* Display: HDMI/eDP/MIPI
20*a13110a9SKlaus Goger	* Camera: 2x CSI (one on the edge connector, one on the Q7 specified CSI ZIF)
21*a13110a9SKlaus Goger	* NOR Flash: onboard SPI NOR
22*a13110a9SKlaus Goger	* Companion Controller: onboard additional Cortex-M0 microcontroller
23*a13110a9SKlaus Goger		* RTC
24*a13110a9SKlaus Goger		* fan controller
25*a13110a9SKlaus Goger		* CAN
26*a13110a9SKlaus Goger
27*a13110a9SKlaus GogerHere is the step-by-step to boot to U-Boot on rk3399.
28*a13110a9SKlaus Goger
29*a13110a9SKlaus GogerGet the Source and build ATF/Cortex-M0 binaries
30*a13110a9SKlaus Goger===============================================
31*a13110a9SKlaus Goger
32*a13110a9SKlaus Goger  > git clone git://git.theobroma-systems.com/arm-trusted-firmware.git
33*a13110a9SKlaus Goger  > git clone git://git.theobroma-systems.com/rk3399-cortex-m0.git
34*a13110a9SKlaus Goger
35*a13110a9SKlaus GogerCompile the ATF
36*a13110a9SKlaus Goger===============
37*a13110a9SKlaus Goger
38*a13110a9SKlaus Goger  > cd arm-trusted-firmware
39*a13110a9SKlaus Goger  > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
40*a13110a9SKlaus Goger  > cp build/rk3399/release/bl31.bin ../u-boot
41*a13110a9SKlaus Goger
42*a13110a9SKlaus GogerCompile the M0 firmware
43*a13110a9SKlaus Goger=======================
44*a13110a9SKlaus Goger
45*a13110a9SKlaus Goger  > cd ../rk3399-cortex-m0
46*a13110a9SKlaus Goger  > make CROSS_COMPILE=arm-cortex_m0-eabi-
47*a13110a9SKlaus Goger  > cp rk3399m0.bin ../u-boot
48*a13110a9SKlaus Goger
49*a13110a9SKlaus GogerCompile the U-Boot
50*a13110a9SKlaus Goger==================
51*a13110a9SKlaus Goger
52*a13110a9SKlaus Goger  > cd ../u-boot
53*a13110a9SKlaus Goger  > make CROSS_COMPILE=aarch64-linux-gnu- puma-rk3399_defconfig all
54*a13110a9SKlaus Goger
55*a13110a9SKlaus GogerPackage the image
56*a13110a9SKlaus Goger=================
57*a13110a9SKlaus Goger
58*a13110a9SKlaus Goger	> tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin spl.img
59*a13110a9SKlaus Goger	> tools/mkimage -f board/theobroma/puma_rk3399/fit_spl_atf.its \
60*a13110a9SKlaus Goger		-E rk3399_bl3x.itb
61*a13110a9SKlaus Goger
62*a13110a9SKlaus GogerFlash the image
63*a13110a9SKlaus Goger===============
64*a13110a9SKlaus Goger
65*a13110a9SKlaus GogerCopy the SPL to offset 32k and the FIT image containing the payloads
66*a13110a9SKlaus Goger(U-Boot proper, ATF, M0 Firmware, devicetree) to offset 256k on a SD
67*a13110a9SKlaus Gogercard.
68*a13110a9SKlaus Goger
69*a13110a9SKlaus Goger  > dd if=spl.img of=/dev/sdb seek=64
70*a13110a9SKlaus Goger  > dd if=rk3399_bl3x.itb of=/dev/sdb seek=512
71*a13110a9SKlaus Goger
72*a13110a9SKlaus GogerAfter powering up the board (with the inserted SD card), you should see
73*a13110a9SKlaus Gogera U-Boot console on UART0 (115200n8).
74