Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 3 | U-Boot for Amlogic SEI610 (S905X3) |
| 4 | ================================== |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 5 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 6 | SEI610 is a customer board manufactured by SEI Robotics with the following specification: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 7 | |
| 8 | - Amlogic S905X3 ARM Cortex-A55 quad-core SoC |
| 9 | - 2GB DDR4 SDRAM |
| 10 | - 10/100 Ethernet (Internal PHY) |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 11 | - 1x USB 3.0 Host |
| 12 | - 1x USB Type-C DRD |
| 13 | - 1x FTDI USB Serial Debug Interface |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 14 | - eMMC |
| 15 | - SDcard |
| 16 | - Infrared receiver |
| 17 | - SDIO WiFi Module |
| 18 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 19 | U-Boot Compilation |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 20 | ------------------ |
| 21 | |
| 22 | .. code-block:: bash |
| 23 | |
| 24 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 25 | $ make sei610_defconfig |
| 26 | $ make |
| 27 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 28 | U-Boot Signing with Pre-Built FIP repo |
| 29 | -------------------------------------- |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 30 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 31 | .. 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 Armstrong | 2ea9868 | 2022-03-02 10:42:22 +0100 | [diff] [blame] | 37 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 38 | U-Boot Manual Signing |
| 39 | --------------------- |
| 40 | |
| 41 | Amlogic does not provide sources for the firmware and tools needed to create a bootloader |
| 42 | image so it is necessary to obtain binaries from sources published by the board vendor: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 43 | |
| 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 Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 57 | Download the latest Amlogic buildroot package and extract it: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 58 | |
| 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 Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 66 | Go back to the mainline U-Boot source tree then: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 67 | |
| 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 Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 88 | 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 Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 95 | |
| 96 | $ sh fip/blx_fix.sh \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 97 | 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 Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 104 | |
| 105 | $ $FIPDIR/g12a/aml_encrypt_g12a --bl30sig --input fip/bl30_new.bin \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 106 | --output fip/bl30_new.bin.g12a.enc \ |
| 107 | --level v3 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 108 | $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl30_new.bin.g12a.enc \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 109 | --output fip/bl30_new.bin.enc \ |
| 110 | --level v3 --type bl30 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 111 | $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl31.img \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 112 | --output fip/bl31.img.enc \ |
| 113 | --level v3 --type bl31 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 114 | $ $FIPDIR/g12a/aml_encrypt_g12a --bl3sig --input fip/bl33.bin --compress lz4 \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 115 | --output fip/bl33.bin.enc \ |
| 116 | --level v3 --type bl33 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 117 | $ $FIPDIR/g12a/aml_encrypt_g12a --bl2sig --input fip/bl2_new.bin \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 118 | --output fip/bl2.n.bin.sig |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 119 | $ $FIPDIR/g12a/aml_encrypt_g12a --bootmk \ |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 120 | --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 Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 133 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 134 | Then write U-Boot to SD or eMMC with: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 135 | |
| 136 | .. code-block:: bash |
| 137 | |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 138 | $ DEV=/dev/boot_device |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 139 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
Christian Hewitt | e7a67c3 | 2023-03-20 11:46:02 +0000 | [diff] [blame] | 140 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 |