Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2007 |
| 3 | # Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 6 | # |
| 7 | |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 8 | include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk |
| 9 | |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 10 | nandobj := $(OBJTREE)/nand_spl/ |
| 11 | |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 12 | LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds |
Haiying Wang | 3935873 | 2011-02-22 16:38:05 -0500 | [diff] [blame] | 13 | LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \ |
| 14 | $(LDFLAGS_FINAL) |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 15 | asflags-y += -DCONFIG_NAND_SPL |
| 16 | ccflags-y += -DCONFIG_NAND_SPL |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 17 | |
| 18 | SOBJS = start.o init.o resetvec.o |
| 19 | COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o |
| 20 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 21 | OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS)) |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 22 | __OBJS := $(SOBJS) $(COBJS) |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 23 | LNDIR := $(nandobj)board/$(BOARDDIR) |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 24 | |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 25 | targets += $(__OBJS) |
| 26 | |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 27 | all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 28 | |
| 29 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl |
Masahiro Yamada | c9c83ba | 2014-02-24 11:12:12 +0900 | [diff] [blame^] | 30 | $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 31 | |
| 32 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl |
Masahiro Yamada | c9c83ba | 2014-02-24 11:12:12 +0900 | [diff] [blame^] | 33 | $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 34 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 35 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds |
Scott Wood | 9d6b227 | 2010-12-10 15:13:39 -0600 | [diff] [blame] | 36 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 37 | -Map $(nandobj)u-boot-spl.map -o $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 38 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 39 | $(nandobj)u-boot.lds: $(LDSCRIPT) |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 40 | $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 41 | |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 42 | # create symbolic links for common files |
| 43 | |
| 44 | # from cpu directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 45 | $(obj)/ndfc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 46 | @rm -f $@ |
| 47 | ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 48 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 49 | $(obj)/resetvec.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 50 | @rm -f $@ |
| 51 | ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 52 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 53 | $(obj)/start.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 54 | @rm -f $@ |
| 55 | ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 56 | |
| 57 | # from board directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 58 | $(obj)/init.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 59 | @rm -f $@ |
| 60 | ln -s $(SRCTREE)/board/amcc/bamboo/init.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 61 | |
| 62 | # from nand_spl directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 63 | $(obj)/nand_boot.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 64 | @rm -f $@ |
| 65 | ln -s $(SRCTREE)/nand_spl/nand_boot.c $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 66 | |
Marcel Ziswiler | aea6856 | 2007-12-30 03:30:46 +0100 | [diff] [blame] | 67 | # from drivers/mtd/nand directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 68 | $(obj)/nand_ecc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 69 | @rm -f $@ |
| 70 | ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@ |