3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
8 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
10 nandobj := $(OBJTREE)/nand_spl/
12 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
13 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
15 asflags-y += -DCONFIG_NAND_SPL
16 ccflags-y += -DCONFIG_NAND_SPL
18 SOBJS = start.o init.o resetvec.o
19 COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o
21 OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
22 __OBJS := $(SOBJS) $(COBJS)
23 LNDIR := $(nandobj)board/$(BOARDDIR)
27 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
29 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
30 $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
32 $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
33 $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
35 $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
36 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
37 -Map $(nandobj)u-boot-spl.map -o $@
39 $(nandobj)u-boot.lds: $(LDSCRIPT)
40 $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
42 # create symbolic links for common files
47 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
51 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
55 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
57 # from board directory
60 ln -s $(SRCTREE)/board/amcc/bamboo/init.S $@
62 # from nand_spl directory
65 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
67 # from drivers/mtd/nand directory
70 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@