U-Boot for Amlogic P201 (S905)

P201 is a reference board manufactured by Amlogic with the following specifications:

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

  • ARM Mali 450 GPU

  • 2GB DDR3 SDRAM

  • 10/100 Ethernet

  • HDMI 2.0 4K/60Hz display

  • 2x USB 2.0 Host

  • eMMC, microSD

  • Infrared receiver

  • SDIO WiFi Module

  • CVBS + Stereo Audio Jack

Schematics are available from Amlogic on demand.

U-Boot Compilation

$exportCROSS_COMPILE=aarch64-none-elf-
$makep201_defconfig
$make

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.shp201/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 but sources have been shared by Linux development contractor, Baylibre:

$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-bn-amlogic-openlinux-20170606amlogic-u-boot
$cdamlogic-u-boot
$makegxb_p201_v1_defconfig
$make
$exportFIPDIR=$PWD/fip

Go back to mainline U-Boot source tree then :

$mkdirfip
$cp$FIPDIR/gxb/bl2.binfip/
$cp$FIPDIR/gxb/acs.binfip/
$cp$FIPDIR/gxb/bl21.binfip/
$cp$FIPDIR/gxb/bl30.binfip/
$cp$FIPDIR/gxb/bl301.binfip/
$cp$FIPDIR/gxb/bl31.imgfip/
$cpu-boot.binfip/bl33.bin
$wgethttps://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/bl1.bin.hardkernelfip/bl1.bin.hardkernel
$chmod+xfip/bl1.bin.hardkernel
$wgethttps://github.com/LibreELEC/amlogic-boot-fip/raw/master/nanopi-k2/aml_chksumfip/aml_chksum
$chmod+xfip/aml_chksum
$$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
$python$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/fip_create--bl30fip/bl30_new.bin\
--bl31fip/bl31.img\
--bl33fip/bl33.bin\
fip/fip.bin
$catfip/bl2_new.binfip/fip.bin>fip/boot_new.bin
$$FIPDIR/gxb/aml_encrypt_gxb--bootsig\
--inputfip/boot_new.bin\
--outputfip/u-boot.bin

Then write U-Boot to SD or eMMC with:

$DEV=/dev/boot_device
$ddif=fip/u-boot.binof=fip/u-boot.bin.gxbbbs=512conv=fsync
$ddif=fip/u-boot.binof=fip/u-boot.bin.gxbbbs=512seek=9skip=8count=87conv=fsync,notrunc
$ddif=/dev/zeroof=fip/u-boot.bin.gxbbbs=512seek=8count=1conv=fsync,notrunc
$ddif=bl1.bin.hardkernelof=fip/u-boot.bin.gxbbbs=512seek=2skip=2count=1conv=fsync,notrunc
$./aml_chksumfip/u-boot.bin.gxbb
$ddif=fip/u-boot.gxbbof=$DEVconv=fsync,notruncbs=512skip=1seek=1
$ddif=fip/u-boot.gxbbof=$DEVconv=fsync,notruncbs=1count=440