omap_hwmod_2420_data.c 23 KB

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