]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/mips/include/asm/cpu-type.h
Merge branches 'fixes', 'misc', 'mmci', 'unstable/dma-for-next' and 'sa11x0' into...
[karo-tx-linux.git] / arch / mips / include / asm / cpu-type.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 2003, 2004 Ralf Baechle
7  * Copyright (C) 2004  Maciej W. Rozycki
8  */
9 #ifndef __ASM_CPU_TYPE_H
10 #define __ASM_CPU_TYPE_H
11
12 #include <linux/smp.h>
13 #include <linux/compiler.h>
14
15 static inline int __pure __get_cpu_type(const int cpu_type)
16 {
17         switch (cpu_type) {
18 #if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \
19     defined(CONFIG_SYS_HAS_CPU_LOONGSON2F)
20         case CPU_LOONGSON2:
21 #endif
22
23 #ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B
24         case CPU_LOONGSON1:
25 #endif
26
27 #ifdef CONFIG_SYS_HAS_CPU_MIPS32_R1
28         case CPU_4KC:
29         case CPU_ALCHEMY:
30         case CPU_BMIPS3300:
31         case CPU_BMIPS4350:
32         case CPU_PR4450:
33         case CPU_BMIPS32:
34         case CPU_JZRISC:
35 #endif
36
37 #if defined(CONFIG_SYS_HAS_CPU_MIPS32_R1) || \
38     defined(CONFIG_SYS_HAS_CPU_MIPS32_R2)
39         case CPU_4KEC:
40 #endif
41
42 #ifdef CONFIG_SYS_HAS_CPU_MIPS32_R2
43         case CPU_4KSC:
44         case CPU_24K:
45         case CPU_34K:
46         case CPU_1004K:
47         case CPU_74K:
48         case CPU_M14KC:
49         case CPU_M14KEC:
50 #endif
51
52 #ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1
53         case CPU_5KC:
54         case CPU_5KE:
55         case CPU_20KC:
56         case CPU_25KF:
57         case CPU_SB1:
58         case CPU_SB1A:
59 #endif
60
61 #ifdef CONFIG_SYS_HAS_CPU_MIPS64_R2
62         /*
63          * All MIPS64 R2 processors have their own special symbols.  That is,
64          * there currently is no pure R2 core
65          */
66 #endif
67
68 #ifdef CONFIG_SYS_HAS_CPU_R3000
69         case CPU_R2000:
70         case CPU_R3000:
71         case CPU_R3000A:
72         case CPU_R3041:
73         case CPU_R3051:
74         case CPU_R3052:
75         case CPU_R3081:
76         case CPU_R3081E:
77 #endif
78
79 #ifdef CONFIG_SYS_HAS_CPU_TX39XX
80         case CPU_TX3912:
81         case CPU_TX3922:
82         case CPU_TX3927:
83 #endif
84
85 #ifdef CONFIG_SYS_HAS_CPU_VR41XX
86         case CPU_VR41XX:
87         case CPU_VR4111:
88         case CPU_VR4121:
89         case CPU_VR4122:
90         case CPU_VR4131:
91         case CPU_VR4133:
92         case CPU_VR4181:
93         case CPU_VR4181A:
94 #endif
95
96 #ifdef CONFIG_SYS_HAS_CPU_R4300
97         case CPU_R4300:
98         case CPU_R4310:
99 #endif
100
101 #ifdef CONFIG_SYS_HAS_CPU_R4X00
102         case CPU_R4000PC:
103         case CPU_R4000SC:
104         case CPU_R4000MC:
105         case CPU_R4200:
106         case CPU_R4400PC:
107         case CPU_R4400SC:
108         case CPU_R4400MC:
109         case CPU_R4600:
110         case CPU_R4700:
111         case CPU_R4640:
112         case CPU_R4650:
113 #endif
114
115 #ifdef CONFIG_SYS_HAS_CPU_TX49XX
116         case CPU_TX49XX:
117 #endif
118
119 #ifdef CONFIG_SYS_HAS_CPU_R5000
120         case CPU_R5000:
121 #endif
122
123 #ifdef CONFIG_SYS_HAS_CPU_R5432
124         case CPU_R5432:
125 #endif
126
127 #ifdef CONFIG_SYS_HAS_CPU_R5500
128         case CPU_R5500:
129 #endif
130
131 #ifdef CONFIG_SYS_HAS_CPU_R6000
132         case CPU_R6000:
133         case CPU_R6000A:
134 #endif
135
136 #ifdef CONFIG_SYS_HAS_CPU_NEVADA
137         case CPU_NEVADA:
138 #endif
139
140 #ifdef CONFIG_SYS_HAS_CPU_R8000
141         case CPU_R8000:
142 #endif
143
144 #ifdef CONFIG_SYS_HAS_CPU_R10000
145         case CPU_R10000:
146         case CPU_R12000:
147         case CPU_R14000:
148 #endif
149 #ifdef CONFIG_SYS_HAS_CPU_RM7000
150         case CPU_RM7000:
151         case CPU_SR71000:
152 #endif
153 #ifdef CONFIG_SYS_HAS_CPU_RM9000
154         case CPU_RM9000:
155 #endif
156 #ifdef CONFIG_SYS_HAS_CPU_SB1
157         case CPU_SB1:
158         case CPU_SB1A:
159 #endif
160 #ifdef CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON
161         case CPU_CAVIUM_OCTEON:
162         case CPU_CAVIUM_OCTEON_PLUS:
163         case CPU_CAVIUM_OCTEON2:
164 #endif
165
166 #ifdef CONFIG_SYS_HAS_CPU_BMIPS4380
167         case CPU_BMIPS4380:
168 #endif
169
170 #ifdef CONFIG_SYS_HAS_CPU_BMIPS5000
171         case CPU_BMIPS5000:
172 #endif
173
174 #ifdef CONFIG_SYS_HAS_CPU_XLP
175         case CPU_XLP:
176 #endif
177
178 #ifdef CONFIG_SYS_HAS_CPU_XLR
179         case CPU_XLR:
180 #endif
181                 break;
182         default:
183                 unreachable();
184         }
185
186         return cpu_type;
187 }
188
189 static inline int __pure current_cpu_type(void)
190 {
191         const int cpu_type = current_cpu_data.cputype;
192
193         return __get_cpu_type(cpu_type);
194 }
195
196 static inline int __pure boot_cpu_type(void)
197 {
198         const int cpu_type = cpu_data[0].cputype;
199
200         return __get_cpu_type(cpu_type);
201 }
202
203 #endif /* __ASM_CPU_TYPE_H */