X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=arch%2Fmips%2FMakefile;h=c30d4ef39db0b79840fcdf9ff64e789cf4085067;hb=22693376144cbbe2547f60a6aa48fb56cf8247d1;hp=0a9e7e614b2061ee674a91add20888f4e9ee1e5b;hpb=1d6a95011ffa25241c2e9c112893f6c6c96f2b46;p=u-boot diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 0a9e7e614b..c30d4ef39d 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -2,9 +2,43 @@ # SPDX-License-Identifier: GPL-2.0+ # -head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o -head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o +head-y := arch/mips/cpu/start.o -libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/ -libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/ +ifeq ($(CONFIG_SPL_BUILD),y) +ifneq ($(CONFIG_SPL_START_S_PATH),) +head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o +endif +endif + +libs-y += arch/mips/cpu/ libs-y += arch/mips/lib/ + +machine-$(CONFIG_SOC_AU1X00) += au1x00 +machine-$(CONFIG_ARCH_ATH79) += ath79 +machine-$(CONFIG_ARCH_BMIPS) += bmips +machine-$(CONFIG_MACH_PIC32) += pic32 + +machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y)) +libs-y += $(machdirs) + +PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) + +# Optimize for MIPS architectures +arch-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,-mips32 +arch-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,-mips32r2 +arch-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,-mips32r6 +arch-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,-mips64 +arch-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,-mips64r2 +arch-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,-mips64r6 + +# Allow extra optimization for specific CPUs/SoCs +tune-$(CONFIG_MIPS_TUNE_4KC) += -mtune=4kc +tune-$(CONFIG_MIPS_TUNE_14KC) += -mtune=14kc +tune-$(CONFIG_MIPS_TUNE_24KC) += -mtune=24kc +tune-$(CONFIG_MIPS_TUNE_34KC) += -mtune=34kc +tune-$(CONFIG_MIPS_TUNE_74KC) += -mtune=74kc + +# Include default header files +cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic + +PLATFORM_CPPFLAGS += $(arch-y) $(tune-y) $(cflags-y)