omap_hwmod_2430_data.c 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 "omap_hwmod_common_data.h"
  20. #include "prm-regbits-24xx.h"
  21. /*
  22. * OMAP2430 hardware module integration data
  23. *
  24. * ALl of the data in this section should be autogeneratable from the
  25. * TI hardware database or other technical documentation. Data that
  26. * is driver-specific or driver-kernel integration-specific belongs
  27. * elsewhere.
  28. */
  29. static struct omap_hwmod omap2430_mpu_hwmod;
  30. static struct omap_hwmod omap2430_iva_hwmod;
  31. static struct omap_hwmod omap2430_l3_main_hwmod;
  32. static struct omap_hwmod omap2430_l4_core_hwmod;
  33. /* L3 -> L4_CORE interface */
  34. static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
  35. .master = &omap2430_l3_main_hwmod,
  36. .slave = &omap2430_l4_core_hwmod,
  37. .user = OCP_USER_MPU | OCP_USER_SDMA,
  38. };
  39. /* MPU -> L3 interface */
  40. static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = {
  41. .master = &omap2430_mpu_hwmod,
  42. .slave = &omap2430_l3_main_hwmod,
  43. .user = OCP_USER_MPU,
  44. };
  45. /* Slave interfaces on the L3 interconnect */
  46. static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
  47. &omap2430_mpu__l3_main,
  48. };
  49. /* Master interfaces on the L3 interconnect */
  50. static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
  51. &omap2430_l3_main__l4_core,
  52. };
  53. /* L3 */
  54. static struct omap_hwmod omap2430_l3_main_hwmod = {
  55. .name = "l3_main",
  56. .class = &l3_hwmod_class,
  57. .masters = omap2430_l3_main_masters,
  58. .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
  59. .slaves = omap2430_l3_main_slaves,
  60. .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
  61. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  62. .flags = HWMOD_NO_IDLEST,
  63. };
  64. static struct omap_hwmod omap2430_l4_wkup_hwmod;
  65. static struct omap_hwmod omap2430_uart1_hwmod;
  66. static struct omap_hwmod omap2430_uart2_hwmod;
  67. static struct omap_hwmod omap2430_uart3_hwmod;
  68. /* L4_CORE -> L4_WKUP interface */
  69. static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
  70. .master = &omap2430_l4_core_hwmod,
  71. .slave = &omap2430_l4_wkup_hwmod,
  72. .user = OCP_USER_MPU | OCP_USER_SDMA,
  73. };
  74. /* L4 CORE -> UART1 interface */
  75. static struct omap_hwmod_addr_space omap2430_uart1_addr_space[] = {
  76. {
  77. .pa_start = OMAP2_UART1_BASE,
  78. .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
  79. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  80. },
  81. };
  82. static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
  83. .master = &omap2430_l4_core_hwmod,
  84. .slave = &omap2430_uart1_hwmod,
  85. .clk = "uart1_ick",
  86. .addr = omap2430_uart1_addr_space,
  87. .addr_cnt = ARRAY_SIZE(omap2430_uart1_addr_space),
  88. .user = OCP_USER_MPU | OCP_USER_SDMA,
  89. };
  90. /* L4 CORE -> UART2 interface */
  91. static struct omap_hwmod_addr_space omap2430_uart2_addr_space[] = {
  92. {
  93. .pa_start = OMAP2_UART2_BASE,
  94. .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
  95. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  96. },
  97. };
  98. static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
  99. .master = &omap2430_l4_core_hwmod,
  100. .slave = &omap2430_uart2_hwmod,
  101. .clk = "uart2_ick",
  102. .addr = omap2430_uart2_addr_space,
  103. .addr_cnt = ARRAY_SIZE(omap2430_uart2_addr_space),
  104. .user = OCP_USER_MPU | OCP_USER_SDMA,
  105. };
  106. /* L4 PER -> UART3 interface */
  107. static struct omap_hwmod_addr_space omap2430_uart3_addr_space[] = {
  108. {
  109. .pa_start = OMAP2_UART3_BASE,
  110. .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
  111. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  112. },
  113. };
  114. static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
  115. .master = &omap2430_l4_core_hwmod,
  116. .slave = &omap2430_uart3_hwmod,
  117. .clk = "uart3_ick",
  118. .addr = omap2430_uart3_addr_space,
  119. .addr_cnt = ARRAY_SIZE(omap2430_uart3_addr_space),
  120. .user = OCP_USER_MPU | OCP_USER_SDMA,
  121. };
  122. /* Slave interfaces on the L4_CORE interconnect */
  123. static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
  124. &omap2430_l3_main__l4_core,
  125. };
  126. /* Master interfaces on the L4_CORE interconnect */
  127. static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
  128. &omap2430_l4_core__l4_wkup,
  129. };
  130. /* L4 CORE */
  131. static struct omap_hwmod omap2430_l4_core_hwmod = {
  132. .name = "l4_core",
  133. .class = &l4_hwmod_class,
  134. .masters = omap2430_l4_core_masters,
  135. .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
  136. .slaves = omap2430_l4_core_slaves,
  137. .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
  138. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  139. .flags = HWMOD_NO_IDLEST,
  140. };
  141. /* Slave interfaces on the L4_WKUP interconnect */
  142. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
  143. &omap2430_l4_core__l4_wkup,
  144. &omap2_l4_core__uart1,
  145. &omap2_l4_core__uart2,
  146. &omap2_l4_core__uart3,
  147. };
  148. /* Master interfaces on the L4_WKUP interconnect */
  149. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
  150. };
  151. /* L4 WKUP */
  152. static struct omap_hwmod omap2430_l4_wkup_hwmod = {
  153. .name = "l4_wkup",
  154. .class = &l4_hwmod_class,
  155. .masters = omap2430_l4_wkup_masters,
  156. .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
  157. .slaves = omap2430_l4_wkup_slaves,
  158. .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
  159. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  160. .flags = HWMOD_NO_IDLEST,
  161. };
  162. /* Master interfaces on the MPU device */
  163. static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
  164. &omap2430_mpu__l3_main,
  165. };
  166. /* MPU */
  167. static struct omap_hwmod omap2430_mpu_hwmod = {
  168. .name = "mpu",
  169. .class = &mpu_hwmod_class,
  170. .main_clk = "mpu_ck",
  171. .masters = omap2430_mpu_masters,
  172. .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
  173. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  174. };
  175. /*
  176. * IVA2_1 interface data
  177. */
  178. /* IVA2 <- L3 interface */
  179. static struct omap_hwmod_ocp_if omap2430_l3__iva = {
  180. .master = &omap2430_l3_main_hwmod,
  181. .slave = &omap2430_iva_hwmod,
  182. .clk = "dsp_fck",
  183. .user = OCP_USER_MPU | OCP_USER_SDMA,
  184. };
  185. static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
  186. &omap2430_l3__iva,
  187. };
  188. /*
  189. * IVA2 (IVA2)
  190. */
  191. static struct omap_hwmod omap2430_iva_hwmod = {
  192. .name = "iva",
  193. .class = &iva_hwmod_class,
  194. .masters = omap2430_iva_masters,
  195. .masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
  196. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
  197. };
  198. /* UART */
  199. static struct omap_hwmod_class_sysconfig uart_sysc = {
  200. .rev_offs = 0x50,
  201. .sysc_offs = 0x54,
  202. .syss_offs = 0x58,
  203. .sysc_flags = (SYSC_HAS_SIDLEMODE |
  204. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  205. SYSC_HAS_AUTOIDLE),
  206. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  207. .sysc_fields = &omap_hwmod_sysc_type1,
  208. };
  209. static struct omap_hwmod_class uart_class = {
  210. .name = "uart",
  211. .sysc = &uart_sysc,
  212. };
  213. /* UART1 */
  214. static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
  215. { .irq = INT_24XX_UART1_IRQ, },
  216. };
  217. static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
  218. { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
  219. { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
  220. };
  221. static struct omap_hwmod_ocp_if *omap2430_uart1_slaves[] = {
  222. &omap2_l4_core__uart1,
  223. };
  224. static struct omap_hwmod omap2430_uart1_hwmod = {
  225. .name = "uart1",
  226. .mpu_irqs = uart1_mpu_irqs,
  227. .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
  228. .sdma_reqs = uart1_sdma_reqs,
  229. .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
  230. .main_clk = "uart1_fck",
  231. .prcm = {
  232. .omap2 = {
  233. .module_offs = CORE_MOD,
  234. .prcm_reg_id = 1,
  235. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  236. .idlest_reg_id = 1,
  237. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  238. },
  239. },
  240. .slaves = omap2430_uart1_slaves,
  241. .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
  242. .class = &uart_class,
  243. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  244. };
  245. /* UART2 */
  246. static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
  247. { .irq = INT_24XX_UART2_IRQ, },
  248. };
  249. static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
  250. { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
  251. { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
  252. };
  253. static struct omap_hwmod_ocp_if *omap2430_uart2_slaves[] = {
  254. &omap2_l4_core__uart2,
  255. };
  256. static struct omap_hwmod omap2430_uart2_hwmod = {
  257. .name = "uart2",
  258. .mpu_irqs = uart2_mpu_irqs,
  259. .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
  260. .sdma_reqs = uart2_sdma_reqs,
  261. .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
  262. .main_clk = "uart2_fck",
  263. .prcm = {
  264. .omap2 = {
  265. .module_offs = CORE_MOD,
  266. .prcm_reg_id = 1,
  267. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  268. .idlest_reg_id = 1,
  269. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  270. },
  271. },
  272. .slaves = omap2430_uart2_slaves,
  273. .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
  274. .class = &uart_class,
  275. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  276. };
  277. /* UART3 */
  278. static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
  279. { .irq = INT_24XX_UART3_IRQ, },
  280. };
  281. static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
  282. { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
  283. { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
  284. };
  285. static struct omap_hwmod_ocp_if *omap2430_uart3_slaves[] = {
  286. &omap2_l4_core__uart3,
  287. };
  288. static struct omap_hwmod omap2430_uart3_hwmod = {
  289. .name = "uart3",
  290. .mpu_irqs = uart3_mpu_irqs,
  291. .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
  292. .sdma_reqs = uart3_sdma_reqs,
  293. .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
  294. .main_clk = "uart3_fck",
  295. .prcm = {
  296. .omap2 = {
  297. .module_offs = CORE_MOD,
  298. .prcm_reg_id = 2,
  299. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  300. .idlest_reg_id = 2,
  301. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  302. },
  303. },
  304. .slaves = omap2430_uart3_slaves,
  305. .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
  306. .class = &uart_class,
  307. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  308. };
  309. static __initdata struct omap_hwmod *omap2430_hwmods[] = {
  310. &omap2430_l3_main_hwmod,
  311. &omap2430_l4_core_hwmod,
  312. &omap2430_l4_wkup_hwmod,
  313. &omap2430_mpu_hwmod,
  314. &omap2430_iva_hwmod,
  315. &omap2430_uart1_hwmod,
  316. &omap2430_uart2_hwmod,
  317. &omap2430_uart3_hwmod,
  318. NULL,
  319. };
  320. int __init omap2430_hwmod_init(void)
  321. {
  322. return omap_hwmod_init(omap2430_hwmods);
  323. }