bfd9c5f5ee1485b1f4f2c6f98e507fbd79b5d29d
2 * arch/arm/plat-omap/include/mach/cpu.h
4 * OMAP cpu type detection
6 * Copyright (C) 2004, 2008 Nokia Corporation
8 * Copyright (C) 2009-11 Texas Instruments.
10 * Written by Tony Lindgren <tony.lindgren@nokia.com>
12 * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
14 * 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.
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.
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
30 #ifndef __ASM_ARCH_OMAP_CPU_H
31 #define __ASM_ARCH_OMAP_CPU_H
35 #include <linux/bitops.h>
38 * Test if multicore OMAP support is needed
44 #ifdef CONFIG_ARCH_OMAP730
49 # define OMAP_NAME omap730
52 #ifdef CONFIG_ARCH_OMAP850
57 # define OMAP_NAME omap850
60 #ifdef CONFIG_ARCH_OMAP15XX
65 # define OMAP_NAME omap1510
68 #ifdef CONFIG_ARCH_OMAP16XX
73 # define OMAP_NAME omap16xx
76 #ifdef CONFIG_ARCH_OMAP2PLUS
77 # if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
78 # error "OMAP1 and OMAP2PLUS can't be selected at the same time"
81 #ifdef CONFIG_SOC_OMAP2420
86 # define OMAP_NAME omap2420
89 #ifdef CONFIG_SOC_OMAP2430
94 # define OMAP_NAME omap2430
97 #ifdef CONFIG_ARCH_OMAP3
102 # define OMAP_NAME omap3
105 #ifdef CONFIG_ARCH_OMAP4
110 # define OMAP_NAME omap4
114 #ifdef CONFIG_SOC_OMAP5
119 # define OMAP_NAME omap5
123 #ifdef CONFIG_SOC_AM33XX
128 # define OMAP_NAME am33xx
133 * Omap device type i.e. EMU/HS/TST/GP/BAD
135 #define OMAP2_DEVICE_TYPE_TEST 0
136 #define OMAP2_DEVICE_TYPE_EMU 1
137 #define OMAP2_DEVICE_TYPE_SEC 2
138 #define OMAP2_DEVICE_TYPE_GP 3
139 #define OMAP2_DEVICE_TYPE_BAD 4
145 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
146 * CPU revision (See _REV_ defined in cpu.h) [15:08]
147 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
149 unsigned int omap_rev(void);
152 * Get the CPU revision for OMAP devices
154 #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
157 * Macros to group OMAP into cpu classes.
158 * These can be used in most places.
159 * cpu_is_omap7xx(): True for OMAP730, OMAP850
160 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
161 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
162 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
163 * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
164 * cpu_is_omap243x(): True for OMAP2430
165 * cpu_is_omap343x(): True for OMAP3430
166 * cpu_is_omap443x(): True for OMAP4430
167 * cpu_is_omap446x(): True for OMAP4460
168 * cpu_is_omap447x(): True for OMAP4470
169 * soc_is_omap543x(): True for OMAP5430, OMAP5432
171 #define GET_OMAP_CLASS (omap_rev() & 0xff)
173 #define IS_OMAP_CLASS(class, id) \
174 static inline int is_omap ##class (void) \
176 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
179 #define GET_AM_CLASS ((omap_rev() >> 24) & 0xff)
181 #define IS_AM_CLASS(class, id) \
182 static inline int is_am ##class (void) \
184 return (GET_AM_CLASS == (id)) ? 1 : 0; \
187 #define GET_TI_CLASS ((omap_rev() >> 24) & 0xff)
189 #define IS_TI_CLASS(class, id) \
190 static inline int is_ti ##class (void) \
192 return (GET_TI_CLASS == (id)) ? 1 : 0; \
195 #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
197 #define IS_OMAP_SUBCLASS(subclass, id) \
198 static inline int is_omap ##subclass (void) \
200 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
203 #define IS_TI_SUBCLASS(subclass, id) \
204 static inline int is_ti ##subclass (void) \
206 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
209 #define IS_AM_SUBCLASS(subclass, id) \
210 static inline int is_am ##subclass (void) \
212 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
215 IS_OMAP_CLASS(7xx
, 0x07)
216 IS_OMAP_CLASS(15xx
, 0x15)
217 IS_OMAP_CLASS(16xx
, 0x16)
218 IS_OMAP_CLASS(24xx
, 0x24)
219 IS_OMAP_CLASS(34xx
, 0x34)
220 IS_OMAP_CLASS(44xx
, 0x44)
221 IS_AM_CLASS(35xx
, 0x35)
222 IS_OMAP_CLASS(54xx
, 0x54)
223 IS_AM_CLASS(33xx
, 0x33)
225 IS_TI_CLASS(81xx
, 0x81)
227 IS_OMAP_SUBCLASS(242x
, 0x242)
228 IS_OMAP_SUBCLASS(243x
, 0x243)
229 IS_OMAP_SUBCLASS(343x
, 0x343)
230 IS_OMAP_SUBCLASS(363x
, 0x363)
231 IS_OMAP_SUBCLASS(443x
, 0x443)
232 IS_OMAP_SUBCLASS(446x
, 0x446)
233 IS_OMAP_SUBCLASS(447x
, 0x447)
234 IS_OMAP_SUBCLASS(543x
, 0x543)
236 IS_TI_SUBCLASS(816x
, 0x816)
237 IS_TI_SUBCLASS(814x
, 0x814)
238 IS_AM_SUBCLASS(335x
, 0x335)
240 #define cpu_is_omap7xx() 0
241 #define cpu_is_omap15xx() 0
242 #define cpu_is_omap16xx() 0
243 #define cpu_is_omap24xx() 0
244 #define cpu_is_omap242x() 0
245 #define cpu_is_omap243x() 0
246 #define cpu_is_omap34xx() 0
247 #define cpu_is_omap343x() 0
248 #define cpu_is_ti81xx() 0
249 #define cpu_is_ti816x() 0
250 #define cpu_is_ti814x() 0
251 #define soc_is_am35xx() 0
252 #define soc_is_am33xx() 0
253 #define soc_is_am335x() 0
254 #define cpu_is_omap44xx() 0
255 #define cpu_is_omap443x() 0
256 #define cpu_is_omap446x() 0
257 #define cpu_is_omap447x() 0
258 #define soc_is_omap54xx() 0
259 #define soc_is_omap543x() 0
261 #if defined(MULTI_OMAP1)
262 # if defined(CONFIG_ARCH_OMAP730)
263 # undef cpu_is_omap7xx
264 # define cpu_is_omap7xx() is_omap7xx()
266 # if defined(CONFIG_ARCH_OMAP850)
267 # undef cpu_is_omap7xx
268 # define cpu_is_omap7xx() is_omap7xx()
270 # if defined(CONFIG_ARCH_OMAP15XX)
271 # undef cpu_is_omap15xx
272 # define cpu_is_omap15xx() is_omap15xx()
274 # if defined(CONFIG_ARCH_OMAP16XX)
275 # undef cpu_is_omap16xx
276 # define cpu_is_omap16xx() is_omap16xx()
279 # if defined(CONFIG_ARCH_OMAP730)
280 # undef cpu_is_omap7xx
281 # define cpu_is_omap7xx() 1
283 # if defined(CONFIG_ARCH_OMAP850)
284 # undef cpu_is_omap7xx
285 # define cpu_is_omap7xx() 1
287 # if defined(CONFIG_ARCH_OMAP15XX)
288 # undef cpu_is_omap15xx
289 # define cpu_is_omap15xx() 1
291 # if defined(CONFIG_ARCH_OMAP16XX)
292 # undef cpu_is_omap16xx
293 # define cpu_is_omap16xx() 1
297 #if defined(MULTI_OMAP2)
298 # if defined(CONFIG_ARCH_OMAP2)
299 # undef cpu_is_omap24xx
300 # define cpu_is_omap24xx() is_omap24xx()
302 # if defined (CONFIG_SOC_OMAP2420)
303 # undef cpu_is_omap242x
304 # define cpu_is_omap242x() is_omap242x()
306 # if defined (CONFIG_SOC_OMAP2430)
307 # undef cpu_is_omap243x
308 # define cpu_is_omap243x() is_omap243x()
310 # if defined(CONFIG_ARCH_OMAP3)
311 # undef cpu_is_omap34xx
312 # undef cpu_is_omap343x
313 # define cpu_is_omap34xx() is_omap34xx()
314 # define cpu_is_omap343x() is_omap343x()
317 # if defined(CONFIG_ARCH_OMAP2)
318 # undef cpu_is_omap24xx
319 # define cpu_is_omap24xx() 1
321 # if defined(CONFIG_SOC_OMAP2420)
322 # undef cpu_is_omap242x
323 # define cpu_is_omap242x() 1
325 # if defined(CONFIG_SOC_OMAP2430)
326 # undef cpu_is_omap243x
327 # define cpu_is_omap243x() 1
329 # if defined(CONFIG_ARCH_OMAP3)
330 # undef cpu_is_omap34xx
331 # define cpu_is_omap34xx() 1
333 # if defined(CONFIG_SOC_OMAP3430)
334 # undef cpu_is_omap343x
335 # define cpu_is_omap343x() 1
340 * Macros to detect individual cpu types.
341 * These are only rarely needed.
342 * cpu_is_omap310(): True for OMAP310
343 * cpu_is_omap1510(): True for OMAP1510
344 * cpu_is_omap1610(): True for OMAP1610
345 * cpu_is_omap1611(): True for OMAP1611
346 * cpu_is_omap5912(): True for OMAP5912
347 * cpu_is_omap1621(): True for OMAP1621
348 * cpu_is_omap1710(): True for OMAP1710
349 * cpu_is_omap2420(): True for OMAP2420
350 * cpu_is_omap2422(): True for OMAP2422
351 * cpu_is_omap2423(): True for OMAP2423
352 * cpu_is_omap2430(): True for OMAP2430
353 * cpu_is_omap3430(): True for OMAP3430
355 #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
357 #define IS_OMAP_TYPE(type, id) \
358 static inline int is_omap ##type (void) \
360 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
363 IS_OMAP_TYPE(310, 0x0310)
364 IS_OMAP_TYPE(1510, 0x1510)
365 IS_OMAP_TYPE(1610, 0x1610)
366 IS_OMAP_TYPE(1611, 0x1611)
367 IS_OMAP_TYPE(5912, 0x1611)
368 IS_OMAP_TYPE(1621, 0x1621)
369 IS_OMAP_TYPE(1710, 0x1710)
370 IS_OMAP_TYPE(2420, 0x2420)
371 IS_OMAP_TYPE(2422, 0x2422)
372 IS_OMAP_TYPE(2423, 0x2423)
373 IS_OMAP_TYPE(2430, 0x2430)
374 IS_OMAP_TYPE(3430, 0x3430)
376 #define cpu_is_omap310() 0
377 #define cpu_is_omap1510() 0
378 #define cpu_is_omap1610() 0
379 #define cpu_is_omap5912() 0
380 #define cpu_is_omap1611() 0
381 #define cpu_is_omap1621() 0
382 #define cpu_is_omap1710() 0
383 #define cpu_is_omap2420() 0
384 #define cpu_is_omap2422() 0
385 #define cpu_is_omap2423() 0
386 #define cpu_is_omap2430() 0
387 #define cpu_is_omap3430() 0
388 #define cpu_is_omap3630() 0
389 #define soc_is_omap5430() 0
392 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
393 * between 310 vs. 1510 and 1611B/5912 vs. 1710.
396 #if defined(CONFIG_ARCH_OMAP15XX)
397 # undef cpu_is_omap310
398 # undef cpu_is_omap1510
399 # define cpu_is_omap310() is_omap310()
400 # define cpu_is_omap1510() is_omap1510()
403 #if defined(CONFIG_ARCH_OMAP16XX)
404 # undef cpu_is_omap1610
405 # undef cpu_is_omap1611
406 # undef cpu_is_omap5912
407 # undef cpu_is_omap1621
408 # undef cpu_is_omap1710
409 # define cpu_is_omap1610() is_omap1610()
410 # define cpu_is_omap1611() is_omap1611()
411 # define cpu_is_omap5912() is_omap5912()
412 # define cpu_is_omap1621() is_omap1621()
413 # define cpu_is_omap1710() is_omap1710()
416 #if defined(CONFIG_ARCH_OMAP2)
417 # undef cpu_is_omap2420
418 # undef cpu_is_omap2422
419 # undef cpu_is_omap2423
420 # undef cpu_is_omap2430
421 # define cpu_is_omap2420() is_omap2420()
422 # define cpu_is_omap2422() is_omap2422()
423 # define cpu_is_omap2423() is_omap2423()
424 # define cpu_is_omap2430() is_omap2430()
427 #if defined(CONFIG_ARCH_OMAP3)
428 # undef cpu_is_omap3430
429 # undef cpu_is_ti81xx
430 # undef cpu_is_ti816x
431 # undef cpu_is_ti814x
432 # undef soc_is_am35xx
433 # define cpu_is_omap3430() is_omap3430()
434 # undef cpu_is_omap3630
435 # define cpu_is_omap3630() is_omap363x()
436 # define cpu_is_ti81xx() is_ti81xx()
437 # define cpu_is_ti816x() is_ti816x()
438 # define cpu_is_ti814x() is_ti814x()
439 # define soc_is_am35xx() is_am35xx()
442 # if defined(CONFIG_SOC_AM33XX)
443 # undef soc_is_am33xx
444 # undef soc_is_am335x
445 # define soc_is_am33xx() is_am33xx()
446 # define soc_is_am335x() is_am335x()
449 # if defined(CONFIG_ARCH_OMAP4)
450 # undef cpu_is_omap44xx
451 # undef cpu_is_omap443x
452 # undef cpu_is_omap446x
453 # undef cpu_is_omap447x
454 # define cpu_is_omap44xx() is_omap44xx()
455 # define cpu_is_omap443x() is_omap443x()
456 # define cpu_is_omap446x() is_omap446x()
457 # define cpu_is_omap447x() is_omap447x()
460 # if defined(CONFIG_SOC_OMAP5)
461 # undef soc_is_omap54xx
462 # undef soc_is_omap543x
463 # define soc_is_omap54xx() is_omap54xx()
464 # define soc_is_omap543x() is_omap543x()
467 /* Macros to detect if we have OMAP1 or OMAP2 */
468 #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
470 #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
471 cpu_is_omap44xx() || soc_is_omap54xx() || \
474 /* Various silicon revisions for omap2 */
475 #define OMAP242X_CLASS 0x24200024
476 #define OMAP2420_REV_ES1_0 OMAP242X_CLASS
477 #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8))
479 #define OMAP243X_CLASS 0x24300024
480 #define OMAP2430_REV_ES1_0 OMAP243X_CLASS
482 #define OMAP343X_CLASS 0x34300034
483 #define OMAP3430_REV_ES1_0 OMAP343X_CLASS
484 #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8))
485 #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8))
486 #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8))
487 #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8))
488 #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8))
490 #define OMAP363X_CLASS 0x36300034
491 #define OMAP3630_REV_ES1_0 OMAP363X_CLASS
492 #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
493 #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
495 #define TI816X_CLASS 0x81600034
496 #define TI8168_REV_ES1_0 TI816X_CLASS
497 #define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
499 #define TI814X_CLASS 0x81400034
500 #define TI8148_REV_ES1_0 TI814X_CLASS
501 #define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8))
502 #define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8))
504 #define AM35XX_CLASS 0x35170034
505 #define AM35XX_REV_ES1_0 AM35XX_CLASS
506 #define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8))
508 #define AM335X_CLASS 0x33500033
509 #define AM335X_REV_ES1_0 AM335X_CLASS
511 #define OMAP443X_CLASS 0x44300044
512 #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
513 #define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
514 #define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
515 #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
516 #define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8))
518 #define OMAP446X_CLASS 0x44600044
519 #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8))
520 #define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8))
522 #define OMAP447X_CLASS 0x44700044
523 #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
525 #define OMAP54XX_CLASS 0x54000054
526 #define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
527 #define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
529 void omap2xxx_check_revision(void);
530 void omap3xxx_check_revision(void);
531 void omap4xxx_check_revision(void);
532 void omap5xxx_check_revision(void);
533 void omap3xxx_check_features(void);
534 void ti81xx_check_features(void);
535 void omap4xxx_check_features(void);
538 * Runtime detection of OMAP3 features
540 * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
541 * family have OS-level control over the I/O chain clock. This is
542 * to avoid a window during which wakeups could potentially be lost
543 * during powerdomain transitions. If this bit is set, it
544 * indicates that the chip does support OS-level control of this
547 extern u32 omap_features
;
549 #define OMAP3_HAS_L2CACHE BIT(0)
550 #define OMAP3_HAS_IVA BIT(1)
551 #define OMAP3_HAS_SGX BIT(2)
552 #define OMAP3_HAS_NEON BIT(3)
553 #define OMAP3_HAS_ISP BIT(4)
554 #define OMAP3_HAS_192MHZ_CLK BIT(5)
555 #define OMAP3_HAS_IO_WAKEUP BIT(6)
556 #define OMAP3_HAS_SDRC BIT(7)
557 #define OMAP3_HAS_IO_CHAIN_CTRL BIT(8)
558 #define OMAP4_HAS_MPU_1GHZ BIT(9)
559 #define OMAP4_HAS_MPU_1_2GHZ BIT(10)
560 #define OMAP4_HAS_MPU_1_5GHZ BIT(11)
563 #define OMAP3_HAS_FEATURE(feat,flag) \
564 static inline unsigned int omap3_has_ ##feat(void) \
566 return omap_features & OMAP3_HAS_ ##flag; \
569 OMAP3_HAS_FEATURE(l2cache, L2CACHE)
570 OMAP3_HAS_FEATURE(sgx
, SGX
)
571 OMAP3_HAS_FEATURE(iva
, IVA
)
572 OMAP3_HAS_FEATURE(neon
, NEON
)
573 OMAP3_HAS_FEATURE(isp
, ISP
)
574 OMAP3_HAS_FEATURE(192mhz_clk
, 192MHZ_CLK
)
575 OMAP3_HAS_FEATURE(io_wakeup
, IO_WAKEUP
)
576 OMAP3_HAS_FEATURE(sdrc
, SDRC
)
577 OMAP3_HAS_FEATURE(io_chain_ctrl
, IO_CHAIN_CTRL
)
580 * Runtime detection of OMAP4 features
582 #define OMAP4_HAS_FEATURE(feat, flag) \
583 static inline unsigned int omap4_has_ ##feat(void) \
585 return omap_features & OMAP4_HAS_ ##flag; \
588 OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
589 OMAP4_HAS_FEATURE(mpu_1_2ghz
, MPU_1_2GHZ
)
590 OMAP4_HAS_FEATURE(mpu_1_5ghz
, MPU_1_5GHZ
)
592 #endif /* __ASSEMBLY__ */
This page took 0.042212 seconds and 4 git commands to generate.