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) |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 15 | AFLAGS += -DCONFIG_NAND_SPL |
| 16 | CFLAGS += -DCONFIG_NAND_SPL |
| 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 | SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 22 | OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS)) |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 23 | __OBJS := $(SOBJS) $(COBJS) |
Wolfgang Denk | 29547c6 | 2011-03-31 16:26:29 -0500 | [diff] [blame] | 24 | LNDIR := $(nandobj)board/$(BOARDDIR) |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 25 | |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 26 | all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 27 | |
| 28 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl |
| 29 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ |
| 30 | |
| 31 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl |
| 32 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 33 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 34 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds |
Scott Wood | 9d6b227 | 2010-12-10 15:13:39 -0600 | [diff] [blame] | 35 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 36 | -Map $(nandobj)u-boot-spl.map -o $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 37 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 38 | $(nandobj)u-boot.lds: $(LDSCRIPT) |
| 39 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 40 | |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 41 | # create symbolic links for common files |
| 42 | |
| 43 | # from cpu directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 44 | $(obj)/ndfc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 45 | @rm -f $@ |
| 46 | ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 47 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 48 | $(obj)/resetvec.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 49 | @rm -f $@ |
| 50 | ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 51 | |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 52 | $(obj)/start.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 53 | @rm -f $@ |
| 54 | ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 55 | |
| 56 | # from board directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 57 | $(obj)/init.S: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 58 | @rm -f $@ |
| 59 | ln -s $(SRCTREE)/board/amcc/bamboo/init.S $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 60 | |
| 61 | # from nand_spl directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 62 | $(obj)/nand_boot.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 63 | @rm -f $@ |
| 64 | ln -s $(SRCTREE)/nand_spl/nand_boot.c $@ |
Stefan Roese | 4274351 | 2007-06-01 15:27:11 +0200 | [diff] [blame] | 65 | |
Marcel Ziswiler | aea6856 | 2007-12-30 03:30:46 +0100 | [diff] [blame] | 66 | # from drivers/mtd/nand directory |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 67 | $(obj)/nand_ecc.c: |
Masahiro Yamada | d1aacf2 | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 68 | @rm -f $@ |
| 69 | ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@ |