All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Building u-boot.imx and SPL simultaneously
@ 2016-09-02 16:46 Petr Kulhavy
  2016-09-02 18:18 ` Stefano Babic
  0 siblings, 1 reply; 20+ messages in thread
From: Petr Kulhavy @ 2016-09-02 16:46 UTC (permalink / raw)
  To: u-boot

Hi,

I'm facing a problem that the iMX Makefile does not allow to build 
u-boot.imx and the SPL binary simultaneously. 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 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.


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)

----------------------------------------

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-09-18  7:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 16:46 [U-Boot] Building u-boot.imx and SPL simultaneously Petr Kulhavy
2016-09-02 18:18 ` Stefano Babic
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

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.