Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #
  2. # (C) Copyright 2007
  3. # Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. #
  5. # Copyright 2009 Freescale Semiconductor, Inc.
  6. #
  7. # See file CREDITS for list of people who contributed to this
  8. # project.
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU General Public License as
  12. # published by the Free Software Foundation; either version 2 of
  13. # the License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. # MA 02111-1307 USA
  24. #
  25. NAND_SPL := y
  26. CONFIG_SYS_TEXT_BASE := 0xfff00000
  27. PAD_TO := 0xfff01000
  28. include $(TOPDIR)/config.mk
  29. LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
  30. LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
  31. AFLAGS += -DCONFIG_NAND_SPL
  32. CFLAGS += -DCONFIG_NAND_SPL
  33. SOBJS = start.o resetvec.o
  34. COBJS = cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.o \
  35. nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
  36. SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
  37. OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  38. __OBJS := $(SOBJS) $(COBJS)
  39. LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
  40. nandobj := $(OBJTREE)/nand_spl/
  41. ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
  42. all: $(obj).depend $(ALL)
  43. $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
  44. $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
  45. $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
  46. $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
  47. $(nandobj)u-boot-spl: $(OBJS)
  48. cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
  49. -Map $(nandobj)u-boot-spl.map \
  50. -o $(nandobj)u-boot-spl
  51. # create symbolic links for common files
  52. $(obj)cache.c:
  53. @rm -f $(obj)cache.c
  54. ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c
  55. $(obj)cpu_init_early.c:
  56. @rm -f $(obj)cpu_init_early.c
  57. ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $(obj)cpu_init_early.c
  58. $(obj)cpu_init_nand.c:
  59. @rm -f $(obj)cpu_init_nand.c
  60. ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_nand.c $(obj)cpu_init_nand.c
  61. $(obj)fsl_law.c:
  62. @rm -f $(obj)fsl_law.c
  63. ln -sf $(SRCTREE)/drivers/misc/fsl_law.c $(obj)fsl_law.c
  64. $(obj)law.c:
  65. @rm -f $(obj)law.c
  66. ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $(obj)law.c
  67. $(obj)nand_boot_fsl_elbc.c:
  68. @rm -f $(obj)nand_boot_fsl_elbc.c
  69. ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
  70. $(obj)nand_boot_fsl_elbc.c
  71. $(obj)ns16550.c:
  72. @rm -f $(obj)ns16550.c
  73. ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
  74. $(obj)resetvec.S:
  75. @rm -f $(obj)resetvec.S
  76. ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
  77. $(obj)fixed_ivor.S:
  78. @rm -f $(obj)fixed_ivor.S
  79. ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $(obj)fixed_ivor.S
  80. $(obj)start.S: $(obj)fixed_ivor.S
  81. @rm -f $(obj)start.S
  82. ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $(obj)start.S
  83. $(obj)tlb.c:
  84. @rm -f $(obj)tlb.c
  85. ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $(obj)tlb.c
  86. $(obj)tlb_table.c:
  87. @rm -f $(obj)tlb_table.c
  88. ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $(obj)tlb_table.c
  89. ifneq ($(OBJTREE), $(SRCTREE))
  90. $(obj)nand_boot.c:
  91. @rm -f $(obj)nand_boot.c
  92. ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $(obj)nand_boot.c
  93. endif
  94. #########################################################################
  95. $(obj)%.o: $(obj)%.S
  96. $(CC) $(AFLAGS) -c -o $@ $<
  97. $(obj)%.o: $(obj)%.c
  98. $(CC) $(CFLAGS) -c -o $@ $<
  99. # defines $(obj).depend target
  100. include $(SRCTREE)/rules.mk
  101. sinclude $(obj).depend
  102. #########################################################################