]> git.ipfire.org Git - people/ms/u-boot.git/blame - nand_spl/board/freescale/mpc8572ds/Makefile
Merge remote-tracking branch 'u-boot-ti/master'
[people/ms/u-boot.git] / nand_spl / board / freescale / mpc8572ds / Makefile
CommitLineData
cb14e93b
KG
1#
2# (C) Copyright 2007
3# Stefan Roese, DENX Software Engineering, sr@denx.de.
4#
e1f70381 5# Copyright 2009-2011 Freescale Semiconductor, Inc.
cb14e93b
KG
6#
7# See file CREDITS for list of people who contributed to this
8# project.
9#
10# This program is free software; you can redistribute it and/or
11# modify it under the terms of the GNU General Public License as
12# published by the Free Software Foundation; either version 2 of
13# the License, or (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23# MA 02111-1307 USA
24#
25
26NAND_SPL := y
27CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
28PAD_TO := 0xfff01000
29
30include $(TOPDIR)/config.mk
31
3b258e2e
WD
32nandobj := $(OBJTREE)/nand_spl/
33
cb14e93b 34LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
97b24d3d 35LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
e1f70381
DD
36LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
37 $(LDFLAGS) $(LDFLAGS_FINAL)
cb14e93b
KG
38AFLAGS += -DCONFIG_NAND_SPL
39CFLAGS += -DCONFIG_NAND_SPL
40
41SOBJS = start.o resetvec.o
42COBJS = cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.o \
43 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
44
45SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
46OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
47__OBJS := $(SOBJS) $(COBJS)
3b258e2e 48LNDIR := $(nandobj)board/$(BOARDDIR)
cb14e93b
KG
49
50ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
51
52all: $(obj).depend $(ALL)
53
54$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
55 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
56
57$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
58 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
59
e1f70381 60$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cb14e93b
KG
61 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
62 -Map $(nandobj)u-boot-spl.map \
63 -o $(nandobj)u-boot-spl
64
97b24d3d
MV
65# The following line expands into whole rule which generates $(LSTSCRIPT),
66# the file containing u-boots LG-array linker section. This is included into
67# $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
68$(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
69$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
70 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj) -ansi -D__ASSEMBLY__ -P - <$< >$@
e1f70381 71
cb14e93b
KG
72# create symbolic links for common files
73
74$(obj)cache.c:
75 @rm -f $(obj)cache.c
76 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c
77
78$(obj)cpu_init_early.c:
79 @rm -f $(obj)cpu_init_early.c
80 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $(obj)cpu_init_early.c
81
82$(obj)cpu_init_nand.c:
83 @rm -f $(obj)cpu_init_nand.c
84 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c $(obj)cpu_init_nand.c
85
86$(obj)fsl_law.c:
87 @rm -f $(obj)fsl_law.c
88 ln -sf $(SRCTREE)/drivers/misc/fsl_law.c $(obj)fsl_law.c
89
90$(obj)law.c:
91 @rm -f $(obj)law.c
92 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $(obj)law.c
93
94$(obj)nand_boot_fsl_elbc.c:
95 @rm -f $(obj)nand_boot_fsl_elbc.c
96 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
97 $(obj)nand_boot_fsl_elbc.c
98
99$(obj)ns16550.c:
100 @rm -f $(obj)ns16550.c
101 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
102
103$(obj)resetvec.S:
104 @rm -f $(obj)resetvec.S
105 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
106
107$(obj)fixed_ivor.S:
108 @rm -f $(obj)fixed_ivor.S
109 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $(obj)fixed_ivor.S
110
111$(obj)start.S: $(obj)fixed_ivor.S
112 @rm -f $(obj)start.S
113 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $(obj)start.S
114
115$(obj)tlb.c:
116 @rm -f $(obj)tlb.c
117 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $(obj)tlb.c
118
119$(obj)tlb_table.c:
120 @rm -f $(obj)tlb_table.c
121 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $(obj)tlb_table.c
122
123ifneq ($(OBJTREE), $(SRCTREE))
124$(obj)nand_boot.c:
125 @rm -f $(obj)nand_boot.c
126 ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $(obj)nand_boot.c
127endif
128
129#########################################################################
130
131$(obj)%.o: $(obj)%.S
132 $(CC) $(AFLAGS) -c -o $@ $<
133
134$(obj)%.o: $(obj)%.c
135 $(CC) $(CFLAGS) -c -o $@ $<
136
137# defines $(obj).depend target
138include $(SRCTREE)/rules.mk
139
140sinclude $(obj).depend
141
142#########################################################################