blob: 87cb701a086092d5fb5d7814696bf3804b96f366 [file] [log] [blame]
Neil Armstrong0ce36392020-06-11 10:53:49 +02001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewittd1f366f2023-03-20 11:46:01 +00003U-Boot for Amlogic SEI510 (S905X2)
4==================================
Neil Armstrong0ce36392020-06-11 10:53:49 +02005
Christian Hewittd1f366f2023-03-20 11:46:01 +00006SEI510 is a customer board manufactured by SEI Robotics with the following specification:
Neil Armstrong0ce36392020-06-11 10:53:49 +02007
8 - Amlogic S905X2 ARM Cortex-A53 quad-core SoC
9 - 2GB DDR4 SDRAM
10 - 10/100 Ethernet (Internal PHY)
Christian Hewittd1f366f2023-03-20 11:46:01 +000011 - 1x USB 3.0 Host
Neil Armstrong0ce36392020-06-11 10:53:49 +020012 - eMMC
13 - SDcard
14 - Infrared receiver
15 - SDIO WiFi Module
16
Christian Hewittd1f366f2023-03-20 11:46:01 +000017U-Boot Compilation
Neil Armstrong0ce36392020-06-11 10:53:49 +020018------------------
19
20.. code-block:: bash
21
22 $ export CROSS_COMPILE=aarch64-none-elf-
23 $ make sei510_defconfig
24 $ make
25
Christian Hewittd1f366f2023-03-20 11:46:01 +000026U-Boot Signing with Pre-Built FIP repo
27--------------------------------------
Neil Armstrong0ce36392020-06-11 10:53:49 +020028
Christian Hewittd1f366f2023-03-20 11:46:01 +000029.. code-block:: bash
Neil Armstrong4c605122022-03-02 10:42:22 +010030
Christian Hewittd1f366f2023-03-20 11:46:01 +000031 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
32 $ cd amlogic-boot-fip
33 $ mkdir my-output-dir
34 $ ./build-fip.sh sei510 /path/to/u-boot/u-boot.bin my-output-dir
35
36U-Boot Manual Signing
37---------------------
38
39Amlogic does not provide sources for the firmware and tools needed to create a bootloader
40image so it is necessary to obtain binaries from sources published by the board vendor:
Neil Armstrong0ce36392020-06-11 10:53:49 +020041
42.. code-block:: bash
43
44 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
45 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
46 $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
47 $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
48 $ 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
49 $ git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-20180418 amlogic-u-boot
50 $ cd amlogic-u-boot
51 $ make g12a_u200_v1_defconfig
52 $ make
53 $ export UBOOTDIR=$PWD
54
Christian Hewittd1f366f2023-03-20 11:46:01 +000055Download the latest Amlogic Buildroot package and extract it:
Neil Armstrong0ce36392020-06-11 10:53:49 +020056
57.. code-block:: bash
58
59 $ wget http://openlinux2.amlogic.com:8000/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz
60 $ tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz buildroot_openlinux_kernel_4.9_fbdev_20180706/bootloader
61 $ export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706
62 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
63
Christian Hewittd1f366f2023-03-20 11:46:01 +000064Go back to the mainline U-Boot source tree then:
Neil Armstrong0ce36392020-06-11 10:53:49 +020065
66.. code-block:: bash
67
68 $ mkdir fip
69
70 $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
71 $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
72 $ cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
73 $ cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
74 $ cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
75 $ cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
76 $ cp $FIPDIR/g12a/ddr3_1d.fw fip/
77 $ cp $FIPDIR/g12a/ddr4_1d.fw fip/
78 $ cp $FIPDIR/g12a/ddr4_2d.fw fip/
79 $ cp $FIPDIR/g12a/diag_lpddr4.fw fip/
80 $ cp $FIPDIR/g12a/lpddr4_1d.fw fip/
81 $ cp $FIPDIR/g12a/lpddr4_2d.fw fip/
82 $ cp $FIPDIR/g12a/piei.fw fip/
83 $ cp u-boot.bin fip/bl33.bin
84
85 $ sh fip/blx_fix.sh \
Christian Hewittd1f366f2023-03-20 11:46:01 +000086 fip/bl30.bin \
87 fip/zero_tmp \
88 fip/bl30_zero.bin \
89 fip/bl301.bin \
90 fip/bl301_zero.bin \
91 fip/bl30_new.bin \
92 bl30
Neil Armstrong0ce36392020-06-11 10:53:49 +020093
94 $ sh fip/blx_fix.sh \
Christian Hewittd1f366f2023-03-20 11:46:01 +000095 fip/bl2.bin \
96 fip/zero_tmp \
97 fip/bl2_zero.bin \
98 fip/acs.bin \
99 fip/bl21_zero.bin \
100 fip/bl2_new.bin \
101 bl2
Neil Armstrong0ce36392020-06-11 10:53:49 +0200102
103 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000104 --output fip/bl30_new.bin.g12a.enc \
105 --level v3
Neil Armstrong0ce36392020-06-11 10:53:49 +0200106 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000107 --output fip/bl30_new.bin.enc \
108 --level v3 --type bl30
Neil Armstrong0ce36392020-06-11 10:53:49 +0200109 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000110 --output fip/bl31.img.enc \
111 --level v3 --type bl31
Neil Armstrong0ce36392020-06-11 10:53:49 +0200112 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000113 --output fip/bl33.bin.enc \
114 --level v3 --type bl33
Neil Armstrong0ce36392020-06-11 10:53:49 +0200115 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000116 --output fip/bl2.n.bin.sig
Neil Armstrong0ce36392020-06-11 10:53:49 +0200117 $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
Christian Hewittd1f366f2023-03-20 11:46:01 +0000118 --output fip/u-boot.bin \
119 --bl2 fip/bl2.n.bin.sig \
120 --bl30 fip/bl30_new.bin.enc \
121 --bl31 fip/bl31.img.enc \
122 --bl33 fip/bl33.bin.enc \
123 --ddrfw1 fip/ddr4_1d.fw \
124 --ddrfw2 fip/ddr4_2d.fw \
125 --ddrfw3 fip/ddr3_1d.fw \
126 --ddrfw4 fip/piei.fw \
127 --ddrfw5 fip/lpddr4_1d.fw \
128 --ddrfw6 fip/lpddr4_2d.fw \
129 --ddrfw7 fip/diag_lpddr4.fw \
130 --level v3
Neil Armstrong0ce36392020-06-11 10:53:49 +0200131
Christian Hewittd1f366f2023-03-20 11:46:01 +0000132Then write U-Boot to SD or eMMC with:
Neil Armstrong0ce36392020-06-11 10:53:49 +0200133
134.. code-block:: bash
135
Christian Hewittd1f366f2023-03-20 11:46:01 +0000136 $ DEV=/dev/boot_device
Neil Armstrong0ce36392020-06-11 10:53:49 +0200137 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewittd1f366f2023-03-20 11:46:01 +0000138 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440