3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
5 # Copyright 2011 Freescale Semiconductor, Inc.
7 # See file CREDITS for list of people who contributed to this
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.
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.
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,
27 CONFIG_SYS_TEXT_BASE_SPL
:= 0xff800000
30 include $(TOPDIR
)/config.mk
32 nandobj
:= $(OBJTREE
)/nand_spl
/
34 LDSCRIPT
= $(TOPDIR
)/$(CPUDIR
)/u-boot-nand_spl.lds
35 LDFLAGS
:= -T
$(nandobj
)u-boot-nand_spl.lds
-Ttext
$(CONFIG_SYS_TEXT_BASE_SPL
) $(LDFLAGS
) \
37 AFLAGS
+= -DCONFIG_NAND_SPL
38 CFLAGS
+= -DCONFIG_NAND_SPL
40 SOBJS
= start.o resetvec.o ticks.o
41 COBJS
= cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.o \
42 nand_boot.o nand_boot_fsl_ifc.o ns16550.o tlb.o tlb_table.o \
45 SRCS
:= $(addprefix $(obj
),$(SOBJS
:.o
=.S
) $(COBJS
:.o
=.c
))
46 OBJS
:= $(addprefix $(obj
),$(SOBJS
) $(COBJS
))
47 __OBJS
:= $(SOBJS
) $(COBJS
)
48 LNDIR
:= $(nandobj
)board
/$(BOARDDIR
)
50 ALL
= $(nandobj
)u-boot-spl
$(nandobj
)u-boot-spl.bin
$(nandobj
)u-boot-spl-16k.bin
52 all: $(obj
).depend
$(ALL
)
54 $(nandobj
)u-boot-spl-16k.bin
: $(nandobj
)u-boot-spl
55 $(OBJCOPY
) ${OBJCFLAGS} --pad-to
=$(PAD_TO
) -O binary
$< $@
57 $(nandobj
)u-boot-spl.bin
: $(nandobj
)u-boot-spl
58 $(OBJCOPY
) ${OBJCFLAGS} -O binary
$< $@
60 $(nandobj
)u-boot-spl
: $(OBJS
) $(nandobj
)u-boot-nand_spl.lds
61 cd
$(LNDIR
) && $(LD
) $(LDFLAGS
) $(__OBJS
) $(PLATFORM_LIBS
) \
62 -Map
$(nandobj
)u-boot-spl.map \
63 -o
$(nandobj
)u-boot-spl
65 $(nandobj
)u-boot-nand_spl.lds
: $(LDSCRIPT
)
66 $(CPP
) $(CPPFLAGS
) $(LDPPFLAGS
) -ansi
-D__ASSEMBLY__
-P
- <$^
>$@
68 # create symbolic links for common files
72 ln
-sf
$(SRCTREE
)/arch
/powerpc
/lib
/cache.c
$(obj
)cache.c
74 $(obj
)cpu_init_early.c
:
75 @
rm -f
$(obj
)cpu_init_early.c
76 ln
-sf
$(SRCTREE
)/$(CPUDIR
)/cpu_init_early.c
$(obj
)cpu_init_early.c
78 $(obj
)cpu_init_nand.c
:
79 @
rm -f
$(obj
)cpu_init_nand.c
80 ln
-sf
$(SRCTREE
)/$(CPUDIR
)/cpu_init_nand.c
$(obj
)cpu_init_nand.c
83 @
rm -f
$(obj
)fsl_law.c
84 ln
-sf
$(SRCTREE
)/drivers
/misc
/fsl_law.c
$(obj
)fsl_law.c
88 ln
-sf
$(SRCTREE
)/board
/$(BOARDDIR
)/law.c
$(obj
)law.c
90 $(obj
)nand_boot_fsl_ifc.c
:
91 @
rm -f
$(obj
)nand_boot_fsl_ifc.c
92 ln
-sf
$(SRCTREE
)/nand_spl
/nand_boot_fsl_ifc.c \
93 $(obj
)nand_boot_fsl_ifc.c
96 @
rm -f
$(obj
)ns16550.c
97 ln
-sf
$(SRCTREE
)/drivers
/serial
/ns16550.c
$(obj
)ns16550.c
100 @
rm -f
$(obj
)resetvec.S
101 ln
-s
$(SRCTREE
)/$(CPUDIR
)/resetvec.S
$(obj
)resetvec.S
104 @
rm -f
$(obj
)fixed_ivor.S
105 ln
-sf
$(SRCTREE
)/$(CPUDIR
)/fixed_ivor.S
$(obj
)fixed_ivor.S
107 $(obj
)start.S
: $(obj
)fixed_ivor.S
109 ln
-sf
$(SRCTREE
)/$(CPUDIR
)/start.S
$(obj
)start.S
113 ln
-sf
$(SRCTREE
)/arch
/powerpc
/lib
/ticks.S
$(obj
)ticks.S
117 ln
-sf
$(SRCTREE
)/$(CPUDIR
)/tlb.c
$(obj
)tlb.c
120 @
rm -f
$(obj
)tlb_table.c
121 ln
-sf
$(SRCTREE
)/board
/$(BOARDDIR
)/tlb.c
$(obj
)tlb_table.c
123 ifneq ($(OBJTREE
), $(SRCTREE
))
125 @
rm -f
$(obj
)nand_boot.c
126 ln
-s
$(SRCTREE
)/nand_spl
/board
/$(BOARDDIR
)/nand_boot.c
$(obj
)nand_boot.c
128 @
rm -f
$(obj
)..
/common.c
129 ln
-s
$(SRCTREE
)/nand_spl
/board
/freescale
/common.c
$(obj
)..
/common.c
132 #########################################################################
135 $(CC
) $(AFLAGS
) -c
-o
$@
$<
138 $(CC
) $(CFLAGS
) -c
-o
$@
$<
140 # defines $(obj).depend target
141 include $(SRCTREE
)/rules.mk
143 sinclude
$(obj
).depend
145 #########################################################################