eefa44da6c2d7d6e763d763a6514347814309d7f
[karo-tx-uboot.git] / nand_spl / board / freescale / p1_p2_rdb / Makefile
1 #
2 # (C) Copyright 2007
3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
4 #
5 # Copyright 2009-2011 Freescale Semiconductor, Inc.
6 #
7 # SPDX-License-Identifier:      GPL-2.0+
8 #
9
10 CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
11 PAD_TO := 0xfff01000
12
13 nandobj := $(OBJTREE)/nand_spl/
14
15 LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
16 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
17                 $(LDFLAGS) $(LDFLAGS_FINAL)
18 asflags-y += -DCONFIG_NAND_SPL
19 ccflags-y += -DCONFIG_NAND_SPL
20
21 SOBJS   = start.o resetvec.o
22 COBJS   = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
23           nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24
25 OBJS    := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
26 __OBJS  := $(SOBJS) $(COBJS)
27 LNDIR   := $(nandobj)board/$(BOARDDIR)
28
29 targets += $(__OBJS)
30
31 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
32
33 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
34         $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
35
36 $(nandobj)u-boot-spl.bin:       $(nandobj)u-boot-spl
37         $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
38
39 $(nandobj)u-boot-spl:   $(OBJS) $(nandobj)u-boot-nand_spl.lds
40         cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
41                 -Map $(nandobj)u-boot-spl.map -o $@
42
43 $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
44         $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
45                 -ansi -D__ASSEMBLY__ -P - <$< >$@
46
47 # create symbolic links for common files
48
49 $(obj)/cache.c:
50         @rm -f $@
51         ln -sf $(srctree)/arch/powerpc/lib/cache.c $@
52
53 $(obj)/cpu_init_early.c:
54         @rm -f $@
55         ln -sf $(srctree)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
56
57 $(obj)/spl_minimal.c:
58         @rm -f $@
59         ln -sf $(srctree)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
60
61 $(obj)/fsl_law.c:
62         @rm -f $@
63         ln -sf $(srctree)/arch/powerpc/cpu/mpc8xxx/law.c $@
64
65 $(obj)/law.c:
66         @rm -f $@
67         ln -sf $(srctree)/board/$(BOARDDIR)/law.c $@
68
69 $(obj)/nand_boot_fsl_elbc.c:
70         @rm -f $@
71         ln -sf $(srctree)/nand_spl/nand_boot_fsl_elbc.c $@
72
73 $(obj)/ns16550.c:
74         @rm -f $@
75         ln -sf $(srctree)/drivers/serial/ns16550.c $@
76
77 $(obj)/resetvec.S:
78         @rm -f $@
79         ln -s $(srctree)/$(CPUDIR)/resetvec.S $@
80
81 $(obj)/fixed_ivor.S:
82         @rm -f $@
83         ln -sf $(srctree)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
84
85 $(obj)/start.S: $(obj)/fixed_ivor.S
86         @rm -f $@
87         ln -sf $(srctree)/arch/powerpc/cpu/mpc85xx/start.S $@
88
89 $(obj)/tlb.c:
90         @rm -f $@
91         ln -sf $(srctree)/arch/powerpc/cpu/mpc85xx/tlb.c $@
92
93 $(obj)/tlb_table.c:
94         @rm -f $@
95         ln -sf $(srctree)/board/$(BOARDDIR)/tlb.c $@