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