Jason Liu | 83aa8fe | 2011-11-25 00:18:01 +0000 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2000-2006 |
| 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
| 5 | # (C) Copyright 2011 Freescale Semiconductor, Inc. |
| 6 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | # SPDX-License-Identifier: GPL-2.0+ |
Jason Liu | 83aa8fe | 2011-11-25 00:18:01 +0000 | [diff] [blame] | 8 | # |
| 9 | |
| 10 | include $(TOPDIR)/config.mk |
| 11 | |
| 12 | LIB = $(obj)libimx-common.o |
| 13 | |
Alison Wang | 831beaf | 2013-05-27 22:55:41 +0000 | [diff] [blame] | 14 | ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) |
Benoît Thébaudeau | 689a158 | 2013-05-03 10:32:13 +0000 | [diff] [blame] | 15 | COBJS-y = iomux-v3.o |
| 16 | endif |
Stefano Babic | 8c7238e | 2012-09-05 20:16:36 +0000 | [diff] [blame] | 17 | ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) |
Benoît Thébaudeau | 689a158 | 2013-05-03 10:32:13 +0000 | [diff] [blame] | 18 | COBJS-y += timer.o cpu.o speed.o |
Stefano Babic | 8c7238e | 2012-09-05 20:16:36 +0000 | [diff] [blame] | 19 | COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o |
| 20 | endif |
Stefan Roese | 05b0ef4 | 2013-04-09 21:06:08 +0000 | [diff] [blame] | 21 | ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) |
| 22 | COBJS-y += misc.o |
| 23 | endif |
Troy Kisky | 0ca618c | 2012-08-15 10:31:20 +0000 | [diff] [blame] | 24 | COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o |
Eric Nelson | b94cfae | 2013-03-09 07:06:09 +0000 | [diff] [blame] | 25 | COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o |
Troy Kisky | d4fdc99 | 2012-07-19 08:18:25 +0000 | [diff] [blame] | 26 | COBJS := $(sort $(COBJS-y)) |
Jason Liu | 83aa8fe | 2011-11-25 00:18:01 +0000 | [diff] [blame] | 27 | |
| 28 | SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) |
| 29 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 30 | |
| 31 | all: $(obj).depend $(LIB) |
| 32 | |
| 33 | $(LIB): $(OBJS) |
| 34 | $(call cmd_link_o_target, $(OBJS)) |
| 35 | |
Troy Kisky | a18d786 | 2013-01-18 16:14:24 +0000 | [diff] [blame] | 36 | $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/% |
| 37 | mkdir -p $(dir $@) |
| 38 | $(CC) -E -x c $< $(CPPFLAGS) -o $@ |
| 39 | |
| 40 | $(OBJTREE)/u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp |
| 41 | $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ |
| 42 | -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ |
| 43 | |
| 44 | $(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp |
| 45 | $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ |
| 46 | -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ |
| 47 | |
Benoît Thébaudeau | b2c7920 | 2013-04-11 09:35:56 +0000 | [diff] [blame] | 48 | $(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin |
| 49 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \ |
| 50 | -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx |
Marek Vasut | 652c09d | 2013-04-21 05:52:24 +0000 | [diff] [blame] | 51 | $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ |
| 52 | -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \ |
| 53 | $(OBJTREE)/u-boot.uim |
| 54 | cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ |
| 55 | rm $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim |
Benoît Thébaudeau | b2c7920 | 2013-04-11 09:35:56 +0000 | [diff] [blame] | 56 | |
Benoît Thébaudeau | 393b98d | 2013-04-11 09:35:57 +0000 | [diff] [blame] | 57 | $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin |
| 58 | (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \ |
| 59 | dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \ |
| 60 | cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx |
| 61 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \ |
| 62 | -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \ |
| 63 | $(OBJTREE)/spl/u-boot-nand-spl-pad.imx |
| 64 | rm $(OBJTREE)/spl/u-boot-nand-spl.imx |
Marek Vasut | 652c09d | 2013-04-21 05:52:24 +0000 | [diff] [blame] | 65 | $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ |
| 66 | -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \ |
| 67 | $(OBJTREE)/u-boot.uim |
| 68 | cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ |
| 69 | rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim |
Benoît Thébaudeau | 393b98d | 2013-04-11 09:35:57 +0000 | [diff] [blame] | 70 | |
Troy Kisky | a18d786 | 2013-01-18 16:14:24 +0000 | [diff] [blame] | 71 | |
Jason Liu | 83aa8fe | 2011-11-25 00:18:01 +0000 | [diff] [blame] | 72 | ######################################################################### |
| 73 | |
| 74 | # defines $(obj).depend target |
| 75 | include $(SRCTREE)/rules.mk |
| 76 | |
| 77 | sinclude $(obj).depend |
| 78 | |
| 79 | ######################################################################### |