blob: 9a028bdebb06797166f2a3fff44e0aacd685740b [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
2 * arch/arm/plat-omap/include/mach/cpu.h
3 *
4 * OMAP cpu type detection
5 *
6 * Copyright (C) 2004, 2008 Nokia Corporation
7 *
Santosh Shilimkar44169072009-05-28 14:16:04 -07008 * Copyright (C) 2009 Texas Instruments.
9 *
Russell Kinga09e64f2008-08-05 16:14:15 +010010 * Written by Tony Lindgren <tony.lindgren@nokia.com>
11 *
Santosh Shilimkar44169072009-05-28 14:16:04 -070012 * Added OMAP4 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
13 *
Russell Kinga09e64f2008-08-05 16:14:15 +010014 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H
32
Sanjeev Premi8384ce02009-11-22 10:10:53 -080033#include <linux/bitops.h>
34
Kevin Hilman8e25ad92009-06-23 13:30:23 +030035/*
36 * Omap device type i.e. EMU/HS/TST/GP/BAD
37 */
38#define OMAP2_DEVICE_TYPE_TEST 0
39#define OMAP2_DEVICE_TYPE_EMU 1
40#define OMAP2_DEVICE_TYPE_SEC 2
41#define OMAP2_DEVICE_TYPE_GP 3
42#define OMAP2_DEVICE_TYPE_BAD 4
43
44int omap_type(void);
45
Russell Kinga09e64f2008-08-05 16:14:15 +010046struct omap_chip_id {
47 u8 oc;
Tony Lindgrena8823142008-12-10 17:36:30 -080048 u8 type;
Russell Kinga09e64f2008-08-05 16:14:15 +010049};
50
51#define OMAP_CHIP_INIT(x) { .oc = x }
52
Tony Lindgrena8823142008-12-10 17:36:30 -080053/*
Lauri Leukkunen84a34342008-12-10 17:36:31 -080054 * omap_rev bits:
Tony Lindgrena8823142008-12-10 17:36:30 -080055 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
56 * CPU revision (See _REV_ defined in cpu.h) [15:08]
57 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
58 */
Lauri Leukkunen84a34342008-12-10 17:36:31 -080059unsigned int omap_rev(void);
Russell Kinga09e64f2008-08-05 16:14:15 +010060
Russell Kinga09e64f2008-08-05 16:14:15 +010061/*
Sanjeev Premi048f4bd2009-11-22 10:10:54 -080062 * Define CPU revision bits
63 *
64 * Verbose meaning of the revision bits may be different for a silicon
65 * family. This difference can be handled separately.
66 */
67#define OMAP_REVBITS_00 0x00
68#define OMAP_REVBITS_10 0x10
69#define OMAP_REVBITS_20 0x20
70#define OMAP_REVBITS_30 0x30
71#define OMAP_REVBITS_40 0x40
72
73/*
74 * Get the CPU revision for OMAP devices
75 */
76#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
77
78/*
Russell Kinga09e64f2008-08-05 16:14:15 +010079 * Test if multicore OMAP support is needed
80 */
81#undef MULTI_OMAP1
82#undef MULTI_OMAP2
83#undef OMAP_NAME
84
85#ifdef CONFIG_ARCH_OMAP730
86# ifdef OMAP_NAME
87# undef MULTI_OMAP1
88# define MULTI_OMAP1
89# else
90# define OMAP_NAME omap730
91# endif
92#endif
Zebediah C. McClureae302f42009-03-23 18:07:39 -070093#ifdef CONFIG_ARCH_OMAP850
94# ifdef OMAP_NAME
95# undef MULTI_OMAP1
96# define MULTI_OMAP1
97# else
98# define OMAP_NAME omap850
99# endif
100#endif
Russell Kinga09e64f2008-08-05 16:14:15 +0100101#ifdef CONFIG_ARCH_OMAP15XX
102# ifdef OMAP_NAME
103# undef MULTI_OMAP1
104# define MULTI_OMAP1
105# else
106# define OMAP_NAME omap1510
107# endif
108#endif
109#ifdef CONFIG_ARCH_OMAP16XX
110# ifdef OMAP_NAME
111# undef MULTI_OMAP1
112# define MULTI_OMAP1
113# else
114# define OMAP_NAME omap16xx
115# endif
116#endif
117#if (defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX))
118# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
119# error "OMAP1 and OMAP2 can't be selected at the same time"
120# endif
121#endif
122#ifdef CONFIG_ARCH_OMAP2420
123# ifdef OMAP_NAME
124# undef MULTI_OMAP2
125# define MULTI_OMAP2
126# else
127# define OMAP_NAME omap2420
128# endif
129#endif
130#ifdef CONFIG_ARCH_OMAP2430
131# ifdef OMAP_NAME
132# undef MULTI_OMAP2
133# define MULTI_OMAP2
134# else
135# define OMAP_NAME omap2430
136# endif
137#endif
138#ifdef CONFIG_ARCH_OMAP3430
139# ifdef OMAP_NAME
140# undef MULTI_OMAP2
141# define MULTI_OMAP2
142# else
143# define OMAP_NAME omap3430
144# endif
145#endif
146
147/*
148 * Macros to group OMAP into cpu classes.
149 * These can be used in most places.
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700150 * cpu_is_omap7xx(): True for OMAP730, OMAP850
Russell Kinga09e64f2008-08-05 16:14:15 +0100151 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
152 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
153 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
154 * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
155 * cpu_is_omap243x(): True for OMAP2430
156 * cpu_is_omap343x(): True for OMAP3430
157 */
Lauri Leukkunen84a34342008-12-10 17:36:31 -0800158#define GET_OMAP_CLASS (omap_rev() & 0xff)
Russell Kinga09e64f2008-08-05 16:14:15 +0100159
160#define IS_OMAP_CLASS(class, id) \
161static inline int is_omap ##class (void) \
162{ \
163 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
164}
165
Lauri Leukkunen84a34342008-12-10 17:36:31 -0800166#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
Russell Kinga09e64f2008-08-05 16:14:15 +0100167
168#define IS_OMAP_SUBCLASS(subclass, id) \
169static inline int is_omap ##subclass (void) \
170{ \
171 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
172}
173
174IS_OMAP_CLASS(7xx, 0x07)
175IS_OMAP_CLASS(15xx, 0x15)
176IS_OMAP_CLASS(16xx, 0x16)
177IS_OMAP_CLASS(24xx, 0x24)
178IS_OMAP_CLASS(34xx, 0x34)
Santosh Shilimkarb570e0e2009-12-11 16:16:34 -0800179IS_OMAP_CLASS(44xx, 0x44)
Russell Kinga09e64f2008-08-05 16:14:15 +0100180
181IS_OMAP_SUBCLASS(242x, 0x242)
182IS_OMAP_SUBCLASS(243x, 0x243)
183IS_OMAP_SUBCLASS(343x, 0x343)
Nishanth Menon2456a102009-11-22 10:10:56 -0800184IS_OMAP_SUBCLASS(363x, 0x363)
Santosh Shilimkarb570e0e2009-12-11 16:16:34 -0800185IS_OMAP_SUBCLASS(443x, 0x443)
Russell Kinga09e64f2008-08-05 16:14:15 +0100186
187#define cpu_is_omap7xx() 0
188#define cpu_is_omap15xx() 0
189#define cpu_is_omap16xx() 0
190#define cpu_is_omap24xx() 0
191#define cpu_is_omap242x() 0
192#define cpu_is_omap243x() 0
193#define cpu_is_omap34xx() 0
194#define cpu_is_omap343x() 0
Santosh Shilimkar44169072009-05-28 14:16:04 -0700195#define cpu_is_omap44xx() 0
196#define cpu_is_omap443x() 0
Russell Kinga09e64f2008-08-05 16:14:15 +0100197
198#if defined(MULTI_OMAP1)
199# if defined(CONFIG_ARCH_OMAP730)
200# undef cpu_is_omap7xx
201# define cpu_is_omap7xx() is_omap7xx()
202# endif
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700203# if defined(CONFIG_ARCH_OMAP850)
204# undef cpu_is_omap7xx
205# define cpu_is_omap7xx() is_omap7xx()
206# endif
Russell Kinga09e64f2008-08-05 16:14:15 +0100207# if defined(CONFIG_ARCH_OMAP15XX)
208# undef cpu_is_omap15xx
209# define cpu_is_omap15xx() is_omap15xx()
210# endif
211# if defined(CONFIG_ARCH_OMAP16XX)
212# undef cpu_is_omap16xx
213# define cpu_is_omap16xx() is_omap16xx()
214# endif
215#else
216# if defined(CONFIG_ARCH_OMAP730)
217# undef cpu_is_omap7xx
218# define cpu_is_omap7xx() 1
219# endif
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700220# if defined(CONFIG_ARCH_OMAP850)
221# undef cpu_is_omap7xx
222# define cpu_is_omap7xx() 1
223# endif
Russell Kinga09e64f2008-08-05 16:14:15 +0100224# if defined(CONFIG_ARCH_OMAP15XX)
225# undef cpu_is_omap15xx
226# define cpu_is_omap15xx() 1
227# endif
228# if defined(CONFIG_ARCH_OMAP16XX)
229# undef cpu_is_omap16xx
230# define cpu_is_omap16xx() 1
231# endif
232#endif
233
234#if defined(MULTI_OMAP2)
235# if defined(CONFIG_ARCH_OMAP24XX)
236# undef cpu_is_omap24xx
237# undef cpu_is_omap242x
238# undef cpu_is_omap243x
239# define cpu_is_omap24xx() is_omap24xx()
240# define cpu_is_omap242x() is_omap242x()
241# define cpu_is_omap243x() is_omap243x()
242# endif
243# if defined(CONFIG_ARCH_OMAP34XX)
244# undef cpu_is_omap34xx
245# undef cpu_is_omap343x
246# define cpu_is_omap34xx() is_omap34xx()
247# define cpu_is_omap343x() is_omap343x()
248# endif
249#else
250# if defined(CONFIG_ARCH_OMAP24XX)
251# undef cpu_is_omap24xx
252# define cpu_is_omap24xx() 1
253# endif
254# if defined(CONFIG_ARCH_OMAP2420)
255# undef cpu_is_omap242x
256# define cpu_is_omap242x() 1
257# endif
258# if defined(CONFIG_ARCH_OMAP2430)
259# undef cpu_is_omap243x
260# define cpu_is_omap243x() 1
261# endif
262# if defined(CONFIG_ARCH_OMAP34XX)
263# undef cpu_is_omap34xx
264# define cpu_is_omap34xx() 1
265# endif
266# if defined(CONFIG_ARCH_OMAP3430)
267# undef cpu_is_omap343x
268# define cpu_is_omap343x() 1
269# endif
270#endif
271
272/*
273 * Macros to detect individual cpu types.
274 * These are only rarely needed.
275 * cpu_is_omap330(): True for OMAP330
276 * cpu_is_omap730(): True for OMAP730
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700277 * cpu_is_omap850(): True for OMAP850
Russell Kinga09e64f2008-08-05 16:14:15 +0100278 * cpu_is_omap1510(): True for OMAP1510
279 * cpu_is_omap1610(): True for OMAP1610
280 * cpu_is_omap1611(): True for OMAP1611
281 * cpu_is_omap5912(): True for OMAP5912
282 * cpu_is_omap1621(): True for OMAP1621
283 * cpu_is_omap1710(): True for OMAP1710
284 * cpu_is_omap2420(): True for OMAP2420
285 * cpu_is_omap2422(): True for OMAP2422
286 * cpu_is_omap2423(): True for OMAP2423
287 * cpu_is_omap2430(): True for OMAP2430
288 * cpu_is_omap3430(): True for OMAP3430
Sanjeev Premi4cac6012009-11-22 10:10:58 -0800289 * cpu_is_omap3505(): True for OMAP3505
290 * cpu_is_omap3517(): True for OMAP3517
Russell Kinga09e64f2008-08-05 16:14:15 +0100291 */
Lauri Leukkunen84a34342008-12-10 17:36:31 -0800292#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
Russell Kinga09e64f2008-08-05 16:14:15 +0100293
294#define IS_OMAP_TYPE(type, id) \
295static inline int is_omap ##type (void) \
296{ \
297 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
298}
299
300IS_OMAP_TYPE(310, 0x0310)
301IS_OMAP_TYPE(730, 0x0730)
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700302IS_OMAP_TYPE(850, 0x0850)
Russell Kinga09e64f2008-08-05 16:14:15 +0100303IS_OMAP_TYPE(1510, 0x1510)
304IS_OMAP_TYPE(1610, 0x1610)
305IS_OMAP_TYPE(1611, 0x1611)
306IS_OMAP_TYPE(5912, 0x1611)
307IS_OMAP_TYPE(1621, 0x1621)
308IS_OMAP_TYPE(1710, 0x1710)
309IS_OMAP_TYPE(2420, 0x2420)
310IS_OMAP_TYPE(2422, 0x2422)
311IS_OMAP_TYPE(2423, 0x2423)
312IS_OMAP_TYPE(2430, 0x2430)
313IS_OMAP_TYPE(3430, 0x3430)
Sanjeev Premi4cac6012009-11-22 10:10:58 -0800314IS_OMAP_TYPE(3505, 0x3505)
315IS_OMAP_TYPE(3517, 0x3517)
Russell Kinga09e64f2008-08-05 16:14:15 +0100316
317#define cpu_is_omap310() 0
318#define cpu_is_omap730() 0
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700319#define cpu_is_omap850() 0
Russell Kinga09e64f2008-08-05 16:14:15 +0100320#define cpu_is_omap1510() 0
321#define cpu_is_omap1610() 0
322#define cpu_is_omap5912() 0
323#define cpu_is_omap1611() 0
324#define cpu_is_omap1621() 0
325#define cpu_is_omap1710() 0
326#define cpu_is_omap2420() 0
327#define cpu_is_omap2422() 0
328#define cpu_is_omap2423() 0
329#define cpu_is_omap2430() 0
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800330#define cpu_is_omap3503() 0
331#define cpu_is_omap3515() 0
332#define cpu_is_omap3525() 0
333#define cpu_is_omap3530() 0
Sanjeev Premi4cac6012009-11-22 10:10:58 -0800334#define cpu_is_omap3505() 0
335#define cpu_is_omap3517() 0
Russell Kinga09e64f2008-08-05 16:14:15 +0100336#define cpu_is_omap3430() 0
Nishanth Menon2456a102009-11-22 10:10:56 -0800337#define cpu_is_omap3630() 0
Russell Kinga09e64f2008-08-05 16:14:15 +0100338
Russell Kinga09e64f2008-08-05 16:14:15 +0100339/*
340 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
Tony Lindgrena9f82d12009-10-05 13:31:43 -0700341 * between 730 vs 850, 330 vs. 1510 and 1611B/5912 vs. 1710.
Russell Kinga09e64f2008-08-05 16:14:15 +0100342 */
Tony Lindgrena9f82d12009-10-05 13:31:43 -0700343
344#if defined(CONFIG_ARCH_OMAP730)
345# undef cpu_is_omap730
346# define cpu_is_omap730() is_omap730()
347#endif
348
349#if defined(CONFIG_ARCH_OMAP850)
350# undef cpu_is_omap850
351# define cpu_is_omap850() is_omap850()
352#endif
353
Russell Kinga09e64f2008-08-05 16:14:15 +0100354#if defined(CONFIG_ARCH_OMAP15XX)
355# undef cpu_is_omap310
356# undef cpu_is_omap1510
357# define cpu_is_omap310() is_omap310()
358# define cpu_is_omap1510() is_omap1510()
359#endif
360
361#if defined(CONFIG_ARCH_OMAP16XX)
362# undef cpu_is_omap1610
363# undef cpu_is_omap1611
364# undef cpu_is_omap5912
365# undef cpu_is_omap1621
366# undef cpu_is_omap1710
367# define cpu_is_omap1610() is_omap1610()
368# define cpu_is_omap1611() is_omap1611()
369# define cpu_is_omap5912() is_omap5912()
370# define cpu_is_omap1621() is_omap1621()
371# define cpu_is_omap1710() is_omap1710()
372#endif
373
374#if defined(CONFIG_ARCH_OMAP24XX)
375# undef cpu_is_omap2420
376# undef cpu_is_omap2422
377# undef cpu_is_omap2423
378# undef cpu_is_omap2430
379# define cpu_is_omap2420() is_omap2420()
380# define cpu_is_omap2422() is_omap2422()
381# define cpu_is_omap2423() is_omap2423()
382# define cpu_is_omap2430() is_omap2430()
383#endif
384
385#if defined(CONFIG_ARCH_OMAP34XX)
386# undef cpu_is_omap3430
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800387# undef cpu_is_omap3503
388# undef cpu_is_omap3515
389# undef cpu_is_omap3525
390# undef cpu_is_omap3530
Sanjeev Premi4cac6012009-11-22 10:10:58 -0800391# undef cpu_is_omap3505
392# undef cpu_is_omap3517
Russell Kinga09e64f2008-08-05 16:14:15 +0100393# define cpu_is_omap3430() is_omap3430()
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800394# define cpu_is_omap3503() (cpu_is_omap3430() && \
395 (!omap3_has_iva()) && \
396 (!omap3_has_sgx()))
397# define cpu_is_omap3515() (cpu_is_omap3430() && \
Sergey Lapin0712fb32009-12-11 16:16:37 -0800398 (!omap3_has_iva()) && \
399 (omap3_has_sgx()))
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800400# define cpu_is_omap3525() (cpu_is_omap3430() && \
Sergey Lapin0712fb32009-12-11 16:16:37 -0800401 (!omap3_has_sgx()) && \
402 (omap3_has_iva()))
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800403# define cpu_is_omap3530() (cpu_is_omap3430())
Sanjeev Premi4cac6012009-11-22 10:10:58 -0800404# define cpu_is_omap3505() is_omap3505()
405# define cpu_is_omap3517() is_omap3517()
Nishanth Menon2456a102009-11-22 10:10:56 -0800406# undef cpu_is_omap3630
407# define cpu_is_omap3630() is_omap363x()
Russell Kinga09e64f2008-08-05 16:14:15 +0100408#endif
409
Santosh Shilimkar44169072009-05-28 14:16:04 -0700410# if defined(CONFIG_ARCH_OMAP4)
411# undef cpu_is_omap44xx
412# undef cpu_is_omap443x
Santosh Shilimkarb570e0e2009-12-11 16:16:34 -0800413# define cpu_is_omap44xx() is_omap44xx()
414# define cpu_is_omap443x() is_omap443x()
Santosh Shilimkar44169072009-05-28 14:16:04 -0700415# endif
416
Russell Kinga09e64f2008-08-05 16:14:15 +0100417/* Macros to detect if we have OMAP1 or OMAP2 */
Zebediah C. McClureae302f42009-03-23 18:07:39 -0700418#define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
Russell Kinga09e64f2008-08-05 16:14:15 +0100419 cpu_is_omap16xx())
Santosh Shilimkar44169072009-05-28 14:16:04 -0700420#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
421 cpu_is_omap44xx())
Russell Kinga09e64f2008-08-05 16:14:15 +0100422
Tony Lindgrena8823142008-12-10 17:36:30 -0800423/* Various silicon revisions for omap2 */
424#define OMAP242X_CLASS 0x24200024
425#define OMAP2420_REV_ES1_0 0x24200024
426#define OMAP2420_REV_ES2_0 0x24201024
Russell Kinga09e64f2008-08-05 16:14:15 +0100427
Tony Lindgrena8823142008-12-10 17:36:30 -0800428#define OMAP243X_CLASS 0x24300024
429#define OMAP2430_REV_ES1_0 0x24300024
Russell Kinga09e64f2008-08-05 16:14:15 +0100430
Tony Lindgrena8823142008-12-10 17:36:30 -0800431#define OMAP343X_CLASS 0x34300034
432#define OMAP3430_REV_ES1_0 0x34300034
433#define OMAP3430_REV_ES2_0 0x34301034
434#define OMAP3430_REV_ES2_1 0x34302034
435#define OMAP3430_REV_ES3_0 0x34303034
Tony Lindgren187e6882009-01-29 08:57:16 -0800436#define OMAP3430_REV_ES3_1 0x34304034
Russell Kinga09e64f2008-08-05 16:14:15 +0100437
Nishanth Menon2456a102009-11-22 10:10:56 -0800438#define OMAP3630_REV_ES1_0 0x36300034
439
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800440#define OMAP35XX_CLASS 0x35000034
Sanjeev Premi435bb822009-12-11 16:16:37 -0800441#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8))
442#define OMAP3515_REV(v) (OMAP35XX_CLASS | (0x3515 << 16) | (v << 8))
443#define OMAP3525_REV(v) (OMAP35XX_CLASS | (0x3525 << 16) | (v << 8))
444#define OMAP3530_REV(v) (OMAP35XX_CLASS | (0x3530 << 16) | (v << 8))
445#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8))
446#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
Sanjeev Premi048f4bd2009-11-22 10:10:54 -0800447
Santosh Shilimkarb570e0e2009-12-11 16:16:34 -0800448#define OMAP443X_CLASS 0x44300044
449#define OMAP4430_REV_ES1_0 0x44300044
Santosh Shilimkar44169072009-05-28 14:16:04 -0700450
Russell Kinga09e64f2008-08-05 16:14:15 +0100451/*
452 * omap_chip bits
453 *
454 * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is
455 * valid on all chips of that type. CHIP_IS_OMAP3430ES{1,2} indicates
456 * something that is only valid on that particular ES revision.
457 *
458 * These bits may be ORed together to indicate structures that are
459 * available on multiple chip types.
460 *
461 * To test whether a particular structure matches the current OMAP chip type,
462 * use omap_chip_is().
463 *
464 */
Paul Walmsleyd41ad522009-02-05 20:45:25 -0700465#define CHIP_IS_OMAP2420 (1 << 0)
466#define CHIP_IS_OMAP2430 (1 << 1)
467#define CHIP_IS_OMAP3430 (1 << 2)
468#define CHIP_IS_OMAP3430ES1 (1 << 3)
469#define CHIP_IS_OMAP3430ES2 (1 << 4)
470#define CHIP_IS_OMAP3430ES3_0 (1 << 5)
471#define CHIP_IS_OMAP3430ES3_1 (1 << 6)
vikram panditaf18af0a2009-11-22 10:10:57 -0800472#define CHIP_IS_OMAP3630ES1 (1 << 7)
Russell Kinga09e64f2008-08-05 16:14:15 +0100473
Paul Walmsleyd41ad522009-02-05 20:45:25 -0700474#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
475
476/*
477 * "GE" here represents "greater than or equal to" in terms of ES
478 * levels. So CHIP_GE_OMAP3430ES2 is intended to match all OMAP3430
479 * chips at ES2 and beyond, but not, for example, any OMAP lines after
480 * OMAP3.
481 */
482#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \
483 CHIP_IS_OMAP3430ES3_0 | \
vikram panditaf18af0a2009-11-22 10:10:57 -0800484 CHIP_IS_OMAP3430ES3_1 | \
485 CHIP_IS_OMAP3630ES1)
486#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \
487 CHIP_IS_OMAP3630ES1)
Paul Walmsleyd41ad522009-02-05 20:45:25 -0700488
Russell Kinga09e64f2008-08-05 16:14:15 +0100489
490int omap_chip_is(struct omap_chip_id oci);
Russell Kinga09e64f2008-08-05 16:14:15 +0100491void omap2_check_revision(void);
Tony Lindgrena9f82d12009-10-05 13:31:43 -0700492
Sanjeev Premi8384ce02009-11-22 10:10:53 -0800493/*
494 * Runtime detection of OMAP3 features
495 */
496extern u32 omap3_features;
497
498#define OMAP3_HAS_L2CACHE BIT(0)
499#define OMAP3_HAS_IVA BIT(1)
500#define OMAP3_HAS_SGX BIT(2)
501#define OMAP3_HAS_NEON BIT(3)
502#define OMAP3_HAS_ISP BIT(4)
503
504#define OMAP3_HAS_FEATURE(feat,flag) \
505static inline unsigned int omap3_has_ ##feat(void) \
506{ \
507 return (omap3_features & OMAP3_HAS_ ##flag); \
508} \
509
510OMAP3_HAS_FEATURE(l2cache, L2CACHE)
511OMAP3_HAS_FEATURE(sgx, SGX)
512OMAP3_HAS_FEATURE(iva, IVA)
513OMAP3_HAS_FEATURE(neon, NEON)
514OMAP3_HAS_FEATURE(isp, ISP)
515
Tony Lindgrena9f82d12009-10-05 13:31:43 -0700516#endif