omap_hwmod_2430_data.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. /*
  2. * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 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 "prm-regbits-24xx.h"
  23. #include "cm-regbits-24xx.h"
  24. /*
  25. * OMAP2430 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 omap2430_mpu_hwmod;
  33. static struct omap_hwmod omap2430_iva_hwmod;
  34. static struct omap_hwmod omap2430_l3_main_hwmod;
  35. static struct omap_hwmod omap2430_l4_core_hwmod;
  36. static struct omap_hwmod omap2430_wd_timer2_hwmod;
  37. static struct omap_hwmod omap2430_gpio1_hwmod;
  38. static struct omap_hwmod omap2430_gpio2_hwmod;
  39. static struct omap_hwmod omap2430_gpio3_hwmod;
  40. static struct omap_hwmod omap2430_gpio4_hwmod;
  41. static struct omap_hwmod omap2430_gpio5_hwmod;
  42. /* L3 -> L4_CORE interface */
  43. static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
  44. .master = &omap2430_l3_main_hwmod,
  45. .slave = &omap2430_l4_core_hwmod,
  46. .user = OCP_USER_MPU | OCP_USER_SDMA,
  47. };
  48. /* MPU -> L3 interface */
  49. static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = {
  50. .master = &omap2430_mpu_hwmod,
  51. .slave = &omap2430_l3_main_hwmod,
  52. .user = OCP_USER_MPU,
  53. };
  54. /* Slave interfaces on the L3 interconnect */
  55. static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
  56. &omap2430_mpu__l3_main,
  57. };
  58. /* Master interfaces on the L3 interconnect */
  59. static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
  60. &omap2430_l3_main__l4_core,
  61. };
  62. /* L3 */
  63. static struct omap_hwmod omap2430_l3_main_hwmod = {
  64. .name = "l3_main",
  65. .class = &l3_hwmod_class,
  66. .masters = omap2430_l3_main_masters,
  67. .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
  68. .slaves = omap2430_l3_main_slaves,
  69. .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
  70. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  71. .flags = HWMOD_NO_IDLEST,
  72. };
  73. static struct omap_hwmod omap2430_l4_wkup_hwmod;
  74. static struct omap_hwmod omap2430_uart1_hwmod;
  75. static struct omap_hwmod omap2430_uart2_hwmod;
  76. static struct omap_hwmod omap2430_uart3_hwmod;
  77. static struct omap_hwmod omap2430_i2c1_hwmod;
  78. static struct omap_hwmod omap2430_i2c2_hwmod;
  79. /* I2C IP block address space length (in bytes) */
  80. #define OMAP2_I2C_AS_LEN 128
  81. /* L4 CORE -> I2C1 interface */
  82. static struct omap_hwmod_addr_space omap2430_i2c1_addr_space[] = {
  83. {
  84. .pa_start = 0x48070000,
  85. .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
  86. .flags = ADDR_TYPE_RT,
  87. },
  88. };
  89. static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = {
  90. .master = &omap2430_l4_core_hwmod,
  91. .slave = &omap2430_i2c1_hwmod,
  92. .clk = "i2c1_ick",
  93. .addr = omap2430_i2c1_addr_space,
  94. .addr_cnt = ARRAY_SIZE(omap2430_i2c1_addr_space),
  95. .user = OCP_USER_MPU | OCP_USER_SDMA,
  96. };
  97. /* L4 CORE -> I2C2 interface */
  98. static struct omap_hwmod_addr_space omap2430_i2c2_addr_space[] = {
  99. {
  100. .pa_start = 0x48072000,
  101. .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
  102. .flags = ADDR_TYPE_RT,
  103. },
  104. };
  105. static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = {
  106. .master = &omap2430_l4_core_hwmod,
  107. .slave = &omap2430_i2c2_hwmod,
  108. .clk = "i2c2_ick",
  109. .addr = omap2430_i2c2_addr_space,
  110. .addr_cnt = ARRAY_SIZE(omap2430_i2c2_addr_space),
  111. .user = OCP_USER_MPU | OCP_USER_SDMA,
  112. };
  113. /* L4_CORE -> L4_WKUP interface */
  114. static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
  115. .master = &omap2430_l4_core_hwmod,
  116. .slave = &omap2430_l4_wkup_hwmod,
  117. .user = OCP_USER_MPU | OCP_USER_SDMA,
  118. };
  119. /* L4 CORE -> UART1 interface */
  120. static struct omap_hwmod_addr_space omap2430_uart1_addr_space[] = {
  121. {
  122. .pa_start = OMAP2_UART1_BASE,
  123. .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
  124. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  125. },
  126. };
  127. static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
  128. .master = &omap2430_l4_core_hwmod,
  129. .slave = &omap2430_uart1_hwmod,
  130. .clk = "uart1_ick",
  131. .addr = omap2430_uart1_addr_space,
  132. .addr_cnt = ARRAY_SIZE(omap2430_uart1_addr_space),
  133. .user = OCP_USER_MPU | OCP_USER_SDMA,
  134. };
  135. /* L4 CORE -> UART2 interface */
  136. static struct omap_hwmod_addr_space omap2430_uart2_addr_space[] = {
  137. {
  138. .pa_start = OMAP2_UART2_BASE,
  139. .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
  140. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  141. },
  142. };
  143. static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
  144. .master = &omap2430_l4_core_hwmod,
  145. .slave = &omap2430_uart2_hwmod,
  146. .clk = "uart2_ick",
  147. .addr = omap2430_uart2_addr_space,
  148. .addr_cnt = ARRAY_SIZE(omap2430_uart2_addr_space),
  149. .user = OCP_USER_MPU | OCP_USER_SDMA,
  150. };
  151. /* L4 PER -> UART3 interface */
  152. static struct omap_hwmod_addr_space omap2430_uart3_addr_space[] = {
  153. {
  154. .pa_start = OMAP2_UART3_BASE,
  155. .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
  156. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  157. },
  158. };
  159. static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
  160. .master = &omap2430_l4_core_hwmod,
  161. .slave = &omap2430_uart3_hwmod,
  162. .clk = "uart3_ick",
  163. .addr = omap2430_uart3_addr_space,
  164. .addr_cnt = ARRAY_SIZE(omap2430_uart3_addr_space),
  165. .user = OCP_USER_MPU | OCP_USER_SDMA,
  166. };
  167. /* Slave interfaces on the L4_CORE interconnect */
  168. static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
  169. &omap2430_l3_main__l4_core,
  170. };
  171. /* Master interfaces on the L4_CORE interconnect */
  172. static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
  173. &omap2430_l4_core__l4_wkup,
  174. };
  175. /* L4 CORE */
  176. static struct omap_hwmod omap2430_l4_core_hwmod = {
  177. .name = "l4_core",
  178. .class = &l4_hwmod_class,
  179. .masters = omap2430_l4_core_masters,
  180. .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
  181. .slaves = omap2430_l4_core_slaves,
  182. .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
  183. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  184. .flags = HWMOD_NO_IDLEST,
  185. };
  186. /* Slave interfaces on the L4_WKUP interconnect */
  187. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
  188. &omap2430_l4_core__l4_wkup,
  189. &omap2_l4_core__uart1,
  190. &omap2_l4_core__uart2,
  191. &omap2_l4_core__uart3,
  192. };
  193. /* Master interfaces on the L4_WKUP interconnect */
  194. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
  195. };
  196. /* L4 WKUP */
  197. static struct omap_hwmod omap2430_l4_wkup_hwmod = {
  198. .name = "l4_wkup",
  199. .class = &l4_hwmod_class,
  200. .masters = omap2430_l4_wkup_masters,
  201. .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
  202. .slaves = omap2430_l4_wkup_slaves,
  203. .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
  204. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  205. .flags = HWMOD_NO_IDLEST,
  206. };
  207. /* Master interfaces on the MPU device */
  208. static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
  209. &omap2430_mpu__l3_main,
  210. };
  211. /* MPU */
  212. static struct omap_hwmod omap2430_mpu_hwmod = {
  213. .name = "mpu",
  214. .class = &mpu_hwmod_class,
  215. .main_clk = "mpu_ck",
  216. .masters = omap2430_mpu_masters,
  217. .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
  218. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  219. };
  220. /*
  221. * IVA2_1 interface data
  222. */
  223. /* IVA2 <- L3 interface */
  224. static struct omap_hwmod_ocp_if omap2430_l3__iva = {
  225. .master = &omap2430_l3_main_hwmod,
  226. .slave = &omap2430_iva_hwmod,
  227. .clk = "dsp_fck",
  228. .user = OCP_USER_MPU | OCP_USER_SDMA,
  229. };
  230. static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
  231. &omap2430_l3__iva,
  232. };
  233. /*
  234. * IVA2 (IVA2)
  235. */
  236. static struct omap_hwmod omap2430_iva_hwmod = {
  237. .name = "iva",
  238. .class = &iva_hwmod_class,
  239. .masters = omap2430_iva_masters,
  240. .masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
  241. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
  242. };
  243. /* l4_wkup -> wd_timer2 */
  244. static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
  245. {
  246. .pa_start = 0x49016000,
  247. .pa_end = 0x4901607f,
  248. .flags = ADDR_TYPE_RT
  249. },
  250. };
  251. static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = {
  252. .master = &omap2430_l4_wkup_hwmod,
  253. .slave = &omap2430_wd_timer2_hwmod,
  254. .clk = "mpu_wdt_ick",
  255. .addr = omap2430_wd_timer2_addrs,
  256. .addr_cnt = ARRAY_SIZE(omap2430_wd_timer2_addrs),
  257. .user = OCP_USER_MPU | OCP_USER_SDMA,
  258. };
  259. /*
  260. * 'wd_timer' class
  261. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  262. * overflow condition
  263. */
  264. static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
  265. .rev_offs = 0x0,
  266. .sysc_offs = 0x0010,
  267. .syss_offs = 0x0014,
  268. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  269. SYSC_HAS_AUTOIDLE),
  270. .sysc_fields = &omap_hwmod_sysc_type1,
  271. };
  272. static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
  273. .name = "wd_timer",
  274. .sysc = &omap2430_wd_timer_sysc,
  275. };
  276. /* wd_timer2 */
  277. static struct omap_hwmod_ocp_if *omap2430_wd_timer2_slaves[] = {
  278. &omap2430_l4_wkup__wd_timer2,
  279. };
  280. static struct omap_hwmod omap2430_wd_timer2_hwmod = {
  281. .name = "wd_timer2",
  282. .class = &omap2430_wd_timer_hwmod_class,
  283. .main_clk = "mpu_wdt_fck",
  284. .prcm = {
  285. .omap2 = {
  286. .prcm_reg_id = 1,
  287. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  288. .module_offs = WKUP_MOD,
  289. .idlest_reg_id = 1,
  290. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  291. },
  292. },
  293. .slaves = omap2430_wd_timer2_slaves,
  294. .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves),
  295. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  296. };
  297. /* UART */
  298. static struct omap_hwmod_class_sysconfig uart_sysc = {
  299. .rev_offs = 0x50,
  300. .sysc_offs = 0x54,
  301. .syss_offs = 0x58,
  302. .sysc_flags = (SYSC_HAS_SIDLEMODE |
  303. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  304. SYSC_HAS_AUTOIDLE),
  305. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  306. .sysc_fields = &omap_hwmod_sysc_type1,
  307. };
  308. static struct omap_hwmod_class uart_class = {
  309. .name = "uart",
  310. .sysc = &uart_sysc,
  311. };
  312. /* UART1 */
  313. static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
  314. { .irq = INT_24XX_UART1_IRQ, },
  315. };
  316. static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
  317. { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
  318. { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
  319. };
  320. static struct omap_hwmod_ocp_if *omap2430_uart1_slaves[] = {
  321. &omap2_l4_core__uart1,
  322. };
  323. static struct omap_hwmod omap2430_uart1_hwmod = {
  324. .name = "uart1",
  325. .mpu_irqs = uart1_mpu_irqs,
  326. .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
  327. .sdma_reqs = uart1_sdma_reqs,
  328. .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
  329. .main_clk = "uart1_fck",
  330. .prcm = {
  331. .omap2 = {
  332. .module_offs = CORE_MOD,
  333. .prcm_reg_id = 1,
  334. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  335. .idlest_reg_id = 1,
  336. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  337. },
  338. },
  339. .slaves = omap2430_uart1_slaves,
  340. .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
  341. .class = &uart_class,
  342. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  343. };
  344. /* UART2 */
  345. static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
  346. { .irq = INT_24XX_UART2_IRQ, },
  347. };
  348. static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
  349. { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
  350. { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
  351. };
  352. static struct omap_hwmod_ocp_if *omap2430_uart2_slaves[] = {
  353. &omap2_l4_core__uart2,
  354. };
  355. static struct omap_hwmod omap2430_uart2_hwmod = {
  356. .name = "uart2",
  357. .mpu_irqs = uart2_mpu_irqs,
  358. .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
  359. .sdma_reqs = uart2_sdma_reqs,
  360. .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
  361. .main_clk = "uart2_fck",
  362. .prcm = {
  363. .omap2 = {
  364. .module_offs = CORE_MOD,
  365. .prcm_reg_id = 1,
  366. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  367. .idlest_reg_id = 1,
  368. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  369. },
  370. },
  371. .slaves = omap2430_uart2_slaves,
  372. .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
  373. .class = &uart_class,
  374. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  375. };
  376. /* UART3 */
  377. static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
  378. { .irq = INT_24XX_UART3_IRQ, },
  379. };
  380. static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
  381. { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
  382. { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
  383. };
  384. static struct omap_hwmod_ocp_if *omap2430_uart3_slaves[] = {
  385. &omap2_l4_core__uart3,
  386. };
  387. static struct omap_hwmod omap2430_uart3_hwmod = {
  388. .name = "uart3",
  389. .mpu_irqs = uart3_mpu_irqs,
  390. .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
  391. .sdma_reqs = uart3_sdma_reqs,
  392. .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
  393. .main_clk = "uart3_fck",
  394. .prcm = {
  395. .omap2 = {
  396. .module_offs = CORE_MOD,
  397. .prcm_reg_id = 2,
  398. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  399. .idlest_reg_id = 2,
  400. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  401. },
  402. },
  403. .slaves = omap2430_uart3_slaves,
  404. .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
  405. .class = &uart_class,
  406. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  407. };
  408. /* I2C common */
  409. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  410. .rev_offs = 0x00,
  411. .sysc_offs = 0x20,
  412. .syss_offs = 0x10,
  413. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  414. .sysc_fields = &omap_hwmod_sysc_type1,
  415. };
  416. static struct omap_hwmod_class i2c_class = {
  417. .name = "i2c",
  418. .sysc = &i2c_sysc,
  419. };
  420. static struct omap_i2c_dev_attr i2c_dev_attr;
  421. /* I2C1 */
  422. static struct omap_i2c_dev_attr i2c1_dev_attr = {
  423. .fifo_depth = 8, /* bytes */
  424. };
  425. static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
  426. { .irq = INT_24XX_I2C1_IRQ, },
  427. };
  428. static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
  429. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
  430. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
  431. };
  432. static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = {
  433. &omap2430_l4_core__i2c1,
  434. };
  435. static struct omap_hwmod omap2430_i2c1_hwmod = {
  436. .name = "i2c1",
  437. .mpu_irqs = i2c1_mpu_irqs,
  438. .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
  439. .sdma_reqs = i2c1_sdma_reqs,
  440. .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
  441. .main_clk = "i2chs1_fck",
  442. .prcm = {
  443. .omap2 = {
  444. /*
  445. * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
  446. * I2CHS IP's do not follow the usual pattern.
  447. * prcm_reg_id alone cannot be used to program
  448. * the iclk and fclk. Needs to be handled using
  449. * additonal flags when clk handling is moved
  450. * to hwmod framework.
  451. */
  452. .module_offs = CORE_MOD,
  453. .prcm_reg_id = 1,
  454. .module_bit = OMAP2430_EN_I2CHS1_SHIFT,
  455. .idlest_reg_id = 1,
  456. .idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
  457. },
  458. },
  459. .slaves = omap2430_i2c1_slaves,
  460. .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
  461. .class = &i2c_class,
  462. .dev_attr = &i2c1_dev_attr,
  463. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  464. };
  465. /* I2C2 */
  466. static struct omap_i2c_dev_attr i2c2_dev_attr = {
  467. .fifo_depth = 8, /* bytes */
  468. };
  469. static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
  470. { .irq = INT_24XX_I2C2_IRQ, },
  471. };
  472. static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
  473. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
  474. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
  475. };
  476. static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
  477. &omap2430_l4_core__i2c2,
  478. };
  479. static struct omap_hwmod omap2430_i2c2_hwmod = {
  480. .name = "i2c2",
  481. .mpu_irqs = i2c2_mpu_irqs,
  482. .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
  483. .sdma_reqs = i2c2_sdma_reqs,
  484. .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
  485. .main_clk = "i2chs2_fck",
  486. .prcm = {
  487. .omap2 = {
  488. .module_offs = CORE_MOD,
  489. .prcm_reg_id = 1,
  490. .module_bit = OMAP2430_EN_I2CHS2_SHIFT,
  491. .idlest_reg_id = 1,
  492. .idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
  493. },
  494. },
  495. .slaves = omap2430_i2c2_slaves,
  496. .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
  497. .class = &i2c_class,
  498. .dev_attr = &i2c2_dev_attr,
  499. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  500. };
  501. /* l4_wkup -> gpio1 */
  502. static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
  503. {
  504. .pa_start = 0x4900C000,
  505. .pa_end = 0x4900C1ff,
  506. .flags = ADDR_TYPE_RT
  507. },
  508. };
  509. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
  510. .master = &omap2430_l4_wkup_hwmod,
  511. .slave = &omap2430_gpio1_hwmod,
  512. .clk = "gpios_ick",
  513. .addr = omap2430_gpio1_addr_space,
  514. .addr_cnt = ARRAY_SIZE(omap2430_gpio1_addr_space),
  515. .user = OCP_USER_MPU | OCP_USER_SDMA,
  516. };
  517. /* l4_wkup -> gpio2 */
  518. static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
  519. {
  520. .pa_start = 0x4900E000,
  521. .pa_end = 0x4900E1ff,
  522. .flags = ADDR_TYPE_RT
  523. },
  524. };
  525. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
  526. .master = &omap2430_l4_wkup_hwmod,
  527. .slave = &omap2430_gpio2_hwmod,
  528. .clk = "gpios_ick",
  529. .addr = omap2430_gpio2_addr_space,
  530. .addr_cnt = ARRAY_SIZE(omap2430_gpio2_addr_space),
  531. .user = OCP_USER_MPU | OCP_USER_SDMA,
  532. };
  533. /* l4_wkup -> gpio3 */
  534. static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
  535. {
  536. .pa_start = 0x49010000,
  537. .pa_end = 0x490101ff,
  538. .flags = ADDR_TYPE_RT
  539. },
  540. };
  541. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
  542. .master = &omap2430_l4_wkup_hwmod,
  543. .slave = &omap2430_gpio3_hwmod,
  544. .clk = "gpios_ick",
  545. .addr = omap2430_gpio3_addr_space,
  546. .addr_cnt = ARRAY_SIZE(omap2430_gpio3_addr_space),
  547. .user = OCP_USER_MPU | OCP_USER_SDMA,
  548. };
  549. /* l4_wkup -> gpio4 */
  550. static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
  551. {
  552. .pa_start = 0x49012000,
  553. .pa_end = 0x490121ff,
  554. .flags = ADDR_TYPE_RT
  555. },
  556. };
  557. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
  558. .master = &omap2430_l4_wkup_hwmod,
  559. .slave = &omap2430_gpio4_hwmod,
  560. .clk = "gpios_ick",
  561. .addr = omap2430_gpio4_addr_space,
  562. .addr_cnt = ARRAY_SIZE(omap2430_gpio4_addr_space),
  563. .user = OCP_USER_MPU | OCP_USER_SDMA,
  564. };
  565. /* l4_core -> gpio5 */
  566. static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
  567. {
  568. .pa_start = 0x480B6000,
  569. .pa_end = 0x480B61ff,
  570. .flags = ADDR_TYPE_RT
  571. },
  572. };
  573. static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
  574. .master = &omap2430_l4_core_hwmod,
  575. .slave = &omap2430_gpio5_hwmod,
  576. .clk = "gpio5_ick",
  577. .addr = omap2430_gpio5_addr_space,
  578. .addr_cnt = ARRAY_SIZE(omap2430_gpio5_addr_space),
  579. .user = OCP_USER_MPU | OCP_USER_SDMA,
  580. };
  581. /* gpio dev_attr */
  582. static struct omap_gpio_dev_attr gpio_dev_attr = {
  583. .bank_width = 32,
  584. .dbck_flag = false,
  585. };
  586. static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
  587. .rev_offs = 0x0000,
  588. .sysc_offs = 0x0010,
  589. .syss_offs = 0x0014,
  590. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  591. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  592. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  593. .sysc_fields = &omap_hwmod_sysc_type1,
  594. };
  595. /*
  596. * 'gpio' class
  597. * general purpose io module
  598. */
  599. static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
  600. .name = "gpio",
  601. .sysc = &omap243x_gpio_sysc,
  602. .rev = 0,
  603. };
  604. /* gpio1 */
  605. static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = {
  606. { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
  607. };
  608. static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
  609. &omap2430_l4_wkup__gpio1,
  610. };
  611. static struct omap_hwmod omap2430_gpio1_hwmod = {
  612. .name = "gpio1",
  613. .mpu_irqs = omap243x_gpio1_irqs,
  614. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_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_EN_GPIOS_SHIFT,
  623. },
  624. },
  625. .slaves = omap2430_gpio1_slaves,
  626. .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
  627. .class = &omap243x_gpio_hwmod_class,
  628. .dev_attr = &gpio_dev_attr,
  629. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  630. };
  631. /* gpio2 */
  632. static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = {
  633. { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
  634. };
  635. static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
  636. &omap2430_l4_wkup__gpio2,
  637. };
  638. static struct omap_hwmod omap2430_gpio2_hwmod = {
  639. .name = "gpio2",
  640. .mpu_irqs = omap243x_gpio2_irqs,
  641. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_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 = omap2430_gpio2_slaves,
  653. .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
  654. .class = &omap243x_gpio_hwmod_class,
  655. .dev_attr = &gpio_dev_attr,
  656. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  657. };
  658. /* gpio3 */
  659. static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = {
  660. { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
  661. };
  662. static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
  663. &omap2430_l4_wkup__gpio3,
  664. };
  665. static struct omap_hwmod omap2430_gpio3_hwmod = {
  666. .name = "gpio3",
  667. .mpu_irqs = omap243x_gpio3_irqs,
  668. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_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 = omap2430_gpio3_slaves,
  680. .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
  681. .class = &omap243x_gpio_hwmod_class,
  682. .dev_attr = &gpio_dev_attr,
  683. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  684. };
  685. /* gpio4 */
  686. static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = {
  687. { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
  688. };
  689. static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
  690. &omap2430_l4_wkup__gpio4,
  691. };
  692. static struct omap_hwmod omap2430_gpio4_hwmod = {
  693. .name = "gpio4",
  694. .mpu_irqs = omap243x_gpio4_irqs,
  695. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
  696. .main_clk = "gpios_fck",
  697. .prcm = {
  698. .omap2 = {
  699. .prcm_reg_id = 1,
  700. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  701. .module_offs = WKUP_MOD,
  702. .idlest_reg_id = 1,
  703. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  704. },
  705. },
  706. .slaves = omap2430_gpio4_slaves,
  707. .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
  708. .class = &omap243x_gpio_hwmod_class,
  709. .dev_attr = &gpio_dev_attr,
  710. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  711. };
  712. /* gpio5 */
  713. static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
  714. { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
  715. };
  716. static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
  717. &omap2430_l4_core__gpio5,
  718. };
  719. static struct omap_hwmod omap2430_gpio5_hwmod = {
  720. .name = "gpio5",
  721. .mpu_irqs = omap243x_gpio5_irqs,
  722. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
  723. .main_clk = "gpio5_fck",
  724. .prcm = {
  725. .omap2 = {
  726. .prcm_reg_id = 2,
  727. .module_bit = OMAP2430_EN_GPIO5_SHIFT,
  728. .module_offs = CORE_MOD,
  729. .idlest_reg_id = 2,
  730. .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
  731. },
  732. },
  733. .slaves = omap2430_gpio5_slaves,
  734. .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
  735. .class = &omap243x_gpio_hwmod_class,
  736. .dev_attr = &gpio_dev_attr,
  737. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  738. };
  739. static __initdata struct omap_hwmod *omap2430_hwmods[] = {
  740. &omap2430_l3_main_hwmod,
  741. &omap2430_l4_core_hwmod,
  742. &omap2430_l4_wkup_hwmod,
  743. &omap2430_mpu_hwmod,
  744. &omap2430_iva_hwmod,
  745. &omap2430_wd_timer2_hwmod,
  746. &omap2430_uart1_hwmod,
  747. &omap2430_uart2_hwmod,
  748. &omap2430_uart3_hwmod,
  749. &omap2430_i2c1_hwmod,
  750. &omap2430_i2c2_hwmod,
  751. /* gpio class */
  752. &omap2430_gpio1_hwmod,
  753. &omap2430_gpio2_hwmod,
  754. &omap2430_gpio3_hwmod,
  755. &omap2430_gpio4_hwmod,
  756. &omap2430_gpio5_hwmod,
  757. NULL,
  758. };
  759. int __init omap2430_hwmod_init(void)
  760. {
  761. return omap_hwmod_init(omap2430_hwmods);
  762. }