Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2007 |
| 3 | # Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | # |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 5 | # Copyright 2009-2011 Freescale Semiconductor, Inc. |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 6 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | # SPDX-License-Identifier: GPL-2.0+ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 8 | # |
| 9 | |
Haiying Wang | 31b9012 | 2010-11-10 15:37:13 -0500 | [diff] [blame] | 10 | CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000 |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 11 | PAD_TO := 0xfff01000 |
| 12 | |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 13 | nandobj := $(OBJTREE)/nand_spl/ |
| 14 | |
Peter Tyser | d53e8fd | 2010-04-12 22:28:02 -0500 | [diff] [blame] | 15 | LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 16 | LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \ |
| 17 | $(LDFLAGS) $(LDFLAGS_FINAL) |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 18 | AFLAGS += -DCONFIG_NAND_SPL |
| 19 | CFLAGS += -DCONFIG_NAND_SPL |
| 20 | |
| 21 | SOBJS = start.o resetvec.o |
Scott Wood | 5847d78 | 2012-09-20 16:35:21 -0500 | [diff] [blame] | 22 | COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 23 | nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o |
| 24 | |
| 25 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 26 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 27 | __OBJS := $(SOBJS) $(COBJS) |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 28 | LNDIR := $(nandobj)board/$(BOARDDIR) |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 29 | |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 30 | all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 31 | |
| 32 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl |
| 33 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ |
| 34 | |
| 35 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl |
| 36 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 37 | |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 38 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 39 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 40 | -Map $(nandobj)u-boot-spl.map -o $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 41 | |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 42 | $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) |
Scott Wood | 67de957 | 2012-11-13 12:30:39 +0000 | [diff] [blame] | 43 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \ |
| 44 | -ansi -D__ASSEMBLY__ -P - <$< >$@ |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 45 | |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 46 | # create symbolic links for common files |
| 47 | |
| 48 | $(obj)cache.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 49 | @rm -f $@ |
| 50 | ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 51 | |
| 52 | $(obj)cpu_init_early.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 53 | @rm -f $@ |
| 54 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 55 | |
Scott Wood | 5847d78 | 2012-09-20 16:35:21 -0500 | [diff] [blame] | 56 | $(obj)spl_minimal.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 57 | @rm -f $@ |
| 58 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 59 | |
| 60 | $(obj)fsl_law.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 61 | @rm -f $@ |
| 62 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 63 | |
| 64 | $(obj)law.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 65 | @rm -f $@ |
| 66 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 67 | |
| 68 | $(obj)nand_boot_fsl_elbc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 69 | @rm -f $@ |
| 70 | ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 71 | |
| 72 | $(obj)ns16550.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 73 | @rm -f $@ |
| 74 | ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 75 | |
| 76 | $(obj)resetvec.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 77 | @rm -f $@ |
| 78 | ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 79 | |
| 80 | $(obj)fixed_ivor.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 81 | @rm -f $@ |
| 82 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 83 | |
| 84 | $(obj)start.S: $(obj)fixed_ivor.S |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 85 | @rm -f $@ |
| 86 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 87 | |
| 88 | $(obj)tlb.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 89 | @rm -f $@ |
| 90 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 91 | |
| 92 | $(obj)tlb_table.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 93 | @rm -f $@ |
| 94 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 95 | |
| 96 | ifneq ($(OBJTREE), $(SRCTREE)) |
| 97 | $(obj)nand_boot.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 98 | @rm -f $@ |
| 99 | ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 100 | endif |
| 101 | |
| 102 | ######################################################################### |
| 103 | |
| 104 | $(obj)%.o: $(obj)%.S |
| 105 | $(CC) $(AFLAGS) -c -o $@ $< |
| 106 | |
| 107 | $(obj)%.o: $(obj)%.c |
| 108 | $(CC) $(CFLAGS) -c -o $@ $< |