cpu.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. /*
  2. * arch/arm/plat-omap/include/mach/cpu.h
  3. *
  4. * OMAP cpu type detection
  5. *
  6. * Copyright (C) 2004, 2008 Nokia Corporation
  7. *
  8. * Copyright (C) 2009-11 Texas Instruments.
  9. *
  10. * Written by Tony Lindgren <tony.lindgren@nokia.com>
  11. *
  12. * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
  13. *
  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.
  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. #ifndef __ASM_ARCH_OMAP_CPU_H
  30. #define __ASM_ARCH_OMAP_CPU_H
  31. #ifndef __ASSEMBLY__
  32. #include <linux/bitops.h>
  33. /*
  34. * Test if multicore OMAP support is needed
  35. */
  36. #undef MULTI_OMAP1
  37. #undef MULTI_OMAP2
  38. #undef OMAP_NAME
  39. #ifdef CONFIG_ARCH_OMAP730
  40. # ifdef OMAP_NAME
  41. # undef MULTI_OMAP1
  42. # define MULTI_OMAP1
  43. # else
  44. # define OMAP_NAME omap730
  45. # endif
  46. #endif
  47. #ifdef CONFIG_ARCH_OMAP850
  48. # ifdef OMAP_NAME
  49. # undef MULTI_OMAP1
  50. # define MULTI_OMAP1
  51. # else
  52. # define OMAP_NAME omap850
  53. # endif
  54. #endif
  55. #ifdef CONFIG_ARCH_OMAP15XX
  56. # ifdef OMAP_NAME
  57. # undef MULTI_OMAP1
  58. # define MULTI_OMAP1
  59. # else
  60. # define OMAP_NAME omap1510
  61. # endif
  62. #endif
  63. #ifdef CONFIG_ARCH_OMAP16XX
  64. # ifdef OMAP_NAME
  65. # undef MULTI_OMAP1
  66. # define MULTI_OMAP1
  67. # else
  68. # define OMAP_NAME omap16xx
  69. # endif
  70. #endif
  71. #ifdef CONFIG_ARCH_OMAP2PLUS
  72. # if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
  73. # error "OMAP1 and OMAP2PLUS can't be selected at the same time"
  74. # endif
  75. #endif
  76. #ifdef CONFIG_SOC_OMAP2420
  77. # ifdef OMAP_NAME
  78. # undef MULTI_OMAP2
  79. # define MULTI_OMAP2
  80. # else
  81. # define OMAP_NAME omap2420
  82. # endif
  83. #endif
  84. #ifdef CONFIG_SOC_OMAP2430
  85. # ifdef OMAP_NAME
  86. # undef MULTI_OMAP2
  87. # define MULTI_OMAP2
  88. # else
  89. # define OMAP_NAME omap2430
  90. # endif
  91. #endif
  92. #ifdef CONFIG_ARCH_OMAP3
  93. # ifdef OMAP_NAME
  94. # undef MULTI_OMAP2
  95. # define MULTI_OMAP2
  96. # else
  97. # define OMAP_NAME omap3
  98. # endif
  99. #endif
  100. #ifdef CONFIG_ARCH_OMAP4
  101. # ifdef OMAP_NAME
  102. # undef MULTI_OMAP2
  103. # define MULTI_OMAP2
  104. # else
  105. # define OMAP_NAME omap4
  106. # endif
  107. #endif
  108. #ifdef CONFIG_SOC_OMAP5
  109. # ifdef OMAP_NAME
  110. # undef MULTI_OMAP2
  111. # define MULTI_OMAP2
  112. # else
  113. # define OMAP_NAME omap5
  114. # endif
  115. #endif
  116. #ifdef CONFIG_SOC_AM33XX
  117. # ifdef OMAP_NAME
  118. # undef MULTI_OMAP2
  119. # define MULTI_OMAP2
  120. # else
  121. # define OMAP_NAME am33xx
  122. # endif
  123. #endif
  124. /*
  125. * Omap device type i.e. EMU/HS/TST/GP/BAD
  126. */
  127. #define OMAP2_DEVICE_TYPE_TEST 0
  128. #define OMAP2_DEVICE_TYPE_EMU 1
  129. #define OMAP2_DEVICE_TYPE_SEC 2
  130. #define OMAP2_DEVICE_TYPE_GP 3
  131. #define OMAP2_DEVICE_TYPE_BAD 4
  132. int omap_type(void);
  133. /*
  134. * omap_rev bits:
  135. * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
  136. * CPU revision (See _REV_ defined in cpu.h) [15:08]
  137. * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
  138. */
  139. unsigned int omap_rev(void);
  140. /*
  141. * Get the CPU revision for OMAP devices
  142. */
  143. #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
  144. /*
  145. * Macros to group OMAP into cpu classes.
  146. * These can be used in most places.
  147. * cpu_is_omap7xx(): True for OMAP730, OMAP850
  148. * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
  149. * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
  150. * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
  151. * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
  152. * cpu_is_omap243x(): True for OMAP2430
  153. * cpu_is_omap343x(): True for OMAP3430
  154. * cpu_is_omap443x(): True for OMAP4430
  155. * cpu_is_omap446x(): True for OMAP4460
  156. * cpu_is_omap447x(): True for OMAP4470
  157. * soc_is_omap543x(): True for OMAP5430, OMAP5432
  158. */
  159. #define GET_OMAP_CLASS (omap_rev() & 0xff)
  160. #define IS_OMAP_CLASS(class, id) \
  161. static inline int is_omap ##class (void) \
  162. { \
  163. return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
  164. }
  165. #define GET_AM_CLASS ((omap_rev() >> 24) & 0xff)
  166. #define IS_AM_CLASS(class, id) \
  167. static inline int is_am ##class (void) \
  168. { \
  169. return (GET_AM_CLASS == (id)) ? 1 : 0; \
  170. }
  171. #define GET_TI_CLASS ((omap_rev() >> 24) & 0xff)
  172. #define IS_TI_CLASS(class, id) \
  173. static inline int is_ti ##class (void) \
  174. { \
  175. return (GET_TI_CLASS == (id)) ? 1 : 0; \
  176. }
  177. #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
  178. #define IS_OMAP_SUBCLASS(subclass, id) \
  179. static inline int is_omap ##subclass (void) \
  180. { \
  181. return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
  182. }
  183. #define IS_TI_SUBCLASS(subclass, id) \
  184. static inline int is_ti ##subclass (void) \
  185. { \
  186. return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
  187. }
  188. #define IS_AM_SUBCLASS(subclass, id) \
  189. static inline int is_am ##subclass (void) \
  190. { \
  191. return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
  192. }
  193. IS_OMAP_CLASS(7xx, 0x07)
  194. IS_OMAP_CLASS(15xx, 0x15)
  195. IS_OMAP_CLASS(16xx, 0x16)
  196. IS_OMAP_CLASS(24xx, 0x24)
  197. IS_OMAP_CLASS(34xx, 0x34)
  198. IS_OMAP_CLASS(44xx, 0x44)
  199. IS_AM_CLASS(35xx, 0x35)
  200. IS_OMAP_CLASS(54xx, 0x54)
  201. IS_AM_CLASS(33xx, 0x33)
  202. IS_TI_CLASS(81xx, 0x81)
  203. IS_OMAP_SUBCLASS(242x, 0x242)
  204. IS_OMAP_SUBCLASS(243x, 0x243)
  205. IS_OMAP_SUBCLASS(343x, 0x343)
  206. IS_OMAP_SUBCLASS(363x, 0x363)
  207. IS_OMAP_SUBCLASS(443x, 0x443)
  208. IS_OMAP_SUBCLASS(446x, 0x446)
  209. IS_OMAP_SUBCLASS(447x, 0x447)
  210. IS_OMAP_SUBCLASS(543x, 0x543)
  211. IS_TI_SUBCLASS(816x, 0x816)
  212. IS_TI_SUBCLASS(814x, 0x814)
  213. IS_AM_SUBCLASS(335x, 0x335)
  214. #define cpu_is_omap7xx() 0
  215. #define cpu_is_omap15xx() 0
  216. #define cpu_is_omap16xx() 0
  217. #define cpu_is_omap24xx() 0
  218. #define cpu_is_omap242x() 0
  219. #define cpu_is_omap243x() 0
  220. #define cpu_is_omap34xx() 0
  221. #define cpu_is_omap343x() 0
  222. #define cpu_is_ti81xx() 0
  223. #define cpu_is_ti816x() 0
  224. #define cpu_is_ti814x() 0
  225. #define soc_is_am35xx() 0
  226. #define soc_is_am33xx() 0
  227. #define soc_is_am335x() 0
  228. #define cpu_is_omap44xx() 0
  229. #define cpu_is_omap443x() 0
  230. #define cpu_is_omap446x() 0
  231. #define cpu_is_omap447x() 0
  232. #define soc_is_omap54xx() 0
  233. #define soc_is_omap543x() 0
  234. #if defined(MULTI_OMAP1)
  235. # if defined(CONFIG_ARCH_OMAP730)
  236. # undef cpu_is_omap7xx
  237. # define cpu_is_omap7xx() is_omap7xx()
  238. # endif
  239. # if defined(CONFIG_ARCH_OMAP850)
  240. # undef cpu_is_omap7xx
  241. # define cpu_is_omap7xx() is_omap7xx()
  242. # endif
  243. # if defined(CONFIG_ARCH_OMAP15XX)
  244. # undef cpu_is_omap15xx
  245. # define cpu_is_omap15xx() is_omap15xx()
  246. # endif
  247. # if defined(CONFIG_ARCH_OMAP16XX)
  248. # undef cpu_is_omap16xx
  249. # define cpu_is_omap16xx() is_omap16xx()
  250. # endif
  251. #else
  252. # if defined(CONFIG_ARCH_OMAP730)
  253. # undef cpu_is_omap7xx
  254. # define cpu_is_omap7xx() 1
  255. # endif
  256. # if defined(CONFIG_ARCH_OMAP850)
  257. # undef cpu_is_omap7xx
  258. # define cpu_is_omap7xx() 1
  259. # endif
  260. # if defined(CONFIG_ARCH_OMAP15XX)
  261. # undef cpu_is_omap15xx
  262. # define cpu_is_omap15xx() 1
  263. # endif
  264. # if defined(CONFIG_ARCH_OMAP16XX)
  265. # undef cpu_is_omap16xx
  266. # define cpu_is_omap16xx() 1
  267. # endif
  268. #endif
  269. #if defined(MULTI_OMAP2)
  270. # if defined(CONFIG_ARCH_OMAP2)
  271. # undef cpu_is_omap24xx
  272. # define cpu_is_omap24xx() is_omap24xx()
  273. # endif
  274. # if defined (CONFIG_SOC_OMAP2420)
  275. # undef cpu_is_omap242x
  276. # define cpu_is_omap242x() is_omap242x()
  277. # endif
  278. # if defined (CONFIG_SOC_OMAP2430)
  279. # undef cpu_is_omap243x
  280. # define cpu_is_omap243x() is_omap243x()
  281. # endif
  282. # if defined(CONFIG_ARCH_OMAP3)
  283. # undef cpu_is_omap34xx
  284. # undef cpu_is_omap343x
  285. # define cpu_is_omap34xx() is_omap34xx()
  286. # define cpu_is_omap343x() is_omap343x()
  287. # endif
  288. #else
  289. # if defined(CONFIG_ARCH_OMAP2)
  290. # undef cpu_is_omap24xx
  291. # define cpu_is_omap24xx() 1
  292. # endif
  293. # if defined(CONFIG_SOC_OMAP2420)
  294. # undef cpu_is_omap242x
  295. # define cpu_is_omap242x() 1
  296. # endif
  297. # if defined(CONFIG_SOC_OMAP2430)
  298. # undef cpu_is_omap243x
  299. # define cpu_is_omap243x() 1
  300. # endif
  301. # if defined(CONFIG_ARCH_OMAP3)
  302. # undef cpu_is_omap34xx
  303. # define cpu_is_omap34xx() 1
  304. # endif
  305. # if defined(CONFIG_SOC_OMAP3430)
  306. # undef cpu_is_omap343x
  307. # define cpu_is_omap343x() 1
  308. # endif
  309. #endif
  310. /*
  311. * Macros to detect individual cpu types.
  312. * These are only rarely needed.
  313. * cpu_is_omap310(): True for OMAP310
  314. * cpu_is_omap1510(): True for OMAP1510
  315. * cpu_is_omap1610(): True for OMAP1610
  316. * cpu_is_omap1611(): True for OMAP1611
  317. * cpu_is_omap5912(): True for OMAP5912
  318. * cpu_is_omap1621(): True for OMAP1621
  319. * cpu_is_omap1710(): True for OMAP1710
  320. * cpu_is_omap2420(): True for OMAP2420
  321. * cpu_is_omap2422(): True for OMAP2422
  322. * cpu_is_omap2423(): True for OMAP2423
  323. * cpu_is_omap2430(): True for OMAP2430
  324. * cpu_is_omap3430(): True for OMAP3430
  325. */
  326. #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
  327. #define IS_OMAP_TYPE(type, id) \
  328. static inline int is_omap ##type (void) \
  329. { \
  330. return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
  331. }
  332. IS_OMAP_TYPE(310, 0x0310)
  333. IS_OMAP_TYPE(1510, 0x1510)
  334. IS_OMAP_TYPE(1610, 0x1610)
  335. IS_OMAP_TYPE(1611, 0x1611)
  336. IS_OMAP_TYPE(5912, 0x1611)
  337. IS_OMAP_TYPE(1621, 0x1621)
  338. IS_OMAP_TYPE(1710, 0x1710)
  339. IS_OMAP_TYPE(2420, 0x2420)
  340. IS_OMAP_TYPE(2422, 0x2422)
  341. IS_OMAP_TYPE(2423, 0x2423)
  342. IS_OMAP_TYPE(2430, 0x2430)
  343. IS_OMAP_TYPE(3430, 0x3430)
  344. #define cpu_is_omap310() 0
  345. #define cpu_is_omap1510() 0
  346. #define cpu_is_omap1610() 0
  347. #define cpu_is_omap5912() 0
  348. #define cpu_is_omap1611() 0
  349. #define cpu_is_omap1621() 0
  350. #define cpu_is_omap1710() 0
  351. #define cpu_is_omap2420() 0
  352. #define cpu_is_omap2422() 0
  353. #define cpu_is_omap2423() 0
  354. #define cpu_is_omap2430() 0
  355. #define cpu_is_omap3430() 0
  356. #define cpu_is_omap3630() 0
  357. #define soc_is_omap5430() 0
  358. /*
  359. * Whether we have MULTI_OMAP1 or not, we still need to distinguish
  360. * between 310 vs. 1510 and 1611B/5912 vs. 1710.
  361. */
  362. #if defined(CONFIG_ARCH_OMAP15XX)
  363. # undef cpu_is_omap310
  364. # undef cpu_is_omap1510
  365. # define cpu_is_omap310() is_omap310()
  366. # define cpu_is_omap1510() is_omap1510()
  367. #endif
  368. #if defined(CONFIG_ARCH_OMAP16XX)
  369. # undef cpu_is_omap1610
  370. # undef cpu_is_omap1611
  371. # undef cpu_is_omap5912
  372. # undef cpu_is_omap1621
  373. # undef cpu_is_omap1710
  374. # define cpu_is_omap1610() is_omap1610()
  375. # define cpu_is_omap1611() is_omap1611()
  376. # define cpu_is_omap5912() is_omap5912()
  377. # define cpu_is_omap1621() is_omap1621()
  378. # define cpu_is_omap1710() is_omap1710()
  379. #endif
  380. #if defined(CONFIG_ARCH_OMAP2)
  381. # undef cpu_is_omap2420
  382. # undef cpu_is_omap2422
  383. # undef cpu_is_omap2423
  384. # undef cpu_is_omap2430
  385. # define cpu_is_omap2420() is_omap2420()
  386. # define cpu_is_omap2422() is_omap2422()
  387. # define cpu_is_omap2423() is_omap2423()
  388. # define cpu_is_omap2430() is_omap2430()
  389. #endif
  390. #if defined(CONFIG_ARCH_OMAP3)
  391. # undef cpu_is_omap3430
  392. # undef cpu_is_ti81xx
  393. # undef cpu_is_ti816x
  394. # undef cpu_is_ti814x
  395. # undef soc_is_am35xx
  396. # define cpu_is_omap3430() is_omap3430()
  397. # undef cpu_is_omap3630
  398. # define cpu_is_omap3630() is_omap363x()
  399. # define cpu_is_ti81xx() is_ti81xx()
  400. # define cpu_is_ti816x() is_ti816x()
  401. # define cpu_is_ti814x() is_ti814x()
  402. # define soc_is_am35xx() is_am35xx()
  403. #endif
  404. # if defined(CONFIG_SOC_AM33XX)
  405. # undef soc_is_am33xx
  406. # undef soc_is_am335x
  407. # define soc_is_am33xx() is_am33xx()
  408. # define soc_is_am335x() is_am335x()
  409. #endif
  410. # if defined(CONFIG_ARCH_OMAP4)
  411. # undef cpu_is_omap44xx
  412. # undef cpu_is_omap443x
  413. # undef cpu_is_omap446x
  414. # undef cpu_is_omap447x
  415. # define cpu_is_omap44xx() is_omap44xx()
  416. # define cpu_is_omap443x() is_omap443x()
  417. # define cpu_is_omap446x() is_omap446x()
  418. # define cpu_is_omap447x() is_omap447x()
  419. # endif
  420. # if defined(CONFIG_SOC_OMAP5)
  421. # undef soc_is_omap54xx
  422. # undef soc_is_omap543x
  423. # define soc_is_omap54xx() is_omap54xx()
  424. # define soc_is_omap543x() is_omap543x()
  425. #endif
  426. /* Macros to detect if we have OMAP1 or OMAP2 */
  427. #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
  428. cpu_is_omap16xx())
  429. #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
  430. cpu_is_omap44xx() || soc_is_omap54xx() || \
  431. soc_is_am33xx())
  432. /* Various silicon revisions for omap2 */
  433. #define OMAP242X_CLASS 0x24200024
  434. #define OMAP2420_REV_ES1_0 OMAP242X_CLASS
  435. #define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8))
  436. #define OMAP243X_CLASS 0x24300024
  437. #define OMAP2430_REV_ES1_0 OMAP243X_CLASS
  438. #define OMAP343X_CLASS 0x34300034
  439. #define OMAP3430_REV_ES1_0 OMAP343X_CLASS
  440. #define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8))
  441. #define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8))
  442. #define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8))
  443. #define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8))
  444. #define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8))
  445. #define OMAP363X_CLASS 0x36300034
  446. #define OMAP3630_REV_ES1_0 OMAP363X_CLASS
  447. #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
  448. #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
  449. #define TI816X_CLASS 0x81600034
  450. #define TI8168_REV_ES1_0 TI816X_CLASS
  451. #define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
  452. #define TI814X_CLASS 0x81400034
  453. #define TI8148_REV_ES1_0 TI814X_CLASS
  454. #define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8))
  455. #define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8))
  456. #define AM35XX_CLASS 0x35170034
  457. #define AM35XX_REV_ES1_0 AM35XX_CLASS
  458. #define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8))
  459. #define AM335X_CLASS 0x33500033
  460. #define AM335X_REV_ES1_0 AM335X_CLASS
  461. #define OMAP443X_CLASS 0x44300044
  462. #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
  463. #define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
  464. #define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
  465. #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
  466. #define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8))
  467. #define OMAP446X_CLASS 0x44600044
  468. #define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8))
  469. #define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8))
  470. #define OMAP447X_CLASS 0x44700044
  471. #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
  472. #define OMAP54XX_CLASS 0x54000054
  473. #define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
  474. #define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
  475. void omap2xxx_check_revision(void);
  476. void omap3xxx_check_revision(void);
  477. void omap4xxx_check_revision(void);
  478. void omap5xxx_check_revision(void);
  479. void omap3xxx_check_features(void);
  480. void ti81xx_check_features(void);
  481. void omap4xxx_check_features(void);
  482. /*
  483. * Runtime detection of OMAP3 features
  484. *
  485. * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
  486. * family have OS-level control over the I/O chain clock. This is
  487. * to avoid a window during which wakeups could potentially be lost
  488. * during powerdomain transitions. If this bit is set, it
  489. * indicates that the chip does support OS-level control of this
  490. * feature.
  491. */
  492. extern u32 omap_features;
  493. #define OMAP3_HAS_L2CACHE BIT(0)
  494. #define OMAP3_HAS_IVA BIT(1)
  495. #define OMAP3_HAS_SGX BIT(2)
  496. #define OMAP3_HAS_NEON BIT(3)
  497. #define OMAP3_HAS_ISP BIT(4)
  498. #define OMAP3_HAS_192MHZ_CLK BIT(5)
  499. #define OMAP3_HAS_IO_WAKEUP BIT(6)
  500. #define OMAP3_HAS_SDRC BIT(7)
  501. #define OMAP3_HAS_IO_CHAIN_CTRL BIT(8)
  502. #define OMAP4_HAS_MPU_1GHZ BIT(9)
  503. #define OMAP4_HAS_MPU_1_2GHZ BIT(10)
  504. #define OMAP4_HAS_MPU_1_5GHZ BIT(11)
  505. #define OMAP3_HAS_FEATURE(feat,flag) \
  506. static inline unsigned int omap3_has_ ##feat(void) \
  507. { \
  508. return omap_features & OMAP3_HAS_ ##flag; \
  509. } \
  510. OMAP3_HAS_FEATURE(l2cache, L2CACHE)
  511. OMAP3_HAS_FEATURE(sgx, SGX)
  512. OMAP3_HAS_FEATURE(iva, IVA)
  513. OMAP3_HAS_FEATURE(neon, NEON)
  514. OMAP3_HAS_FEATURE(isp, ISP)
  515. OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
  516. OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
  517. OMAP3_HAS_FEATURE(sdrc, SDRC)
  518. OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL)
  519. /*
  520. * Runtime detection of OMAP4 features
  521. */
  522. #define OMAP4_HAS_FEATURE(feat, flag) \
  523. static inline unsigned int omap4_has_ ##feat(void) \
  524. { \
  525. return omap_features & OMAP4_HAS_ ##flag; \
  526. } \
  527. OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
  528. OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
  529. OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
  530. #endif /* __ASSEMBLY__ */
  531. #endif