[Question] TI's u-boot.img is built twice

Simon Glass sjg at chromium.org
Fri Sep 22 17:01:18 CEST 2023


Hi Masahiro,

On Thu, 21 Sept 2023 at 09:36, Masahiro Yamada <masahiroy at kernel.org> wrote:
>
> Hi.
>
> Since the TI platform migrated to binman,
> u-boot.img is built twice.
>
> It is created by "mkimage -E",
> then overwritten by binman.
>
>
> So, the data are embedded in the FIT structure
> instead of being appended.
>
> Is this intentional?
>
> To me, it looks weird.
>
>
>
>
> To confirm it, apply the following hack.
>
> Since u-boot.img is overwritten by binman,
> copy it to u-boot.img.backup.
>
>
>
>
> diff --git a/Makefile b/Makefile
> index 87f9fc786e..4cffa8a061 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1112,6 +1112,7 @@ endef
>  # Timestamp file to make sure that binman always runs
>  .binman_stamp: $(INPUTS-y) FORCE
>  ifeq ($(CONFIG_BINMAN),y)
> +       cp u-boot.img u-boot.img.backup
>         $(call if_changed,binman)
>  endif
>         @touch $@
>
>
>
> Then, build it for the main core.
>
>
> make -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu-
>    am64x_evm_a53_defconfig all
>    TEE=~/ref/OP-TEE/optee_os/out/arm-plat-k3/core/tee-raw.bin
>    BL31=~/ref/trusted-firmware-a/build/k3/lite/release/bl31.bin
>    BINMAN_INDIRS=~/ref/ti-linux-firmware
>
>
>
>
> Compare the two files.
> Run fdtdump to see what happened to them.
>
>
> $ diff -u u-boot.img  u-boot.img.backup
> Binary files u-boot.img and u-boot.img.backup differ
>
>
> $ fdtdump u-boot.img
>     => u-boot and dt are embedded.
>
> $ fdtdump u-boot.img.backup
>     => u-boot and dt are appended after the
>        FIT structure

That seems like a bug to me...at some point we might consider building
u-boot.img with Binman, but for now it is built by the Makefile.

>
>
>
> --
> Best Regards
> Masahiro Yamada

Regards,
Simon


More information about the U-Boot mailing list