diff options
Diffstat (limited to 'arch/mips/include/asm/cpu-features.h')
-rw-r--r-- | arch/mips/include/asm/cpu-features.h | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index 0d8208de9a3f..5aeaf19c26b0 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -68,6 +68,7 @@ | |||
68 | #ifndef cpu_has_octeon_cache | 68 | #ifndef cpu_has_octeon_cache |
69 | #define cpu_has_octeon_cache 0 | 69 | #define cpu_has_octeon_cache 0 |
70 | #endif | 70 | #endif |
71 | /* Don't override `cpu_has_fpu' to 1 or the "nofpu" option won't work. */ | ||
71 | #ifndef cpu_has_fpu | 72 | #ifndef cpu_has_fpu |
72 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) | 73 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) |
73 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) | 74 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) |
@@ -139,6 +140,9 @@ | |||
139 | # endif | 140 | # endif |
140 | #endif | 141 | #endif |
141 | 142 | ||
143 | #ifndef cpu_has_xpa | ||
144 | #define cpu_has_xpa (cpu_data[0].options & MIPS_CPU_XPA) | ||
145 | #endif | ||
142 | #ifndef cpu_has_vtag_icache | 146 | #ifndef cpu_has_vtag_icache |
143 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | 147 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) |
144 | #endif | 148 | #endif |
@@ -220,8 +224,11 @@ | |||
220 | #define cpu_has_mips_4_5_r (cpu_has_mips_4 | cpu_has_mips_5_r) | 224 | #define cpu_has_mips_4_5_r (cpu_has_mips_4 | cpu_has_mips_5_r) |
221 | #define cpu_has_mips_5_r (cpu_has_mips_5 | cpu_has_mips_r) | 225 | #define cpu_has_mips_5_r (cpu_has_mips_5 | cpu_has_mips_r) |
222 | 226 | ||
223 | #define cpu_has_mips_4_5_r2_r6 (cpu_has_mips_4_5 | cpu_has_mips_r2 | \ | 227 | #define cpu_has_mips_3_4_5_64_r2_r6 \ |
224 | cpu_has_mips_r6) | 228 | (cpu_has_mips_3 | cpu_has_mips_4_5_64_r2_r6) |
229 | #define cpu_has_mips_4_5_64_r2_r6 \ | ||
230 | (cpu_has_mips_4_5 | cpu_has_mips64r1 | \ | ||
231 | cpu_has_mips_r2 | cpu_has_mips_r6) | ||
225 | 232 | ||
226 | #define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2 | cpu_has_mips32r6) | 233 | #define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2 | cpu_has_mips32r6) |
227 | #define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2 | cpu_has_mips64r6) | 234 | #define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2 | cpu_has_mips64r6) |
@@ -235,8 +242,39 @@ | |||
235 | /* MIPSR2 and MIPSR6 have a lot of similarities */ | 242 | /* MIPSR2 and MIPSR6 have a lot of similarities */ |
236 | #define cpu_has_mips_r2_r6 (cpu_has_mips_r2 | cpu_has_mips_r6) | 243 | #define cpu_has_mips_r2_r6 (cpu_has_mips_r2 | cpu_has_mips_r6) |
237 | 244 | ||
245 | /* | ||
246 | * cpu_has_mips_r2_exec_hazard - return if IHB is required on current processor | ||
247 | * | ||
248 | * Returns non-zero value if the current processor implementation requires | ||
249 | * an IHB instruction to deal with an instruction hazard as per MIPS R2 | ||
250 | * architecture specification, zero otherwise. | ||
251 | */ | ||
238 | #ifndef cpu_has_mips_r2_exec_hazard | 252 | #ifndef cpu_has_mips_r2_exec_hazard |
239 | #define cpu_has_mips_r2_exec_hazard (cpu_has_mips_r2 | cpu_has_mips_r6) | 253 | #define cpu_has_mips_r2_exec_hazard \ |
254 | ({ \ | ||
255 | int __res; \ | ||
256 | \ | ||
257 | switch (current_cpu_type()) { \ | ||
258 | case CPU_M14KC: \ | ||
259 | case CPU_74K: \ | ||
260 | case CPU_1074K: \ | ||
261 | case CPU_PROAPTIV: \ | ||
262 | case CPU_P5600: \ | ||
263 | case CPU_M5150: \ | ||
264 | case CPU_QEMU_GENERIC: \ | ||
265 | case CPU_CAVIUM_OCTEON: \ | ||
266 | case CPU_CAVIUM_OCTEON_PLUS: \ | ||
267 | case CPU_CAVIUM_OCTEON2: \ | ||
268 | case CPU_CAVIUM_OCTEON3: \ | ||
269 | __res = 0; \ | ||
270 | break; \ | ||
271 | \ | ||
272 | default: \ | ||
273 | __res = 1; \ | ||
274 | } \ | ||
275 | \ | ||
276 | __res; \ | ||
277 | }) | ||
240 | #endif | 278 | #endif |
241 | 279 | ||
242 | /* | 280 | /* |
@@ -366,4 +404,8 @@ | |||
366 | # define cpu_has_fre (cpu_data[0].options & MIPS_CPU_FRE) | 404 | # define cpu_has_fre (cpu_data[0].options & MIPS_CPU_FRE) |
367 | #endif | 405 | #endif |
368 | 406 | ||
407 | #ifndef cpu_has_cdmm | ||
408 | # define cpu_has_cdmm (cpu_data[0].options & MIPS_CPU_CDMM) | ||
409 | #endif | ||
410 | |||
369 | #endif /* __ASM_CPU_FEATURES_H */ | 411 | #endif /* __ASM_CPU_FEATURES_H */ |