omap_hwmod_2430_data.c 25 KB

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