meson-tools is a collection of tools for use with the Amlogic Meson family of ARM based SoCs.
Name-wise it was inspired by sunxi-tools.
Usage:
amlbootsig boot_new.bin u-boot.img
This tool is supposed to provide equivalent output to:
aml_encrypt_gxb --bootsig --input boot_new.bin --output u-boot.img
with the tool version distributed by Hardkernel for their Odroid-C2 board (S905 / Meson GXBaby).
hexdump -C a/u-boot.img > a/u-boot.img.hex
hexdump -C b/u-boot.img > b/u-boot.img.hex
diff -u a/u-boot.img.hex b/u-boot.img.hex | less
This should result in a diff with only the following differences:
For testing identity of output files, modify the code to use the random bytes from the file you are testing against.
Usage:
unamlbootsig u-boot.img boot_new.bin
This tool is supposed to do the reverse of amlbootsig
, i.e. drop the boot signature.
The output may differ from the original aml_encrypt_gxb --bootsig
/amlbootsig
input from 0xb000 to 0xbfff as well as in FIP TOC entry size 16-byte alignment.
See amlbootsig
.
Usage:
amlbootsig-gxl bl2_new.bin bl2_new.bin.sig
This tool is supposed to provide equivalent output to:
aml_encrypt_gxl --bl2sig --input bl2_new.bin --output bl2_new.bin.sig
with the tool version distributed by Amlogic in their 2018-07-06 Buildroot tarball.
hexdump -C a/bl2_new.bin.sig > a/bl2_new.bin.sig.hex
hexdump -C b/bl2_new.bin.sig > b/bl2_new.bin.sig.hex
diff -u a/bl2_new.bin.sig.hex b/bl2_new.bin.sig.hex | less
This should result in a diff with only the following differences:
For testing identity of output files, modify the code to use the random bytes from the file you are testing against.
Specifically tailored to BL2.
Otherwise see amlbootsig
.
Usage:
amlbootenc-gxl u-boot.bin u-boot.bin.enc
This tool is supposed to provide equivalent output to:
aml_encrypt_gxl --bl3enc --input u-boot.bin --output u-boot.bin.enc
with the tool versions distributed by Amlogic in their 2018-07-06 Buildroot tarball.
hexdump -C a/u-boot.bin.enc > a/u-boot.bin.enc.hex
hexdump -C b/u-boot.bin.enc > b/u-boot.bin.enc.hex
diff -u a/u-boot.bin.enc.hex b/u-boot.bin.enc.hex | less
This should result in a diff with the following differences:
For testing identity of output files, modify the code to use the key/IV bytes from the file you are testing against.
Specifically tailored to BL3x.
Otherwise see amlbootsig
.
Usage:
fiptool --align 0x4000 --scp-fw bl30_new.bin.enc --soc-fw bl31.img.enc --nt-fw u-boot.bin.enc fip.bin
amlbootenc-gxl fip.bin fip.bin.enc
dd if=fip.bin.enc of=fip.enc.bin bs=512 count=31
amlbootimg-gxl bl2_new.bin.sig fip.enc.bin bl30_new.bin.enc bl31.img.enc u-boot.bin.enc u-boot.img
This tool is supposed to provide equivalent output to:
aml_encrypt_gxl --bootmk --bl2 bl2_new.bin.sig --bl30 bl30_new.bin.enc --bl31 bl31.img.enc --bl33 u-boot.bin.enc --output u-boot.img
dd if=u-boot.img.sd.bin of=/dev/XXX bs=512 skip=1 seek=1
with the tool versions distributed by Amlogic in their 2018-07-06 Buildroot tarball.
To deploy the file to SD card:
dd if=u-boot.img of=/dev/XXX bs=512 seek=1
hexdump -C a/u-boot.img > a/u-boot.img.hex
hexdump -C b/u-boot.img > b/u-boot.img.hex
diff -u a/u-boot.img.hex b/u-boot.img.hex | less
This should result in a diff with the following differences:
Otherwise see amlbootsig
.
Usage:
amlinfo u-boot.img
This tool dumps info about an existing image file.
It supports the following inputs:
amlbootsig
outputaml_encrypt_gxb --bootsig
output, except when using --amluserkey
or --efuse
dd if=u-boot.img bs=512 skip=96
output for either of them (FIP TOC with headered entries)dd if=u-boot.img bs=1 skip=16
output, i.e. raw @AML
header, of at least 64 bytesamlbootsig-gxl
outputaml_encrypt_gxl --bl2sig
output