U-Boot for WeTek Play2 (S905)

WeTek Play2 is an Android STB manufactured by WeTek with the following specification:

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

  • ARM Mali 450 GPU

  • 2GB DDR3 SDRAM

  • 8GB eMMC

  • Gigabit Ethernet

  • AP6335 (v1) or AP6255 (v2) WiFi (b/g/n) and BT 4.0

  • HDMI 2.0 4K/60Hz display

  • 2x USB 2.0 host

  • 1x USB 2.0 otg

  • microSD

  • UART jack

  • Infrared receiver

  • Power LED (blue)

  • Power button (case, front)

  • Reset button (underside)

  • DVB Card: DVB-S or DVB-T/C or ATSC

Schematics are not publicly available but have been shared privately to maintainers.

U-Boot Compilation

$exportCROSS_COMPILE=aarch64-none-elf-
$makewetek-play2_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.shwetek-play2/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 and WeTek has not publicly shared the U-Boot sources needed to build FIP binaries for signing. However you can download them from the amlogic-fip-repo.

$gitclonehttps://github.com/LibreELEC/amlogic-boot-fip--depth=1
$cdamlogic-boot-fip/wetek-play2
$exportFIPDIR=$PWD

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

$mkdirfip
$cp$FIPDIR/bl2.binfip/
$cp$FIPDIR/acs.binfip/
$cp$FIPDIR/bl21.binfip/
$cp$FIPDIR/bl30.binfip/
$cp$FIPDIR/bl301.binfip/
$cp$FIPDIR/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/fip_create--bl30fip/bl30_new.bin\
--bl31fip/bl31.img\
--bl33fip/bl33.bin\
fip/fip.bin
$sed-i's/\x73\x02\x08\x91/\x1F\x20\x03\xD5/'fip/bl2.bin
$python3$FIPDIR/acs_tool.pyfip/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
$catfip/bl2_new.binfip/fip.bin>fip/boot_new.bin
$$FIPDIR/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