blob: f5718628ebe06020ba59e678e561e7c3c36cf6ef [file] [log] [blame]
Liu Yu2639e512010-01-18 19:03:28 +08001#
2# (C) Copyright 2007
3# Stefan Roese, DENX Software Engineering, sr@denx.de.
4#
Dipen Dudhat831b6602011-04-09 12:52:32 -05005# Copyright 2009-2011 Freescale Semiconductor, Inc.
Liu Yu2639e512010-01-18 19:03:28 +08006#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007# SPDX-License-Identifier: GPL-2.0+
Liu Yu2639e512010-01-18 19:03:28 +08008#
9
Haiying Wang31b90122010-11-10 15:37:13 -050010CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
Liu Yu2639e512010-01-18 19:03:28 +080011PAD_TO := 0xfff01000
12
Wolfgang Denk29547c62011-03-31 16:26:29 -050013nandobj := $(OBJTREE)/nand_spl/
14
Peter Tyserd53e8fd2010-04-12 22:28:02 -050015LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
Dipen Dudhat831b6602011-04-09 12:52:32 -050016LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
17 $(LDFLAGS) $(LDFLAGS_FINAL)
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090018asflags-y += -DCONFIG_NAND_SPL
19ccflags-y += -DCONFIG_NAND_SPL
Liu Yu2639e512010-01-18 19:03:28 +080020
21SOBJS = start.o resetvec.o
Scott Wood5847d782012-09-20 16:35:21 -050022COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
Liu Yu2639e512010-01-18 19:03:28 +080023 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24
Masahiro Yamada59f15f22014-02-04 17:24:24 +090025OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
Liu Yu2639e512010-01-18 19:03:28 +080026__OBJS := $(SOBJS) $(COBJS)
Wolfgang Denk29547c62011-03-31 16:26:29 -050027LNDIR := $(nandobj)board/$(BOARDDIR)
Liu Yu2639e512010-01-18 19:03:28 +080028
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090029targets += $(__OBJS)
30
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090031all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
Liu Yu2639e512010-01-18 19:03:28 +080032
33$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
Masahiro Yamadac9c83ba2014-02-24 11:12:12 +090034 $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
Liu Yu2639e512010-01-18 19:03:28 +080035
36$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
Masahiro Yamadac9c83ba2014-02-24 11:12:12 +090037 $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
Liu Yu2639e512010-01-18 19:03:28 +080038
Dipen Dudhat831b6602011-04-09 12:52:32 -050039$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
Liu Yu2639e512010-01-18 19:03:28 +080040 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090041 -Map $(nandobj)u-boot-spl.map -o $@
Liu Yu2639e512010-01-18 19:03:28 +080042
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000043$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090044 $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
Scott Wood67de9572012-11-13 12:30:39 +000045 -ansi -D__ASSEMBLY__ -P - <$< >$@
Dipen Dudhat831b6602011-04-09 12:52:32 -050046
Liu Yu2639e512010-01-18 19:03:28 +080047# create symbolic links for common files
48
Masahiro Yamada59f15f22014-02-04 17:24:24 +090049$(obj)/cache.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090050 @rm -f $@
51 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
Liu Yu2639e512010-01-18 19:03:28 +080052
Masahiro Yamada59f15f22014-02-04 17:24:24 +090053$(obj)/cpu_init_early.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090054 @rm -f $@
55 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
Liu Yu2639e512010-01-18 19:03:28 +080056
Masahiro Yamada59f15f22014-02-04 17:24:24 +090057$(obj)/spl_minimal.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090058 @rm -f $@
59 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
Liu Yu2639e512010-01-18 19:03:28 +080060
Masahiro Yamada59f15f22014-02-04 17:24:24 +090061$(obj)/fsl_law.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090062 @rm -f $@
63 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
Liu Yu2639e512010-01-18 19:03:28 +080064
Masahiro Yamada59f15f22014-02-04 17:24:24 +090065$(obj)/law.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090066 @rm -f $@
67 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
Liu Yu2639e512010-01-18 19:03:28 +080068
Masahiro Yamada59f15f22014-02-04 17:24:24 +090069$(obj)/nand_boot_fsl_elbc.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090070 @rm -f $@
71 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
Liu Yu2639e512010-01-18 19:03:28 +080072
Masahiro Yamada59f15f22014-02-04 17:24:24 +090073$(obj)/ns16550.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090074 @rm -f $@
75 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
Liu Yu2639e512010-01-18 19:03:28 +080076
Masahiro Yamada59f15f22014-02-04 17:24:24 +090077$(obj)/resetvec.S:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090078 @rm -f $@
79 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
Liu Yu2639e512010-01-18 19:03:28 +080080
Masahiro Yamada59f15f22014-02-04 17:24:24 +090081$(obj)/fixed_ivor.S:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090082 @rm -f $@
83 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
Liu Yu2639e512010-01-18 19:03:28 +080084
Masahiro Yamada59f15f22014-02-04 17:24:24 +090085$(obj)/start.S: $(obj)/fixed_ivor.S
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090086 @rm -f $@
87 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
Liu Yu2639e512010-01-18 19:03:28 +080088
Masahiro Yamada59f15f22014-02-04 17:24:24 +090089$(obj)/tlb.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090090 @rm -f $@
91 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
Liu Yu2639e512010-01-18 19:03:28 +080092
Masahiro Yamada59f15f22014-02-04 17:24:24 +090093$(obj)/tlb_table.c:
Masahiro Yamadad1aacf22013-11-20 18:11:57 +090094 @rm -f $@
95 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@