blob: 68f0f5276ae9b87234315ed002d909597271441f [file] [log] [blame]
Jason Liu83aa8fe2011-11-25 00:18:01 +00001#
2# (C) Copyright 2000-2006
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# (C) Copyright 2011 Freescale Semiconductor, Inc.
6#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007# SPDX-License-Identifier: GPL-2.0+
Jason Liu83aa8fe2011-11-25 00:18:01 +00008#
9
Alison Wang831beaf2013-05-27 22:55:41 +000010ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610))
Masahiro Yamada15103d12013-10-17 17:34:53 +090011obj-y = iomux-v3.o
Benoît Thébaudeau689a1582013-05-03 10:32:13 +000012endif
Stefano Babic8c7238e2012-09-05 20:16:36 +000013ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
Masahiro Yamada15103d12013-10-17 17:34:53 +090014obj-y += timer.o cpu.o speed.o
15obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
Stefano Babic8c7238e2012-09-05 20:16:36 +000016endif
Stefan Roese05b0ef42013-04-09 21:06:08 +000017ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
Masahiro Yamada15103d12013-10-17 17:34:53 +090018obj-y += misc.o
Stefan Roese05b0ef42013-04-09 21:06:08 +000019endif
Giuseppe Pagano23442e02013-11-28 12:32:48 +010020ifeq ($(SOC),$(filter $(SOC),mx6))
21objs-$(CONFIG_CMD_SATA) += sata.o
22endif
Masahiro Yamada15103d12013-10-17 17:34:53 +090023obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
24obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
Jason Liu83aa8fe2011-11-25 00:18:01 +000025
Troy Kiskya18d7862013-01-18 16:14:24 +000026$(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/%
27 mkdir -p $(dir $@)
28 $(CC) -E -x c $< $(CPPFLAGS) -o $@
29
30$(OBJTREE)/u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp
31 $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
32 -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
33
34$(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp
35 $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
36 -e $(CONFIG_SPL_TEXT_BASE) -d $< $@
37
Benoît Thébaudeaub2c79202013-04-11 09:35:56 +000038$(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
39 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
40 -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx
Marek Vasut652c09d2013-04-21 05:52:24 +000041 $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
42 -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
43 $(OBJTREE)/u-boot.uim
44 cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim > $@
45 rm $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim
Benoît Thébaudeaub2c79202013-04-11 09:35:56 +000046
Benoît Thébaudeau393b98d2013-04-11 09:35:57 +000047$(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
48 (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \
49 dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \
50 cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx
51 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
52 -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \
53 $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
54 rm $(OBJTREE)/spl/u-boot-nand-spl.imx
Marek Vasut652c09d2013-04-21 05:52:24 +000055 $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
56 -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
57 $(OBJTREE)/u-boot.uim
58 cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@
59 rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim