3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
4 # (C) Copyright 2008 Freescale Semiconductor
5 # (C) Copyright Sheldon Instruments, Inc. 2008
7 # SPDX-License-Identifier: GPL-2.0+
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_SPL) \
14 $(LDFLAGS) $(LDFLAGS_FINAL)
15 asflags-y += -DCONFIG_NAND_SPL
16 ccflags-y += -DCONFIG_NAND_SPL
18 SOBJS = start.o ticks.o
19 COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
22 OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 __OBJS := $(SOBJS) $(COBJS)
24 LNDIR := $(nandobj)board/$(BOARDDIR)
28 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)u-boot.lds: $(LDSCRIPT)
41 $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
43 # create symbolic links for common files
47 ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
49 $(obj)/nand_boot_fsl_elbc.c:
51 ln -s $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
55 ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
59 ln -s $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
63 ln -s $(SRCTREE)/drivers/serial/ns16550.c $@
67 ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
71 ln -s $(SRCTREE)/arch/powerpc/lib/cache.c $@
75 ln -s $(SRCTREE)/arch/powerpc/lib/time.c $@
79 ln -s $(SRCTREE)/arch/powerpc/lib/ticks.S $@