omap_hwmod_2430_data.c 12 KB

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