blob: 64f62575e2c85dd11ba03df7fd69bcaede7c2c3a [file] [log] [blame]
Neil Armstrong84e5e8e2020-06-11 10:53:49 +02001.. SPDX-License-Identifier: GPL-2.0+
2
Christian Hewitte7a67c32023-03-20 11:46:02 +00003U-Boot for Amlogic SEI610 (S905X3)
4==================================
Neil Armstrong84e5e8e2020-06-11 10:53:49 +02005
Christian Hewitte7a67c32023-03-20 11:46:02 +00006SEI610 is a customer board manufactured by SEI Robotics with the following specification:
Neil Armstrong84e5e8e2020-06-11 10:53:49 +02007
8 - Amlogic S905X3 ARM Cortex-A55 quad-core SoC
9 - 2GB DDR4 SDRAM
10 - 10/100 Ethernet (Internal PHY)
Christian Hewitte7a67c32023-03-20 11:46:02 +000011 - 1x USB 3.0 Host
12 - 1x USB Type-C DRD
13 - 1x FTDI USB Serial Debug Interface
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020014 - eMMC
15 - SDcard
16 - Infrared receiver
17 - SDIO WiFi Module
18
Christian Hewitte7a67c32023-03-20 11:46:02 +000019U-Boot Compilation
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020020------------------
21
22.. code-block:: bash
23
24 $ export CROSS_COMPILE=aarch64-none-elf-
25 $ make sei610_defconfig
26 $ make
27
Christian Hewitte7a67c32023-03-20 11:46:02 +000028U-Boot Signing with Pre-Built FIP repo
29--------------------------------------
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020030
Christian Hewitte7a67c32023-03-20 11:46:02 +000031.. code-block:: bash
32
33 $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
34 $ cd amlogic-boot-fip
35 $ mkdir my-output-dir
36 $ ./build-fip.sh sei610 /path/to/u-boot/u-boot.bin my-output-dir
Neil Armstrong2ea98682022-03-02 10:42:22 +010037
Christian Hewitte7a67c32023-03-20 11:46:02 +000038U-Boot Manual Signing
39---------------------
40
41Amlogic does not provide sources for the firmware and tools needed to create a bootloader
42image so it is necessary to obtain binaries from sources published by the board vendor:
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020043
44.. code-block:: bash
45
46 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
47 $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
48 $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
49 $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
50 $ 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
51 $ git clone https://github.com/BayLibre/u-boot.git -b buildroot-openlinux-4.9-g12a-201904 amlogic-u-boot
52 $ cd amlogic-u-boot
53 $ make sm1_ac200_v1_defconfig
54 $ make
55 $ export UBOOTDIR=$PWD
56
Christian Hewitte7a67c32023-03-20 11:46:02 +000057Download the latest Amlogic buildroot package and extract it:
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020058
59.. code-block:: bash
60
61 $ wget http://openlinux2.amlogic.com:8000/ARM/filesystem/buildroot-openlinux-A113-201901.tgz
62 $ tar xfz buildroot-openlinux-A113-201901.tgz buildroot-openlinux-A113-201901/bootloader
63 $ export BRDIR=$PWD/buildroot-openlinux-A113-201901
64 $ export FIPDIR=$BRDIR/bootloader/uboot-repo/fip
65
Christian Hewitte7a67c32023-03-20 11:46:02 +000066Go back to the mainline U-Boot source tree then:
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020067
68.. code-block:: bash
69
70 $ mkdir fip
71
72 $ wget https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh -O fip/blx_fix.sh
73 $ cp $UBOOTDIR/build/scp_task/bl301.bin fip/
74 $ cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/
75 $ cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/
76 $ cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin fip/
77 $ cp $BRDIR/bootloader/uboot-repo/bl31_1.3/bin/g12a/bl31.img fip/
78 $ cp $FIPDIR/g12a/ddr3_1d.fw fip/
79 $ cp $FIPDIR/g12a/ddr4_1d.fw fip/
80 $ cp $FIPDIR/g12a/ddr4_2d.fw fip/
81 $ cp $FIPDIR/g12a/diag_lpddr4.fw fip/
82 $ cp $FIPDIR/g12a/lpddr4_1d.fw fip/
83 $ cp $FIPDIR/g12a/lpddr4_2d.fw fip/
84 $ cp $FIPDIR/g12a/piei.fw fip/
85 $ cp u-boot.bin fip/bl33.bin
86
87 $ sh fip/blx_fix.sh \
Christian Hewitte7a67c32023-03-20 11:46:02 +000088 fip/bl30.bin \
89 fip/zero_tmp \
90 fip/bl30_zero.bin \
91 fip/bl301.bin \
92 fip/bl301_zero.bin \
93 fip/bl30_new.bin \
94 bl30
Neil Armstrong84e5e8e2020-06-11 10:53:49 +020095
96 $ sh fip/blx_fix.sh \
Christian Hewitte7a67c32023-03-20 11:46:02 +000097 fip/bl2.bin \
98 fip/zero_tmp \
99 fip/bl2_zero.bin \
100 fip/acs.bin \
101 fip/bl21_zero.bin \
102 fip/bl2_new.bin \
103 bl2
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200104
105 $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000106 --output fip/bl30_new.bin.g12a.enc \
107 --level v3
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200108 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000109 --output fip/bl30_new.bin.enc \
110 --level v3 --type bl30
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200111 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000112 --output fip/bl31.img.enc \
113 --level v3 --type bl31
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200114 $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000115 --output fip/bl33.bin.enc \
116 --level v3 --type bl33
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200117 $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000118 --output fip/bl2.n.bin.sig
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200119 $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \
Christian Hewitte7a67c32023-03-20 11:46:02 +0000120 --output fip/u-boot.bin \
121 --bl2 fip/bl2.n.bin.sig \
122 --bl30 fip/bl30_new.bin.enc \
123 --bl31 fip/bl31.img.enc \
124 --bl33 fip/bl33.bin.enc \
125 --ddrfw1 fip/ddr4_1d.fw \
126 --ddrfw2 fip/ddr4_2d.fw \
127 --ddrfw3 fip/ddr3_1d.fw \
128 --ddrfw4 fip/piei.fw \
129 --ddrfw5 fip/lpddr4_1d.fw \
130 --ddrfw6 fip/lpddr4_2d.fw \
131 --ddrfw7 fip/diag_lpddr4.fw \
132 --level v3
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200133
Christian Hewitte7a67c32023-03-20 11:46:02 +0000134Then write U-Boot to SD or eMMC with:
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200135
136.. code-block:: bash
137
Christian Hewitte7a67c32023-03-20 11:46:02 +0000138 $ DEV=/dev/boot_device
Neil Armstrong84e5e8e2020-06-11 10:53:49 +0200139 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
Christian Hewitte7a67c32023-03-20 11:46:02 +0000140 $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440