xref: /openbmc/u-boot/board/amlogic/q200/README.q200 (revision 93e72ac472b537bb4b0c6a97a7e6aab2b37860c6)
1*302987b6SNeil ArmstrongU-Boot for Amlogic Q200
2*302987b6SNeil Armstrong=======================
3*302987b6SNeil Armstrong
4*302987b6SNeil ArmstrongQ200 is a reference board manufactured by Amlogic with the following
5*302987b6SNeil Armstrongspecifications:
6*302987b6SNeil Armstrong
7*302987b6SNeil Armstrong - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
8*302987b6SNeil Armstrong - ARM Mali T860 GPU
9*302987b6SNeil Armstrong - 2/3GB DDR4 SDRAM
10*302987b6SNeil Armstrong - 10/100/1000 Ethernet
11*302987b6SNeil Armstrong - HDMI 2.0 4K/60Hz display
12*302987b6SNeil Armstrong - 2 x USB 2.0 Host, 1 x USB 2.0 Device
13*302987b6SNeil Armstrong - 16GB/32GB/64GB eMMC
14*302987b6SNeil Armstrong - 2MB SPI Flash
15*302987b6SNeil Armstrong - microSD
16*302987b6SNeil Armstrong - SDIO Wifi Module, Bluetooth
17*302987b6SNeil Armstrong - IR receiver
18*302987b6SNeil Armstrong
19*302987b6SNeil ArmstrongCurrently the u-boot port supports the following devices:
20*302987b6SNeil Armstrong - serial
21*302987b6SNeil Armstrong - eMMC, microSD
22*302987b6SNeil Armstrong - Ethernet
23*302987b6SNeil Armstrong - I2C
24*302987b6SNeil Armstrong - Regulators
25*302987b6SNeil Armstrong - Reset controller
26*302987b6SNeil Armstrong - Clock controller
27*302987b6SNeil Armstrong - USB Host
28*302987b6SNeil Armstrong - ADC
29*302987b6SNeil Armstrong
30*302987b6SNeil ArmstrongU-Boot compilation
31*302987b6SNeil Armstrong==================
32*302987b6SNeil Armstrong
33*302987b6SNeil Armstrong > export ARCH=arm
34*302987b6SNeil Armstrong > export CROSS_COMPILE=aarch64-none-elf-
35*302987b6SNeil Armstrong > make khadas-vim2_defconfig
36*302987b6SNeil Armstrong > make
37*302987b6SNeil Armstrong
38*302987b6SNeil ArmstrongImage creation
39*302987b6SNeil Armstrong==============
40*302987b6SNeil Armstrong
41*302987b6SNeil ArmstrongAmlogic doesn't provide sources for the firmware and for tools needed
42*302987b6SNeil Armstrongto create the bootloader image, so it is necessary to obtain them from
43*302987b6SNeil Armstrongthe git tree published by the board vendor:
44*302987b6SNeil Armstrong
45*302987b6SNeil Armstrong > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
46*302987b6SNeil Armstrong > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
47*302987b6SNeil Armstrong > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
48*302987b6SNeil Armstrong > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
49*302987b6SNeil Armstrong > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
50*302987b6SNeil Armstrong > git clone https://github.com/BayLibre/u-boot.git -b n-amlogic-openlinux-20170606 amlogic-u-boot
51*302987b6SNeil Armstrong > cd amlogic-u-boot
52*302987b6SNeil Armstrong > make gxm_q200_v1_defconfig
53*302987b6SNeil Armstrong > make
54*302987b6SNeil Armstrong > export FIPDIR=$PWD/fip
55*302987b6SNeil Armstrong
56*302987b6SNeil ArmstrongGo back to mainline U-Boot source tree then :
57*302987b6SNeil Armstrong > mkdir fip
58*302987b6SNeil Armstrong
59*302987b6SNeil Armstrong > cp $FIPDIR/gxl/bl2.bin fip/
60*302987b6SNeil Armstrong > cp $FIPDIR/gxl/acs.bin fip/
61*302987b6SNeil Armstrong > cp $FIPDIR/gxl/bl21.bin fip/
62*302987b6SNeil Armstrong > cp $FIPDIR/gxl/bl30.bin fip/
63*302987b6SNeil Armstrong > cp $FIPDIR/gxl/bl301.bin fip/
64*302987b6SNeil Armstrong > cp $FIPDIR/gxl/bl31.img fip/
65*302987b6SNeil Armstrong > cp u-boot.bin fip/bl33.bin
66*302987b6SNeil Armstrong
67*302987b6SNeil Armstrong > $FIPDIR/blx_fix.sh \
68*302987b6SNeil Armstrong	fip/bl30.bin \
69*302987b6SNeil Armstrong	fip/zero_tmp \
70*302987b6SNeil Armstrong	fip/bl30_zero.bin \
71*302987b6SNeil Armstrong	fip/bl301.bin \
72*302987b6SNeil Armstrong	fip/bl301_zero.bin \
73*302987b6SNeil Armstrong	fip/bl30_new.bin \
74*302987b6SNeil Armstrong	bl30
75*302987b6SNeil Armstrong
76*302987b6SNeil Armstrong > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
77*302987b6SNeil Armstrong
78*302987b6SNeil Armstrong > $FIPDIR/blx_fix.sh \
79*302987b6SNeil Armstrong	fip/bl2_acs.bin \
80*302987b6SNeil Armstrong	fip/zero_tmp \
81*302987b6SNeil Armstrong	fip/bl2_zero.bin \
82*302987b6SNeil Armstrong	fip/bl21.bin \
83*302987b6SNeil Armstrong	fip/bl21_zero.bin \
84*302987b6SNeil Armstrong	fip/bl2_new.bin \
85*302987b6SNeil Armstrong	bl2
86*302987b6SNeil Armstrong
87*302987b6SNeil Armstrong > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
88*302987b6SNeil Armstrong > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
89*302987b6SNeil Armstrong > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
90*302987b6SNeil Armstrong > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
91*302987b6SNeil Armstrong > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
92*302987b6SNeil Armstrong		--output fip/u-boot.bin \
93*302987b6SNeil Armstrong		--bl2 fip/bl2.n.bin.sig \
94*302987b6SNeil Armstrong		--bl30 fip/bl30_new.bin.enc \
95*302987b6SNeil Armstrong		--bl31 fip/bl31.img.enc \
96*302987b6SNeil Armstrong		--bl33 fip/bl33.bin.enc
97*302987b6SNeil Armstrong
98*302987b6SNeil Armstrongand then write the image to SD with:
99*302987b6SNeil Armstrong
100*302987b6SNeil Armstrong > DEV=/dev/your_sd_device
101*302987b6SNeil Armstrong > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
102*302987b6SNeil Armstrong > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
103