[Buildroot] [PATCH 2/2] board: Add Libre Computer AML-S905X-CC board support

Neil Armstrong narmstrong at baylibre.com
Thu Sep 20 09:28:42 UTC 2018


Hi Thomas,

On 09/08/2018 23:14, Thomas Petazzoni wrote:
> Hello Neil,
> 
> On Mon,  6 Aug 2018 08:50:08 +0000, Neil Armstrong wrote:
> 
>> +mkdir ${BINARIES_DIR}/fip/tmp
>> +cp ${BINARIES_DIR}/u-boot.bin ${BINARIES_DIR}/fip/tmp/bl33.bin
>> +cp ${BINARIES_DIR}/fip/bl31.img ${BINARIES_DIR}/fip/tmp/bl31.img
>> +
>> +${BINARIES_DIR}/fip/blx_fix.sh ${BINARIES_DIR}/fip/bl30.bin \
>> +		${BINARIES_DIR}/fip/tmp/zero_tmp \
>> +		${BINARIES_DIR}/fip/tmp/bl30_zero.bin \
>> +		${BINARIES_DIR}/fip/bl301.bin \
>> +		${BINARIES_DIR}/fip/tmp/bl301_zero.bin \
>> +		${BINARIES_DIR}/fip/tmp/bl30_new.bin bl30
>> +
>> +python ${BINARIES_DIR}/fip/acs_tool.pyc ${BINARIES_DIR}/fip/bl2.bin \
>> +		${BINARIES_DIR}/fip/tmp/bl2_acs.bin \
>> +		${BINARIES_DIR}/fip/acs.bin 0
>> +
>> +${BINARIES_DIR}/fip/blx_fix.sh ${BINARIES_DIR}/fip/tmp/bl2_acs.bin \
>> +		${BINARIES_DIR}/fip/tmp/zero_tmp \
>> +		${BINARIES_DIR}/fip/tmp/bl2_zero.bin \
>> +		${BINARIES_DIR}/fip/bl21.bin \
>> +		${BINARIES_DIR}/fip/tmp/bl21_zero.bin \
>> +		${BINARIES_DIR}/fip/tmp/bl2_new.bin bl2
>> +
>> +${BINARIES_DIR}/fip/aml_encrypt_gxl --bl3enc \
>> +		--input ${BINARIES_DIR}/fip/tmp/bl30_new.bin
>> +
>> +${BINARIES_DIR}/fip/aml_encrypt_gxl --bl3enc \
>> +		--input ${BINARIES_DIR}/fip/tmp/bl31.img
>> +
>> +${BINARIES_DIR}/fip/aml_encrypt_gxl --bl3enc \
>> +		--input ${BINARIES_DIR}/fip/tmp/bl33.bin
>> +
>> +${BINARIES_DIR}/fip/aml_encrypt_gxl --bl2sig \
>> +		--input ${BINARIES_DIR}/fip/tmp/bl2_new.bin \
>> +		--output ${BINARIES_DIR}/fip/tmp/bl2.n.bin.sig
>> +
>> +${BINARIES_DIR}/fip/aml_encrypt_gxl --bootmk \
>> +		--output ${BINARIES_DIR}/fip/tmp/u-boot.bin \
>> +		--bl2 ${BINARIES_DIR}/fip/tmp/bl2.n.bin.sig \
>> +		--bl30 ${BINARIES_DIR}/fip/tmp/bl30_new.bin.enc \
>> +		--bl31 ${BINARIES_DIR}/fip/tmp/bl31.img.enc \
>> +		--bl33 ${BINARIES_DIR}/fip/tmp/bl33.bin.enc
> 
> Can't all this stuff be done in a script provided in the aml-s905x-cc
> repository ?

It should, yes.

> 
>> +dd if=${BINARIES_DIR}/fip/tmp/u-boot.bin.sd.bin \
>> +   of=${BINARIES_DIR}/sdcard.img \
>> +   bs=1 count=444 conv=sync,notrunc
>> +
>> +dd if=${BINARIES_DIR}/fip/tmp/u-boot.bin.sd.bin \
>> +   of=${BINARIES_DIR}/sdcard.img \
>> +   bs=512 skip=1 seek=1 conv=fsync,notrunc
> 
> Both of these should be done using the genimage configuration file.
> genimage allows you to place some image data at an arbitrary offset:
> 
> For example:
> 
>         partition spl {
>                 in-partition-table = "no"
>                 image = "sunxi-spl.bin"
>                 offset = 8192
>         }
> 
>         partition u-boot {
>                 in-partition-table = "no"
>                 image = "u-boot.itb"
>                 offset = 40K
>                 size = 1M # 1MB - 40K
>         }

Does it support offset 0 ? We had issues with Yocto Wic not supporting offset < 512....

> 
> 
>> +How to write the SD card or eMMC
>> +================================
>> +
>> +Once the build process is finished you will have an image called "sdcard.img"
>> +in the output/images/ directory.
>> +
>> +Copy the bootable "sdcard.img" onto an SD card or eMMC with "dd":
> 
> How is the eMMC visible as a block device on the build machine ?

This was copied from the Odroid-C2 README ;-)
My bas, on Odroid-C2, you can buy an adapter for eMMC for your PC... I'll remove this.

> 
>> diff --git a/configs/aml-s905x-cc_defconfig b/configs/aml-s905x-cc_defconfig
>> new file mode 100644
>> index 0000000..cb2550b
>> --- /dev/null
>> +++ b/configs/aml-s905x-cc_defconfig
>> @@ -0,0 +1,30 @@
>> +# Architecture
>> +BR2_aarch64=y
> 
> You need something like this:
> 
> # Linux headers same as kernel, a 4.14 series
> BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y
> 
> to make sure the toolchain uses the same kernel headers version as the
> kernel being built.

Sure.

> 
>> +# System
>> +BR2_TARGET_GENERIC_HOSTNAME="aml-s905x-cc"
> 
> Probably not needed.
> 
>> +BR2_TARGET_ROOTFS_EXT2=y
>> +BR2_TARGET_ROOTFS_EXT2_4=y
>> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/librecomputer/aml-s905x-cc/post-build.sh"
>> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/librecomputer/aml-s905x-cc/post-image.sh"
>> +
>> +# Kernel
>> +BR2_LINUX_KERNEL=y
> 
> Please use a fixed version of the Linux kernel.

Why can't it use the latest kernel ? the board is supported upstream and *should* worrk on any version.

> 
>> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
>> +BR2_LINUX_KERNEL_BUILD_DEFAULT_DTS=y
>> +BR2_LINUX_KERNEL_USE_INTREE_DTS=y
>> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="amlogic/meson-gxl-s905x-libretech-cc"
>> +BR2_LINUX_KERNEL_IMAGE=y
>> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
>> +
>> +# U-Boot
>> +BR2_TARGET_UBOOT=y
> 
> Please use a fixed version of U-Boot.

Same as Linux, the board is supported upstream and *should* work on any version.

> 
> Thanks!
> 
> Thomas
> 

Thanks,
Neil


More information about the buildroot mailing list