Makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2000-2006
  4. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. #
  6. # (C) Copyright 2011 Freescale Semiconductor, Inc.
  7. ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 mx8m vf610))
  8. obj-y = iomux-v3.o
  9. endif
  10. ifeq ($(SOC),$(filter $(SOC),mx8m))
  11. obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
  12. obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
  13. obj-$(CONFIG_FEC_MXC) += mac.o
  14. obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
  15. obj-y += cpu.o
  16. endif
  17. ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
  18. obj-y += cpu.o speed.o
  19. obj-$(CONFIG_GPT_TIMER) += timer.o
  20. obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
  21. endif
  22. ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs mx8m))
  23. obj-y += misc.o
  24. obj-$(CONFIG_SPL_BUILD) += spl.o
  25. endif
  26. ifeq ($(SOC),$(filter $(SOC),mx7))
  27. obj-y += cpu.o
  28. obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
  29. obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
  30. endif
  31. ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
  32. obj-y += cache.o init.o
  33. obj-$(CONFIG_FEC_MXC) += mac.o
  34. obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
  35. obj-$(CONFIG_IMX_RDC) += rdc-sema.o
  36. ifneq ($(CONFIG_SPL_BUILD),y)
  37. obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
  38. endif
  39. obj-$(CONFIG_SATA) += sata.o
  40. obj-$(CONFIG_SECURE_BOOT) += hab.o
  41. obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
  42. endif
  43. ifeq ($(SOC),$(filter $(SOC),mx7ulp))
  44. obj-y += cache.o
  45. obj-$(CONFIG_SECURE_BOOT) += hab.o
  46. endif
  47. ifeq ($(SOC),$(filter $(SOC),vf610))
  48. obj-y += ddrmc-vf610.o
  49. endif
  50. ifneq ($(CONFIG_SPL_BUILD),y)
  51. obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
  52. obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
  53. obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
  54. endif
  55. PLUGIN = board/$(BOARDDIR)/plugin
  56. ifeq ($(CONFIG_USE_IMXIMG_PLUGIN),y)
  57. $(PLUGIN).o: $(PLUGIN).S FORCE
  58. $(Q)mkdir -p $(dir $@)
  59. $(call if_changed_dep,as_o_S)
  60. $(PLUGIN).bin: $(PLUGIN).o FORCE
  61. $(Q)mkdir -p $(dir $@)
  62. $(OBJCOPY) -O binary --gap-fill 0xff $< $@
  63. else
  64. $(PLUGIN).bin:
  65. endif
  66. quiet_cmd_cpp_cfg = CFGS $@
  67. cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
  68. # mkimage source config file
  69. IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
  70. # How to create a cpp processed config file, they all use the same source
  71. %.cfgout: $(IMX_CONFIG) FORCE
  72. $(Q)mkdir -p $(dir $@)
  73. $(call if_changed_dep,cpp_cfg)
  74. MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
  75. -e $(CONFIG_SYS_TEXT_BASE)
  76. u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
  77. u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
  78. $(call if_changed,mkimage)
  79. ifeq ($(CONFIG_OF_SEPARATE),y)
  80. MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
  81. -e $(CONFIG_SYS_TEXT_BASE)
  82. u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
  83. u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
  84. $(call if_changed,mkimage)
  85. endif
  86. MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
  87. -e $(CONFIG_SPL_TEXT_BASE)
  88. SPL: MKIMAGEOUTPUT = SPL.log
  89. SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
  90. $(call if_changed,mkimage)
  91. MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
  92. -e $(CONFIG_SYS_TEXT_BASE) -C none -T firmware
  93. u-boot.uim: u-boot.bin FORCE
  94. $(call if_changed,mkimage)
  95. OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
  96. append = cat $(filter-out $< $(PHONY), $^) >> $@
  97. quiet_cmd_pad_cat = CAT $@
  98. cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
  99. u-boot-with-spl.imx: SPL u-boot.uim FORCE
  100. $(call if_changed,pad_cat)
  101. u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
  102. $(call if_changed,pad_cat)
  103. quiet_cmd_u-boot-nand-spl_imx = GEN $@
  104. cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
  105. dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
  106. spl/u-boot-nand-spl.imx: SPL FORCE
  107. $(call if_changed,u-boot-nand-spl_imx)
  108. targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
  109. obj-$(CONFIG_ARM64) += sip.o
  110. obj-$(CONFIG_MX5) += mx5/
  111. obj-$(CONFIG_MX6) += mx6/
  112. obj-$(CONFIG_MX7) += mx7/
  113. obj-$(CONFIG_ARCH_MX7ULP) += mx7ulp/
  114. obj-$(CONFIG_MX8M) += mx8m/