diff options
Diffstat (limited to 'include/asm-mips/cpu-features.h')
-rw-r--r-- | include/asm-mips/cpu-features.h | 66 |
1 files changed, 52 insertions, 14 deletions
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 9a2de642eee6..03627cfb3e45 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2003, 2004 Ralf Baechle | 6 | * Copyright (C) 2003, 2004 Ralf Baechle |
7 | * Copyright (C) 2004 Maciej W. Rozycki | ||
7 | */ | 8 | */ |
8 | #ifndef __ASM_CPU_FEATURES_H | 9 | #ifndef __ASM_CPU_FEATURES_H |
9 | #define __ASM_CPU_FEATURES_H | 10 | #define __ASM_CPU_FEATURES_H |
@@ -24,8 +25,19 @@ | |||
24 | #ifndef cpu_has_4kex | 25 | #ifndef cpu_has_4kex |
25 | #define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) | 26 | #define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) |
26 | #endif | 27 | #endif |
27 | #ifndef cpu_has_4ktlb | 28 | #ifndef cpu_has_3k_cache |
28 | #define cpu_has_4ktlb (cpu_data[0].options & MIPS_CPU_4KTLB) | 29 | #define cpu_has_3k_cache (cpu_data[0].options & MIPS_CPU_3K_CACHE) |
30 | #endif | ||
31 | #define cpu_has_6k_cache 0 | ||
32 | #define cpu_has_8k_cache 0 | ||
33 | #ifndef cpu_has_4k_cache | ||
34 | #define cpu_has_4k_cache (cpu_data[0].options & MIPS_CPU_4K_CACHE) | ||
35 | #endif | ||
36 | #ifndef cpu_has_tx39_cache | ||
37 | #define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) | ||
38 | #endif | ||
39 | #ifndef cpu_has_sb1_cache | ||
40 | #define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE) | ||
29 | #endif | 41 | #endif |
30 | #ifndef cpu_has_fpu | 42 | #ifndef cpu_has_fpu |
31 | #define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) | 43 | #define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) |
@@ -39,9 +51,6 @@ | |||
39 | #ifndef cpu_has_watch | 51 | #ifndef cpu_has_watch |
40 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) | 52 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) |
41 | #endif | 53 | #endif |
42 | #ifndef cpu_has_mips16 | ||
43 | #define cpu_has_mips16 (cpu_data[0].options & MIPS_CPU_MIPS16) | ||
44 | #endif | ||
45 | #ifndef cpu_has_divec | 54 | #ifndef cpu_has_divec |
46 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) | 55 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) |
47 | #endif | 56 | #endif |
@@ -66,6 +75,18 @@ | |||
66 | #ifndef cpu_has_llsc | 75 | #ifndef cpu_has_llsc |
67 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) | 76 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) |
68 | #endif | 77 | #endif |
78 | #ifndef cpu_has_mips16 | ||
79 | #define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) | ||
80 | #endif | ||
81 | #ifndef cpu_has_mdmx | ||
82 | #define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX) | ||
83 | #endif | ||
84 | #ifndef cpu_has_mips3d | ||
85 | #define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D) | ||
86 | #endif | ||
87 | #ifndef cpu_has_smartmips | ||
88 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) | ||
89 | #endif | ||
69 | #ifndef cpu_has_vtag_icache | 90 | #ifndef cpu_has_vtag_icache |
70 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | 91 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) |
71 | #endif | 92 | #endif |
@@ -95,15 +116,16 @@ | |||
95 | #endif | 116 | #endif |
96 | #endif | 117 | #endif |
97 | 118 | ||
98 | /* | 119 | #ifndef cpu_has_dsp |
99 | * Certain CPUs may throw bizarre exceptions if not the whole cacheline | 120 | #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) |
100 | * contains valid instructions. For these we ensure proper alignment of | 121 | #endif |
101 | * signal trampolines and pad them to the size of a full cache lines with | 122 | |
102 | * nops. This is also used in structure definitions so can't be a test macro | 123 | #ifdef CONFIG_MIPS_MT |
103 | * like the others. | 124 | #ifndef cpu_has_mipsmt |
104 | */ | 125 | # define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) |
105 | #ifndef PLAT_TRAMPOLINE_STUFF_LINE | 126 | #endif |
106 | #define PLAT_TRAMPOLINE_STUFF_LINE 0UL | 127 | #else |
128 | # define cpu_has_mipsmt 0 | ||
107 | #endif | 129 | #endif |
108 | 130 | ||
109 | #ifdef CONFIG_32BIT | 131 | #ifdef CONFIG_32BIT |
@@ -142,6 +164,22 @@ | |||
142 | # endif | 164 | # endif |
143 | #endif | 165 | #endif |
144 | 166 | ||
167 | #ifdef CONFIG_CPU_MIPSR2 | ||
168 | # if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) | ||
169 | # define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) | ||
170 | # else | ||
171 | # define cpu_has_vint 0 | ||
172 | # endif | ||
173 | # if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic) | ||
174 | # define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC) | ||
175 | # else | ||
176 | # define cpu_has_veic 0 | ||
177 | # endif | ||
178 | #else | ||
179 | # define cpu_has_vint 0 | ||
180 | # define cpu_has_veic 0 | ||
181 | #endif | ||
182 | |||
145 | #ifndef cpu_has_subset_pcaches | 183 | #ifndef cpu_has_subset_pcaches |
146 | #define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) | 184 | #define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) |
147 | #endif | 185 | #endif |