2
1

0001-imx-Create-distinct-pre-processed-mkimage-config-fil.patch 3.4 KB

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