]> git.sur5r.net Git - u-boot/blob - arch/arm/imx-common/Makefile
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[u-boot] / arch / arm / imx-common / 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   += timer.o cpu.o speed.o
15 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
16 endif
17 ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
18 obj-y   += misc.o
19 obj-$(CONFIG_SPL_BUILD) += spl.o
20 endif
21 ifeq ($(SOC),$(filter $(SOC),mx7))
22 obj-y   += cpu.o
23 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
24 obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
25 endif
26 ifeq ($(SOC),$(filter $(SOC),mx6 mx7))
27 obj-y   += cache.o init.o
28 obj-$(CONFIG_CMD_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 endif
34 ifeq ($(SOC),$(filter $(SOC),vf610))
35 obj-y += ddrmc-vf610.o
36 endif
37 ifneq ($(CONFIG_SPL_BUILD),y)
38 obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
39 obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
40 obj-$(CONFIG_CMD_DEKBLOB) += cmd_dek.o
41 endif
42
43 PLUGIN = board/$(BOARDDIR)/plugin
44
45 ifeq ($(CONFIG_USE_IMXIMG_PLUGIN),y)
46
47 $(PLUGIN).o: $(PLUGIN).S FORCE
48         $(Q)mkdir -p $(dir $@)
49         $(call if_changed_dep,as_o_S)
50
51 $(PLUGIN).bin: $(PLUGIN).o FORCE
52         $(Q)mkdir -p $(dir $@)
53         $(OBJCOPY) -O binary --gap-fill 0xff $< $@
54 else
55
56 $(PLUGIN).bin:
57
58 endif
59
60 quiet_cmd_cpp_cfg = CFGS    $@
61       cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
62
63 IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp
64
65 $(IMX_CONFIG): %.cfgtmp: % FORCE
66         $(Q)mkdir -p $(dir $@)
67         $(call if_changed_dep,cpp_cfg)
68
69 MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
70         -e $(CONFIG_SYS_TEXT_BASE)
71 u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
72
73 u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
74         $(call if_changed,mkimage)
75
76 ifeq ($(CONFIG_OF_SEPARATE),y)
77 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
78         -e $(CONFIG_SYS_TEXT_BASE)
79 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
80
81 u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
82         $(call if_changed,mkimage)
83 endif
84
85 MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
86         -e $(CONFIG_SPL_TEXT_BASE)
87
88 SPL: MKIMAGEOUTPUT = SPL.log
89
90 SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
91         $(call if_changed,mkimage)
92
93 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
94                 -e $(CONFIG_SYS_TEXT_BASE) -C none -T firmware
95
96 u-boot.uim: u-boot.bin FORCE
97         $(call if_changed,mkimage)
98
99 OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
100 append = cat $(filter-out $< $(PHONY), $^) >> $@
101
102 quiet_cmd_pad_cat = CAT     $@
103 cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
104
105 u-boot-with-spl.imx: SPL u-boot.uim FORCE
106         $(call if_changed,pad_cat)
107
108 u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
109         $(call if_changed,pad_cat)
110
111 quiet_cmd_u-boot-nand-spl_imx = GEN     $@
112 cmd_u-boot-nand-spl_imx = (printf '\000\000\000\000\106\103\102\040\001' && \
113         dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
114
115 spl/u-boot-nand-spl.imx: SPL FORCE
116         $(call if_changed,u-boot-nand-spl_imx)
117
118 targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx)