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