omap_hwmod_2420_data.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. /*
  2. * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
  3. *
  4. * Copyright (C) 2009-2010 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. * XXX handle crossbar/shared link difference for L3?
  12. * XXX these should be marked initdata for multi-OMAP kernels
  13. */
  14. #include <plat/omap_hwmod.h>
  15. #include <mach/irqs.h>
  16. #include <plat/cpu.h>
  17. #include <plat/dma.h>
  18. #include <plat/serial.h>
  19. #include <plat/i2c.h>
  20. #include <plat/gpio.h>
  21. #include "omap_hwmod_common_data.h"
  22. #include "cm-regbits-24xx.h"
  23. #include "prm-regbits-24xx.h"
  24. /*
  25. * OMAP2420 hardware module integration data
  26. *
  27. * ALl of the data in this section should be autogeneratable from the
  28. * TI hardware database or other technical documentation. Data that
  29. * is driver-specific or driver-kernel integration-specific belongs
  30. * elsewhere.
  31. */
  32. static struct omap_hwmod omap2420_mpu_hwmod;
  33. static struct omap_hwmod omap2420_iva_hwmod;
  34. static struct omap_hwmod omap2420_l3_main_hwmod;
  35. static struct omap_hwmod omap2420_l4_core_hwmod;
  36. static struct omap_hwmod omap2420_wd_timer2_hwmod;
  37. static struct omap_hwmod omap2420_gpio1_hwmod;
  38. static struct omap_hwmod omap2420_gpio2_hwmod;
  39. static struct omap_hwmod omap2420_gpio3_hwmod;
  40. static struct omap_hwmod omap2420_gpio4_hwmod;
  41. /* L3 -> L4_CORE interface */
  42. static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
  43. .master = &omap2420_l3_main_hwmod,
  44. .slave = &omap2420_l4_core_hwmod,
  45. .user = OCP_USER_MPU | OCP_USER_SDMA,
  46. };
  47. /* MPU -> L3 interface */
  48. static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
  49. .master = &omap2420_mpu_hwmod,
  50. .slave = &omap2420_l3_main_hwmod,
  51. .user = OCP_USER_MPU,
  52. };
  53. /* Slave interfaces on the L3 interconnect */
  54. static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
  55. &omap2420_mpu__l3_main,
  56. };
  57. /* Master interfaces on the L3 interconnect */
  58. static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
  59. &omap2420_l3_main__l4_core,
  60. };
  61. /* L3 */
  62. static struct omap_hwmod omap2420_l3_main_hwmod = {
  63. .name = "l3_main",
  64. .class = &l3_hwmod_class,
  65. .masters = omap2420_l3_main_masters,
  66. .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
  67. .slaves = omap2420_l3_main_slaves,
  68. .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
  69. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  70. .flags = HWMOD_NO_IDLEST,
  71. };
  72. static struct omap_hwmod omap2420_l4_wkup_hwmod;
  73. static struct omap_hwmod omap2420_uart1_hwmod;
  74. static struct omap_hwmod omap2420_uart2_hwmod;
  75. static struct omap_hwmod omap2420_uart3_hwmod;
  76. static struct omap_hwmod omap2420_i2c1_hwmod;
  77. static struct omap_hwmod omap2420_i2c2_hwmod;
  78. /* L4_CORE -> L4_WKUP interface */
  79. static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
  80. .master = &omap2420_l4_core_hwmod,
  81. .slave = &omap2420_l4_wkup_hwmod,
  82. .user = OCP_USER_MPU | OCP_USER_SDMA,
  83. };
  84. /* L4 CORE -> UART1 interface */
  85. static struct omap_hwmod_addr_space omap2420_uart1_addr_space[] = {
  86. {
  87. .pa_start = OMAP2_UART1_BASE,
  88. .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
  89. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  90. },
  91. };
  92. static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
  93. .master = &omap2420_l4_core_hwmod,
  94. .slave = &omap2420_uart1_hwmod,
  95. .clk = "uart1_ick",
  96. .addr = omap2420_uart1_addr_space,
  97. .addr_cnt = ARRAY_SIZE(omap2420_uart1_addr_space),
  98. .user = OCP_USER_MPU | OCP_USER_SDMA,
  99. };
  100. /* L4 CORE -> UART2 interface */
  101. static struct omap_hwmod_addr_space omap2420_uart2_addr_space[] = {
  102. {
  103. .pa_start = OMAP2_UART2_BASE,
  104. .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
  105. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  106. },
  107. };
  108. static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
  109. .master = &omap2420_l4_core_hwmod,
  110. .slave = &omap2420_uart2_hwmod,
  111. .clk = "uart2_ick",
  112. .addr = omap2420_uart2_addr_space,
  113. .addr_cnt = ARRAY_SIZE(omap2420_uart2_addr_space),
  114. .user = OCP_USER_MPU | OCP_USER_SDMA,
  115. };
  116. /* L4 PER -> UART3 interface */
  117. static struct omap_hwmod_addr_space omap2420_uart3_addr_space[] = {
  118. {
  119. .pa_start = OMAP2_UART3_BASE,
  120. .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
  121. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  122. },
  123. };
  124. static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
  125. .master = &omap2420_l4_core_hwmod,
  126. .slave = &omap2420_uart3_hwmod,
  127. .clk = "uart3_ick",
  128. .addr = omap2420_uart3_addr_space,
  129. .addr_cnt = ARRAY_SIZE(omap2420_uart3_addr_space),
  130. .user = OCP_USER_MPU | OCP_USER_SDMA,
  131. };
  132. /* I2C IP block address space length (in bytes) */
  133. #define OMAP2_I2C_AS_LEN 128
  134. /* L4 CORE -> I2C1 interface */
  135. static struct omap_hwmod_addr_space omap2420_i2c1_addr_space[] = {
  136. {
  137. .pa_start = 0x48070000,
  138. .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
  139. .flags = ADDR_TYPE_RT,
  140. },
  141. };
  142. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
  143. .master = &omap2420_l4_core_hwmod,
  144. .slave = &omap2420_i2c1_hwmod,
  145. .clk = "i2c1_ick",
  146. .addr = omap2420_i2c1_addr_space,
  147. .addr_cnt = ARRAY_SIZE(omap2420_i2c1_addr_space),
  148. .user = OCP_USER_MPU | OCP_USER_SDMA,
  149. };
  150. /* L4 CORE -> I2C2 interface */
  151. static struct omap_hwmod_addr_space omap2420_i2c2_addr_space[] = {
  152. {
  153. .pa_start = 0x48072000,
  154. .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
  155. .flags = ADDR_TYPE_RT,
  156. },
  157. };
  158. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
  159. .master = &omap2420_l4_core_hwmod,
  160. .slave = &omap2420_i2c2_hwmod,
  161. .clk = "i2c2_ick",
  162. .addr = omap2420_i2c2_addr_space,
  163. .addr_cnt = ARRAY_SIZE(omap2420_i2c2_addr_space),
  164. .user = OCP_USER_MPU | OCP_USER_SDMA,
  165. };
  166. /* Slave interfaces on the L4_CORE interconnect */
  167. static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
  168. &omap2420_l3_main__l4_core,
  169. };
  170. /* Master interfaces on the L4_CORE interconnect */
  171. static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
  172. &omap2420_l4_core__l4_wkup,
  173. &omap2_l4_core__uart1,
  174. &omap2_l4_core__uart2,
  175. &omap2_l4_core__uart3,
  176. &omap2420_l4_core__i2c1,
  177. &omap2420_l4_core__i2c2
  178. };
  179. /* L4 CORE */
  180. static struct omap_hwmod omap2420_l4_core_hwmod = {
  181. .name = "l4_core",
  182. .class = &l4_hwmod_class,
  183. .masters = omap2420_l4_core_masters,
  184. .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
  185. .slaves = omap2420_l4_core_slaves,
  186. .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
  187. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  188. .flags = HWMOD_NO_IDLEST,
  189. };
  190. /* Slave interfaces on the L4_WKUP interconnect */
  191. static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
  192. &omap2420_l4_core__l4_wkup,
  193. };
  194. /* Master interfaces on the L4_WKUP interconnect */
  195. static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
  196. };
  197. /* L4 WKUP */
  198. static struct omap_hwmod omap2420_l4_wkup_hwmod = {
  199. .name = "l4_wkup",
  200. .class = &l4_hwmod_class,
  201. .masters = omap2420_l4_wkup_masters,
  202. .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
  203. .slaves = omap2420_l4_wkup_slaves,
  204. .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
  205. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  206. .flags = HWMOD_NO_IDLEST,
  207. };
  208. /* Master interfaces on the MPU device */
  209. static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
  210. &omap2420_mpu__l3_main,
  211. };
  212. /* MPU */
  213. static struct omap_hwmod omap2420_mpu_hwmod = {
  214. .name = "mpu",
  215. .class = &mpu_hwmod_class,
  216. .main_clk = "mpu_ck",
  217. .masters = omap2420_mpu_masters,
  218. .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
  219. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  220. };
  221. /*
  222. * IVA1 interface data
  223. */
  224. /* IVA <- L3 interface */
  225. static struct omap_hwmod_ocp_if omap2420_l3__iva = {
  226. .master = &omap2420_l3_main_hwmod,
  227. .slave = &omap2420_iva_hwmod,
  228. .clk = "iva1_ifck",
  229. .user = OCP_USER_MPU | OCP_USER_SDMA,
  230. };
  231. static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = {
  232. &omap2420_l3__iva,
  233. };
  234. /*
  235. * IVA2 (IVA2)
  236. */
  237. static struct omap_hwmod omap2420_iva_hwmod = {
  238. .name = "iva",
  239. .class = &iva_hwmod_class,
  240. .masters = omap2420_iva_masters,
  241. .masters_cnt = ARRAY_SIZE(omap2420_iva_masters),
  242. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
  243. };
  244. /* l4_wkup -> wd_timer2 */
  245. static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
  246. {
  247. .pa_start = 0x48022000,
  248. .pa_end = 0x4802207f,
  249. .flags = ADDR_TYPE_RT
  250. },
  251. };
  252. static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
  253. .master = &omap2420_l4_wkup_hwmod,
  254. .slave = &omap2420_wd_timer2_hwmod,
  255. .clk = "mpu_wdt_ick",
  256. .addr = omap2420_wd_timer2_addrs,
  257. .addr_cnt = ARRAY_SIZE(omap2420_wd_timer2_addrs),
  258. .user = OCP_USER_MPU | OCP_USER_SDMA,
  259. };
  260. /*
  261. * 'wd_timer' class
  262. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  263. * overflow condition
  264. */
  265. static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
  266. .rev_offs = 0x0000,
  267. .sysc_offs = 0x0010,
  268. .syss_offs = 0x0014,
  269. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  270. SYSC_HAS_AUTOIDLE),
  271. .sysc_fields = &omap_hwmod_sysc_type1,
  272. };
  273. static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
  274. .name = "wd_timer",
  275. .sysc = &omap2420_wd_timer_sysc,
  276. };
  277. /* wd_timer2 */
  278. static struct omap_hwmod_ocp_if *omap2420_wd_timer2_slaves[] = {
  279. &omap2420_l4_wkup__wd_timer2,
  280. };
  281. static struct omap_hwmod omap2420_wd_timer2_hwmod = {
  282. .name = "wd_timer2",
  283. .class = &omap2420_wd_timer_hwmod_class,
  284. .main_clk = "mpu_wdt_fck",
  285. .prcm = {
  286. .omap2 = {
  287. .prcm_reg_id = 1,
  288. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  289. .module_offs = WKUP_MOD,
  290. .idlest_reg_id = 1,
  291. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  292. },
  293. },
  294. .slaves = omap2420_wd_timer2_slaves,
  295. .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves),
  296. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  297. };
  298. /* UART */
  299. static struct omap_hwmod_class_sysconfig uart_sysc = {
  300. .rev_offs = 0x50,
  301. .sysc_offs = 0x54,
  302. .syss_offs = 0x58,
  303. .sysc_flags = (SYSC_HAS_SIDLEMODE |
  304. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  305. SYSC_HAS_AUTOIDLE),
  306. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  307. .sysc_fields = &omap_hwmod_sysc_type1,
  308. };
  309. static struct omap_hwmod_class uart_class = {
  310. .name = "uart",
  311. .sysc = &uart_sysc,
  312. };
  313. /* UART1 */
  314. static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
  315. { .irq = INT_24XX_UART1_IRQ, },
  316. };
  317. static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
  318. { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
  319. { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
  320. };
  321. static struct omap_hwmod_ocp_if *omap2420_uart1_slaves[] = {
  322. &omap2_l4_core__uart1,
  323. };
  324. static struct omap_hwmod omap2420_uart1_hwmod = {
  325. .name = "uart1",
  326. .mpu_irqs = uart1_mpu_irqs,
  327. .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
  328. .sdma_reqs = uart1_sdma_reqs,
  329. .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
  330. .main_clk = "uart1_fck",
  331. .prcm = {
  332. .omap2 = {
  333. .module_offs = CORE_MOD,
  334. .prcm_reg_id = 1,
  335. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  336. .idlest_reg_id = 1,
  337. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  338. },
  339. },
  340. .slaves = omap2420_uart1_slaves,
  341. .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
  342. .class = &uart_class,
  343. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  344. };
  345. /* UART2 */
  346. static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
  347. { .irq = INT_24XX_UART2_IRQ, },
  348. };
  349. static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
  350. { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
  351. { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
  352. };
  353. static struct omap_hwmod_ocp_if *omap2420_uart2_slaves[] = {
  354. &omap2_l4_core__uart2,
  355. };
  356. static struct omap_hwmod omap2420_uart2_hwmod = {
  357. .name = "uart2",
  358. .mpu_irqs = uart2_mpu_irqs,
  359. .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
  360. .sdma_reqs = uart2_sdma_reqs,
  361. .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
  362. .main_clk = "uart2_fck",
  363. .prcm = {
  364. .omap2 = {
  365. .module_offs = CORE_MOD,
  366. .prcm_reg_id = 1,
  367. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  368. .idlest_reg_id = 1,
  369. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  370. },
  371. },
  372. .slaves = omap2420_uart2_slaves,
  373. .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
  374. .class = &uart_class,
  375. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  376. };
  377. /* UART3 */
  378. static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
  379. { .irq = INT_24XX_UART3_IRQ, },
  380. };
  381. static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
  382. { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
  383. { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
  384. };
  385. static struct omap_hwmod_ocp_if *omap2420_uart3_slaves[] = {
  386. &omap2_l4_core__uart3,
  387. };
  388. static struct omap_hwmod omap2420_uart3_hwmod = {
  389. .name = "uart3",
  390. .mpu_irqs = uart3_mpu_irqs,
  391. .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
  392. .sdma_reqs = uart3_sdma_reqs,
  393. .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
  394. .main_clk = "uart3_fck",
  395. .prcm = {
  396. .omap2 = {
  397. .module_offs = CORE_MOD,
  398. .prcm_reg_id = 2,
  399. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  400. .idlest_reg_id = 2,
  401. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  402. },
  403. },
  404. .slaves = omap2420_uart3_slaves,
  405. .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
  406. .class = &uart_class,
  407. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  408. };
  409. /* I2C common */
  410. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  411. .rev_offs = 0x00,
  412. .sysc_offs = 0x20,
  413. .syss_offs = 0x10,
  414. .sysc_flags = SYSC_HAS_SOFTRESET,
  415. .sysc_fields = &omap_hwmod_sysc_type1,
  416. };
  417. static struct omap_hwmod_class i2c_class = {
  418. .name = "i2c",
  419. .sysc = &i2c_sysc,
  420. };
  421. static struct omap_i2c_dev_attr i2c_dev_attr;
  422. /* I2C1 */
  423. static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
  424. { .irq = INT_24XX_I2C1_IRQ, },
  425. };
  426. static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
  427. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
  428. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
  429. };
  430. static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = {
  431. &omap2420_l4_core__i2c1,
  432. };
  433. static struct omap_hwmod omap2420_i2c1_hwmod = {
  434. .name = "i2c1",
  435. .mpu_irqs = i2c1_mpu_irqs,
  436. .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
  437. .sdma_reqs = i2c1_sdma_reqs,
  438. .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
  439. .main_clk = "i2c1_fck",
  440. .prcm = {
  441. .omap2 = {
  442. .module_offs = CORE_MOD,
  443. .prcm_reg_id = 1,
  444. .module_bit = OMAP2420_EN_I2C1_SHIFT,
  445. .idlest_reg_id = 1,
  446. .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
  447. },
  448. },
  449. .slaves = omap2420_i2c1_slaves,
  450. .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
  451. .class = &i2c_class,
  452. .dev_attr = &i2c_dev_attr,
  453. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  454. .flags = HWMOD_16BIT_REG,
  455. };
  456. /* I2C2 */
  457. static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
  458. { .irq = INT_24XX_I2C2_IRQ, },
  459. };
  460. static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
  461. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
  462. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
  463. };
  464. static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = {
  465. &omap2420_l4_core__i2c2,
  466. };
  467. static struct omap_hwmod omap2420_i2c2_hwmod = {
  468. .name = "i2c2",
  469. .mpu_irqs = i2c2_mpu_irqs,
  470. .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
  471. .sdma_reqs = i2c2_sdma_reqs,
  472. .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
  473. .main_clk = "i2c2_fck",
  474. .prcm = {
  475. .omap2 = {
  476. .module_offs = CORE_MOD,
  477. .prcm_reg_id = 1,
  478. .module_bit = OMAP2420_EN_I2C2_SHIFT,
  479. .idlest_reg_id = 1,
  480. .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
  481. },
  482. },
  483. .slaves = omap2420_i2c2_slaves,
  484. .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves),
  485. .class = &i2c_class,
  486. .dev_attr = &i2c_dev_attr,
  487. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  488. .flags = HWMOD_16BIT_REG,
  489. };
  490. /* l4_wkup -> gpio1 */
  491. static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
  492. {
  493. .pa_start = 0x48018000,
  494. .pa_end = 0x480181ff,
  495. .flags = ADDR_TYPE_RT
  496. },
  497. };
  498. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
  499. .master = &omap2420_l4_wkup_hwmod,
  500. .slave = &omap2420_gpio1_hwmod,
  501. .clk = "gpios_ick",
  502. .addr = omap2420_gpio1_addr_space,
  503. .addr_cnt = ARRAY_SIZE(omap2420_gpio1_addr_space),
  504. .user = OCP_USER_MPU | OCP_USER_SDMA,
  505. };
  506. /* l4_wkup -> gpio2 */
  507. static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
  508. {
  509. .pa_start = 0x4801a000,
  510. .pa_end = 0x4801a1ff,
  511. .flags = ADDR_TYPE_RT
  512. },
  513. };
  514. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
  515. .master = &omap2420_l4_wkup_hwmod,
  516. .slave = &omap2420_gpio2_hwmod,
  517. .clk = "gpios_ick",
  518. .addr = omap2420_gpio2_addr_space,
  519. .addr_cnt = ARRAY_SIZE(omap2420_gpio2_addr_space),
  520. .user = OCP_USER_MPU | OCP_USER_SDMA,
  521. };
  522. /* l4_wkup -> gpio3 */
  523. static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
  524. {
  525. .pa_start = 0x4801c000,
  526. .pa_end = 0x4801c1ff,
  527. .flags = ADDR_TYPE_RT
  528. },
  529. };
  530. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
  531. .master = &omap2420_l4_wkup_hwmod,
  532. .slave = &omap2420_gpio3_hwmod,
  533. .clk = "gpios_ick",
  534. .addr = omap2420_gpio3_addr_space,
  535. .addr_cnt = ARRAY_SIZE(omap2420_gpio3_addr_space),
  536. .user = OCP_USER_MPU | OCP_USER_SDMA,
  537. };
  538. /* l4_wkup -> gpio4 */
  539. static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
  540. {
  541. .pa_start = 0x4801e000,
  542. .pa_end = 0x4801e1ff,
  543. .flags = ADDR_TYPE_RT
  544. },
  545. };
  546. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
  547. .master = &omap2420_l4_wkup_hwmod,
  548. .slave = &omap2420_gpio4_hwmod,
  549. .clk = "gpios_ick",
  550. .addr = omap2420_gpio4_addr_space,
  551. .addr_cnt = ARRAY_SIZE(omap2420_gpio4_addr_space),
  552. .user = OCP_USER_MPU | OCP_USER_SDMA,
  553. };
  554. /* gpio dev_attr */
  555. static struct omap_gpio_dev_attr gpio_dev_attr = {
  556. .bank_width = 32,
  557. .dbck_flag = false,
  558. };
  559. static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
  560. .rev_offs = 0x0000,
  561. .sysc_offs = 0x0010,
  562. .syss_offs = 0x0014,
  563. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  564. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  565. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  566. .sysc_fields = &omap_hwmod_sysc_type1,
  567. };
  568. /*
  569. * 'gpio' class
  570. * general purpose io module
  571. */
  572. static struct omap_hwmod_class omap242x_gpio_hwmod_class = {
  573. .name = "gpio",
  574. .sysc = &omap242x_gpio_sysc,
  575. .rev = 0,
  576. };
  577. /* gpio1 */
  578. static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = {
  579. { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
  580. };
  581. static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
  582. &omap2420_l4_wkup__gpio1,
  583. };
  584. static struct omap_hwmod omap2420_gpio1_hwmod = {
  585. .name = "gpio1",
  586. .mpu_irqs = omap242x_gpio1_irqs,
  587. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_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. .slaves = omap2420_gpio1_slaves,
  599. .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
  600. .class = &omap242x_gpio_hwmod_class,
  601. .dev_attr = &gpio_dev_attr,
  602. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  603. };
  604. /* gpio2 */
  605. static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = {
  606. { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
  607. };
  608. static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
  609. &omap2420_l4_wkup__gpio2,
  610. };
  611. static struct omap_hwmod omap2420_gpio2_hwmod = {
  612. .name = "gpio2",
  613. .mpu_irqs = omap242x_gpio2_irqs,
  614. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
  615. .main_clk = "gpios_fck",
  616. .prcm = {
  617. .omap2 = {
  618. .prcm_reg_id = 1,
  619. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  620. .module_offs = WKUP_MOD,
  621. .idlest_reg_id = 1,
  622. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  623. },
  624. },
  625. .slaves = omap2420_gpio2_slaves,
  626. .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
  627. .class = &omap242x_gpio_hwmod_class,
  628. .dev_attr = &gpio_dev_attr,
  629. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  630. };
  631. /* gpio3 */
  632. static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = {
  633. { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
  634. };
  635. static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
  636. &omap2420_l4_wkup__gpio3,
  637. };
  638. static struct omap_hwmod omap2420_gpio3_hwmod = {
  639. .name = "gpio3",
  640. .mpu_irqs = omap242x_gpio3_irqs,
  641. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
  642. .main_clk = "gpios_fck",
  643. .prcm = {
  644. .omap2 = {
  645. .prcm_reg_id = 1,
  646. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  647. .module_offs = WKUP_MOD,
  648. .idlest_reg_id = 1,
  649. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  650. },
  651. },
  652. .slaves = omap2420_gpio3_slaves,
  653. .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
  654. .class = &omap242x_gpio_hwmod_class,
  655. .dev_attr = &gpio_dev_attr,
  656. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  657. };
  658. /* gpio4 */
  659. static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = {
  660. { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
  661. };
  662. static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
  663. &omap2420_l4_wkup__gpio4,
  664. };
  665. static struct omap_hwmod omap2420_gpio4_hwmod = {
  666. .name = "gpio4",
  667. .mpu_irqs = omap242x_gpio4_irqs,
  668. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
  669. .main_clk = "gpios_fck",
  670. .prcm = {
  671. .omap2 = {
  672. .prcm_reg_id = 1,
  673. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  674. .module_offs = WKUP_MOD,
  675. .idlest_reg_id = 1,
  676. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  677. },
  678. },
  679. .slaves = omap2420_gpio4_slaves,
  680. .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
  681. .class = &omap242x_gpio_hwmod_class,
  682. .dev_attr = &gpio_dev_attr,
  683. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  684. };
  685. static __initdata struct omap_hwmod *omap2420_hwmods[] = {
  686. &omap2420_l3_main_hwmod,
  687. &omap2420_l4_core_hwmod,
  688. &omap2420_l4_wkup_hwmod,
  689. &omap2420_mpu_hwmod,
  690. &omap2420_iva_hwmod,
  691. &omap2420_wd_timer2_hwmod,
  692. &omap2420_uart1_hwmod,
  693. &omap2420_uart2_hwmod,
  694. &omap2420_uart3_hwmod,
  695. &omap2420_i2c1_hwmod,
  696. &omap2420_i2c2_hwmod,
  697. /* gpio class */
  698. &omap2420_gpio1_hwmod,
  699. &omap2420_gpio2_hwmod,
  700. &omap2420_gpio3_hwmod,
  701. &omap2420_gpio4_hwmod,
  702. NULL,
  703. };
  704. int __init omap2420_hwmod_init(void)
  705. {
  706. return omap_hwmod_init(omap2420_hwmods);
  707. }