1 U-Boot for LibreTech CC
2 =======================
4 LibreTech CC is a single board computer manufactured by Libre Technology
5 with the following specifications:
7 - Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz
11 - HDMI 2.0 4K/60Hz display
17 Schematics are available on the manufacturer website.
19 Currently the U-Boot port supports the following devices:
33 > export CROSS_COMPILE=aarch64-none-elf-
34 > make libretech-cc_defconfig
40 To boot the system, u-boot must be combined with several earlier stage
43 * bl2.bin: vendor-provided binary blob
44 * bl21.bin: built from vendor u-boot source
45 * bl30.bin: vendor-provided binary blob
46 * bl301.bin: built from vendor u-boot source
47 * bl31.bin: vendor-provided binary blob
48 * acs.bin: built from vendor u-boot source
50 These binaries and the tools required below have been collected and prebuilt
51 for convenience at <https://github.com/BayLibre/u-boot/releases/>
53 Download and extract the libretech-cc release from there, and set FIPDIR to
54 point to the `fip` subdirectory.
56 > export FIPDIR=/path/to/extracted/fip
58 Alternatively, you can obtain the original vendor u-boot tree which
59 contains the required blobs and sources, and build yourself.
60 Note that old compilers are required for this to build. The compilers here
61 are suggested by Amlogic, and they are 32-bit x86 binaries.
63 > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
64 > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
65 > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
66 > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
67 > 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
68 > git clone https://github.com/BayLibre/u-boot.git -b libretech-cc amlogic-u-boot
70 > make libretech_cc_defconfig
72 > export FIPDIR=$PWD/fip
74 Once you have the binaries available (either through the prebuilt download,
75 or having built the vendor u-boot yourself), you can then proceed to glue
76 everything together. Go back to mainline U-Boot source tree then :
80 > cp $FIPDIR/gxl/bl2.bin fip/
81 > cp $FIPDIR/gxl/acs.bin fip/
82 > cp $FIPDIR/gxl/bl21.bin fip/
83 > cp $FIPDIR/gxl/bl30.bin fip/
84 > cp $FIPDIR/gxl/bl301.bin fip/
85 > cp $FIPDIR/gxl/bl31.img fip/
86 > cp u-boot.bin fip/bl33.bin
88 > $FIPDIR/blx_fix.sh \
97 > $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
99 > $FIPDIR/blx_fix.sh \
108 > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
109 > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
110 > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
111 > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
112 > $FIPDIR/gxl/aml_encrypt_gxl --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
119 and then write the image to SD with:
121 > DEV=/dev/your_sd_device
122 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
123 > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
125 Note that Amlogic provides aml_encrypt_gxl as a 32-bit x86 binary with no
126 source code. Should you prefer to avoid that, there are open source reverse
127 engineered versions available:
129 1. gxlimg <https://github.com/repk/gxlimg>, which comes with a handy
130 Makefile that automates the whole process.
131 2. meson-tools <https://github.com/afaerber/meson-tools>
133 However, these community-developed alternatives are not endorsed by or
134 supported by Amlogic.