[Buildroot] [PATCH v3 02/11] support/scripts: Add sunxi64-post-build.sh

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Oct 21 21:06:37 UTC 2017


Hello,

On Thu, 19 Oct 2017 11:45:24 +0200, Jagan Teki wrote:

> +# sunxi64-post-build script
> +#
> +# Allwinner A64/H5 firmware consists of three parts:
> +# 1) U-Boot's SPL
> +# 2) ARM Trusted Firmware (ATF)
> +# 3) U-Boot proper.
> +#
> +# The SPL will load both ATF and U-Boot proper along with the right device
> +# tree blob (.dtb) and will pass execution to ATF (in EL3), which in turn will
> +# drop into the U-Boot proper (in EL2).
> +#
> +# As the ATF binary will become part of the U-Boot image file, you will need
> +# to build it first and export ATF variable to built U-Boot proper. Since
> +# buildroot not take of building ATF first and export the binary, this post-build
> +# script build the u-boot.itb

Thanks for this explanation. However, I am not too happy with the
solution you propose. Indeed, the U-Boot build system already has all
the logic to produce the u-boot.itb, provided the BL31 environment
variable is defined.

I think the problem is that the ATF package currently only supports
the case where ATF embeds U-Boot (that is for example how it works on
the ARM Juno platform if I remember correctly
(configs/arm_juno_defconfig) or on Marvell platforms. This explains why
the arm-trusted-firmware package depends on uboot.

The sunxi scenario is different because it wants ATF to be built
*before* U-Boot, so basically the opposite.

So I would propose:

 * An option in ATF to decide if it needs U-Boot to be built before or
   not.

 * An option in U-Boot to decide if it needs ATF to be built before or
   not.

 * An option in U-Boot to pass custom variable on the build command
   line so that we can pass the path to BL31. Or directly an option
   that will make uboot.mk pass BL31.

What do you think ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the buildroot mailing list