]> git.sur5r.net Git - u-boot/blob - arch/arm/mach-imx/Makefile
imx: initialize and use generic timer on i.MX 6UL/ULL
[u-boot] / arch / arm / mach-imx / Makefile
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
10 ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 vf610))
11 obj-y   = iomux-v3.o
12 endif
13 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
14 obj-y   += cpu.o speed.o
15 obj-$(CONFIG_GPT_TIMER) += timer.o
16 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
17 endif
18 ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
19 obj-y   += misc.o
20 obj-$(CONFIG_SPL_BUILD) += spl.o
21 endif
22 ifeq ($(SOC),$(filter $(SOC),mx7))
23 obj-y   += cpu.o
24 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
25 endif
26 ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
27 obj-y   += cache.o init.o
28 obj-$(CONFIG_SATA) += sata.o
29 obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
30 obj-$(CONFIG_IMX_RDC) += rdc-sema.o
31 obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
32 obj-$(CONFIG_SECURE_BOOT)    += hab.o
33 obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
34 endif
35 ifeq ($(SOC),$(filter $(SOC),mx7ulp))
36 obj-y  += cache.o
37 obj-$(CONFIG_SECURE_BOOT) += hab.o
38 endif
39 ifeq ($(SOC),$(filter $(SOC),vf610))
40 obj-y += ddrmc-vf610.o
41 endif
42 ifneq ($(CONFIG_SPL_BUILD),y)
43 obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
44 obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
45 obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
46 endif
47
48 PLUGIN = board/$(BOARDDIR)/plugin
49
50 ifeq ($(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 $< $@
59 else
60
61 $(PLUGIN).bin:
62
63 endif
64
65 quiet_cmd_cpp_cfg = CFGS    $@
66       cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
67
68 IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
69
70 $(IMX_CONFIG): %.cfgtmp: % FORCE
71         $(Q)mkdir -p $(dir $@)
72         $(call if_changed_dep,cpp_cfg)
73
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
78 u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
79         $(call if_changed,mkimage)
80
81 ifeq ($(CONFIG_OF_SEPARATE),y)
82 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
83         -e $(CONFIG_SYS_TEXT_BASE)
84 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
85
86 u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
87         $(call if_changed,mkimage)
88 endif
89
90 MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
91         -e $(CONFIG_SPL_TEXT_BASE)
92
93 SPL: MKIMAGEOUTPUT = SPL.log
94
95 SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
96         $(call if_changed,mkimage)
97
98 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
99                 -e $(CONFIG_SYS_TEXT_BASE) -C none -T firmware
100
101 u-boot.uim: u-boot.bin FORCE
102         $(call if_changed,mkimage)
103
104 OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
105 append = cat $(filter-out $< $(PHONY), $^) >> $@
106
107 quiet_cmd_pad_cat = CAT     $@
108 cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
109
110 u-boot-with-spl.imx: SPL u-boot.uim FORCE
111         $(call if_changed,pad_cat)
112
113 u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
114         $(call if_changed,pad_cat)
115
116 quiet_cmd_u-boot-nand-spl_imx = GEN     $@
117 cmd_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
120 spl/u-boot-nand-spl.imx: SPL FORCE
121         $(call if_changed,u-boot-nand-spl_imx)
122
123 targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx)
124
125 obj-$(CONFIG_MX5) += mx5/
126 obj-$(CONFIG_MX6) += mx6/
127 obj-$(CONFIG_MX7) += mx7/
128 obj-$(CONFIG_ARCH_MX7ULP) += mx7ulp/
129