b8989cb965930fb247f037a610aa79ac608276d0
[buildroot.git] /
1 From 27a2cd6a1980adf3002412678c8fdec6528dc47d Mon Sep 17 00:00:00 2001
2 From: Trent Piepho <tpiepho@impinj.com>
3 Date: Fri, 6 Apr 2018 17:11:27 -0700
4 Subject: [PATCH] imx: Create distinct pre-processed mkimage config files
5
6 Each imx image is created by a separate sub-make and during this process
7 the mkimage config file is run though cpp.
8
9 The cpp output is to the same file no matter what imx image is being
10 created.
11
12 This means if two imx images are generated in parallel they will attempt
13 to independently produce the same pre-processed mkimage config file at
14 the same time.
15
16 Avoid the problem by making the pre-processed config file name unique
17 based on the imx image it will be used in. This way each image will
18 create a unique config file and they won't clobber each other when run
19 in parallel.
20
21 This should fixed the build bug referenced in b5b0e4e3 ("imximage:
22 Remove failure when no IVT offset is found").
23
24 Cc: Breno Lima <breno.lima@nxp.com>
25 Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
26 Cc: Fabio Estevam <fabio.estevam@nxp.com>
27 Signed-off-by: Trent Piepho <tpiepho@impinj.com>
28 Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
29 [fabio: Adapted to imx_v2017.03_4.9.11_1.0.0_ga]
30 Signed-off-by: Fabio Estevam <festevam@gmail.com>
31 ---
32 arch/arm/imx-common/Makefile | 15 ++++++++-------
33 1 file changed, 8 insertions(+), 7 deletions(-)
34
35 diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
36 index d862258..f1bae8d 100644
37 --- a/arch/arm/imx-common/Makefile
38 +++ b/arch/arm/imx-common/Makefile
39 @@ -69,9 +69,11 @@ endif
40 quiet_cmd_cpp_cfg = CFGS $@
41 cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
42
43 -IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
44 +# mkimage source config file
45 +IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
46
47 -$(IMX_CONFIG): %.cfgtmp: % FORCE
48 +# How to create a cpp processed config file, they all use the same source
49 +%.cfgout: $(IMX_CONFIG) FORCE
50 $(Q)mkdir -p $(dir $@)
51 $(call if_changed_dep,cpp_cfg)
52
53 @@ -79,7 +81,7 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imxim
54 -e $(CONFIG_SYS_TEXT_BASE)
55 u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
56
57 -u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
58 +u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
59 $(call if_changed,mkimage)
60
61 ifeq ($(CONFIG_OF_SEPARATE),y)
62 @@ -87,16 +89,15 @@ MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T i
63 -e $(CONFIG_SYS_TEXT_BASE)
64 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
65
66 -u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
67 +u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
68 $(call if_changed,mkimage)
69 endif
70
71 MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
72 -e $(CONFIG_SPL_TEXT_BASE)
73 -
74 SPL: MKIMAGEOUTPUT = SPL.log
75
76 -SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
77 +SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
78 $(call if_changed,mkimage)
79
80 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
81 @@ -124,4 +125,4 @@ cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
82 spl/u-boot-nand-spl.imx: SPL FORCE
83 $(call if_changed,u-boot-nand-spl_imx)
84
85 -targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx)
86 +targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
87 --
88 2.7.4
89