am65x build issues

Andrew F. Davis afd at ti.com
Thu Apr 30 23:16:55 CEST 2020


On 4/30/20 3:03 PM, Jan Kiszka wrote:
> Hi all,
> 
> I've noticed that building am65x_evm_a53_defconfig causes the dtbs to be
> built twice, once for the main u-boot and once for the spl. This is
> because of an extra dependency in mach-k3/config_secure.mk added by
> 508369672ca3. Why should the produced dtbs depend on the target that
> produces them? Why not simply this?
> 
> diff --git a/arch/arm/mach-k3/config_secure.mk b/arch/arm/mach-k3/config_secure.mk
> index 6d63c57665..cbe9b684fb 100644
> --- a/arch/arm/mach-k3/config_secure.mk
> +++ b/arch/arm/mach-k3/config_secure.mk
> @@ -34,11 +34,8 @@ MKIMAGEFLAGS_u-boot.img_HS = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
>  	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
>  	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb_HS,$(subst ",,$(CONFIG_OF_LIST)))
> 
> -OF_LIST_TARGETS = $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST)))
> -$(OF_LIST_TARGETS): dtbs
> -
>  u-boot-nodtb.bin_HS: u-boot-nodtb.bin FORCE
>  	$(call if_changed,k3secureimg)
> 
> -u-boot.img_HS: u-boot-nodtb.bin_HS u-boot.img $(patsubst %.dtb,%.dtb_HS,$(OF_LIST_TARGETS)) FORCE
> +u-boot.img_HS: u-boot-nodtb.bin_HS u-boot.img dtbs FORCE
>  	$(call if_changed,mkimage)
> 


Because then no one will depend on the _HS versions of the .dtb files,
so they wont get built.

I agree it's a huge mess right now, the "correct" thing to do would be
for the %.dtb_HS files to depend on their corresponding %.dtb files from
which they are generated. Which they do, kinda. But Make doesn't seem
smart enough to know that at the start, it checks for the .dtb files and
fails instantly during the first round of parsing, due to the .dtb files
not existing and no rules existing for them. The .dtb files are not
being generated by a rule with their name so Make doesn't understand
they will be generated later, because U-Boot uses scripting for dtbs and
uses target "dtbs". So we are stuck depending on that until someone does
some major rework of the U-Boot/Linux makefiles.. Feel free :D

Andrew


> 
> Disclaimer: I didn't actually test the HS path, just the unsigned build.
> 
> But also with this change, make -j remains broken for this target:
> 
> [...]
>   COPY    u-boot.dtb
>   MKIMAGE u-boot-dtb.img
>   MKIMAGE u-boot.img
>   CAT     u-boot-dtb.bin
>   COPY    u-boot.bin
>   CC      spl/./lib/asm-offsets.s
>   CC      spl/./arch/arm/lib/asm-offsets.s
> ../tools/k3_fit_atf.sh \
> spl/dts/k3-am654-base-board.dtb > u-boot-spl-k3.its
>   LDS     spl/u-boot-spl.lds
>   FDTGREP spl/dts/k3-am654-base-board.dtb
> Usage: fdtgrep - extract portions from device tree
> [...]
> 
> Error: Cannot open output file
> make[2]: *** [../scripts/Makefile.spl:465: spl/dts/k3-am654-base-board.dtb] Error 1
> make[2]: *** Waiting for unfinished jobs....
> 
> 
> Something is fishy with dependencies here. Any ideas?
> 
> Thanks,
> Jan
> 


More information about the U-Boot mailing list