aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile55
1 files changed, 37 insertions, 18 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 2563a088d3b8..8f57fc72d62c 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -122,26 +122,8 @@ predef-le += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
122cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be)) 122cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(undef-all) $(predef-be))
123cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le)) 123cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(undef-all) $(predef-le))
124 124
125# For smartmips configurations, there are hundreds of warnings due to ISA overrides
126# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
127# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
128# similar directives in the kernel will spam the build logs with the following warnings:
129# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
130# or
131# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
132# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
133# been fixed properly.
134cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,-msmartmips) -Wa,--no-warn
135cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
136
137cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ 125cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
138 -fno-omit-frame-pointer 126 -fno-omit-frame-pointer
139
140ifeq ($(CONFIG_CPU_HAS_MSA),y)
141toolchain-msa := $(call cc-option-yn,-mhard-float -mfp64 -Wa$(comma)-mmsa)
142cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
143endif
144
145# 127#
146# CPU-dependent compiler/assembler options for optimization. 128# CPU-dependent compiler/assembler options for optimization.
147# 129#
@@ -156,10 +138,12 @@ cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS
156 -Wa,-mips32 -Wa,--trap 138 -Wa,-mips32 -Wa,--trap
157cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 139cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
158 -Wa,-mips32r2 -Wa,--trap 140 -Wa,-mips32r2 -Wa,--trap
141cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap
159cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ 142cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
160 -Wa,-mips64 -Wa,--trap 143 -Wa,-mips64 -Wa,--trap
161cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ 144cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
162 -Wa,-mips64r2 -Wa,--trap 145 -Wa,-mips64r2 -Wa,--trap
146cflags-$(CONFIG_CPU_MIPS64_R6) += -march=mips64r6 -Wa,--trap
163cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap 147cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
164cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \ 148cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \
165 -Wa,--trap 149 -Wa,--trap
@@ -182,6 +166,16 @@ cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon
182endif 166endif
183cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1 167cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1
184cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap 168cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap
169#
170# binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a
171# as MIPS64 R1; older versions as just R1. This leaves the possibility open
172# that GCC might generate R2 code for -march=loongson3a which then is rejected
173# by GAS. The cc-option can't probe for this behaviour so -march=loongson3a
174# can't easily be used safely within the kbuild framework.
175#
176cflags-$(CONFIG_CPU_LOONGSON3) += \
177 $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
178 -Wa,-mips64r2 -Wa,--trap
185 179
186cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) 180cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)
187cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) 181cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,)
@@ -194,6 +188,23 @@ KBUILD_CFLAGS_MODULE += -msb1-pass1-workarounds
194endif 188endif
195endif 189endif
196 190
191# For smartmips configurations, there are hundreds of warnings due to ISA overrides
192# in assembly and header files. smartmips is only supported for MIPS32r1 onwards
193# and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
194# similar directives in the kernel will spam the build logs with the following warnings:
195# Warning: the `smartmips' extension requires MIPS32 revision 1 or greater
196# or
197# Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
198# Pass -Wa,--no-warn to disable all assembler warnings until the kernel code has
199# been fixed properly.
200mips-cflags := "$(cflags-y)"
201cflags-$(CONFIG_CPU_HAS_SMARTMIPS) += $(call cc-option,$(mips-cflags),-msmartmips) -Wa,--no-warn
202cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,$(mips-cflags),-mmicromips)
203ifeq ($(CONFIG_CPU_HAS_MSA),y)
204toolchain-msa := $(call cc-option-yn,-$(mips-cflags),mhard-float -mfp64 -Wa$(comma)-mmsa)
205cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
206endif
207
197# 208#
198# Firmware support 209# Firmware support
199# 210#
@@ -287,7 +298,11 @@ boot-y += vmlinux.ecoff
287boot-y += vmlinux.srec 298boot-y += vmlinux.srec
288ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0) 299ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0)
289boot-y += uImage 300boot-y += uImage
301boot-y += uImage.bin
302boot-y += uImage.bz2
290boot-y += uImage.gz 303boot-y += uImage.gz
304boot-y += uImage.lzma
305boot-y += uImage.lzo
291endif 306endif
292 307
293# compressed boot image targets (arch/mips/boot/compressed/) 308# compressed boot image targets (arch/mips/boot/compressed/)
@@ -386,7 +401,11 @@ define archhelp
386 echo ' vmlinuz.bin - Raw binary zboot image' 401 echo ' vmlinuz.bin - Raw binary zboot image'
387 echo ' vmlinuz.srec - SREC zboot image' 402 echo ' vmlinuz.srec - SREC zboot image'
388 echo ' uImage - U-Boot image' 403 echo ' uImage - U-Boot image'
404 echo ' uImage.bin - U-Boot image (uncompressed)'
405 echo ' uImage.bz2 - U-Boot image (bz2)'
389 echo ' uImage.gz - U-Boot image (gzip)' 406 echo ' uImage.gz - U-Boot image (gzip)'
407 echo ' uImage.lzma - U-Boot image (lzma)'
408 echo ' uImage.lzo - U-Boot image (lzo)'
390 echo ' dtbs - Device-tree blobs for enabled boards' 409 echo ' dtbs - Device-tree blobs for enabled boards'
391 echo 410 echo
392 echo ' These will be default as appropriate for a configured platform.' 411 echo ' These will be default as appropriate for a configured platform.'