omap_hwmod_2xxx_ipblock_data.c 20 KB

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