[U-Boot] Building u-boot.imx and SPL simultaneously

Stefano Babic sbabic at denx.de
Fri Sep 2 20:18:48 CEST 2016


Hi,

On 02/09/2016 18:46, Petr Kulhavy wrote:
> Hi,
> 
> I'm facing a problem that the iMX Makefile does not allow to build
> u-boot.imx and the SPL binary simultaneously.

...I am missing why you need to build them at the same time. Can you
start with a detailed description of the problem ? Why is it not enough
to build them in sequence ?

> This would be useful for
> generating images for flash and for a serial loading.
> The reason is that each target needs a different config file, but there
> is only one IMX_CONFIG variable.

I do not get the point. Yes, you have two defconfig. And yes, you cannot
built it at the same time. But you define the IMX_CONFIG in each of the
two defconfig, making use of two different IMX_CONFIG, if this is what
you want.

> 
> I have tried to create a dedicated IMX_CONFIG_SPL for the SPL, which
> seems to work and I almost prepared a patch for submit.
> Unfortunatelly there is some problem with the dependencies if both
> u-boot.imx and SPL are put in ALL-y. The make with single job runs but
> it fails in multi-job execution.
> 
> Could you please help me and throw some light into the dependencies. I
> think this patch could be useful also for others, see below.
> 
> 

Best regards,
Stefano Babic

> Thanks
> Petr
> 
> ---------------------------------------------
> 
> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> index 8f85862..57ea5d3 100644
> --- a/arch/arm/config.mk
> +++ b/arch/arm/config.mk
> @@ -132,16 +132,18 @@ ifdef CONFIG_EFI_LOADER
>  OBJCOPYFLAGS += -j .efi_runtime -j .efi_runtime_rel
>  endif
> 
> -ifneq ($(CONFIG_IMX_CONFIG),)
> +ifneq ($(CONFIG_IMX_CONFIG_SPL),)
>  ifdef CONFIG_SPL
>  ifndef CONFIG_SPL_BUILD
>  ALL-y += SPL
>  endif
> -else
> +endif
> +endif
> +
> +ifneq ($(CONFIG_IMX_CONFIG),)
>  ifeq ($(CONFIG_OF_SEPARATE),y)
>  ALL-y += u-boot-dtb.imx
>  else
>  ALL-y += u-boot.imx
>  endif
>  endif
> -endif
> diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
> index d34a784..b2e3490 100644
> --- a/arch/arm/imx-common/Makefile
> +++ b/arch/arm/imx-common/Makefile
> @@ -42,8 +42,9 @@ quiet_cmd_cpp_cfg = CFGS    $@
>        cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
> 
>  IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
> +IMX_CONFIG_SPL = $(CONFIG_IMX_CONFIG_SPL:"%"=%).cfgtmp
> 
> -$(IMX_CONFIG): %.cfgtmp: % FORCE
> +$(IMX_CONFIG) $(IMX_CONFIG_SPL): %.cfgtmp: % FORCE
>         $(Q)mkdir -p $(dir $@)
>         $(call if_changed_dep,cpp_cfg)
> 
> @@ -64,7 +65,7 @@ endif
>  MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \
>         -e $(CONFIG_SPL_TEXT_BASE)
> 
> -SPL: spl/u-boot-spl.bin $(IMX_CONFIG) FORCE
> +SPL: spl/u-boot-spl.bin $(IMX_CONFIG_SPL) FORCE
>         $(call if_changed,mkimage)
> 
>  MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
> @@ -92,4 +93,4 @@ cmd_u-boot-nand-spl_imx = (printf
> '\000\000\000\000\106\103\102\040\001' && \
>  spl/u-boot-nand-spl.imx: SPL FORCE
>         $(call if_changed,u-boot-nand-spl_imx)
> 
> -targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim
> spl/u-boot-nand-spl.imx)
> +targets += $(addprefix ../../../,$(IMX_CONFIG) $(IMX_CONFIG_SPL) SPL
> u-boot.uim spl/u-boot-nand-spl.imx)
> 
> ----------------------------------------
> 


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list