omap_hwmod_2420_data.c 23 KB

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