3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
8 include $(TOPDIR)/config.mk
9 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
11 nandobj := $(OBJTREE)/nand_spl/
13 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
14 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
16 AFLAGS += -DCONFIG_NAND_SPL
17 CFLAGS += -DCONFIG_NAND_SPL
19 SOBJS = start.o resetvec.o cache.o
20 COBJS = gpio.o nand_boot.o nand_ecc.o memory.o ndfc.o pll.o
22 SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
23 OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
24 __OBJS := $(SOBJS) $(COBJS)
25 LNDIR := $(nandobj)board/$(BOARDDIR)
27 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin \
30 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
31 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
33 $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
34 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
36 $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
37 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
38 -Map $(nandobj)u-boot-spl.map -o $@
40 $(nandobj)System.map: $(nandobj)u-boot-spl
42 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
45 $(nandobj)u-boot.lds: $(LDSCRIPT)
46 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
48 # create symbolic links for common files
53 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
57 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/gpio.c $@
61 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
65 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
69 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
71 # from board directory
74 ln -s $(SRCTREE)/board/amcc/acadia/memory.c $@
78 ln -s $(SRCTREE)/board/amcc/acadia/pll.c $@
80 # from nand_spl directory
83 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
85 # from drivers/mtd/nand directory
88 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
90 #########################################################################
93 $(CC) $(AFLAGS) -c -o $@ $<
96 $(CC) $(CFLAGS) -c -o $@ $<
98 # defines $(obj).depend target
99 include $(SRCTREE)/rules.mk
101 sinclude $(obj).depend
103 #########################################################################