omap_hwmod_2xxx_ipblock_data.c 22 KB

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