U-Boot for LibreTech CC ‘LePotato’ (S905X)

LibreTech CC is a Single Board Computer manufactured by Libre Computer Technology with the following specifications:

v1:

  • Amlogic S905X ARM Cortex-A53 quad-core SoC @ 1.5GHz

  • ARM Mali 450 GPU

  • 2GB DDR3 SDRAM

  • 10/100 Ethernet

  • HDMI 2.0 4K/60Hz display

  • 40-pin GPIO header

  • 4 x USB 2.0 Host

  • eMMC, microSD

  • Infrared receiver

  • Jack for CVBS and Audio

v2:

  • Added SPI NOR

  • Removed Jack

Schematics are available on the manufacturer website.

U-Boot Compilation

$exportCROSS_COMPILE=aarch64-none-elf-
$makelibretech-cc_defconfig
$make

Use libretech-cc_v2_defconfig for v2.

U-Boot Signing with Pre-Built FIP repo

$gitclonehttps://github.com/LibreELEC/amlogic-boot-fip--depth=1
$cdamlogic-boot-fip
$mkdirmy-output-dir
$./build-fip.shlepotato/path/to/u-boot/u-boot.binmy-output-dir

U-Boot Manual Signing

Amlogic does not provide sources for the firmware and tools needed to create a bootloader image so it is necessary to obtain binaries from sources published by the board vendor:

$wgethttps://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
$wgethttps://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
$tarxvfJgcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
$tarxvfJgcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
$exportPATH=$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
$gitclonehttps://github.com/BayLibre/u-boot.git-blibretech-ccamlogic-u-boot
$cdamlogic-u-boot
$makelibretech_cc_defconfig
$make
$exportFIPDIR=$PWD/fip

Go back to the mainline U-Boot source tree then:

$mkdirfip
$cp$FIPDIR/gxl/bl2.binfip/
$cp$FIPDIR/gxl/acs.binfip/
$cp$FIPDIR/gxl/bl21.binfip/
$cp$FIPDIR/gxl/bl30.binfip/
$cp$FIPDIR/gxl/bl301.binfip/
$cp$FIPDIR/gxl/bl31.imgfip/
$cpu-boot.binfip/bl33.bin
$$FIPDIR/blx_fix.sh\
fip/bl30.bin\
fip/zero_tmp\
fip/bl30_zero.bin\
fip/bl301.bin\
fip/bl301_zero.bin\
fip/bl30_new.bin\
bl30
$$FIPDIR/acs_tool.pycfip/bl2.binfip/bl2_acs.binfip/acs.bin0
$$FIPDIR/blx_fix.sh\
fip/bl2_acs.bin\
fip/zero_tmp\
fip/bl2_zero.bin\
fip/bl21.bin\
fip/bl21_zero.bin\
fip/bl2_new.bin\
bl2
$$FIPDIR/gxl/aml_encrypt_gxl--bl3enc--inputfip/bl30_new.bin
$$FIPDIR/gxl/aml_encrypt_gxl--bl3enc--inputfip/bl31.img
$$FIPDIR/gxl/aml_encrypt_gxl--bl3enc--inputfip/bl33.bin
$$FIPDIR/gxl/aml_encrypt_gxl--bl2sig--inputfip/bl2_new.bin--outputfip/bl2.n.bin.sig
$$FIPDIR/gxl/aml_encrypt_gxl--bootmk\
--outputfip/u-boot.bin\
--bl2fip/bl2.n.bin.sig\
--bl30fip/bl30_new.bin.enc\
--bl31fip/bl31.img.enc\
--bl33fip/bl33.bin.enc

Then write U-Boot to SD or eMMC with:

$DEV=/dev/boot_device
$ddif=fip/u-boot.bin.sd.binof=$DEVconv=fsync,notruncbs=512skip=1seek=1
$ddif=fip/u-boot.bin.sd.binof=$DEVconv=fsync,notruncbs=1count=440