Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2007 |
| 3 | # Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | # (C) Copyright 2008 Freescale Semiconductor |
| 5 | # |
| 6 | # See file CREDITS for list of people who contributed to this |
| 7 | # project. |
| 8 | # |
| 9 | # This program is free software; you can redistribute it and/or |
| 10 | # modify it under the terms of the GNU General Public License as |
| 11 | # published by the Free Software Foundation; either version 2 of |
| 12 | # the License, or (at your option) any later version. |
| 13 | # |
| 14 | # This program is distributed in the hope that it will be useful, |
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | # GNU General Public License for more details. |
| 18 | # |
| 19 | # You should have received a copy of the GNU General Public License |
| 20 | # along with this program; if not, write to the Free Software |
| 21 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | # MA 02111-1307 USA |
| 23 | # |
| 24 | |
| 25 | NAND_SPL := y |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 26 | PAD_TO := 0xfff04000 |
| 27 | |
| 28 | include $(TOPDIR)/config.mk |
| 29 | |
| 30 | LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds |
Scott Wood | f60c06e | 2010-11-24 13:28:40 +0000 | [diff] [blame] | 31 | LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds \ |
| 32 | -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(PLATFORM_LDFLAGS) |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 33 | AFLAGS += -DCONFIG_NAND_SPL |
| 34 | CFLAGS += -DCONFIG_NAND_SPL |
| 35 | |
| 36 | SOBJS = start.o ticks.o |
Dave Liu | a94bc28 | 2008-12-02 11:48:51 +0800 | [diff] [blame] | 37 | COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o \ |
| 38 | time.o cache.o |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 39 | |
| 40 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 41 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 42 | __OBJS := $(SOBJS) $(COBJS) |
| 43 | LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR) |
| 44 | |
| 45 | nandobj := $(OBJTREE)/nand_spl/ |
| 46 | |
| 47 | ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
| 48 | |
| 49 | all: $(obj).depend $(ALL) |
| 50 | |
| 51 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl |
| 52 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ |
| 53 | |
| 54 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl |
| 55 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 56 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 57 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds |
Scott Wood | 9d6b227 | 2010-12-10 15:13:39 -0600 | [diff] [blame] | 58 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 59 | -Map $(nandobj)u-boot-spl.map \ |
| 60 | -o $(nandobj)u-boot-spl |
| 61 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 62 | $(nandobj)u-boot.lds: $(LDSCRIPT) |
| 63 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 64 | |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 65 | # create symbolic links for common files |
| 66 | |
| 67 | $(obj)start.S: |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 68 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $(obj)start.S |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 69 | |
| 70 | $(obj)nand_boot_fsl_elbc.c: |
| 71 | ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \ |
| 72 | $(obj)nand_boot_fsl_elbc.c |
| 73 | |
| 74 | $(obj)sdram.c: |
| 75 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $(obj)sdram.c |
| 76 | |
| 77 | $(obj)$(BOARD).c: |
| 78 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $(obj)$(BOARD).c |
| 79 | |
| 80 | $(obj)ns16550.c: |
| 81 | ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c |
| 82 | |
| 83 | $(obj)nand_init.c: |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 84 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/nand_init.c $(obj)nand_init.c |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 85 | |
Dave Liu | a94bc28 | 2008-12-02 11:48:51 +0800 | [diff] [blame] | 86 | $(obj)cache.c: |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 87 | ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c |
Dave Liu | a94bc28 | 2008-12-02 11:48:51 +0800 | [diff] [blame] | 88 | |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 89 | $(obj)time.c: |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 90 | ln -sf $(SRCTREE)/arch/powerpc/lib/time.c $(obj)time.c |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 91 | |
| 92 | $(obj)ticks.S: |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 93 | ln -sf $(SRCTREE)/arch/powerpc/lib/ticks.S $(obj)ticks.S |
Scott Wood | b71689b | 2008-06-30 14:13:28 -0500 | [diff] [blame] | 94 | |
| 95 | ######################################################################### |
| 96 | |
| 97 | $(obj)%.o: $(obj)%.S |
| 98 | $(CC) $(AFLAGS) -c -o $@ $< |
| 99 | |
| 100 | $(obj)%.o: $(obj)%.c |
| 101 | $(CC) $(CFLAGS) -c -o $@ $< |
| 102 | |
| 103 | # defines $(obj).depend target |
| 104 | include $(SRCTREE)/rules.mk |
| 105 | |
| 106 | sinclude $(obj).depend |
| 107 | |
| 108 | ######################################################################### |