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) |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 18 | asflags-y += -DCONFIG_NAND_SPL |
| 19 | ccflags-y += -DCONFIG_NAND_SPL |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 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 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 25 | OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS)) |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 26 | __OBJS := $(SOBJS) $(COBJS) |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 27 | LNDIR := $(nandobj)board/$(BOARDDIR) |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 28 | |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 29 | targets += $(__OBJS) |
| 30 | |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 31 | all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 32 | |
| 33 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl |
Masahiro Yamada | c9c83ba | 2014-02-24 11:12:12 +0900 | [diff] [blame^] | 34 | $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 35 | |
| 36 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl |
Masahiro Yamada | c9c83ba | 2014-02-24 11:12:12 +0900 | [diff] [blame^] | 37 | $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 38 | |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 39 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 40 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 41 | -Map $(nandobj)u-boot-spl.map -o $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 42 | |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 43 | $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 44 | $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \ |
Scott Wood | 67de957 | 2012-11-13 12:30:39 +0000 | [diff] [blame] | 45 | -ansi -D__ASSEMBLY__ -P - <$< >$@ |
Dipen Dudhat | 831b660 | 2011-04-09 12:52:32 -0500 | [diff] [blame] | 46 | |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 47 | # create symbolic links for common files |
| 48 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 49 | $(obj)/cache.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 50 | @rm -f $@ |
| 51 | ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 52 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 53 | $(obj)/cpu_init_early.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 54 | @rm -f $@ |
| 55 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 56 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 57 | $(obj)/spl_minimal.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 58 | @rm -f $@ |
| 59 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 60 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 61 | $(obj)/fsl_law.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 62 | @rm -f $@ |
| 63 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 64 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 65 | $(obj)/law.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 66 | @rm -f $@ |
| 67 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 68 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 69 | $(obj)/nand_boot_fsl_elbc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 70 | @rm -f $@ |
| 71 | ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 72 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 73 | $(obj)/ns16550.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 74 | @rm -f $@ |
| 75 | ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 76 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 77 | $(obj)/resetvec.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 78 | @rm -f $@ |
| 79 | ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 80 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 81 | $(obj)/fixed_ivor.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 82 | @rm -f $@ |
| 83 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 84 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 85 | $(obj)/start.S: $(obj)/fixed_ivor.S |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 86 | @rm -f $@ |
| 87 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 88 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 89 | $(obj)/tlb.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 90 | @rm -f $@ |
| 91 | ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@ |
Liu Yu | 2639e51 | 2010-01-18 19:03:28 +0800 | [diff] [blame] | 92 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 93 | $(obj)/tlb_table.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 94 | @rm -f $@ |
| 95 | ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@ |