All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Building u-boot.imx and SPL simultaneously
Date: Fri, 2 Sep 2016 20:18:48 +0200	[thread overview]
Message-ID: <fb6b5a06-7ebd-c380-c4c8-cd4deede3e08@denx.de> (raw)
In-Reply-To: <226b38f1-0f0f-a997-2272-5bb13d0856bc@jikos.cz>

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
=====================================================================

  reply	other threads:[~2016-09-02 18:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 16:46 [U-Boot] Building u-boot.imx and SPL simultaneously Petr Kulhavy
2016-09-02 18:18 ` Stefano Babic [this message]
2016-09-02 18:57   ` Petr Kulhavy
2016-09-02 20:03     ` Fabio Estevam
2016-09-02 20:53       ` Petr Kulhavy
2016-09-06 13:40         ` Tom Rini
2016-09-06 13:53           ` Otavio Salvador
2016-09-06 13:56             ` Tom Rini
2016-09-06 14:00           ` Eric Nelson
2016-09-06 14:12             ` Petr Kulhavy
2016-09-06 14:17               ` Tom Rini
2016-09-06 14:15             ` Tom Rini
2016-09-10 23:40               ` Eric Nelson
2016-09-18  6:50                 ` Peng Fan
2016-09-18  7:18                   ` Stefano Babic
2016-09-02 21:45     ` Stefano Babic
2016-09-02 23:15       ` Petr Kulhavy
2016-09-03  9:40         ` Stefano Babic
2016-09-03 20:27           ` Otavio Salvador
2016-09-04  8:53             ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb6b5a06-7ebd-c380-c4c8-cd4deede3e08@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.