diff options
Diffstat (limited to 'include/asm-arm/arch-omap/cpu.h')
-rw-r--r-- | include/asm-arm/arch-omap/cpu.h | 82 |
1 files changed, 59 insertions, 23 deletions
diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h index 1119e2b53e72..ec7eb675d922 100644 --- a/include/asm-arm/arch-omap/cpu.h +++ b/include/asm-arm/arch-omap/cpu.h | |||
@@ -28,12 +28,7 @@ | |||
28 | 28 | ||
29 | extern unsigned int system_rev; | 29 | extern unsigned int system_rev; |
30 | 30 | ||
31 | #define OMAP_DIE_ID_0 0xfffe1800 | 31 | #define omap2_cpu_rev() ((system_rev >> 8) & 0x0f) |
32 | #define OMAP_DIE_ID_1 0xfffe1804 | ||
33 | #define OMAP_PRODUCTION_ID_0 0xfffe2000 | ||
34 | #define OMAP_PRODUCTION_ID_1 0xfffe2004 | ||
35 | #define OMAP32_ID_0 0xfffed400 | ||
36 | #define OMAP32_ID_1 0xfffed404 | ||
37 | 32 | ||
38 | /* | 33 | /* |
39 | * Test if multicore OMAP support is needed | 34 | * Test if multicore OMAP support is needed |
@@ -50,7 +45,7 @@ extern unsigned int system_rev; | |||
50 | # define OMAP_NAME omap730 | 45 | # define OMAP_NAME omap730 |
51 | # endif | 46 | # endif |
52 | #endif | 47 | #endif |
53 | #ifdef CONFIG_ARCH_OMAP1510 | 48 | #ifdef CONFIG_ARCH_OMAP15XX |
54 | # ifdef OMAP_NAME | 49 | # ifdef OMAP_NAME |
55 | # undef MULTI_OMAP1 | 50 | # undef MULTI_OMAP1 |
56 | # define MULTI_OMAP1 | 51 | # define MULTI_OMAP1 |
@@ -79,9 +74,11 @@ extern unsigned int system_rev; | |||
79 | * Macros to group OMAP into cpu classes. | 74 | * Macros to group OMAP into cpu classes. |
80 | * These can be used in most places. | 75 | * These can be used in most places. |
81 | * cpu_is_omap7xx(): True for OMAP730 | 76 | * cpu_is_omap7xx(): True for OMAP730 |
82 | * cpu_is_omap15xx(): True for OMAP1510 and OMAP5910 | 77 | * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310 |
83 | * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 | 78 | * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 |
84 | * cpu_is_omap24xx(): True for OMAP2420 | 79 | * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430 |
80 | * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423 | ||
81 | * cpu_is_omap243x(): True for OMAP2430 | ||
85 | */ | 82 | */ |
86 | #define GET_OMAP_CLASS (system_rev & 0xff) | 83 | #define GET_OMAP_CLASS (system_rev & 0xff) |
87 | 84 | ||
@@ -91,22 +88,35 @@ static inline int is_omap ##class (void) \ | |||
91 | return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ | 88 | return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ |
92 | } | 89 | } |
93 | 90 | ||
91 | #define GET_OMAP_SUBCLASS ((system_rev >> 20) & 0x0fff) | ||
92 | |||
93 | #define IS_OMAP_SUBCLASS(subclass, id) \ | ||
94 | static inline int is_omap ##subclass (void) \ | ||
95 | { \ | ||
96 | return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ | ||
97 | } | ||
98 | |||
94 | IS_OMAP_CLASS(7xx, 0x07) | 99 | IS_OMAP_CLASS(7xx, 0x07) |
95 | IS_OMAP_CLASS(15xx, 0x15) | 100 | IS_OMAP_CLASS(15xx, 0x15) |
96 | IS_OMAP_CLASS(16xx, 0x16) | 101 | IS_OMAP_CLASS(16xx, 0x16) |
97 | IS_OMAP_CLASS(24xx, 0x24) | 102 | IS_OMAP_CLASS(24xx, 0x24) |
98 | 103 | ||
104 | IS_OMAP_SUBCLASS(242x, 0x242) | ||
105 | IS_OMAP_SUBCLASS(243x, 0x243) | ||
106 | |||
99 | #define cpu_is_omap7xx() 0 | 107 | #define cpu_is_omap7xx() 0 |
100 | #define cpu_is_omap15xx() 0 | 108 | #define cpu_is_omap15xx() 0 |
101 | #define cpu_is_omap16xx() 0 | 109 | #define cpu_is_omap16xx() 0 |
102 | #define cpu_is_omap24xx() 0 | 110 | #define cpu_is_omap24xx() 0 |
111 | #define cpu_is_omap242x() 0 | ||
112 | #define cpu_is_omap243x() 0 | ||
103 | 113 | ||
104 | #if defined(MULTI_OMAP1) | 114 | #if defined(MULTI_OMAP1) |
105 | # if defined(CONFIG_ARCH_OMAP730) | 115 | # if defined(CONFIG_ARCH_OMAP730) |
106 | # undef cpu_is_omap7xx | 116 | # undef cpu_is_omap7xx |
107 | # define cpu_is_omap7xx() is_omap7xx() | 117 | # define cpu_is_omap7xx() is_omap7xx() |
108 | # endif | 118 | # endif |
109 | # if defined(CONFIG_ARCH_OMAP1510) | 119 | # if defined(CONFIG_ARCH_OMAP15XX) |
110 | # undef cpu_is_omap15xx | 120 | # undef cpu_is_omap15xx |
111 | # define cpu_is_omap15xx() is_omap15xx() | 121 | # define cpu_is_omap15xx() is_omap15xx() |
112 | # endif | 122 | # endif |
@@ -119,7 +129,7 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
119 | # undef cpu_is_omap7xx | 129 | # undef cpu_is_omap7xx |
120 | # define cpu_is_omap7xx() 1 | 130 | # define cpu_is_omap7xx() 1 |
121 | # endif | 131 | # endif |
122 | # if defined(CONFIG_ARCH_OMAP1510) | 132 | # if defined(CONFIG_ARCH_OMAP15XX) |
123 | # undef cpu_is_omap15xx | 133 | # undef cpu_is_omap15xx |
124 | # define cpu_is_omap15xx() 1 | 134 | # define cpu_is_omap15xx() 1 |
125 | # endif | 135 | # endif |
@@ -129,13 +139,18 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
129 | # endif | 139 | # endif |
130 | # if defined(CONFIG_ARCH_OMAP24XX) | 140 | # if defined(CONFIG_ARCH_OMAP24XX) |
131 | # undef cpu_is_omap24xx | 141 | # undef cpu_is_omap24xx |
142 | # undef cpu_is_omap242x | ||
143 | # undef cpu_is_omap243x | ||
132 | # define cpu_is_omap24xx() 1 | 144 | # define cpu_is_omap24xx() 1 |
145 | # define cpu_is_omap242x() is_omap242x() | ||
146 | # define cpu_is_omap243x() is_omap243x() | ||
133 | # endif | 147 | # endif |
134 | #endif | 148 | #endif |
135 | 149 | ||
136 | /* | 150 | /* |
137 | * Macros to detect individual cpu types. | 151 | * Macros to detect individual cpu types. |
138 | * These are only rarely needed. | 152 | * These are only rarely needed. |
153 | * cpu_is_omap330(): True for OMAP330 | ||
139 | * cpu_is_omap730(): True for OMAP730 | 154 | * cpu_is_omap730(): True for OMAP730 |
140 | * cpu_is_omap1510(): True for OMAP1510 | 155 | * cpu_is_omap1510(): True for OMAP1510 |
141 | * cpu_is_omap1610(): True for OMAP1610 | 156 | * cpu_is_omap1610(): True for OMAP1610 |
@@ -144,6 +159,9 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
144 | * cpu_is_omap1621(): True for OMAP1621 | 159 | * cpu_is_omap1621(): True for OMAP1621 |
145 | * cpu_is_omap1710(): True for OMAP1710 | 160 | * cpu_is_omap1710(): True for OMAP1710 |
146 | * cpu_is_omap2420(): True for OMAP2420 | 161 | * cpu_is_omap2420(): True for OMAP2420 |
162 | * cpu_is_omap2422(): True for OMAP2422 | ||
163 | * cpu_is_omap2423(): True for OMAP2423 | ||
164 | * cpu_is_omap2430(): True for OMAP2430 | ||
147 | */ | 165 | */ |
148 | #define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) | 166 | #define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) |
149 | 167 | ||
@@ -153,6 +171,7 @@ static inline int is_omap ##type (void) \ | |||
153 | return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ | 171 | return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ |
154 | } | 172 | } |
155 | 173 | ||
174 | IS_OMAP_TYPE(310, 0x0310) | ||
156 | IS_OMAP_TYPE(730, 0x0730) | 175 | IS_OMAP_TYPE(730, 0x0730) |
157 | IS_OMAP_TYPE(1510, 0x1510) | 176 | IS_OMAP_TYPE(1510, 0x1510) |
158 | IS_OMAP_TYPE(1610, 0x1610) | 177 | IS_OMAP_TYPE(1610, 0x1610) |
@@ -161,7 +180,11 @@ IS_OMAP_TYPE(5912, 0x1611) | |||
161 | IS_OMAP_TYPE(1621, 0x1621) | 180 | IS_OMAP_TYPE(1621, 0x1621) |
162 | IS_OMAP_TYPE(1710, 0x1710) | 181 | IS_OMAP_TYPE(1710, 0x1710) |
163 | IS_OMAP_TYPE(2420, 0x2420) | 182 | IS_OMAP_TYPE(2420, 0x2420) |
183 | IS_OMAP_TYPE(2422, 0x2422) | ||
184 | IS_OMAP_TYPE(2423, 0x2423) | ||
185 | IS_OMAP_TYPE(2430, 0x2430) | ||
164 | 186 | ||
187 | #define cpu_is_omap310() 0 | ||
165 | #define cpu_is_omap730() 0 | 188 | #define cpu_is_omap730() 0 |
166 | #define cpu_is_omap1510() 0 | 189 | #define cpu_is_omap1510() 0 |
167 | #define cpu_is_omap1610() 0 | 190 | #define cpu_is_omap1610() 0 |
@@ -170,31 +193,33 @@ IS_OMAP_TYPE(2420, 0x2420) | |||
170 | #define cpu_is_omap1621() 0 | 193 | #define cpu_is_omap1621() 0 |
171 | #define cpu_is_omap1710() 0 | 194 | #define cpu_is_omap1710() 0 |
172 | #define cpu_is_omap2420() 0 | 195 | #define cpu_is_omap2420() 0 |
196 | #define cpu_is_omap2422() 0 | ||
197 | #define cpu_is_omap2423() 0 | ||
198 | #define cpu_is_omap2430() 0 | ||
173 | 199 | ||
174 | #if defined(MULTI_OMAP1) | 200 | #if defined(MULTI_OMAP1) |
175 | # if defined(CONFIG_ARCH_OMAP730) | 201 | # if defined(CONFIG_ARCH_OMAP730) |
176 | # undef cpu_is_omap730 | 202 | # undef cpu_is_omap730 |
177 | # define cpu_is_omap730() is_omap730() | 203 | # define cpu_is_omap730() is_omap730() |
178 | # endif | 204 | # endif |
179 | # if defined(CONFIG_ARCH_OMAP1510) | ||
180 | # undef cpu_is_omap1510 | ||
181 | # define cpu_is_omap1510() is_omap1510() | ||
182 | # endif | ||
183 | #else | 205 | #else |
184 | # if defined(CONFIG_ARCH_OMAP730) | 206 | # if defined(CONFIG_ARCH_OMAP730) |
185 | # undef cpu_is_omap730 | 207 | # undef cpu_is_omap730 |
186 | # define cpu_is_omap730() 1 | 208 | # define cpu_is_omap730() 1 |
187 | # endif | 209 | # endif |
188 | # if defined(CONFIG_ARCH_OMAP1510) | ||
189 | # undef cpu_is_omap1510 | ||
190 | # define cpu_is_omap1510() 1 | ||
191 | # endif | ||
192 | #endif | 210 | #endif |
193 | 211 | ||
194 | /* | 212 | /* |
195 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish | 213 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish |
196 | * between 1611B/5912 and 1710. | 214 | * between 330 vs. 1510 and 1611B/5912 vs. 1710. |
197 | */ | 215 | */ |
216 | #if defined(CONFIG_ARCH_OMAP15XX) | ||
217 | # undef cpu_is_omap310 | ||
218 | # undef cpu_is_omap1510 | ||
219 | # define cpu_is_omap310() is_omap310() | ||
220 | # define cpu_is_omap1510() is_omap1510() | ||
221 | #endif | ||
222 | |||
198 | #if defined(CONFIG_ARCH_OMAP16XX) | 223 | #if defined(CONFIG_ARCH_OMAP16XX) |
199 | # undef cpu_is_omap1610 | 224 | # undef cpu_is_omap1610 |
200 | # undef cpu_is_omap1611 | 225 | # undef cpu_is_omap1611 |
@@ -208,9 +233,20 @@ IS_OMAP_TYPE(2420, 0x2420) | |||
208 | # define cpu_is_omap1710() is_omap1710() | 233 | # define cpu_is_omap1710() is_omap1710() |
209 | #endif | 234 | #endif |
210 | 235 | ||
211 | #if defined(CONFIG_ARCH_OMAP2420) | 236 | #if defined(CONFIG_ARCH_OMAP24XX) |
212 | # undef cpu_is_omap2420 | 237 | # undef cpu_is_omap2420 |
213 | # define cpu_is_omap2420() 1 | 238 | # undef cpu_is_omap2422 |
239 | # undef cpu_is_omap2423 | ||
240 | # undef cpu_is_omap2430 | ||
241 | # define cpu_is_omap2420() is_omap2420() | ||
242 | # define cpu_is_omap2422() is_omap2422() | ||
243 | # define cpu_is_omap2423() is_omap2423() | ||
244 | # define cpu_is_omap2430() is_omap2430() | ||
214 | #endif | 245 | #endif |
215 | 246 | ||
247 | /* Macros to detect if we have OMAP1 or OMAP2 */ | ||
248 | #define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() || \ | ||
249 | cpu_is_omap16xx()) | ||
250 | #define cpu_class_is_omap2() cpu_is_omap24xx() | ||
251 | |||
216 | #endif | 252 | #endif |