Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 3 | U-Boot for LibreTech CC 'LePotato' (S905X) |
| 4 | ========================================== |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 5 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 6 | LibreTech CC is a Single Board Computer manufactured by Libre Computer Technology with |
| 7 | the following specifications: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 8 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 9 | v1: |
Jerome Brunet | 4e9158a | 2020-11-06 10:45:55 +0100 | [diff] [blame] | 10 | |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 11 | - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz |
| 12 | - ARM Mali 450 GPU |
| 13 | - 2GB DDR3 SDRAM |
| 14 | - 10/100 Ethernet |
| 15 | - HDMI 2.0 4K/60Hz display |
| 16 | - 40-pin GPIO header |
| 17 | - 4 x USB 2.0 Host |
| 18 | - eMMC, microSD |
| 19 | - Infrared receiver |
Jerome Brunet | 4e9158a | 2020-11-06 10:45:55 +0100 | [diff] [blame] | 20 | - Jack for CVBS and Audio |
| 21 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 22 | v2: |
Jerome Brunet | 4e9158a | 2020-11-06 10:45:55 +0100 | [diff] [blame] | 23 | |
| 24 | - Added SPI NOR |
| 25 | - Removed Jack |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 26 | |
| 27 | Schematics are available on the manufacturer website. |
| 28 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 29 | U-Boot Compilation |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 30 | ------------------ |
| 31 | |
| 32 | .. code-block:: bash |
| 33 | |
| 34 | $ export CROSS_COMPILE=aarch64-none-elf- |
| 35 | $ make libretech-cc_defconfig |
| 36 | $ make |
| 37 | |
Jerome Brunet | 4e9158a | 2020-11-06 10:45:55 +0100 | [diff] [blame] | 38 | Use libretech-cc_v2_defconfig for v2. |
| 39 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 40 | U-Boot Signing with Pre-Built FIP repo |
| 41 | -------------------------------------- |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 42 | |
| 43 | .. code-block:: bash |
| 44 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 45 | $ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1 |
| 46 | $ cd amlogic-boot-fip |
| 47 | $ mkdir my-output-dir |
| 48 | $ ./build-fip.sh lepotato /path/to/u-boot/u-boot.bin my-output-dir |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 49 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 50 | U-Boot Manual Signing |
| 51 | --------------------- |
| 52 | |
| 53 | Amlogic does not provide sources for the firmware and tools needed to create a bootloader |
| 54 | 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] | 55 | |
| 56 | .. code-block:: bash |
| 57 | |
| 58 | $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz |
| 59 | $ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz |
| 60 | $ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz |
| 61 | $ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz |
| 62 | $ 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 |
| 63 | $ git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot |
| 64 | $ cd amlogic-u-boot |
| 65 | $ make libretech_cc_defconfig |
| 66 | $ make |
| 67 | $ export FIPDIR=$PWD/fip |
| 68 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 69 | Go back to the mainline U-Boot source tree then: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 70 | |
| 71 | .. code-block:: bash |
| 72 | |
| 73 | $ mkdir fip |
| 74 | |
| 75 | $ cp $FIPDIR/gxl/bl2.bin fip/ |
| 76 | $ cp $FIPDIR/gxl/acs.bin fip/ |
| 77 | $ cp $FIPDIR/gxl/bl21.bin fip/ |
| 78 | $ cp $FIPDIR/gxl/bl30.bin fip/ |
| 79 | $ cp $FIPDIR/gxl/bl301.bin fip/ |
| 80 | $ cp $FIPDIR/gxl/bl31.img fip/ |
| 81 | $ cp u-boot.bin fip/bl33.bin |
| 82 | |
| 83 | $ $FIPDIR/blx_fix.sh \ |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 84 | fip/bl30.bin \ |
| 85 | fip/zero_tmp \ |
| 86 | fip/bl30_zero.bin \ |
| 87 | fip/bl301.bin \ |
| 88 | fip/bl301_zero.bin \ |
| 89 | fip/bl30_new.bin \ |
| 90 | bl30 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 91 | |
| 92 | $ $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0 |
| 93 | |
| 94 | $ $FIPDIR/blx_fix.sh \ |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 95 | fip/bl2_acs.bin \ |
| 96 | fip/zero_tmp \ |
| 97 | fip/bl2_zero.bin \ |
| 98 | fip/bl21.bin \ |
| 99 | fip/bl21_zero.bin \ |
| 100 | fip/bl2_new.bin \ |
| 101 | bl2 |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 102 | |
| 103 | $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin |
| 104 | $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img |
| 105 | $ $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin |
| 106 | $ $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig |
| 107 | $ $FIPDIR/gxl/aml_encrypt_gxl --bootmk \ |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 108 | --output fip/u-boot.bin \ |
| 109 | --bl2 fip/bl2.n.bin.sig \ |
| 110 | --bl30 fip/bl30_new.bin.enc \ |
| 111 | --bl31 fip/bl31.img.enc \ |
| 112 | --bl33 fip/bl33.bin.enc |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 113 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 114 | Then write U-Boot to SD or eMMC with: |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 115 | |
| 116 | .. code-block:: bash |
| 117 | |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 118 | $ DEV=/dev/boot_device |
Neil Armstrong | 84e5e8e | 2020-06-11 10:53:49 +0200 | [diff] [blame] | 119 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1 |
Christian Hewitt | 879fc2f | 2023-03-20 11:45:49 +0000 | [diff] [blame] | 120 | $ dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=440 |