]> Git Repo - J-u-boot.git/blame_incremental - arch/arm/mach-imx/Makefile
global: Rename SPL_ to XPL_
[J-u-boot.git] / arch / arm / mach-imx / Makefile
... / ...
CommitLineData
1# SPDX-License-Identifier: GPL-2.0+
2#
3# (C) Copyright 2000-2006
4# Wolfgang Denk, DENX Software Engineering, [email protected].
5#
6# (C) Copyright 2011 Freescale Semiconductor, Inc.
7
8ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 imx8m imx9 vf610))
9obj-y = iomux-v3.o
10endif
11
12ifeq ($(SOC),$(filter $(SOC),imx8m))
13ifneq ($(CONFIG_XPL_BUILD),y)
14obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
15endif
16obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
17obj-$(CONFIG_FEC_MXC) += mac.o
18obj-$(CONFIG_DWC_ETH_QOS) += mac.o
19obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
20obj-$(CONFIG_IMX_HAB) += hab.o
21obj-y += cpu.o
22endif
23
24ifeq ($(SOC),$(filter $(SOC),imx8m imx9))
25ifneq ($(CONFIG_XPL_BUILD),y)
26obj-y += fdt.o
27endif
28endif
29
30ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
31obj-y += cpu.o speed.o
32ifneq ($(CONFIG_MX51),y)
33obj-y += mmdc_size.o
34endif
35obj-$(CONFIG_GPT_TIMER) += timer.o
36obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
37endif
38ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs imx8m imx8 imx9 imxrt))
39obj-y += misc.o
40obj-$(CONFIG_CMD_PRIBLOB) += priblob.o
41obj-$(CONFIG_XPL_BUILD) += spl.o
42endif
43ifeq ($(SOC),$(filter $(SOC),mx7))
44obj-y += cpu.o
45obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
46obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
47endif
48ifeq ($(SOC),$(filter $(SOC),mx7 imx8m))
49ifneq ($(CONFIG_XPL_BUILD),y)
50obj-$(CONFIG_FSL_MFGPROT) += cmd_mfgprot.o
51endif
52endif
53ifeq ($(SOC),$(filter $(SOC),mx5 mx6 mx7))
54obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
55endif
56ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
57obj-y += cache.o init.o
58obj-$(CONFIG_FEC_MXC) += mac.o
59obj-$(CONFIG_IMX_RDC) += rdc-sema.o
60ifneq ($(CONFIG_XPL_BUILD),y)
61obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
62endif
63obj-$(CONFIG_$(XPL_)SATA) += sata.o
64obj-$(CONFIG_IMX_HAB) += hab.o
65obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
66endif
67ifeq ($(SOC),$(filter $(SOC),mx7ulp))
68obj-y += cache.o mmdc_size.o
69obj-$(CONFIG_IMX_HAB) += hab.o
70endif
71ifeq ($(SOC),$(filter $(SOC),vf610))
72obj-y += ddrmc-vf610.o
73obj-$(CONFIG_DDRMC_VF610_CALIBRATION) += ddrmc-vf610-calibration.o
74endif
75ifeq ($(SOC),$(filter $(SOC),imx8))
76ifneq ($(CONFIG_XPL_BUILD),y)
77obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
78endif
79endif
80ifneq ($(CONFIG_XPL_BUILD),y)
81obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
82obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
83obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
84obj-$(CONFIG_CMD_NANDBCB) += cmd_nandbcb.o
85endif
86
87ifeq ($(CONFIG_XPL_BUILD),y)
88obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += image-container.o
89endif
90
91ifeq ($(SOC),$(filter $(SOC),imx8ulp imx9))
92obj-$(CONFIG_AHAB_BOOT) += ele_ahab.o
93endif
94
95PLUGIN = board/$(BOARDDIR)/plugin
96
97ifeq ($(CONFIG_USE_IMXIMG_PLUGIN),y)
98
99$(PLUGIN).o: $(PLUGIN).S FORCE
100 $(Q)mkdir -p $(dir $@)
101 $(call if_changed_dep,as_o_S)
102
103$(PLUGIN).bin: $(PLUGIN).o FORCE
104 $(Q)mkdir -p $(dir $@)
105 $(OBJCOPY) -O binary --gap-fill 0xff $< $@
106else
107
108$(PLUGIN).bin:
109
110endif
111
112quiet_cmd_cpp_cfg = CFGS $@
113 cmd_cpp_cfg = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -x c -o $@ $<
114
115# mkimage source config file
116IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
117
118# How to create a cpp processed config file, they all use the same source
119%.cfgout: $(IMX_CONFIG) FORCE
120 $(Q)mkdir -p $(dir $@)
121 $(call if_changed_dep,cpp_cfg)
122
123IMX_CONTAINER_CFG = $(CONFIG_IMX_CONTAINER_CFG:"%"=%)
124container.cfg: $(IMX_CONTAINER_CFG) FORCE
125 $(Q)mkdir -p $(dir $@)
126 $(call if_changed_dep,cpp_cfg)
127
128ifeq ($(CONFIG_ARCH_IMX8), y)
129CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh
130IMAGE_TYPE := imx8image
131ifeq ($(CONFIG_XPL_BUILD),y)
132SPL_DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o spl/u-boot-spl.cfgout $(srctree)/$(IMX_CONFIG); if [ -f spl/u-boot-spl.cfgout ]; then $(CNTR_DEPFILES) spl/u-boot-spl.cfgout; echo $$?; fi)
133endif
134DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctree)/$(IMX_CONFIG); if [ -f u-boot-dtb.cfgout ]; then $(CNTR_DEPFILES) u-boot-dtb.cfgout; echo $$?; fi)
135else ifeq ($(CONFIG_ARCH_IMX8M), y)
136IMAGE_TYPE := imx8mimage
137DEPFILE_EXISTS := 0
138else ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
139IMAGE_TYPE := imx8image
140DEPFILE_EXISTS := 0
141else
142IMAGE_TYPE := imximage
143DEPFILE_EXISTS := 0
144endif
145
146MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
147 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
148u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
149
150u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
151 $(call if_changed,mkimage)
152
153quiet_cmd_u-boot-nand_imx = GEN $@
154cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | cat - $< > [email protected] ; \
155 (dd bs=10k count=1 if=/dev/zero 2>/dev/null) | cat [email protected] - > $@ ; \
156 rm -f [email protected]
157
158u-boot-nand.imx: u-boot.imx FORCE
159 $(call if_changed,u-boot-nand_imx)
160
161ifeq ($(CONFIG_MULTI_DTB_FIT),y)
162MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
163 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
164u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
165
166u-boot-dtb.imx: u-boot-fit-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
167ifeq ($(DEPFILE_EXISTS),0)
168 $(call if_changed,mkimage)
169endif
170else ifeq ($(CONFIG_OF_SEPARATE),y)
171MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
172 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
173u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
174
175u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
176ifeq ($(DEPFILE_EXISTS),0)
177 $(call if_changed,mkimage)
178endif
179endif
180
181ifdef CONFIG_ARM64
182ifeq ($(CONFIG_ARCH_IMX8M), y)
183
184SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
185
186MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout \
187 -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
188flash.bin: MKIMAGEOUTPUT = flash.log
189
190spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
191 $(Q)mkdir -p $(dir $@)
192 $(call if_changed_dep,cpp_cfg)
193
194spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
195
196flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE
197 $(call if_changed,mkimage)
198endif
199
200ifeq ($(CONFIG_ARCH_IMX8), y)
201SPL:
202
203MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000
204flash.bin: MKIMAGEOUTPUT = flash.log
205
206MKIMAGEFLAGS_u-boot.cnt = -n container.cfg -T $(IMAGE_TYPE) -e 0x100000
207u-boot.cnt: MKIMAGEOUTPUT = u-boot.cnt.log
208
209ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y)
210u-boot.cnt: u-boot.bin container.cfg FORCE
211 $(call if_changed,mkimage)
212flash.bin: spl/u-boot-spl.bin FORCE
213 $(call if_changed,mkimage)
214 @flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
215 pad_cnt=$$(((flashbin_size + 0x400 - 1) / 0x400)); \
216 echo "append u-boot.cnt at $$pad_cnt KB"; \
217 dd if=u-boot.cnt of=flash.bin bs=1K seek=$$pad_cnt;
218else
219flash.bin: spl/u-boot-spl.bin FORCE
220 $(call if_changed,mkimage)
221endif
222endif
223
224ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
225
226quiet_cmd_cpp_cfg_imx9_check = CHECK $@
227cmd_cpp_cfg_imx9_check = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -x c -o $@ $< && $(srctree)/tools/imx9_image.sh $@
228
229SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout u-boot-container.cfgout FORCE
230
231MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
232flash.bin: MKIMAGEOUTPUT = flash.log
233
234spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
235 $(Q)mkdir -p $(dir $@)
236 $(call if_changed_dep,cpp_cfg_imx9_check)
237
238spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
239
240u-boot-container.cfgout: $(IMX_CONTAINER_CFG) FORCE
241 $(Q)mkdir -p $(dir $@)
242 $(call if_changed_dep,cpp_cfg_imx9_check)
243
244flash.bin: spl/u-boot-spl-ddr.bin container.cfgout FORCE
245 $(call if_changed,mkimage)
246endif
247
248else
249MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
250 -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
251SPL: MKIMAGEOUTPUT = SPL.log
252
253SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
254 $(call if_changed,mkimage)
255
256MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_TEXT_BASE) \
257 -e $(CONFIG_TEXT_BASE) -C none -T firmware
258
259u-boot.uim: u-boot.bin FORCE
260 $(call if_changed,mkimage)
261
262OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
263append = cat $(filter-out $< $(PHONY), $^) >> $@
264
265quiet_cmd_pad_cat = CAT $@
266cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
267
268u-boot-with-spl.imx: SPL $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
269 $(call if_changed,pad_cat)
270
271u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
272 $(call if_changed,pad_cat)
273
274quiet_cmd_u-boot-nand-spl_imx = GEN $@
275cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
276 dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
277
278spl/u-boot-nand-spl.imx: SPL FORCE
279 $(call if_changed,u-boot-nand-spl_imx)
280endif
281
282targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
283
284obj-$(CONFIG_MX5) += mx5/
285obj-$(CONFIG_MX6) += mx6/
286obj-$(CONFIG_MX7) += mx7/
287obj-$(CONFIG_ARCH_MX7ULP) += mx7ulp/
288obj-$(CONFIG_ARCH_IMX8ULP) += imx8ulp/
289obj-$(CONFIG_IMX8M) += imx8m/
290obj-$(CONFIG_ARCH_IMX8) += imx8/
291obj-$(CONFIG_ARCH_IMX9) += imx9/
292obj-$(CONFIG_ARCH_IMXRT) += imxrt/
293
294obj-$(CONFIG_SPL_BOOTROM_SUPPORT) += spl_imx_romapi.o
295obj-$(CONFIG_IMX8_ROMAPI) += romapi.o
This page took 0.026772 seconds and 4 git commands to generate.