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