xref: /openbmc/u-boot/arch/mips/Makefile (revision fd0135e3c54c391b6143f85440e30d576a9a83fe)
1e19db555SDaniel Schwierzeck# SPDX-License-Identifier: GPL-2.0+
2e19db555SDaniel Schwierzeck
3eef88dfbSDaniel Schwierzeckhead-y := arch/mips/cpu/start.o
4e19db555SDaniel Schwierzeck
5ecc9d260SMarek Vasutifeq ($(CONFIG_SPL_BUILD),y)
6ecc9d260SMarek Vasutifneq ($(CONFIG_SPL_START_S_PATH),)
7ecc9d260SMarek Vasuthead-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o
8ecc9d260SMarek Vasutendif
9ecc9d260SMarek Vasutendif
10ecc9d260SMarek Vasut
11eef88dfbSDaniel Schwierzecklibs-y += arch/mips/cpu/
12e19db555SDaniel Schwierzecklibs-y += arch/mips/lib/
13d9a4a622SDaniel Schwierzeck
141d3d0f1fSWills Wangmachine-$(CONFIG_ARCH_ATH79) += ath79
15ee422142SÁlvaro Fernández Rojasmachine-$(CONFIG_ARCH_BMIPS) += bmips
16*cd71b1d5SPaul Burtonmachine-$(CONFIG_ARCH_JZ47XX) += jz47xx
1732c1a6eeSPurna Chandra Mandalmachine-$(CONFIG_MACH_PIC32) += pic32
184c835a60SStefan Roesemachine-$(CONFIG_ARCH_MT7620) += mt7620
19dd1033e4SGregory CLEMENTmachine-$(CONFIG_ARCH_MSCC) += mscc
206479b691SDaniel Schwierzeck
216479b691SDaniel Schwierzeckmachdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
226479b691SDaniel Schwierzecklibs-y += $(machdirs)
236479b691SDaniel Schwierzeck
246479b691SDaniel SchwierzeckPLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
250315a289SDaniel Schwierzeck
260315a289SDaniel Schwierzeck# Optimize for MIPS architectures
270315a289SDaniel Schwierzeckarch-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,-mips32
280315a289SDaniel Schwierzeckarch-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,-mips32r2
29c52ebea1SPaul Burtonarch-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,-mips32r6
300315a289SDaniel Schwierzeckarch-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,-mips64
310315a289SDaniel Schwierzeckarch-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,-mips64r2
32c52ebea1SPaul Burtonarch-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,-mips64r6
330315a289SDaniel Schwierzeck
340315a289SDaniel Schwierzeck# Allow extra optimization for specific CPUs/SoCs
350315a289SDaniel Schwierzecktune-$(CONFIG_MIPS_TUNE_4KC) += -mtune=4kc
360315a289SDaniel Schwierzecktune-$(CONFIG_MIPS_TUNE_14KC) += -mtune=14kc
370315a289SDaniel Schwierzecktune-$(CONFIG_MIPS_TUNE_24KC) += -mtune=24kc
385f9cc363SDaniel Schwierzecktune-$(CONFIG_MIPS_TUNE_34KC) += -mtune=34kc
390a0a958bSMarek Vasuttune-$(CONFIG_MIPS_TUNE_74KC) += -mtune=74kc
400315a289SDaniel Schwierzeck
4123ff8633SDaniel Schwierzeck# Include default header files
4223ff8633SDaniel Schwierzeckcflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
4323ff8633SDaniel Schwierzeck
4423ff8633SDaniel SchwierzeckPLATFORM_CPPFLAGS += $(arch-y) $(tune-y) $(cflags-y)
45