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