omap_hwmod_2xxx_ipblock_data.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. /*
  2. * omap_hwmod_2xxx_ipblock_data.c - common IP block data for OMAP2xxx
  3. *
  4. * Copyright (C) 2011 Nokia Corporation
  5. * Paul Walmsley
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <plat/omap_hwmod.h>
  12. #include <plat/serial.h>
  13. #include <linux/platform_data/gpio-omap.h>
  14. #include <plat/dma.h>
  15. #include <plat/dmtimer.h>
  16. #include <plat/mcspi.h>
  17. #include "omap_hwmod_common_data.h"
  18. #include "cm-regbits-24xx.h"
  19. #include "prm-regbits-24xx.h"
  20. #include "wd_timer.h"
  21. struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
  22. { .irq = 48 + OMAP_INTC_START, },
  23. { .irq = -1 },
  24. };
  25. struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
  26. { .name = "dispc", .dma_req = 5 },
  27. { .dma_req = -1 }
  28. };
  29. /*
  30. * 'dispc' class
  31. * display controller
  32. */
  33. static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
  34. .rev_offs = 0x0000,
  35. .sysc_offs = 0x0010,
  36. .syss_offs = 0x0014,
  37. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  38. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  39. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  40. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  41. .sysc_fields = &omap_hwmod_sysc_type1,
  42. };
  43. struct omap_hwmod_class omap2_dispc_hwmod_class = {
  44. .name = "dispc",
  45. .sysc = &omap2_dispc_sysc,
  46. };
  47. /* OMAP2xxx Timer Common */
  48. static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
  49. .rev_offs = 0x0000,
  50. .sysc_offs = 0x0010,
  51. .syss_offs = 0x0014,
  52. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  53. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  54. SYSC_HAS_AUTOIDLE),
  55. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  56. .sysc_fields = &omap_hwmod_sysc_type1,
  57. };
  58. struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
  59. .name = "timer",
  60. .sysc = &omap2xxx_timer_sysc,
  61. };
  62. /*
  63. * 'wd_timer' class
  64. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  65. * overflow condition
  66. */
  67. static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
  68. .rev_offs = 0x0000,
  69. .sysc_offs = 0x0010,
  70. .syss_offs = 0x0014,
  71. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  72. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  73. .sysc_fields = &omap_hwmod_sysc_type1,
  74. };
  75. struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
  76. .name = "wd_timer",
  77. .sysc = &omap2xxx_wd_timer_sysc,
  78. .pre_shutdown = &omap2_wd_timer_disable,
  79. .reset = &omap2_wd_timer_reset,
  80. };
  81. /*
  82. * 'gpio' class
  83. * general purpose io module
  84. */
  85. static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
  86. .rev_offs = 0x0000,
  87. .sysc_offs = 0x0010,
  88. .syss_offs = 0x0014,
  89. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  90. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  91. SYSS_HAS_RESET_STATUS),
  92. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  93. .sysc_fields = &omap_hwmod_sysc_type1,
  94. };
  95. struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
  96. .name = "gpio",
  97. .sysc = &omap2xxx_gpio_sysc,
  98. .rev = 0,
  99. };
  100. /* system dma */
  101. static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
  102. .rev_offs = 0x0000,
  103. .sysc_offs = 0x002c,
  104. .syss_offs = 0x0028,
  105. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
  106. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
  107. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  108. .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  109. .sysc_fields = &omap_hwmod_sysc_type1,
  110. };
  111. struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
  112. .name = "dma",
  113. .sysc = &omap2xxx_dma_sysc,
  114. };
  115. /*
  116. * 'mailbox' class
  117. * mailbox module allowing communication between the on-chip processors
  118. * using a queued mailbox-interrupt mechanism.
  119. */
  120. static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
  121. .rev_offs = 0x000,
  122. .sysc_offs = 0x010,
  123. .syss_offs = 0x014,
  124. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  125. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  126. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  127. .sysc_fields = &omap_hwmod_sysc_type1,
  128. };
  129. struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
  130. .name = "mailbox",
  131. .sysc = &omap2xxx_mailbox_sysc,
  132. };
  133. /*
  134. * 'mcspi' class
  135. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  136. * bus
  137. */
  138. static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
  139. .rev_offs = 0x0000,
  140. .sysc_offs = 0x0010,
  141. .syss_offs = 0x0014,
  142. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  143. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  144. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  145. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  146. .sysc_fields = &omap_hwmod_sysc_type1,
  147. };
  148. struct omap_hwmod_class omap2xxx_mcspi_class = {
  149. .name = "mcspi",
  150. .sysc = &omap2xxx_mcspi_sysc,
  151. .rev = OMAP2_MCSPI_REV,
  152. };
  153. /*
  154. * 'gpmc' class
  155. * general purpose memory controller
  156. */
  157. static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
  158. .rev_offs = 0x0000,
  159. .sysc_offs = 0x0010,
  160. .syss_offs = 0x0014,
  161. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
  162. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  163. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  164. .sysc_fields = &omap_hwmod_sysc_type1,
  165. };
  166. static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
  167. .name = "gpmc",
  168. .sysc = &omap2xxx_gpmc_sysc,
  169. };
  170. /*
  171. * IP blocks
  172. */
  173. /* L3 */
  174. struct omap_hwmod omap2xxx_l3_main_hwmod = {
  175. .name = "l3_main",
  176. .class = &l3_hwmod_class,
  177. .flags = HWMOD_NO_IDLEST,
  178. };
  179. /* L4 CORE */
  180. struct omap_hwmod omap2xxx_l4_core_hwmod = {
  181. .name = "l4_core",
  182. .class = &l4_hwmod_class,
  183. .flags = HWMOD_NO_IDLEST,
  184. };
  185. /* L4 WKUP */
  186. struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
  187. .name = "l4_wkup",
  188. .class = &l4_hwmod_class,
  189. .flags = HWMOD_NO_IDLEST,
  190. };
  191. /* MPU */
  192. struct omap_hwmod omap2xxx_mpu_hwmod = {
  193. .name = "mpu",
  194. .class = &mpu_hwmod_class,
  195. .main_clk = "mpu_ck",
  196. };
  197. /* IVA2 */
  198. struct omap_hwmod omap2xxx_iva_hwmod = {
  199. .name = "iva",
  200. .class = &iva_hwmod_class,
  201. };
  202. /* always-on timers dev attribute */
  203. static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
  204. .timer_capability = OMAP_TIMER_ALWON,
  205. };
  206. /* pwm timers dev attribute */
  207. static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
  208. .timer_capability = OMAP_TIMER_HAS_PWM,
  209. };
  210. /* timer1 */
  211. struct omap_hwmod omap2xxx_timer1_hwmod = {
  212. .name = "timer1",
  213. .mpu_irqs = omap2_timer1_mpu_irqs,
  214. .main_clk = "gpt1_fck",
  215. .prcm = {
  216. .omap2 = {
  217. .prcm_reg_id = 1,
  218. .module_bit = OMAP24XX_EN_GPT1_SHIFT,
  219. .module_offs = WKUP_MOD,
  220. .idlest_reg_id = 1,
  221. .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
  222. },
  223. },
  224. .dev_attr = &capability_alwon_dev_attr,
  225. .class = &omap2xxx_timer_hwmod_class,
  226. };
  227. /* timer2 */
  228. struct omap_hwmod omap2xxx_timer2_hwmod = {
  229. .name = "timer2",
  230. .mpu_irqs = omap2_timer2_mpu_irqs,
  231. .main_clk = "gpt2_fck",
  232. .prcm = {
  233. .omap2 = {
  234. .prcm_reg_id = 1,
  235. .module_bit = OMAP24XX_EN_GPT2_SHIFT,
  236. .module_offs = CORE_MOD,
  237. .idlest_reg_id = 1,
  238. .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
  239. },
  240. },
  241. .class = &omap2xxx_timer_hwmod_class,
  242. };
  243. /* timer3 */
  244. struct omap_hwmod omap2xxx_timer3_hwmod = {
  245. .name = "timer3",
  246. .mpu_irqs = omap2_timer3_mpu_irqs,
  247. .main_clk = "gpt3_fck",
  248. .prcm = {
  249. .omap2 = {
  250. .prcm_reg_id = 1,
  251. .module_bit = OMAP24XX_EN_GPT3_SHIFT,
  252. .module_offs = CORE_MOD,
  253. .idlest_reg_id = 1,
  254. .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
  255. },
  256. },
  257. .class = &omap2xxx_timer_hwmod_class,
  258. };
  259. /* timer4 */
  260. struct omap_hwmod omap2xxx_timer4_hwmod = {
  261. .name = "timer4",
  262. .mpu_irqs = omap2_timer4_mpu_irqs,
  263. .main_clk = "gpt4_fck",
  264. .prcm = {
  265. .omap2 = {
  266. .prcm_reg_id = 1,
  267. .module_bit = OMAP24XX_EN_GPT4_SHIFT,
  268. .module_offs = CORE_MOD,
  269. .idlest_reg_id = 1,
  270. .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
  271. },
  272. },
  273. .class = &omap2xxx_timer_hwmod_class,
  274. };
  275. /* timer5 */
  276. struct omap_hwmod omap2xxx_timer5_hwmod = {
  277. .name = "timer5",
  278. .mpu_irqs = omap2_timer5_mpu_irqs,
  279. .main_clk = "gpt5_fck",
  280. .prcm = {
  281. .omap2 = {
  282. .prcm_reg_id = 1,
  283. .module_bit = OMAP24XX_EN_GPT5_SHIFT,
  284. .module_offs = CORE_MOD,
  285. .idlest_reg_id = 1,
  286. .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
  287. },
  288. },
  289. .class = &omap2xxx_timer_hwmod_class,
  290. };
  291. /* timer6 */
  292. struct omap_hwmod omap2xxx_timer6_hwmod = {
  293. .name = "timer6",
  294. .mpu_irqs = omap2_timer6_mpu_irqs,
  295. .main_clk = "gpt6_fck",
  296. .prcm = {
  297. .omap2 = {
  298. .prcm_reg_id = 1,
  299. .module_bit = OMAP24XX_EN_GPT6_SHIFT,
  300. .module_offs = CORE_MOD,
  301. .idlest_reg_id = 1,
  302. .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
  303. },
  304. },
  305. .class = &omap2xxx_timer_hwmod_class,
  306. };
  307. /* timer7 */
  308. struct omap_hwmod omap2xxx_timer7_hwmod = {
  309. .name = "timer7",
  310. .mpu_irqs = omap2_timer7_mpu_irqs,
  311. .main_clk = "gpt7_fck",
  312. .prcm = {
  313. .omap2 = {
  314. .prcm_reg_id = 1,
  315. .module_bit = OMAP24XX_EN_GPT7_SHIFT,
  316. .module_offs = CORE_MOD,
  317. .idlest_reg_id = 1,
  318. .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
  319. },
  320. },
  321. .class = &omap2xxx_timer_hwmod_class,
  322. };
  323. /* timer8 */
  324. struct omap_hwmod omap2xxx_timer8_hwmod = {
  325. .name = "timer8",
  326. .mpu_irqs = omap2_timer8_mpu_irqs,
  327. .main_clk = "gpt8_fck",
  328. .prcm = {
  329. .omap2 = {
  330. .prcm_reg_id = 1,
  331. .module_bit = OMAP24XX_EN_GPT8_SHIFT,
  332. .module_offs = CORE_MOD,
  333. .idlest_reg_id = 1,
  334. .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
  335. },
  336. },
  337. .class = &omap2xxx_timer_hwmod_class,
  338. };
  339. /* timer9 */
  340. struct omap_hwmod omap2xxx_timer9_hwmod = {
  341. .name = "timer9",
  342. .mpu_irqs = omap2_timer9_mpu_irqs,
  343. .main_clk = "gpt9_fck",
  344. .prcm = {
  345. .omap2 = {
  346. .prcm_reg_id = 1,
  347. .module_bit = OMAP24XX_EN_GPT9_SHIFT,
  348. .module_offs = CORE_MOD,
  349. .idlest_reg_id = 1,
  350. .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
  351. },
  352. },
  353. .dev_attr = &capability_pwm_dev_attr,
  354. .class = &omap2xxx_timer_hwmod_class,
  355. };
  356. /* timer10 */
  357. struct omap_hwmod omap2xxx_timer10_hwmod = {
  358. .name = "timer10",
  359. .mpu_irqs = omap2_timer10_mpu_irqs,
  360. .main_clk = "gpt10_fck",
  361. .prcm = {
  362. .omap2 = {
  363. .prcm_reg_id = 1,
  364. .module_bit = OMAP24XX_EN_GPT10_SHIFT,
  365. .module_offs = CORE_MOD,
  366. .idlest_reg_id = 1,
  367. .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
  368. },
  369. },
  370. .dev_attr = &capability_pwm_dev_attr,
  371. .class = &omap2xxx_timer_hwmod_class,
  372. };
  373. /* timer11 */
  374. struct omap_hwmod omap2xxx_timer11_hwmod = {
  375. .name = "timer11",
  376. .mpu_irqs = omap2_timer11_mpu_irqs,
  377. .main_clk = "gpt11_fck",
  378. .prcm = {
  379. .omap2 = {
  380. .prcm_reg_id = 1,
  381. .module_bit = OMAP24XX_EN_GPT11_SHIFT,
  382. .module_offs = CORE_MOD,
  383. .idlest_reg_id = 1,
  384. .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
  385. },
  386. },
  387. .dev_attr = &capability_pwm_dev_attr,
  388. .class = &omap2xxx_timer_hwmod_class,
  389. };
  390. /* timer12 */
  391. struct omap_hwmod omap2xxx_timer12_hwmod = {
  392. .name = "timer12",
  393. .mpu_irqs = omap2xxx_timer12_mpu_irqs,
  394. .main_clk = "gpt12_fck",
  395. .prcm = {
  396. .omap2 = {
  397. .prcm_reg_id = 1,
  398. .module_bit = OMAP24XX_EN_GPT12_SHIFT,
  399. .module_offs = CORE_MOD,
  400. .idlest_reg_id = 1,
  401. .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
  402. },
  403. },
  404. .dev_attr = &capability_pwm_dev_attr,
  405. .class = &omap2xxx_timer_hwmod_class,
  406. };
  407. /* wd_timer2 */
  408. struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
  409. .name = "wd_timer2",
  410. .class = &omap2xxx_wd_timer_hwmod_class,
  411. .main_clk = "mpu_wdt_fck",
  412. .prcm = {
  413. .omap2 = {
  414. .prcm_reg_id = 1,
  415. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  416. .module_offs = WKUP_MOD,
  417. .idlest_reg_id = 1,
  418. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  419. },
  420. },
  421. };
  422. /* UART1 */
  423. struct omap_hwmod omap2xxx_uart1_hwmod = {
  424. .name = "uart1",
  425. .mpu_irqs = omap2_uart1_mpu_irqs,
  426. .sdma_reqs = omap2_uart1_sdma_reqs,
  427. .main_clk = "uart1_fck",
  428. .prcm = {
  429. .omap2 = {
  430. .module_offs = CORE_MOD,
  431. .prcm_reg_id = 1,
  432. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  433. .idlest_reg_id = 1,
  434. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  435. },
  436. },
  437. .class = &omap2_uart_class,
  438. };
  439. /* UART2 */
  440. struct omap_hwmod omap2xxx_uart2_hwmod = {
  441. .name = "uart2",
  442. .mpu_irqs = omap2_uart2_mpu_irqs,
  443. .sdma_reqs = omap2_uart2_sdma_reqs,
  444. .main_clk = "uart2_fck",
  445. .prcm = {
  446. .omap2 = {
  447. .module_offs = CORE_MOD,
  448. .prcm_reg_id = 1,
  449. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  450. .idlest_reg_id = 1,
  451. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  452. },
  453. },
  454. .class = &omap2_uart_class,
  455. };
  456. /* UART3 */
  457. struct omap_hwmod omap2xxx_uart3_hwmod = {
  458. .name = "uart3",
  459. .mpu_irqs = omap2_uart3_mpu_irqs,
  460. .sdma_reqs = omap2_uart3_sdma_reqs,
  461. .main_clk = "uart3_fck",
  462. .prcm = {
  463. .omap2 = {
  464. .module_offs = CORE_MOD,
  465. .prcm_reg_id = 2,
  466. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  467. .idlest_reg_id = 2,
  468. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  469. },
  470. },
  471. .class = &omap2_uart_class,
  472. };
  473. /* dss */
  474. static struct omap_hwmod_opt_clk dss_opt_clks[] = {
  475. /*
  476. * The DSS HW needs all DSS clocks enabled during reset. The dss_core
  477. * driver does not use these clocks.
  478. */
  479. { .role = "tv_clk", .clk = "dss_54m_fck" },
  480. { .role = "sys_clk", .clk = "dss2_fck" },
  481. };
  482. struct omap_hwmod omap2xxx_dss_core_hwmod = {
  483. .name = "dss_core",
  484. .class = &omap2_dss_hwmod_class,
  485. .main_clk = "dss1_fck", /* instead of dss_fck */
  486. .sdma_reqs = omap2xxx_dss_sdma_chs,
  487. .prcm = {
  488. .omap2 = {
  489. .prcm_reg_id = 1,
  490. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  491. .module_offs = CORE_MOD,
  492. .idlest_reg_id = 1,
  493. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  494. },
  495. },
  496. .opt_clks = dss_opt_clks,
  497. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  498. .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  499. };
  500. struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
  501. .name = "dss_dispc",
  502. .class = &omap2_dispc_hwmod_class,
  503. .mpu_irqs = omap2_dispc_irqs,
  504. .main_clk = "dss1_fck",
  505. .prcm = {
  506. .omap2 = {
  507. .prcm_reg_id = 1,
  508. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  509. .module_offs = CORE_MOD,
  510. .idlest_reg_id = 1,
  511. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  512. },
  513. },
  514. .flags = HWMOD_NO_IDLEST,
  515. .dev_attr = &omap2_3_dss_dispc_dev_attr
  516. };
  517. static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
  518. { .role = "ick", .clk = "dss_ick" },
  519. };
  520. struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
  521. .name = "dss_rfbi",
  522. .class = &omap2_rfbi_hwmod_class,
  523. .main_clk = "dss1_fck",
  524. .prcm = {
  525. .omap2 = {
  526. .prcm_reg_id = 1,
  527. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  528. .module_offs = CORE_MOD,
  529. },
  530. },
  531. .opt_clks = dss_rfbi_opt_clks,
  532. .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
  533. .flags = HWMOD_NO_IDLEST,
  534. };
  535. struct omap_hwmod omap2xxx_dss_venc_hwmod = {
  536. .name = "dss_venc",
  537. .class = &omap2_venc_hwmod_class,
  538. .main_clk = "dss_54m_fck",
  539. .prcm = {
  540. .omap2 = {
  541. .prcm_reg_id = 1,
  542. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  543. .module_offs = CORE_MOD,
  544. },
  545. },
  546. .flags = HWMOD_NO_IDLEST,
  547. };
  548. /* gpio dev_attr */
  549. struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
  550. .bank_width = 32,
  551. .dbck_flag = false,
  552. };
  553. /* gpio1 */
  554. struct omap_hwmod omap2xxx_gpio1_hwmod = {
  555. .name = "gpio1",
  556. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  557. .mpu_irqs = omap2_gpio1_irqs,
  558. .main_clk = "gpios_fck",
  559. .prcm = {
  560. .omap2 = {
  561. .prcm_reg_id = 1,
  562. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  563. .module_offs = WKUP_MOD,
  564. .idlest_reg_id = 1,
  565. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  566. },
  567. },
  568. .class = &omap2xxx_gpio_hwmod_class,
  569. .dev_attr = &omap2xxx_gpio_dev_attr,
  570. };
  571. /* gpio2 */
  572. struct omap_hwmod omap2xxx_gpio2_hwmod = {
  573. .name = "gpio2",
  574. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  575. .mpu_irqs = omap2_gpio2_irqs,
  576. .main_clk = "gpios_fck",
  577. .prcm = {
  578. .omap2 = {
  579. .prcm_reg_id = 1,
  580. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  581. .module_offs = WKUP_MOD,
  582. .idlest_reg_id = 1,
  583. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  584. },
  585. },
  586. .class = &omap2xxx_gpio_hwmod_class,
  587. .dev_attr = &omap2xxx_gpio_dev_attr,
  588. };
  589. /* gpio3 */
  590. struct omap_hwmod omap2xxx_gpio3_hwmod = {
  591. .name = "gpio3",
  592. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  593. .mpu_irqs = omap2_gpio3_irqs,
  594. .main_clk = "gpios_fck",
  595. .prcm = {
  596. .omap2 = {
  597. .prcm_reg_id = 1,
  598. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  599. .module_offs = WKUP_MOD,
  600. .idlest_reg_id = 1,
  601. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  602. },
  603. },
  604. .class = &omap2xxx_gpio_hwmod_class,
  605. .dev_attr = &omap2xxx_gpio_dev_attr,
  606. };
  607. /* gpio4 */
  608. struct omap_hwmod omap2xxx_gpio4_hwmod = {
  609. .name = "gpio4",
  610. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  611. .mpu_irqs = omap2_gpio4_irqs,
  612. .main_clk = "gpios_fck",
  613. .prcm = {
  614. .omap2 = {
  615. .prcm_reg_id = 1,
  616. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  617. .module_offs = WKUP_MOD,
  618. .idlest_reg_id = 1,
  619. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  620. },
  621. },
  622. .class = &omap2xxx_gpio_hwmod_class,
  623. .dev_attr = &omap2xxx_gpio_dev_attr,
  624. };
  625. /* mcspi1 */
  626. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  627. .num_chipselect = 4,
  628. };
  629. struct omap_hwmod omap2xxx_mcspi1_hwmod = {
  630. .name = "mcspi1",
  631. .mpu_irqs = omap2_mcspi1_mpu_irqs,
  632. .sdma_reqs = omap2_mcspi1_sdma_reqs,
  633. .main_clk = "mcspi1_fck",
  634. .prcm = {
  635. .omap2 = {
  636. .module_offs = CORE_MOD,
  637. .prcm_reg_id = 1,
  638. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  639. .idlest_reg_id = 1,
  640. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  641. },
  642. },
  643. .class = &omap2xxx_mcspi_class,
  644. .dev_attr = &omap_mcspi1_dev_attr,
  645. };
  646. /* mcspi2 */
  647. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  648. .num_chipselect = 2,
  649. };
  650. struct omap_hwmod omap2xxx_mcspi2_hwmod = {
  651. .name = "mcspi2",
  652. .mpu_irqs = omap2_mcspi2_mpu_irqs,
  653. .sdma_reqs = omap2_mcspi2_sdma_reqs,
  654. .main_clk = "mcspi2_fck",
  655. .prcm = {
  656. .omap2 = {
  657. .module_offs = CORE_MOD,
  658. .prcm_reg_id = 1,
  659. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  660. .idlest_reg_id = 1,
  661. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  662. },
  663. },
  664. .class = &omap2xxx_mcspi_class,
  665. .dev_attr = &omap_mcspi2_dev_attr,
  666. };
  667. static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
  668. .name = "counter",
  669. };
  670. struct omap_hwmod omap2xxx_counter_32k_hwmod = {
  671. .name = "counter_32k",
  672. .main_clk = "func_32k_ck",
  673. .prcm = {
  674. .omap2 = {
  675. .module_offs = WKUP_MOD,
  676. .prcm_reg_id = 1,
  677. .module_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  678. .idlest_reg_id = 1,
  679. .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  680. },
  681. },
  682. .class = &omap2xxx_counter_hwmod_class,
  683. };
  684. /* gpmc */
  685. static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
  686. { .irq = 20 },
  687. { .irq = -1 }
  688. };
  689. struct omap_hwmod omap2xxx_gpmc_hwmod = {
  690. .name = "gpmc",
  691. .class = &omap2xxx_gpmc_hwmod_class,
  692. .mpu_irqs = omap2xxx_gpmc_irqs,
  693. .main_clk = "gpmc_fck",
  694. /*
  695. * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
  696. * block. It is not being added due to any known bugs with
  697. * resetting the GPMC IP block, but rather because any timings
  698. * set by the bootloader are not being correctly programmed by
  699. * the kernel from the board file or DT data.
  700. * HWMOD_INIT_NO_RESET should be removed ASAP.
  701. */
  702. .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
  703. HWMOD_NO_IDLEST),
  704. .prcm = {
  705. .omap2 = {
  706. .prcm_reg_id = 3,
  707. .module_bit = OMAP24XX_EN_GPMC_MASK,
  708. .module_offs = CORE_MOD,
  709. },
  710. },
  711. };
  712. /* RNG */
  713. static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
  714. .rev_offs = 0x3c,
  715. .sysc_offs = 0x40,
  716. .syss_offs = 0x44,
  717. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  718. SYSS_HAS_RESET_STATUS),
  719. .sysc_fields = &omap_hwmod_sysc_type1,
  720. };
  721. static struct omap_hwmod_class omap2_rng_hwmod_class = {
  722. .name = "rng",
  723. .sysc = &omap2_rng_sysc,
  724. };
  725. static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
  726. { .irq = 52 },
  727. { .irq = -1 }
  728. };
  729. struct omap_hwmod omap2xxx_rng_hwmod = {
  730. .name = "rng",
  731. .mpu_irqs = omap2_rng_mpu_irqs,
  732. .main_clk = "l4_ck",
  733. .prcm = {
  734. .omap2 = {
  735. .module_offs = CORE_MOD,
  736. .prcm_reg_id = 4,
  737. .module_bit = OMAP24XX_EN_RNG_SHIFT,
  738. .idlest_reg_id = 4,
  739. .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
  740. },
  741. },
  742. /*
  743. * XXX The first read from the SYSSTATUS register of the RNG
  744. * after the SYSCONFIG SOFTRESET bit is set triggers an
  745. * imprecise external abort. It's unclear why this happens.
  746. * Until this is analyzed, skip the IP block reset.
  747. */
  748. .flags = HWMOD_INIT_NO_RESET,
  749. .class = &omap2_rng_hwmod_class,
  750. };