]> Git Repo - J-u-boot.git/blame - arch/arm/mach-imx/Makefile
global: Rename SPL_ to XPL_
[J-u-boot.git] / arch / arm / mach-imx / Makefile
CommitLineData
83d290c5 1# SPDX-License-Identifier: GPL-2.0+
18936ee2
JL
2#
3# (C) Copyright 2000-2006
4# Wolfgang Denk, DENX Software Engineering, [email protected].
5#
6# (C) Copyright 2011 Freescale Semiconductor, Inc.
18936ee2 7
881df6ed 8ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 imx8m imx9 vf610))
71f84ef0 9obj-y = iomux-v3.o
ab3a990b 10endif
e0e4e533 11
cd357ad1 12ifeq ($(SOC),$(filter $(SOC),imx8m))
bef9fdbe 13ifneq ($(CONFIG_XPL_BUILD),y)
e0e4e533 14obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
60afc500 15endif
e0e4e533
PF
16obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
17obj-$(CONFIG_FEC_MXC) += mac.o
5d3ba244 18obj-$(CONFIG_DWC_ETH_QOS) += mac.o
e0e4e533 19obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
41b230bf 20obj-$(CONFIG_IMX_HAB) += hab.o
e0e4e533
PF
21obj-y += cpu.o
22endif
23
98f948ec 24ifeq ($(SOC),$(filter $(SOC),imx8m imx9))
bef9fdbe 25ifneq ($(CONFIG_XPL_BUILD),y)
98f948ec
PF
26obj-y += fdt.o
27endif
28endif
29
ea00e59b 30ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
23b6a131 31obj-y += cpu.o speed.o
89bc388a
FE
32ifneq ($(CONFIG_MX51),y)
33obj-y += mmdc_size.o
34endif
23b6a131 35obj-$(CONFIG_GPT_TIMER) += timer.o
71f84ef0 36obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
ea00e59b 37endif
881df6ed 38ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs imx8m imx8 imx9 imxrt))
71f84ef0 39obj-y += misc.o
613cf239 40obj-$(CONFIG_CMD_PRIBLOB) += priblob.o
bef9fdbe 41obj-$(CONFIG_XPL_BUILD) += spl.o
8870e459 42endif
cd562c8d 43ifeq ($(SOC),$(filter $(SOC),mx7))
0cf207ec 44obj-y += cpu.o
cd562c8d 45obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
c1ef4863 46obj-$(CONFIG_ENV_IS_IN_MMC) += mmc_env.o
92aff90b
YL
47endif
48ifeq ($(SOC),$(filter $(SOC),mx7 imx8m))
bef9fdbe 49ifneq ($(CONFIG_XPL_BUILD),y)
30e39ac7 50obj-$(CONFIG_FSL_MFGPROT) += cmd_mfgprot.o
cd562c8d 51endif
92aff90b 52endif
0b6b8a3a
MV
53ifeq ($(SOC),$(filter $(SOC),mx5 mx6 mx7))
54obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
55endif
cd562c8d 56ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
0cf207ec 57obj-y += cache.o init.o
6ce8b10b 58obj-$(CONFIG_FEC_MXC) += mac.o
de09c43b 59obj-$(CONFIG_IMX_RDC) += rdc-sema.o
bef9fdbe 60ifneq ($(CONFIG_XPL_BUILD),y)
6f6058bf 61obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
20b9f2ea 62endif
c46760d5 63obj-$(CONFIG_$(XPL_)SATA) += sata.o
d714a75f 64obj-$(CONFIG_IMX_HAB) += hab.o
46718353 65obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
164d9846 66endif
1b409828 67ifeq ($(SOC),$(filter $(SOC),mx7ulp))
d9fba73a 68obj-y += cache.o mmdc_size.o
d714a75f 69obj-$(CONFIG_IMX_HAB) += hab.o
1b409828 70endif
c7ea243c
SM
71ifeq ($(SOC),$(filter $(SOC),vf610))
72obj-y += ddrmc-vf610.o
548cc109 73obj-$(CONFIG_DDRMC_VF610_CALIBRATION) += ddrmc-vf610-calibration.o
c7ea243c 74endif
e8cd1f60 75ifeq ($(SOC),$(filter $(SOC),imx8))
bef9fdbe 76ifneq ($(CONFIG_XPL_BUILD),y)
e8cd1f60
YL
77obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
78endif
79endif
bef9fdbe 80ifneq ($(CONFIG_XPL_BUILD),y)
71f84ef0
MY
81obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
82obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
0200020b 83obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
1d43e24b 84obj-$(CONFIG_CMD_NANDBCB) += cmd_nandbcb.o
99f49fdd 85endif
18936ee2 86
bef9fdbe 87ifeq ($(CONFIG_XPL_BUILD),y)
12b33390 88obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += image-container.o
7d84978c
YL
89endif
90
07816f08
YL
91ifeq ($(SOC),$(filter $(SOC),imx8ulp imx9))
92obj-$(CONFIG_AHAB_BOOT) += ele_ahab.o
93endif
94
b3513c5d
PF
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
4e0c8abc 112quiet_cmd_cpp_cfg = CFGS $@
5c86a8f7 113 cmd_cpp_cfg = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -x c -o $@ $<
4e0c8abc 114
f9167573
TP
115# mkimage source config file
116IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
4e0c8abc 117
f9167573
TP
118# How to create a cpp processed config file, they all use the same source
119%.cfgout: $(IMX_CONFIG) FORCE
4e0c8abc
MY
120 $(Q)mkdir -p $(dir $@)
121 $(call if_changed_dep,cpp_cfg)
122
700315c9
PF
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
0e5c8ce7 128ifeq ($(CONFIG_ARCH_IMX8), y)
d7961159
PF
129CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh
130IMAGE_TYPE := imx8image
bef9fdbe 131ifeq ($(CONFIG_XPL_BUILD),y)
caceb739 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)
4c45e43a 133endif
4ac94bfa 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)
94df9885
PF
135else ifeq ($(CONFIG_ARCH_IMX8M), y)
136IMAGE_TYPE := imx8mimage
68de913c 137DEPFILE_EXISTS := 0
9970da6f 138else ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
f637dfe8
MO
139IMAGE_TYPE := imx8image
140DEPFILE_EXISTS := 0
d7961159
PF
141else
142IMAGE_TYPE := imximage
143DEPFILE_EXISTS := 0
0e5c8ce7
PF
144endif
145
146MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
98463903 147 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
1f6a6648 148u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
4e0c8abc 149
f9167573 150u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
4e0c8abc
MY
151 $(call if_changed,mkimage)
152
95942f99 153quiet_cmd_u-boot-nand_imx = GEN $@
7dede403
HDF
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]
95942f99
LC
157
158u-boot-nand.imx: u-boot.imx FORCE
159 $(call if_changed,u-boot-nand_imx)
160
16c776d3
HS
161ifeq ($(CONFIG_MULTI_DTB_FIT),y)
162MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
98463903 163 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
16c776d3
HS
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)
0e5c8ce7 171MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
98463903 172 -T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
1f6a6648 173u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
e64348f5 174
f9167573 175u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
d7961159 176ifeq ($(DEPFILE_EXISTS),0)
e64348f5
SB
177 $(call if_changed,mkimage)
178endif
d7961159 179endif
e64348f5 180
94df9885
PF
181ifdef CONFIG_ARM64
182ifeq ($(CONFIG_ARCH_IMX8M), y)
68de913c
PF
183
184SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
94df9885
PF
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
68de913c
PF
190spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
191 $(Q)mkdir -p $(dir $@)
192 $(call if_changed_dep,cpp_cfg)
193
94df9885 194spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
94df9885
PF
195
196flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE
94df9885
PF
197 $(call if_changed,mkimage)
198endif
94df9885 199
caceb739
PF
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
700315c9
PF
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
caceb739 211 $(call if_changed,mkimage)
700315c9
PF
212flash.bin: spl/u-boot-spl.bin FORCE
213 $(call if_changed,mkimage)
d1c07785
PF
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
caceb739
PF
222endif
223
9970da6f 224ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
f637dfe8 225
aec0015a
JF
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 $@
f637dfe8
MO
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 $@)
aec0015a 236 $(call if_changed_dep,cpp_cfg_imx9_check)
f637dfe8
MO
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 $@)
aec0015a 242 $(call if_changed_dep,cpp_cfg_imx9_check)
f637dfe8
MO
243
244flash.bin: spl/u-boot-spl-ddr.bin container.cfgout FORCE
245 $(call if_changed,mkimage)
881df6ed
PF
246endif
247
94df9885 248else
0e5c8ce7
PF
249MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
250 -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
1f6a6648
SE
251SPL: MKIMAGEOUTPUT = SPL.log
252
f9167573 253SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
4e0c8abc
MY
254 $(call if_changed,mkimage)
255
98463903
SG
256MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_TEXT_BASE) \
257 -e $(CONFIG_TEXT_BASE) -C none -T firmware
4e0c8abc
MY
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
7034478a 268u-boot-with-spl.imx: SPL $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
4e0c8abc
MY
269 $(call if_changed,pad_cat)
270
7034478a 271u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
4e0c8abc
MY
272 $(call if_changed,pad_cat)
273
274quiet_cmd_u-boot-nand-spl_imx = GEN $@
0297bd11 275cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
4e0c8abc
MY
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)
94df9885 280endif
4e0c8abc 281
f9167573 282targets += $(addprefix ../../../,SPL spl/u-boot-spl.cfgout u-boot-dtb.cfgout u-boot.cfgout u-boot.uim spl/u-boot-nand-spl.imx)
552a848e
SB
283
284obj-$(CONFIG_MX5) += mx5/
285obj-$(CONFIG_MX6) += mx6/
286obj-$(CONFIG_MX7) += mx7/
287obj-$(CONFIG_ARCH_MX7ULP) += mx7ulp/
9ef89ea9 288obj-$(CONFIG_ARCH_IMX8ULP) += imx8ulp/
cd357ad1 289obj-$(CONFIG_IMX8M) += imx8m/
b2b8b9be 290obj-$(CONFIG_ARCH_IMX8) += imx8/
881df6ed 291obj-$(CONFIG_ARCH_IMX9) += imx9/
77eb9a90 292obj-$(CONFIG_ARCH_IMXRT) += imxrt/
1cbebc78
PF
293
294obj-$(CONFIG_SPL_BOOTROM_SUPPORT) += spl_imx_romapi.o
748da8ab 295obj-$(CONFIG_IMX8_ROMAPI) += romapi.o
This page took 0.545337 seconds and 4 git commands to generate.