Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 1 | # |
2 | # Copyright 2010-2011 Freescale Semiconductor, Inc. | ||||
3 | # | ||||
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | # SPDX-License-Identifier: GPL-2.0+ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 5 | # |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 6 | |
Masahiro Yamada | a0b14c3 | 2014-02-04 17:24:13 +0900 | [diff] [blame] | 7 | PAD_TO := 0xfff01000 |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 8 | |
Masahiro Yamada | 5ee828c | 2014-03-11 11:05:21 +0900 | [diff] [blame] | 9 | nandobj := $(objtree)/nand_spl/ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 10 | |
Masahiro Yamada | 4379ac6 | 2014-03-11 11:05:19 +0900 | [diff] [blame] | 11 | LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 12 | LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \ |
13 | $(LDFLAGS) $(LDFLAGS_FINAL) | ||||
Masahiro Yamada | 6825a95 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 14 | asflags-y += -DCONFIG_NAND_SPL |
15 | ccflags-y += -DCONFIG_NAND_SPL | ||||
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 16 | |
17 | SOBJS = start.o resetvec.o | ||||
Scott Wood | b9735cb | 2012-09-20 16:35:21 -0500 | [diff] [blame] | 18 | COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \ |
Scott Wood | 59629c2 | 2012-08-17 19:46:29 -0500 | [diff] [blame] | 19 | nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 20 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 21 | OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS)) |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 22 | __OBJS := $(SOBJS) $(COBJS) |
23 | LNDIR := $(nandobj)board/$(BOARDDIR) | ||||
24 | |||||
Masahiro Yamada | 6825a95 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 25 | targets += $(__OBJS) |
26 | |||||
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 27 | all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 28 | |
29 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl | ||||
Masahiro Yamada | 95ddcd6 | 2014-02-24 11:12:12 +0900 | [diff] [blame] | 30 | $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 31 | |
32 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl | ||||
Masahiro Yamada | 95ddcd6 | 2014-02-24 11:12:12 +0900 | [diff] [blame] | 33 | $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 34 | |
35 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds | ||||
36 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ | ||||
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 37 | -Map $(nandobj)u-boot-spl.map -o $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 38 | |
Albert ARIBAUD | ef123c5 | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 39 | $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) |
Masahiro Yamada | 6825a95 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 40 | $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \ |
Scott Wood | a6d0f62 | 2012-11-13 12:30:39 +0000 | [diff] [blame] | 41 | -ansi -D__ASSEMBLY__ -P - <$< >$@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 42 | |
43 | # create symbolic links for common files | ||||
44 | |||||
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 45 | $(obj)/cache.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 46 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 47 | ln -sf $(srctree)/arch/powerpc/lib/cache.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 48 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 49 | $(obj)/cpu_init_early.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 50 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 51 | ln -sf $(srctree)/$(CPUDIR)/cpu_init_early.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 52 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 53 | $(obj)/spl_minimal.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 54 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 55 | ln -sf $(srctree)/$(CPUDIR)/spl_minimal.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 56 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 57 | $(obj)/fsl_law.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 58 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 59 | ln -sf $(srctree)/arch/powerpc/cpu/mpc8xxx/law.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 60 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 61 | $(obj)/law.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 62 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 63 | ln -sf $(srctree)/board/$(BOARDDIR)/law.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 64 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 65 | $(obj)/nand_boot_fsl_elbc.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 66 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 67 | ln -sf $(srctree)/nand_spl/nand_boot_fsl_elbc.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 68 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 69 | $(obj)/ns16550.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 70 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 71 | ln -sf $(srctree)/drivers/serial/ns16550.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 72 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 73 | $(obj)/resetvec.S: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 74 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 75 | ln -s $(srctree)/$(CPUDIR)/resetvec.S $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 76 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 77 | $(obj)/fixed_ivor.S: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 78 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 79 | ln -sf $(srctree)/$(CPUDIR)/fixed_ivor.S $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 80 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 81 | $(obj)/start.S: $(obj)/fixed_ivor.S |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 82 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 83 | ln -sf $(srctree)/$(CPUDIR)/start.S $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 84 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 85 | $(obj)/tlb.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 86 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 87 | ln -sf $(srctree)/$(CPUDIR)/tlb.c $@ |
Roy Zang | 3f7f6b8 | 2011-06-09 11:30:52 +0800 | [diff] [blame] | 88 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 89 | $(obj)/tlb_table.c: |
Masahiro Yamada | 5310b8b | 2013-11-20 18:11:57 +0900 | [diff] [blame] | 90 | @rm -f $@ |
Masahiro Yamada | 0128632 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 91 | ln -sf $(srctree)/board/$(BOARDDIR)/tlb.c $@ |