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 <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 <linux/platform_data/spi-omap2-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. static struct omap_hwmod_irq_info omap2xxx_mpu_irqs[] = {
  193. { .name = "pmu", .irq = 3 + OMAP_INTC_START },
  194. { .irq = -1 }
  195. };
  196. struct omap_hwmod omap2xxx_mpu_hwmod = {
  197. .name = "mpu",
  198. .mpu_irqs = omap2xxx_mpu_irqs,
  199. .class = &mpu_hwmod_class,
  200. .main_clk = "mpu_ck",
  201. };
  202. /* IVA2 */
  203. struct omap_hwmod omap2xxx_iva_hwmod = {
  204. .name = "iva",
  205. .class = &iva_hwmod_class,
  206. };
  207. /* always-on timers dev attribute */
  208. static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
  209. .timer_capability = OMAP_TIMER_ALWON,
  210. };
  211. /* pwm timers dev attribute */
  212. static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
  213. .timer_capability = OMAP_TIMER_HAS_PWM,
  214. };
  215. /* timers with DSP interrupt dev attribute */
  216. static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
  217. .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
  218. };
  219. /* timer1 */
  220. struct omap_hwmod omap2xxx_timer1_hwmod = {
  221. .name = "timer1",
  222. .mpu_irqs = omap2_timer1_mpu_irqs,
  223. .main_clk = "gpt1_fck",
  224. .prcm = {
  225. .omap2 = {
  226. .prcm_reg_id = 1,
  227. .module_bit = OMAP24XX_EN_GPT1_SHIFT,
  228. .module_offs = WKUP_MOD,
  229. .idlest_reg_id = 1,
  230. .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
  231. },
  232. },
  233. .dev_attr = &capability_alwon_dev_attr,
  234. .class = &omap2xxx_timer_hwmod_class,
  235. };
  236. /* timer2 */
  237. struct omap_hwmod omap2xxx_timer2_hwmod = {
  238. .name = "timer2",
  239. .mpu_irqs = omap2_timer2_mpu_irqs,
  240. .main_clk = "gpt2_fck",
  241. .prcm = {
  242. .omap2 = {
  243. .prcm_reg_id = 1,
  244. .module_bit = OMAP24XX_EN_GPT2_SHIFT,
  245. .module_offs = CORE_MOD,
  246. .idlest_reg_id = 1,
  247. .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
  248. },
  249. },
  250. .class = &omap2xxx_timer_hwmod_class,
  251. };
  252. /* timer3 */
  253. struct omap_hwmod omap2xxx_timer3_hwmod = {
  254. .name = "timer3",
  255. .mpu_irqs = omap2_timer3_mpu_irqs,
  256. .main_clk = "gpt3_fck",
  257. .prcm = {
  258. .omap2 = {
  259. .prcm_reg_id = 1,
  260. .module_bit = OMAP24XX_EN_GPT3_SHIFT,
  261. .module_offs = CORE_MOD,
  262. .idlest_reg_id = 1,
  263. .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
  264. },
  265. },
  266. .class = &omap2xxx_timer_hwmod_class,
  267. };
  268. /* timer4 */
  269. struct omap_hwmod omap2xxx_timer4_hwmod = {
  270. .name = "timer4",
  271. .mpu_irqs = omap2_timer4_mpu_irqs,
  272. .main_clk = "gpt4_fck",
  273. .prcm = {
  274. .omap2 = {
  275. .prcm_reg_id = 1,
  276. .module_bit = OMAP24XX_EN_GPT4_SHIFT,
  277. .module_offs = CORE_MOD,
  278. .idlest_reg_id = 1,
  279. .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
  280. },
  281. },
  282. .class = &omap2xxx_timer_hwmod_class,
  283. };
  284. /* timer5 */
  285. struct omap_hwmod omap2xxx_timer5_hwmod = {
  286. .name = "timer5",
  287. .mpu_irqs = omap2_timer5_mpu_irqs,
  288. .main_clk = "gpt5_fck",
  289. .prcm = {
  290. .omap2 = {
  291. .prcm_reg_id = 1,
  292. .module_bit = OMAP24XX_EN_GPT5_SHIFT,
  293. .module_offs = CORE_MOD,
  294. .idlest_reg_id = 1,
  295. .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
  296. },
  297. },
  298. .dev_attr = &capability_dsp_dev_attr,
  299. .class = &omap2xxx_timer_hwmod_class,
  300. };
  301. /* timer6 */
  302. struct omap_hwmod omap2xxx_timer6_hwmod = {
  303. .name = "timer6",
  304. .mpu_irqs = omap2_timer6_mpu_irqs,
  305. .main_clk = "gpt6_fck",
  306. .prcm = {
  307. .omap2 = {
  308. .prcm_reg_id = 1,
  309. .module_bit = OMAP24XX_EN_GPT6_SHIFT,
  310. .module_offs = CORE_MOD,
  311. .idlest_reg_id = 1,
  312. .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
  313. },
  314. },
  315. .dev_attr = &capability_dsp_dev_attr,
  316. .class = &omap2xxx_timer_hwmod_class,
  317. };
  318. /* timer7 */
  319. struct omap_hwmod omap2xxx_timer7_hwmod = {
  320. .name = "timer7",
  321. .mpu_irqs = omap2_timer7_mpu_irqs,
  322. .main_clk = "gpt7_fck",
  323. .prcm = {
  324. .omap2 = {
  325. .prcm_reg_id = 1,
  326. .module_bit = OMAP24XX_EN_GPT7_SHIFT,
  327. .module_offs = CORE_MOD,
  328. .idlest_reg_id = 1,
  329. .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
  330. },
  331. },
  332. .dev_attr = &capability_dsp_dev_attr,
  333. .class = &omap2xxx_timer_hwmod_class,
  334. };
  335. /* timer8 */
  336. struct omap_hwmod omap2xxx_timer8_hwmod = {
  337. .name = "timer8",
  338. .mpu_irqs = omap2_timer8_mpu_irqs,
  339. .main_clk = "gpt8_fck",
  340. .prcm = {
  341. .omap2 = {
  342. .prcm_reg_id = 1,
  343. .module_bit = OMAP24XX_EN_GPT8_SHIFT,
  344. .module_offs = CORE_MOD,
  345. .idlest_reg_id = 1,
  346. .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
  347. },
  348. },
  349. .dev_attr = &capability_dsp_dev_attr,
  350. .class = &omap2xxx_timer_hwmod_class,
  351. };
  352. /* timer9 */
  353. struct omap_hwmod omap2xxx_timer9_hwmod = {
  354. .name = "timer9",
  355. .mpu_irqs = omap2_timer9_mpu_irqs,
  356. .main_clk = "gpt9_fck",
  357. .prcm = {
  358. .omap2 = {
  359. .prcm_reg_id = 1,
  360. .module_bit = OMAP24XX_EN_GPT9_SHIFT,
  361. .module_offs = CORE_MOD,
  362. .idlest_reg_id = 1,
  363. .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
  364. },
  365. },
  366. .dev_attr = &capability_pwm_dev_attr,
  367. .class = &omap2xxx_timer_hwmod_class,
  368. };
  369. /* timer10 */
  370. struct omap_hwmod omap2xxx_timer10_hwmod = {
  371. .name = "timer10",
  372. .mpu_irqs = omap2_timer10_mpu_irqs,
  373. .main_clk = "gpt10_fck",
  374. .prcm = {
  375. .omap2 = {
  376. .prcm_reg_id = 1,
  377. .module_bit = OMAP24XX_EN_GPT10_SHIFT,
  378. .module_offs = CORE_MOD,
  379. .idlest_reg_id = 1,
  380. .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
  381. },
  382. },
  383. .dev_attr = &capability_pwm_dev_attr,
  384. .class = &omap2xxx_timer_hwmod_class,
  385. };
  386. /* timer11 */
  387. struct omap_hwmod omap2xxx_timer11_hwmod = {
  388. .name = "timer11",
  389. .mpu_irqs = omap2_timer11_mpu_irqs,
  390. .main_clk = "gpt11_fck",
  391. .prcm = {
  392. .omap2 = {
  393. .prcm_reg_id = 1,
  394. .module_bit = OMAP24XX_EN_GPT11_SHIFT,
  395. .module_offs = CORE_MOD,
  396. .idlest_reg_id = 1,
  397. .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
  398. },
  399. },
  400. .dev_attr = &capability_pwm_dev_attr,
  401. .class = &omap2xxx_timer_hwmod_class,
  402. };
  403. /* timer12 */
  404. struct omap_hwmod omap2xxx_timer12_hwmod = {
  405. .name = "timer12",
  406. .mpu_irqs = omap2xxx_timer12_mpu_irqs,
  407. .main_clk = "gpt12_fck",
  408. .prcm = {
  409. .omap2 = {
  410. .prcm_reg_id = 1,
  411. .module_bit = OMAP24XX_EN_GPT12_SHIFT,
  412. .module_offs = CORE_MOD,
  413. .idlest_reg_id = 1,
  414. .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
  415. },
  416. },
  417. .dev_attr = &capability_pwm_dev_attr,
  418. .class = &omap2xxx_timer_hwmod_class,
  419. };
  420. /* wd_timer2 */
  421. struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
  422. .name = "wd_timer2",
  423. .class = &omap2xxx_wd_timer_hwmod_class,
  424. .main_clk = "mpu_wdt_fck",
  425. .prcm = {
  426. .omap2 = {
  427. .prcm_reg_id = 1,
  428. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  429. .module_offs = WKUP_MOD,
  430. .idlest_reg_id = 1,
  431. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  432. },
  433. },
  434. };
  435. /* UART1 */
  436. struct omap_hwmod omap2xxx_uart1_hwmod = {
  437. .name = "uart1",
  438. .mpu_irqs = omap2_uart1_mpu_irqs,
  439. .sdma_reqs = omap2_uart1_sdma_reqs,
  440. .main_clk = "uart1_fck",
  441. .prcm = {
  442. .omap2 = {
  443. .module_offs = CORE_MOD,
  444. .prcm_reg_id = 1,
  445. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  446. .idlest_reg_id = 1,
  447. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  448. },
  449. },
  450. .class = &omap2_uart_class,
  451. };
  452. /* UART2 */
  453. struct omap_hwmod omap2xxx_uart2_hwmod = {
  454. .name = "uart2",
  455. .mpu_irqs = omap2_uart2_mpu_irqs,
  456. .sdma_reqs = omap2_uart2_sdma_reqs,
  457. .main_clk = "uart2_fck",
  458. .prcm = {
  459. .omap2 = {
  460. .module_offs = CORE_MOD,
  461. .prcm_reg_id = 1,
  462. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  463. .idlest_reg_id = 1,
  464. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  465. },
  466. },
  467. .class = &omap2_uart_class,
  468. };
  469. /* UART3 */
  470. struct omap_hwmod omap2xxx_uart3_hwmod = {
  471. .name = "uart3",
  472. .mpu_irqs = omap2_uart3_mpu_irqs,
  473. .sdma_reqs = omap2_uart3_sdma_reqs,
  474. .main_clk = "uart3_fck",
  475. .prcm = {
  476. .omap2 = {
  477. .module_offs = CORE_MOD,
  478. .prcm_reg_id = 2,
  479. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  480. .idlest_reg_id = 2,
  481. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  482. },
  483. },
  484. .class = &omap2_uart_class,
  485. };
  486. /* dss */
  487. static struct omap_hwmod_opt_clk dss_opt_clks[] = {
  488. /*
  489. * The DSS HW needs all DSS clocks enabled during reset. The dss_core
  490. * driver does not use these clocks.
  491. */
  492. { .role = "tv_clk", .clk = "dss_54m_fck" },
  493. { .role = "sys_clk", .clk = "dss2_fck" },
  494. };
  495. struct omap_hwmod omap2xxx_dss_core_hwmod = {
  496. .name = "dss_core",
  497. .class = &omap2_dss_hwmod_class,
  498. .main_clk = "dss1_fck", /* instead of dss_fck */
  499. .sdma_reqs = omap2xxx_dss_sdma_chs,
  500. .prcm = {
  501. .omap2 = {
  502. .prcm_reg_id = 1,
  503. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  504. .module_offs = CORE_MOD,
  505. .idlest_reg_id = 1,
  506. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  507. },
  508. },
  509. .opt_clks = dss_opt_clks,
  510. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  511. .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  512. };
  513. struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
  514. .name = "dss_dispc",
  515. .class = &omap2_dispc_hwmod_class,
  516. .mpu_irqs = omap2_dispc_irqs,
  517. .main_clk = "dss1_fck",
  518. .prcm = {
  519. .omap2 = {
  520. .prcm_reg_id = 1,
  521. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  522. .module_offs = CORE_MOD,
  523. .idlest_reg_id = 1,
  524. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  525. },
  526. },
  527. .flags = HWMOD_NO_IDLEST,
  528. .dev_attr = &omap2_3_dss_dispc_dev_attr
  529. };
  530. static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
  531. { .role = "ick", .clk = "dss_ick" },
  532. };
  533. struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
  534. .name = "dss_rfbi",
  535. .class = &omap2_rfbi_hwmod_class,
  536. .main_clk = "dss1_fck",
  537. .prcm = {
  538. .omap2 = {
  539. .prcm_reg_id = 1,
  540. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  541. .module_offs = CORE_MOD,
  542. },
  543. },
  544. .opt_clks = dss_rfbi_opt_clks,
  545. .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
  546. .flags = HWMOD_NO_IDLEST,
  547. };
  548. struct omap_hwmod omap2xxx_dss_venc_hwmod = {
  549. .name = "dss_venc",
  550. .class = &omap2_venc_hwmod_class,
  551. .main_clk = "dss_54m_fck",
  552. .prcm = {
  553. .omap2 = {
  554. .prcm_reg_id = 1,
  555. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  556. .module_offs = CORE_MOD,
  557. },
  558. },
  559. .flags = HWMOD_NO_IDLEST,
  560. };
  561. /* gpio dev_attr */
  562. struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
  563. .bank_width = 32,
  564. .dbck_flag = false,
  565. };
  566. /* gpio1 */
  567. struct omap_hwmod omap2xxx_gpio1_hwmod = {
  568. .name = "gpio1",
  569. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  570. .mpu_irqs = omap2_gpio1_irqs,
  571. .main_clk = "gpios_fck",
  572. .prcm = {
  573. .omap2 = {
  574. .prcm_reg_id = 1,
  575. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  576. .module_offs = WKUP_MOD,
  577. .idlest_reg_id = 1,
  578. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  579. },
  580. },
  581. .class = &omap2xxx_gpio_hwmod_class,
  582. .dev_attr = &omap2xxx_gpio_dev_attr,
  583. };
  584. /* gpio2 */
  585. struct omap_hwmod omap2xxx_gpio2_hwmod = {
  586. .name = "gpio2",
  587. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  588. .mpu_irqs = omap2_gpio2_irqs,
  589. .main_clk = "gpios_fck",
  590. .prcm = {
  591. .omap2 = {
  592. .prcm_reg_id = 1,
  593. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  594. .module_offs = WKUP_MOD,
  595. .idlest_reg_id = 1,
  596. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  597. },
  598. },
  599. .class = &omap2xxx_gpio_hwmod_class,
  600. .dev_attr = &omap2xxx_gpio_dev_attr,
  601. };
  602. /* gpio3 */
  603. struct omap_hwmod omap2xxx_gpio3_hwmod = {
  604. .name = "gpio3",
  605. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  606. .mpu_irqs = omap2_gpio3_irqs,
  607. .main_clk = "gpios_fck",
  608. .prcm = {
  609. .omap2 = {
  610. .prcm_reg_id = 1,
  611. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  612. .module_offs = WKUP_MOD,
  613. .idlest_reg_id = 1,
  614. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  615. },
  616. },
  617. .class = &omap2xxx_gpio_hwmod_class,
  618. .dev_attr = &omap2xxx_gpio_dev_attr,
  619. };
  620. /* gpio4 */
  621. struct omap_hwmod omap2xxx_gpio4_hwmod = {
  622. .name = "gpio4",
  623. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  624. .mpu_irqs = omap2_gpio4_irqs,
  625. .main_clk = "gpios_fck",
  626. .prcm = {
  627. .omap2 = {
  628. .prcm_reg_id = 1,
  629. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  630. .module_offs = WKUP_MOD,
  631. .idlest_reg_id = 1,
  632. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  633. },
  634. },
  635. .class = &omap2xxx_gpio_hwmod_class,
  636. .dev_attr = &omap2xxx_gpio_dev_attr,
  637. };
  638. /* mcspi1 */
  639. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  640. .num_chipselect = 4,
  641. };
  642. struct omap_hwmod omap2xxx_mcspi1_hwmod = {
  643. .name = "mcspi1",
  644. .mpu_irqs = omap2_mcspi1_mpu_irqs,
  645. .sdma_reqs = omap2_mcspi1_sdma_reqs,
  646. .main_clk = "mcspi1_fck",
  647. .prcm = {
  648. .omap2 = {
  649. .module_offs = CORE_MOD,
  650. .prcm_reg_id = 1,
  651. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  652. .idlest_reg_id = 1,
  653. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  654. },
  655. },
  656. .class = &omap2xxx_mcspi_class,
  657. .dev_attr = &omap_mcspi1_dev_attr,
  658. };
  659. /* mcspi2 */
  660. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  661. .num_chipselect = 2,
  662. };
  663. struct omap_hwmod omap2xxx_mcspi2_hwmod = {
  664. .name = "mcspi2",
  665. .mpu_irqs = omap2_mcspi2_mpu_irqs,
  666. .sdma_reqs = omap2_mcspi2_sdma_reqs,
  667. .main_clk = "mcspi2_fck",
  668. .prcm = {
  669. .omap2 = {
  670. .module_offs = CORE_MOD,
  671. .prcm_reg_id = 1,
  672. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  673. .idlest_reg_id = 1,
  674. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  675. },
  676. },
  677. .class = &omap2xxx_mcspi_class,
  678. .dev_attr = &omap_mcspi2_dev_attr,
  679. };
  680. static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
  681. .name = "counter",
  682. };
  683. struct omap_hwmod omap2xxx_counter_32k_hwmod = {
  684. .name = "counter_32k",
  685. .main_clk = "func_32k_ck",
  686. .prcm = {
  687. .omap2 = {
  688. .module_offs = WKUP_MOD,
  689. .prcm_reg_id = 1,
  690. .module_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  691. .idlest_reg_id = 1,
  692. .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  693. },
  694. },
  695. .class = &omap2xxx_counter_hwmod_class,
  696. };
  697. /* gpmc */
  698. static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
  699. { .irq = 20 },
  700. { .irq = -1 }
  701. };
  702. struct omap_hwmod omap2xxx_gpmc_hwmod = {
  703. .name = "gpmc",
  704. .class = &omap2xxx_gpmc_hwmod_class,
  705. .mpu_irqs = omap2xxx_gpmc_irqs,
  706. .main_clk = "gpmc_fck",
  707. /*
  708. * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
  709. * block. It is not being added due to any known bugs with
  710. * resetting the GPMC IP block, but rather because any timings
  711. * set by the bootloader are not being correctly programmed by
  712. * the kernel from the board file or DT data.
  713. * HWMOD_INIT_NO_RESET should be removed ASAP.
  714. */
  715. .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
  716. HWMOD_NO_IDLEST),
  717. .prcm = {
  718. .omap2 = {
  719. .prcm_reg_id = 3,
  720. .module_bit = OMAP24XX_EN_GPMC_MASK,
  721. .module_offs = CORE_MOD,
  722. },
  723. },
  724. };
  725. /* RNG */
  726. static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
  727. .rev_offs = 0x3c,
  728. .sysc_offs = 0x40,
  729. .syss_offs = 0x44,
  730. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  731. SYSS_HAS_RESET_STATUS),
  732. .sysc_fields = &omap_hwmod_sysc_type1,
  733. };
  734. static struct omap_hwmod_class omap2_rng_hwmod_class = {
  735. .name = "rng",
  736. .sysc = &omap2_rng_sysc,
  737. };
  738. static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
  739. { .irq = 52 },
  740. { .irq = -1 }
  741. };
  742. struct omap_hwmod omap2xxx_rng_hwmod = {
  743. .name = "rng",
  744. .mpu_irqs = omap2_rng_mpu_irqs,
  745. .main_clk = "l4_ck",
  746. .prcm = {
  747. .omap2 = {
  748. .module_offs = CORE_MOD,
  749. .prcm_reg_id = 4,
  750. .module_bit = OMAP24XX_EN_RNG_SHIFT,
  751. .idlest_reg_id = 4,
  752. .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
  753. },
  754. },
  755. /*
  756. * XXX The first read from the SYSSTATUS register of the RNG
  757. * after the SYSCONFIG SOFTRESET bit is set triggers an
  758. * imprecise external abort. It's unclear why this happens.
  759. * Until this is analyzed, skip the IP block reset.
  760. */
  761. .flags = HWMOD_INIT_NO_RESET,
  762. .class = &omap2_rng_hwmod_class,
  763. };