blob: c55e77849439db56f10c08ddc565c719db0b5d2b [file] [log] [blame]
Neil Armstrong84e5e8e2020-06-11 10:53:49 +02001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for Amlogic SEI510
4=========================
5
6SEI510 is a customer board manufactured by SEI Robotics with the following
7specifications:
8
9 - Amlogic S905X2 ARM Cortex-A53 quad-core SoC
10 - 2GB DDR4 SDRAM
11 - 10/100 Ethernet (Internal PHY)
12 - 1 x USB 3.0 Host
13 - eMMC
14 - SDcard
15 - Infrared receiver
16 - SDIO WiFi Module
17
18U-Boot compilation
19------------------
20
21.. code-block:: bash
22
23 $ export CROSS_COMPILE=aarch64-none-elf-
24 $ make sei510_defconfig
25 $ make
26
27Image creation
28--------------
29
Neil Armstrong2ea98682022-03-02 10:42:22 +010030For simplified usage, pleaser refer to :doc:`pre-generated-fip` with codename `sei510`
31
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020032Amlogic doesn't provide sources for the firmware and for tools needed
33to create the bootloader image, so it is necessary to obtain them from
34the git tree published by the board vendor:
35
36.. code-block:: bash
37
38 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
39 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
40 $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
41 $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
42 $ 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
43 $ git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-20180418 amlogic-u-boot
44 $ cd amlogic-u-boot
45 $ make g12a_u200_v1_defconfig
46 $ make
47 $ export UBOOTDIR=$PWD
48
49Download the latest Amlogic Buildroot package, and extract it :
50
51.. code-block:: bash
52
53 $ wget http://openlinux2.amlogic.com:8000/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz
54 $ tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz buildroot_openlinux_kernel_4.9_fbdev_20180706/bootloader
55 $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706
56 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
57
58Go back to mainline U-Boot source tree then :
59
60.. code-block:: bash
61
62 $ mkdir fip
63
64 $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
65 $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
66 $ cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
67 $ cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
68 $ cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
69 $ cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
70 $ cp $FIPDIR/g12a/ddr3_1d.fw fip/
71 $ cp $FIPDIR/g12a/ddr4_1d.fw fip/
72 $ cp $FIPDIR/g12a/ddr4_2d.fw fip/
73 $ cp $FIPDIR/g12a/diag_lpddr4.fw fip/
74 $ cp $FIPDIR/g12a/lpddr4_1d.fw fip/
75 $ cp $FIPDIR/g12a/lpddr4_2d.fw fip/
76 $ cp $FIPDIR/g12a/piei.fw fip/
77 $ cp u-boot.bin fip/bl33.bin
78
79 $ sh fip/blx_fix.sh \
80 fip/bl30.bin \
81 fip/zero_tmp \
82 fip/bl30_zero.bin \
83 fip/bl301.bin \
84 fip/bl301_zero.bin \
85 fip/bl30_new.bin \
86 bl30
87
88 $ sh fip/blx_fix.sh \
89 fip/bl2.bin \
90 fip/zero_tmp \
91 fip/bl2_zero.bin \
92 fip/acs.bin \
93 fip/bl21_zero.bin \
94 fip/bl2_new.bin \
95 bl2
96
97 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
98 --output fip/bl30_new.bin.g12a.enc \
99 --level v3
100 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
101 --output fip/bl30_new.bin.enc \
102 --level v3 --type bl30
103 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
104 --output fip/bl31.img.enc \
105 --level v3 --type bl31
106 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
107 --output fip/bl33.bin.enc \
108 --level v3 --type bl33
109 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
110 --output fip/bl2.n.bin.sig
111 $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
112 --output fip/u-boot.bin \
113 --bl2 fip/bl2.n.bin.sig \
114 --bl30 fip/bl30_new.bin.enc \
115 --bl31 fip/bl31.img.enc \
116 --bl33 fip/bl33.bin.enc \
117 --ddrfw1 fip/ddr4_1d.fw \
118 --ddrfw2 fip/ddr4_2d.fw \
119 --ddrfw3 fip/ddr3_1d.fw \
120 --ddrfw4 fip/piei.fw \
121 --ddrfw5 fip/lpddr4_1d.fw \
122 --ddrfw6 fip/lpddr4_2d.fw \
123 --ddrfw7 fip/diag_lpddr4.fw \
124 --level v3
125
126and then write the image to SD with:
127
128.. code-block:: bash
129
130 $ DEV=/dev/your_sd_device
131 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
132 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444