Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
[oweals/u-boot.git] / board / amlogic / sei610 / README
1 U-Boot for Amlogic SEI610
2 =========================
3
4 SEI610 is a customer board manufactured by SEI Robotics with the following
5 specifications:
6
7  - Amlogic S905X3 ARM Cortex-A55 quad-core SoC
8  - 2GB DDR4 SDRAM
9  - 10/100 Ethernet (Internal PHY)
10  - 1 x USB 3.0 Host
11  - 1 x USB Type-C DRD
12  - 1 x FTDI USB Serial Debug Interface
13  - eMMC
14  - SDcard
15  - Infrared receiver
16  - SDIO WiFi Module
17
18 u-boot compilation
19 ==================
20
21  > export CROSS_COMPILE=aarch64-none-elf-
22  > make sei610_defconfig
23  > make
24
25 Image creation
26 ==============
27
28 Amlogic doesn't provide sources for the firmware and for tools needed
29 to create the bootloader image, so it is necessary to obtain them from
30 the git tree published by the board vendor:
31
32  > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
33  > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
34  > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
35  > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
36  > 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
37  > git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-4.9-g12a-201904 amlogic-u-boot
38  > cd amlogic-u-boot
39  > make sm1_ac200_v1_defconfig
40  > make
41  > export UBOOTDIR=$PWD
42
43 Download the latest Amlogic Buildroot package, and extract it :
44  > wget http://openlinux2.amlogic.com:8000/ARM/filesystem/buildroot-openlinux-A113-201901.tgz
45  > tar xfz buildroot-openlinux-A113-201901.tgz buildroot-openlinux-A113-201901/bootloader
46  > export BRDIR=$PWD/buildroot-openlinux-A113-201901
47  > export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
48
49 Go back to mainline U-Boot source tree then :
50  > mkdir fip
51
52  > wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
53  > cp $UBOOTDIR/build/scp_task/bl301.bin fip/
54  > cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
55  > cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
56  > cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
57  > cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
58  > cp $FIPDIR/g12a/ddr3_1d.fw fip/
59  > cp $FIPDIR/g12a/ddr4_1d.fw fip/
60  > cp $FIPDIR/g12a/ddr4_2d.fw fip/
61  > cp $FIPDIR/g12a/diag_lpddr4.fw fip/
62  > cp $FIPDIR/g12a/lpddr4_1d.fw fip/
63  > cp $FIPDIR/g12a/lpddr4_2d.fw fip/
64  > cp $FIPDIR/g12a/piei.fw fip/
65  > cp u-boot.bin fip/bl33.bin
66
67  > sh fip/blx_fix.sh \
68         fip/bl30.bin \
69         fip/zero_tmp \
70         fip/bl30_zero.bin \
71         fip/bl301.bin \
72         fip/bl301_zero.bin \
73         fip/bl30_new.bin \
74         bl30
75
76  > sh fip/blx_fix.sh \
77         fip/bl2.bin \
78         fip/zero_tmp \
79         fip/bl2_zero.bin \
80         fip/acs.bin \
81         fip/bl21_zero.bin \
82         fip/bl2_new.bin \
83         bl2
84
85  > $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
86                                         --output fip/bl30_new.bin.g12a.enc \
87                                         --level v3
88  > $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
89                                         --output fip/bl30_new.bin.enc \
90                                         --level v3 --type bl30
91  > $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
92                                         --output fip/bl31.img.enc \
93                                         --level v3 --type bl31
94  > $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
95                                         --output fip/bl33.bin.enc \
96                                         --level v3 --type bl33
97  > $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
98                                         --output fip/bl2.n.bin.sig
99  > $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
100                 --output fip/u-boot.bin \
101                 --bl2 fip/bl2.n.bin.sig \
102                 --bl30 fip/bl30_new.bin.enc \
103                 --bl31 fip/bl31.img.enc \
104                 --bl33 fip/bl33.bin.enc \
105                 --ddrfw1 fip/ddr4_1d.fw \
106                 --ddrfw2 fip/ddr4_2d.fw \
107                 --ddrfw3 fip/ddr3_1d.fw \
108                 --ddrfw4 fip/piei.fw \
109                 --ddrfw5 fip/lpddr4_1d.fw \
110                 --ddrfw6 fip/lpddr4_2d.fw \
111                 --ddrfw7 fip/diag_lpddr4.fw \
112                 --level v3
113
114 and then write the image to SD with:
115
116  > DEV=/dev/your_sd_device
117  > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
118  > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444