[U-Boot] [PATCH v2 3/7] fdt: Build an SPL binary without device tree

Masahiro Yamada yamada.masahiro at socionext.com
Sun Jan 31 17:15:47 CET 2016


Hi Simon,


2016-01-29 12:24 GMT+09:00 Simon Glass <sjg at chromium.org>:
> At present u-boot-spl.bin holds the plain SPL binary without the device
> tree. This is somewhat annoying since you need either u-boot-spl.bin or
> u-boot-spl-dtb.bin depending on whether device tree is used.
>
> Adjust the build such that u-boot-spl.bin includes a device tree
> (if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now
> u-boot-spl-dtb.bin remains the same.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2: None
>
>  scripts/Makefile.spl | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index dff16b9..2b4890f 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -131,14 +131,14 @@ boot.bin: $(obj)/u-boot-spl.bin
>  else
>  MKIMAGEFLAGS_boot.bin = -T zynqimage
>
> -spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
> +spl/boot.bin: $(obj)/u-boot-spl.bin
>         $(call if_changed,mkimage)
>  endif
>
>  ALL-y  += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
>
>  ifdef CONFIG_SPL_OF_CONTROL
> -ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin $(obj)/$(SPL_BIN)-dtb.bin
> +ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin $(obj)/$(SPL_BIN)-nodtb.bin
>  endif


I think this line can be completely omitted.

If CONFIG_SPL_OF_CONTROL=y, these two are generated by the following
dependency chain:

$(SPL_BIN).bin  ->  $(SPL_BIN)-dtb.bin  -> $(SPL_BIN)-nodtb.bin,
$(SPL_BIN)-pad.bin





>  ifdef CONFIG_SAMSUNG
> @@ -166,11 +166,19 @@ all:      $(ALL-y)
>  quiet_cmd_cat = CAT     $@
>  cmd_cat = cat $(filter-out $(PHONY), $^) > $@
>
> -$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
> +ifeq ($(CONFIG_SPL_OF_CONTROL),y)
> +$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin $(obj)/$(SPL_BIN)-pad.bin \
>                 $(obj)/$(SPL_BIN).dtb FORCE
>         $(call if_changed,cat)
>
> -# Create a file that pads from the end of u-boot-spl.bin to bss_end
> +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
> +       $(call if_changed,cat)
> +else
> +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
> +       $(call if_changed,cat)
> +endif

You can use if_changed,copy  if you like.







-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list