Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # SPDX-License-Identifier: GPL-2.0+
  2. head-y := arch/mips/cpu/start.o
  3. ifeq ($(CONFIG_SPL_BUILD),y)
  4. head-$(CONFIG_ARCH_JZ47XX) := arch/mips/mach-jz47xx/start.o
  5. head-$(CONFIG_SOC_MT7621) := arch/mips/mach-mtmips/mt7621/spl/start.o
  6. endif
  7. ifeq ($(CONFIG_TPL_BUILD),y)
  8. head-$(CONFIG_SOC_MT7621) := arch/mips/mach-mtmips/mt7621/tpl/start.o
  9. endif
  10. libs-y += arch/mips/cpu/
  11. libs-y += arch/mips/lib/
  12. machine-$(CONFIG_ARCH_ATH79) += ath79
  13. machine-$(CONFIG_ARCH_BMIPS) += bmips
  14. machine-$(CONFIG_ARCH_JZ47XX) += jz47xx
  15. machine-$(CONFIG_MACH_PIC32) += pic32
  16. machine-$(CONFIG_ARCH_MTMIPS) += mtmips
  17. machine-$(CONFIG_ARCH_MSCC) += mscc
  18. machine-${CONFIG_ARCH_OCTEON} += octeon
  19. machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
  20. libs-y += $(machdirs)
  21. PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
  22. # Optimize for MIPS architectures
  23. arch-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,-mips32
  24. arch-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,-mips32r2
  25. arch-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,-mips32r6
  26. arch-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,-mips64
  27. arch-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,-mips64r2
  28. arch-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,-mips64r6
  29. arch-${CONFIG_CPU_MIPS64_OCTEON} += -march=octeon2
  30. # Allow extra optimization for specific CPUs/SoCs
  31. tune-$(CONFIG_MIPS_TUNE_4KC) += -mtune=4kc
  32. tune-$(CONFIG_MIPS_TUNE_14KC) += -mtune=14kc
  33. tune-$(CONFIG_MIPS_TUNE_24KC) += -mtune=24kc
  34. tune-$(CONFIG_MIPS_TUNE_34KC) += -mtune=34kc
  35. tune-$(CONFIG_MIPS_TUNE_74KC) += -mtune=74kc
  36. tune-${CONFIG_MIPS_TUNE_OCTEON3} += -mtune=octeon2
  37. # Include default header files
  38. cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
  39. PLATFORM_CPPFLAGS += $(arch-y) $(tune-y) $(cflags-y)