omap_hwmod_2430_data.c 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  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 <plat/mcspi.h>
  22. #include "omap_hwmod_common_data.h"
  23. #include "prm-regbits-24xx.h"
  24. #include "cm-regbits-24xx.h"
  25. #include "wd_timer.h"
  26. /*
  27. * OMAP2430 hardware module integration data
  28. *
  29. * ALl of the data in this section should be autogeneratable from the
  30. * TI hardware database or other technical documentation. Data that
  31. * is driver-specific or driver-kernel integration-specific belongs
  32. * elsewhere.
  33. */
  34. static struct omap_hwmod omap2430_mpu_hwmod;
  35. static struct omap_hwmod omap2430_iva_hwmod;
  36. static struct omap_hwmod omap2430_l3_main_hwmod;
  37. static struct omap_hwmod omap2430_l4_core_hwmod;
  38. static struct omap_hwmod omap2430_wd_timer2_hwmod;
  39. static struct omap_hwmod omap2430_gpio1_hwmod;
  40. static struct omap_hwmod omap2430_gpio2_hwmod;
  41. static struct omap_hwmod omap2430_gpio3_hwmod;
  42. static struct omap_hwmod omap2430_gpio4_hwmod;
  43. static struct omap_hwmod omap2430_gpio5_hwmod;
  44. static struct omap_hwmod omap2430_dma_system_hwmod;
  45. static struct omap_hwmod omap2430_mcspi1_hwmod;
  46. static struct omap_hwmod omap2430_mcspi2_hwmod;
  47. static struct omap_hwmod omap2430_mcspi3_hwmod;
  48. /* L3 -> L4_CORE interface */
  49. static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
  50. .master = &omap2430_l3_main_hwmod,
  51. .slave = &omap2430_l4_core_hwmod,
  52. .user = OCP_USER_MPU | OCP_USER_SDMA,
  53. };
  54. /* MPU -> L3 interface */
  55. static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = {
  56. .master = &omap2430_mpu_hwmod,
  57. .slave = &omap2430_l3_main_hwmod,
  58. .user = OCP_USER_MPU,
  59. };
  60. /* Slave interfaces on the L3 interconnect */
  61. static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
  62. &omap2430_mpu__l3_main,
  63. };
  64. /* Master interfaces on the L3 interconnect */
  65. static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
  66. &omap2430_l3_main__l4_core,
  67. };
  68. /* L3 */
  69. static struct omap_hwmod omap2430_l3_main_hwmod = {
  70. .name = "l3_main",
  71. .class = &l3_hwmod_class,
  72. .masters = omap2430_l3_main_masters,
  73. .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
  74. .slaves = omap2430_l3_main_slaves,
  75. .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
  76. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  77. .flags = HWMOD_NO_IDLEST,
  78. };
  79. static struct omap_hwmod omap2430_l4_wkup_hwmod;
  80. static struct omap_hwmod omap2430_uart1_hwmod;
  81. static struct omap_hwmod omap2430_uart2_hwmod;
  82. static struct omap_hwmod omap2430_uart3_hwmod;
  83. static struct omap_hwmod omap2430_i2c1_hwmod;
  84. static struct omap_hwmod omap2430_i2c2_hwmod;
  85. static struct omap_hwmod omap2430_usbhsotg_hwmod;
  86. /* l3_core -> usbhsotg interface */
  87. static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
  88. .master = &omap2430_usbhsotg_hwmod,
  89. .slave = &omap2430_l3_main_hwmod,
  90. .clk = "core_l3_ck",
  91. .user = OCP_USER_MPU,
  92. };
  93. /* I2C IP block address space length (in bytes) */
  94. #define OMAP2_I2C_AS_LEN 128
  95. /* L4 CORE -> I2C1 interface */
  96. static struct omap_hwmod_addr_space omap2430_i2c1_addr_space[] = {
  97. {
  98. .pa_start = 0x48070000,
  99. .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
  100. .flags = ADDR_TYPE_RT,
  101. },
  102. };
  103. static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = {
  104. .master = &omap2430_l4_core_hwmod,
  105. .slave = &omap2430_i2c1_hwmod,
  106. .clk = "i2c1_ick",
  107. .addr = omap2430_i2c1_addr_space,
  108. .addr_cnt = ARRAY_SIZE(omap2430_i2c1_addr_space),
  109. .user = OCP_USER_MPU | OCP_USER_SDMA,
  110. };
  111. /* L4 CORE -> I2C2 interface */
  112. static struct omap_hwmod_addr_space omap2430_i2c2_addr_space[] = {
  113. {
  114. .pa_start = 0x48072000,
  115. .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
  116. .flags = ADDR_TYPE_RT,
  117. },
  118. };
  119. static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = {
  120. .master = &omap2430_l4_core_hwmod,
  121. .slave = &omap2430_i2c2_hwmod,
  122. .clk = "i2c2_ick",
  123. .addr = omap2430_i2c2_addr_space,
  124. .addr_cnt = ARRAY_SIZE(omap2430_i2c2_addr_space),
  125. .user = OCP_USER_MPU | OCP_USER_SDMA,
  126. };
  127. /* L4_CORE -> L4_WKUP interface */
  128. static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
  129. .master = &omap2430_l4_core_hwmod,
  130. .slave = &omap2430_l4_wkup_hwmod,
  131. .user = OCP_USER_MPU | OCP_USER_SDMA,
  132. };
  133. /* L4 CORE -> UART1 interface */
  134. static struct omap_hwmod_addr_space omap2430_uart1_addr_space[] = {
  135. {
  136. .pa_start = OMAP2_UART1_BASE,
  137. .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
  138. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  139. },
  140. };
  141. static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
  142. .master = &omap2430_l4_core_hwmod,
  143. .slave = &omap2430_uart1_hwmod,
  144. .clk = "uart1_ick",
  145. .addr = omap2430_uart1_addr_space,
  146. .addr_cnt = ARRAY_SIZE(omap2430_uart1_addr_space),
  147. .user = OCP_USER_MPU | OCP_USER_SDMA,
  148. };
  149. /* L4 CORE -> UART2 interface */
  150. static struct omap_hwmod_addr_space omap2430_uart2_addr_space[] = {
  151. {
  152. .pa_start = OMAP2_UART2_BASE,
  153. .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
  154. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  155. },
  156. };
  157. static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
  158. .master = &omap2430_l4_core_hwmod,
  159. .slave = &omap2430_uart2_hwmod,
  160. .clk = "uart2_ick",
  161. .addr = omap2430_uart2_addr_space,
  162. .addr_cnt = ARRAY_SIZE(omap2430_uart2_addr_space),
  163. .user = OCP_USER_MPU | OCP_USER_SDMA,
  164. };
  165. /* L4 PER -> UART3 interface */
  166. static struct omap_hwmod_addr_space omap2430_uart3_addr_space[] = {
  167. {
  168. .pa_start = OMAP2_UART3_BASE,
  169. .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
  170. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  171. },
  172. };
  173. static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
  174. .master = &omap2430_l4_core_hwmod,
  175. .slave = &omap2430_uart3_hwmod,
  176. .clk = "uart3_ick",
  177. .addr = omap2430_uart3_addr_space,
  178. .addr_cnt = ARRAY_SIZE(omap2430_uart3_addr_space),
  179. .user = OCP_USER_MPU | OCP_USER_SDMA,
  180. };
  181. /*
  182. * usbhsotg interface data
  183. */
  184. static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
  185. {
  186. .pa_start = OMAP243X_HS_BASE,
  187. .pa_end = OMAP243X_HS_BASE + SZ_4K - 1,
  188. .flags = ADDR_TYPE_RT
  189. },
  190. };
  191. /* l4_core ->usbhsotg interface */
  192. static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
  193. .master = &omap2430_l4_core_hwmod,
  194. .slave = &omap2430_usbhsotg_hwmod,
  195. .clk = "usb_l4_ick",
  196. .addr = omap2430_usbhsotg_addrs,
  197. .addr_cnt = ARRAY_SIZE(omap2430_usbhsotg_addrs),
  198. .user = OCP_USER_MPU,
  199. };
  200. static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = {
  201. &omap2430_usbhsotg__l3,
  202. };
  203. static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = {
  204. &omap2430_l4_core__usbhsotg,
  205. };
  206. /* Slave interfaces on the L4_CORE interconnect */
  207. static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
  208. &omap2430_l3_main__l4_core,
  209. };
  210. /* Master interfaces on the L4_CORE interconnect */
  211. static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
  212. &omap2430_l4_core__l4_wkup,
  213. };
  214. /* L4 CORE */
  215. static struct omap_hwmod omap2430_l4_core_hwmod = {
  216. .name = "l4_core",
  217. .class = &l4_hwmod_class,
  218. .masters = omap2430_l4_core_masters,
  219. .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
  220. .slaves = omap2430_l4_core_slaves,
  221. .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
  222. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  223. .flags = HWMOD_NO_IDLEST,
  224. };
  225. /* Slave interfaces on the L4_WKUP interconnect */
  226. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
  227. &omap2430_l4_core__l4_wkup,
  228. &omap2_l4_core__uart1,
  229. &omap2_l4_core__uart2,
  230. &omap2_l4_core__uart3,
  231. };
  232. /* Master interfaces on the L4_WKUP interconnect */
  233. static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
  234. };
  235. /* l4 core -> mcspi1 interface */
  236. static struct omap_hwmod_addr_space omap2430_mcspi1_addr_space[] = {
  237. {
  238. .pa_start = 0x48098000,
  239. .pa_end = 0x480980ff,
  240. .flags = ADDR_TYPE_RT,
  241. },
  242. };
  243. static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = {
  244. .master = &omap2430_l4_core_hwmod,
  245. .slave = &omap2430_mcspi1_hwmod,
  246. .clk = "mcspi1_ick",
  247. .addr = omap2430_mcspi1_addr_space,
  248. .addr_cnt = ARRAY_SIZE(omap2430_mcspi1_addr_space),
  249. .user = OCP_USER_MPU | OCP_USER_SDMA,
  250. };
  251. /* l4 core -> mcspi2 interface */
  252. static struct omap_hwmod_addr_space omap2430_mcspi2_addr_space[] = {
  253. {
  254. .pa_start = 0x4809a000,
  255. .pa_end = 0x4809a0ff,
  256. .flags = ADDR_TYPE_RT,
  257. },
  258. };
  259. static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = {
  260. .master = &omap2430_l4_core_hwmod,
  261. .slave = &omap2430_mcspi2_hwmod,
  262. .clk = "mcspi2_ick",
  263. .addr = omap2430_mcspi2_addr_space,
  264. .addr_cnt = ARRAY_SIZE(omap2430_mcspi2_addr_space),
  265. .user = OCP_USER_MPU | OCP_USER_SDMA,
  266. };
  267. /* l4 core -> mcspi3 interface */
  268. static struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = {
  269. {
  270. .pa_start = 0x480b8000,
  271. .pa_end = 0x480b80ff,
  272. .flags = ADDR_TYPE_RT,
  273. },
  274. };
  275. static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
  276. .master = &omap2430_l4_core_hwmod,
  277. .slave = &omap2430_mcspi3_hwmod,
  278. .clk = "mcspi3_ick",
  279. .addr = omap2430_mcspi3_addr_space,
  280. .addr_cnt = ARRAY_SIZE(omap2430_mcspi3_addr_space),
  281. .user = OCP_USER_MPU | OCP_USER_SDMA,
  282. };
  283. /* L4 WKUP */
  284. static struct omap_hwmod omap2430_l4_wkup_hwmod = {
  285. .name = "l4_wkup",
  286. .class = &l4_hwmod_class,
  287. .masters = omap2430_l4_wkup_masters,
  288. .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
  289. .slaves = omap2430_l4_wkup_slaves,
  290. .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
  291. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  292. .flags = HWMOD_NO_IDLEST,
  293. };
  294. /* Master interfaces on the MPU device */
  295. static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
  296. &omap2430_mpu__l3_main,
  297. };
  298. /* MPU */
  299. static struct omap_hwmod omap2430_mpu_hwmod = {
  300. .name = "mpu",
  301. .class = &mpu_hwmod_class,
  302. .main_clk = "mpu_ck",
  303. .masters = omap2430_mpu_masters,
  304. .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
  305. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  306. };
  307. /*
  308. * IVA2_1 interface data
  309. */
  310. /* IVA2 <- L3 interface */
  311. static struct omap_hwmod_ocp_if omap2430_l3__iva = {
  312. .master = &omap2430_l3_main_hwmod,
  313. .slave = &omap2430_iva_hwmod,
  314. .clk = "dsp_fck",
  315. .user = OCP_USER_MPU | OCP_USER_SDMA,
  316. };
  317. static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
  318. &omap2430_l3__iva,
  319. };
  320. /*
  321. * IVA2 (IVA2)
  322. */
  323. static struct omap_hwmod omap2430_iva_hwmod = {
  324. .name = "iva",
  325. .class = &iva_hwmod_class,
  326. .masters = omap2430_iva_masters,
  327. .masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
  328. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
  329. };
  330. /* l4_wkup -> wd_timer2 */
  331. static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
  332. {
  333. .pa_start = 0x49016000,
  334. .pa_end = 0x4901607f,
  335. .flags = ADDR_TYPE_RT
  336. },
  337. };
  338. static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = {
  339. .master = &omap2430_l4_wkup_hwmod,
  340. .slave = &omap2430_wd_timer2_hwmod,
  341. .clk = "mpu_wdt_ick",
  342. .addr = omap2430_wd_timer2_addrs,
  343. .addr_cnt = ARRAY_SIZE(omap2430_wd_timer2_addrs),
  344. .user = OCP_USER_MPU | OCP_USER_SDMA,
  345. };
  346. /*
  347. * 'wd_timer' class
  348. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  349. * overflow condition
  350. */
  351. static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
  352. .rev_offs = 0x0,
  353. .sysc_offs = 0x0010,
  354. .syss_offs = 0x0014,
  355. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  356. SYSC_HAS_AUTOIDLE),
  357. .sysc_fields = &omap_hwmod_sysc_type1,
  358. };
  359. static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
  360. .name = "wd_timer",
  361. .sysc = &omap2430_wd_timer_sysc,
  362. .pre_shutdown = &omap2_wd_timer_disable
  363. };
  364. /* wd_timer2 */
  365. static struct omap_hwmod_ocp_if *omap2430_wd_timer2_slaves[] = {
  366. &omap2430_l4_wkup__wd_timer2,
  367. };
  368. static struct omap_hwmod omap2430_wd_timer2_hwmod = {
  369. .name = "wd_timer2",
  370. .class = &omap2430_wd_timer_hwmod_class,
  371. .main_clk = "mpu_wdt_fck",
  372. .prcm = {
  373. .omap2 = {
  374. .prcm_reg_id = 1,
  375. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  376. .module_offs = WKUP_MOD,
  377. .idlest_reg_id = 1,
  378. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  379. },
  380. },
  381. .slaves = omap2430_wd_timer2_slaves,
  382. .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves),
  383. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  384. };
  385. /* UART */
  386. static struct omap_hwmod_class_sysconfig uart_sysc = {
  387. .rev_offs = 0x50,
  388. .sysc_offs = 0x54,
  389. .syss_offs = 0x58,
  390. .sysc_flags = (SYSC_HAS_SIDLEMODE |
  391. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  392. SYSC_HAS_AUTOIDLE),
  393. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  394. .sysc_fields = &omap_hwmod_sysc_type1,
  395. };
  396. static struct omap_hwmod_class uart_class = {
  397. .name = "uart",
  398. .sysc = &uart_sysc,
  399. };
  400. /* UART1 */
  401. static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
  402. { .irq = INT_24XX_UART1_IRQ, },
  403. };
  404. static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
  405. { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
  406. { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
  407. };
  408. static struct omap_hwmod_ocp_if *omap2430_uart1_slaves[] = {
  409. &omap2_l4_core__uart1,
  410. };
  411. static struct omap_hwmod omap2430_uart1_hwmod = {
  412. .name = "uart1",
  413. .mpu_irqs = uart1_mpu_irqs,
  414. .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
  415. .sdma_reqs = uart1_sdma_reqs,
  416. .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
  417. .main_clk = "uart1_fck",
  418. .prcm = {
  419. .omap2 = {
  420. .module_offs = CORE_MOD,
  421. .prcm_reg_id = 1,
  422. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  423. .idlest_reg_id = 1,
  424. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  425. },
  426. },
  427. .slaves = omap2430_uart1_slaves,
  428. .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
  429. .class = &uart_class,
  430. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  431. };
  432. /* UART2 */
  433. static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
  434. { .irq = INT_24XX_UART2_IRQ, },
  435. };
  436. static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
  437. { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
  438. { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
  439. };
  440. static struct omap_hwmod_ocp_if *omap2430_uart2_slaves[] = {
  441. &omap2_l4_core__uart2,
  442. };
  443. static struct omap_hwmod omap2430_uart2_hwmod = {
  444. .name = "uart2",
  445. .mpu_irqs = uart2_mpu_irqs,
  446. .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
  447. .sdma_reqs = uart2_sdma_reqs,
  448. .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
  449. .main_clk = "uart2_fck",
  450. .prcm = {
  451. .omap2 = {
  452. .module_offs = CORE_MOD,
  453. .prcm_reg_id = 1,
  454. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  455. .idlest_reg_id = 1,
  456. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  457. },
  458. },
  459. .slaves = omap2430_uart2_slaves,
  460. .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
  461. .class = &uart_class,
  462. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  463. };
  464. /* UART3 */
  465. static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
  466. { .irq = INT_24XX_UART3_IRQ, },
  467. };
  468. static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
  469. { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
  470. { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
  471. };
  472. static struct omap_hwmod_ocp_if *omap2430_uart3_slaves[] = {
  473. &omap2_l4_core__uart3,
  474. };
  475. static struct omap_hwmod omap2430_uart3_hwmod = {
  476. .name = "uart3",
  477. .mpu_irqs = uart3_mpu_irqs,
  478. .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
  479. .sdma_reqs = uart3_sdma_reqs,
  480. .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
  481. .main_clk = "uart3_fck",
  482. .prcm = {
  483. .omap2 = {
  484. .module_offs = CORE_MOD,
  485. .prcm_reg_id = 2,
  486. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  487. .idlest_reg_id = 2,
  488. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  489. },
  490. },
  491. .slaves = omap2430_uart3_slaves,
  492. .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
  493. .class = &uart_class,
  494. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  495. };
  496. /* I2C common */
  497. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  498. .rev_offs = 0x00,
  499. .sysc_offs = 0x20,
  500. .syss_offs = 0x10,
  501. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  502. .sysc_fields = &omap_hwmod_sysc_type1,
  503. };
  504. static struct omap_hwmod_class i2c_class = {
  505. .name = "i2c",
  506. .sysc = &i2c_sysc,
  507. };
  508. static struct omap_i2c_dev_attr i2c_dev_attr = {
  509. .fifo_depth = 8, /* bytes */
  510. };
  511. /* I2C1 */
  512. static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
  513. { .irq = INT_24XX_I2C1_IRQ, },
  514. };
  515. static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
  516. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
  517. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
  518. };
  519. static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = {
  520. &omap2430_l4_core__i2c1,
  521. };
  522. static struct omap_hwmod omap2430_i2c1_hwmod = {
  523. .name = "i2c1",
  524. .mpu_irqs = i2c1_mpu_irqs,
  525. .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
  526. .sdma_reqs = i2c1_sdma_reqs,
  527. .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
  528. .main_clk = "i2chs1_fck",
  529. .prcm = {
  530. .omap2 = {
  531. /*
  532. * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
  533. * I2CHS IP's do not follow the usual pattern.
  534. * prcm_reg_id alone cannot be used to program
  535. * the iclk and fclk. Needs to be handled using
  536. * additonal flags when clk handling is moved
  537. * to hwmod framework.
  538. */
  539. .module_offs = CORE_MOD,
  540. .prcm_reg_id = 1,
  541. .module_bit = OMAP2430_EN_I2CHS1_SHIFT,
  542. .idlest_reg_id = 1,
  543. .idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
  544. },
  545. },
  546. .slaves = omap2430_i2c1_slaves,
  547. .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
  548. .class = &i2c_class,
  549. .dev_attr = &i2c_dev_attr,
  550. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  551. };
  552. /* I2C2 */
  553. static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
  554. { .irq = INT_24XX_I2C2_IRQ, },
  555. };
  556. static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
  557. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
  558. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
  559. };
  560. static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
  561. &omap2430_l4_core__i2c2,
  562. };
  563. static struct omap_hwmod omap2430_i2c2_hwmod = {
  564. .name = "i2c2",
  565. .mpu_irqs = i2c2_mpu_irqs,
  566. .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
  567. .sdma_reqs = i2c2_sdma_reqs,
  568. .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
  569. .main_clk = "i2chs2_fck",
  570. .prcm = {
  571. .omap2 = {
  572. .module_offs = CORE_MOD,
  573. .prcm_reg_id = 1,
  574. .module_bit = OMAP2430_EN_I2CHS2_SHIFT,
  575. .idlest_reg_id = 1,
  576. .idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
  577. },
  578. },
  579. .slaves = omap2430_i2c2_slaves,
  580. .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
  581. .class = &i2c_class,
  582. .dev_attr = &i2c_dev_attr,
  583. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  584. };
  585. /* l4_wkup -> gpio1 */
  586. static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
  587. {
  588. .pa_start = 0x4900C000,
  589. .pa_end = 0x4900C1ff,
  590. .flags = ADDR_TYPE_RT
  591. },
  592. };
  593. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
  594. .master = &omap2430_l4_wkup_hwmod,
  595. .slave = &omap2430_gpio1_hwmod,
  596. .clk = "gpios_ick",
  597. .addr = omap2430_gpio1_addr_space,
  598. .addr_cnt = ARRAY_SIZE(omap2430_gpio1_addr_space),
  599. .user = OCP_USER_MPU | OCP_USER_SDMA,
  600. };
  601. /* l4_wkup -> gpio2 */
  602. static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
  603. {
  604. .pa_start = 0x4900E000,
  605. .pa_end = 0x4900E1ff,
  606. .flags = ADDR_TYPE_RT
  607. },
  608. };
  609. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
  610. .master = &omap2430_l4_wkup_hwmod,
  611. .slave = &omap2430_gpio2_hwmod,
  612. .clk = "gpios_ick",
  613. .addr = omap2430_gpio2_addr_space,
  614. .addr_cnt = ARRAY_SIZE(omap2430_gpio2_addr_space),
  615. .user = OCP_USER_MPU | OCP_USER_SDMA,
  616. };
  617. /* l4_wkup -> gpio3 */
  618. static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
  619. {
  620. .pa_start = 0x49010000,
  621. .pa_end = 0x490101ff,
  622. .flags = ADDR_TYPE_RT
  623. },
  624. };
  625. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
  626. .master = &omap2430_l4_wkup_hwmod,
  627. .slave = &omap2430_gpio3_hwmod,
  628. .clk = "gpios_ick",
  629. .addr = omap2430_gpio3_addr_space,
  630. .addr_cnt = ARRAY_SIZE(omap2430_gpio3_addr_space),
  631. .user = OCP_USER_MPU | OCP_USER_SDMA,
  632. };
  633. /* l4_wkup -> gpio4 */
  634. static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
  635. {
  636. .pa_start = 0x49012000,
  637. .pa_end = 0x490121ff,
  638. .flags = ADDR_TYPE_RT
  639. },
  640. };
  641. static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
  642. .master = &omap2430_l4_wkup_hwmod,
  643. .slave = &omap2430_gpio4_hwmod,
  644. .clk = "gpios_ick",
  645. .addr = omap2430_gpio4_addr_space,
  646. .addr_cnt = ARRAY_SIZE(omap2430_gpio4_addr_space),
  647. .user = OCP_USER_MPU | OCP_USER_SDMA,
  648. };
  649. /* l4_core -> gpio5 */
  650. static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
  651. {
  652. .pa_start = 0x480B6000,
  653. .pa_end = 0x480B61ff,
  654. .flags = ADDR_TYPE_RT
  655. },
  656. };
  657. static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
  658. .master = &omap2430_l4_core_hwmod,
  659. .slave = &omap2430_gpio5_hwmod,
  660. .clk = "gpio5_ick",
  661. .addr = omap2430_gpio5_addr_space,
  662. .addr_cnt = ARRAY_SIZE(omap2430_gpio5_addr_space),
  663. .user = OCP_USER_MPU | OCP_USER_SDMA,
  664. };
  665. /* gpio dev_attr */
  666. static struct omap_gpio_dev_attr gpio_dev_attr = {
  667. .bank_width = 32,
  668. .dbck_flag = false,
  669. };
  670. static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
  671. .rev_offs = 0x0000,
  672. .sysc_offs = 0x0010,
  673. .syss_offs = 0x0014,
  674. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  675. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  676. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  677. .sysc_fields = &omap_hwmod_sysc_type1,
  678. };
  679. /*
  680. * 'gpio' class
  681. * general purpose io module
  682. */
  683. static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
  684. .name = "gpio",
  685. .sysc = &omap243x_gpio_sysc,
  686. .rev = 0,
  687. };
  688. /* gpio1 */
  689. static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = {
  690. { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
  691. };
  692. static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
  693. &omap2430_l4_wkup__gpio1,
  694. };
  695. static struct omap_hwmod omap2430_gpio1_hwmod = {
  696. .name = "gpio1",
  697. .mpu_irqs = omap243x_gpio1_irqs,
  698. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_irqs),
  699. .main_clk = "gpios_fck",
  700. .prcm = {
  701. .omap2 = {
  702. .prcm_reg_id = 1,
  703. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  704. .module_offs = WKUP_MOD,
  705. .idlest_reg_id = 1,
  706. .idlest_idle_bit = OMAP24XX_EN_GPIOS_SHIFT,
  707. },
  708. },
  709. .slaves = omap2430_gpio1_slaves,
  710. .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
  711. .class = &omap243x_gpio_hwmod_class,
  712. .dev_attr = &gpio_dev_attr,
  713. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  714. };
  715. /* gpio2 */
  716. static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = {
  717. { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
  718. };
  719. static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
  720. &omap2430_l4_wkup__gpio2,
  721. };
  722. static struct omap_hwmod omap2430_gpio2_hwmod = {
  723. .name = "gpio2",
  724. .mpu_irqs = omap243x_gpio2_irqs,
  725. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_irqs),
  726. .main_clk = "gpios_fck",
  727. .prcm = {
  728. .omap2 = {
  729. .prcm_reg_id = 1,
  730. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  731. .module_offs = WKUP_MOD,
  732. .idlest_reg_id = 1,
  733. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  734. },
  735. },
  736. .slaves = omap2430_gpio2_slaves,
  737. .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
  738. .class = &omap243x_gpio_hwmod_class,
  739. .dev_attr = &gpio_dev_attr,
  740. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  741. };
  742. /* gpio3 */
  743. static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = {
  744. { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
  745. };
  746. static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
  747. &omap2430_l4_wkup__gpio3,
  748. };
  749. static struct omap_hwmod omap2430_gpio3_hwmod = {
  750. .name = "gpio3",
  751. .mpu_irqs = omap243x_gpio3_irqs,
  752. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_irqs),
  753. .main_clk = "gpios_fck",
  754. .prcm = {
  755. .omap2 = {
  756. .prcm_reg_id = 1,
  757. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  758. .module_offs = WKUP_MOD,
  759. .idlest_reg_id = 1,
  760. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  761. },
  762. },
  763. .slaves = omap2430_gpio3_slaves,
  764. .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
  765. .class = &omap243x_gpio_hwmod_class,
  766. .dev_attr = &gpio_dev_attr,
  767. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  768. };
  769. /* gpio4 */
  770. static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = {
  771. { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
  772. };
  773. static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
  774. &omap2430_l4_wkup__gpio4,
  775. };
  776. static struct omap_hwmod omap2430_gpio4_hwmod = {
  777. .name = "gpio4",
  778. .mpu_irqs = omap243x_gpio4_irqs,
  779. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
  780. .main_clk = "gpios_fck",
  781. .prcm = {
  782. .omap2 = {
  783. .prcm_reg_id = 1,
  784. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  785. .module_offs = WKUP_MOD,
  786. .idlest_reg_id = 1,
  787. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  788. },
  789. },
  790. .slaves = omap2430_gpio4_slaves,
  791. .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
  792. .class = &omap243x_gpio_hwmod_class,
  793. .dev_attr = &gpio_dev_attr,
  794. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  795. };
  796. /* gpio5 */
  797. static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
  798. { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
  799. };
  800. static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
  801. &omap2430_l4_core__gpio5,
  802. };
  803. static struct omap_hwmod omap2430_gpio5_hwmod = {
  804. .name = "gpio5",
  805. .mpu_irqs = omap243x_gpio5_irqs,
  806. .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
  807. .main_clk = "gpio5_fck",
  808. .prcm = {
  809. .omap2 = {
  810. .prcm_reg_id = 2,
  811. .module_bit = OMAP2430_EN_GPIO5_SHIFT,
  812. .module_offs = CORE_MOD,
  813. .idlest_reg_id = 2,
  814. .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
  815. },
  816. },
  817. .slaves = omap2430_gpio5_slaves,
  818. .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
  819. .class = &omap243x_gpio_hwmod_class,
  820. .dev_attr = &gpio_dev_attr,
  821. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  822. };
  823. /* dma_system */
  824. static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = {
  825. .rev_offs = 0x0000,
  826. .sysc_offs = 0x002c,
  827. .syss_offs = 0x0028,
  828. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
  829. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
  830. SYSC_HAS_AUTOIDLE),
  831. .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  832. .sysc_fields = &omap_hwmod_sysc_type1,
  833. };
  834. static struct omap_hwmod_class omap2430_dma_hwmod_class = {
  835. .name = "dma",
  836. .sysc = &omap2430_dma_sysc,
  837. };
  838. /* dma attributes */
  839. static struct omap_dma_dev_attr dma_dev_attr = {
  840. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  841. IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
  842. .lch_count = 32,
  843. };
  844. static struct omap_hwmod_irq_info omap2430_dma_system_irqs[] = {
  845. { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
  846. { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
  847. { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
  848. { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
  849. };
  850. static struct omap_hwmod_addr_space omap2430_dma_system_addrs[] = {
  851. {
  852. .pa_start = 0x48056000,
  853. .pa_end = 0x4a0560ff,
  854. .flags = ADDR_TYPE_RT
  855. },
  856. };
  857. /* dma_system -> L3 */
  858. static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = {
  859. .master = &omap2430_dma_system_hwmod,
  860. .slave = &omap2430_l3_main_hwmod,
  861. .clk = "core_l3_ck",
  862. .user = OCP_USER_MPU | OCP_USER_SDMA,
  863. };
  864. /* dma_system master ports */
  865. static struct omap_hwmod_ocp_if *omap2430_dma_system_masters[] = {
  866. &omap2430_dma_system__l3,
  867. };
  868. /* l4_core -> dma_system */
  869. static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
  870. .master = &omap2430_l4_core_hwmod,
  871. .slave = &omap2430_dma_system_hwmod,
  872. .clk = "sdma_ick",
  873. .addr = omap2430_dma_system_addrs,
  874. .addr_cnt = ARRAY_SIZE(omap2430_dma_system_addrs),
  875. .user = OCP_USER_MPU | OCP_USER_SDMA,
  876. };
  877. /* dma_system slave ports */
  878. static struct omap_hwmod_ocp_if *omap2430_dma_system_slaves[] = {
  879. &omap2430_l4_core__dma_system,
  880. };
  881. static struct omap_hwmod omap2430_dma_system_hwmod = {
  882. .name = "dma",
  883. .class = &omap2430_dma_hwmod_class,
  884. .mpu_irqs = omap2430_dma_system_irqs,
  885. .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dma_system_irqs),
  886. .main_clk = "core_l3_ck",
  887. .slaves = omap2430_dma_system_slaves,
  888. .slaves_cnt = ARRAY_SIZE(omap2430_dma_system_slaves),
  889. .masters = omap2430_dma_system_masters,
  890. .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters),
  891. .dev_attr = &dma_dev_attr,
  892. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  893. .flags = HWMOD_NO_IDLEST,
  894. };
  895. /*
  896. * 'mcspi' class
  897. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  898. * bus
  899. */
  900. static struct omap_hwmod_class_sysconfig omap2430_mcspi_sysc = {
  901. .rev_offs = 0x0000,
  902. .sysc_offs = 0x0010,
  903. .syss_offs = 0x0014,
  904. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  905. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  906. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  907. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  908. .sysc_fields = &omap_hwmod_sysc_type1,
  909. };
  910. static struct omap_hwmod_class omap2430_mcspi_class = {
  911. .name = "mcspi",
  912. .sysc = &omap2430_mcspi_sysc,
  913. .rev = OMAP2_MCSPI_REV,
  914. };
  915. /* mcspi1 */
  916. static struct omap_hwmod_irq_info omap2430_mcspi1_mpu_irqs[] = {
  917. { .irq = 65 },
  918. };
  919. static struct omap_hwmod_dma_info omap2430_mcspi1_sdma_reqs[] = {
  920. { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
  921. { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
  922. { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
  923. { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
  924. { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
  925. { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
  926. { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
  927. { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
  928. };
  929. static struct omap_hwmod_ocp_if *omap2430_mcspi1_slaves[] = {
  930. &omap2430_l4_core__mcspi1,
  931. };
  932. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  933. .num_chipselect = 4,
  934. };
  935. static struct omap_hwmod omap2430_mcspi1_hwmod = {
  936. .name = "mcspi1_hwmod",
  937. .mpu_irqs = omap2430_mcspi1_mpu_irqs,
  938. .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi1_mpu_irqs),
  939. .sdma_reqs = omap2430_mcspi1_sdma_reqs,
  940. .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi1_sdma_reqs),
  941. .main_clk = "mcspi1_fck",
  942. .prcm = {
  943. .omap2 = {
  944. .module_offs = CORE_MOD,
  945. .prcm_reg_id = 1,
  946. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  947. .idlest_reg_id = 1,
  948. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  949. },
  950. },
  951. .slaves = omap2430_mcspi1_slaves,
  952. .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves),
  953. .class = &omap2430_mcspi_class,
  954. .dev_attr = &omap_mcspi1_dev_attr,
  955. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  956. };
  957. /* mcspi2 */
  958. static struct omap_hwmod_irq_info omap2430_mcspi2_mpu_irqs[] = {
  959. { .irq = 66 },
  960. };
  961. static struct omap_hwmod_dma_info omap2430_mcspi2_sdma_reqs[] = {
  962. { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
  963. { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
  964. { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
  965. { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
  966. };
  967. static struct omap_hwmod_ocp_if *omap2430_mcspi2_slaves[] = {
  968. &omap2430_l4_core__mcspi2,
  969. };
  970. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  971. .num_chipselect = 2,
  972. };
  973. static struct omap_hwmod omap2430_mcspi2_hwmod = {
  974. .name = "mcspi2_hwmod",
  975. .mpu_irqs = omap2430_mcspi2_mpu_irqs,
  976. .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi2_mpu_irqs),
  977. .sdma_reqs = omap2430_mcspi2_sdma_reqs,
  978. .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi2_sdma_reqs),
  979. .main_clk = "mcspi2_fck",
  980. .prcm = {
  981. .omap2 = {
  982. .module_offs = CORE_MOD,
  983. .prcm_reg_id = 1,
  984. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  985. .idlest_reg_id = 1,
  986. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  987. },
  988. },
  989. .slaves = omap2430_mcspi2_slaves,
  990. .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves),
  991. .class = &omap2430_mcspi_class,
  992. .dev_attr = &omap_mcspi2_dev_attr,
  993. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  994. };
  995. /* mcspi3 */
  996. static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
  997. { .irq = 91 },
  998. };
  999. static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
  1000. { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
  1001. { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
  1002. { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
  1003. { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
  1004. };
  1005. static struct omap_hwmod_ocp_if *omap2430_mcspi3_slaves[] = {
  1006. &omap2430_l4_core__mcspi3,
  1007. };
  1008. static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
  1009. .num_chipselect = 2,
  1010. };
  1011. static struct omap_hwmod omap2430_mcspi3_hwmod = {
  1012. .name = "mcspi3_hwmod",
  1013. .mpu_irqs = omap2430_mcspi3_mpu_irqs,
  1014. .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi3_mpu_irqs),
  1015. .sdma_reqs = omap2430_mcspi3_sdma_reqs,
  1016. .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi3_sdma_reqs),
  1017. .main_clk = "mcspi3_fck",
  1018. .prcm = {
  1019. .omap2 = {
  1020. .module_offs = CORE_MOD,
  1021. .prcm_reg_id = 2,
  1022. .module_bit = OMAP2430_EN_MCSPI3_SHIFT,
  1023. .idlest_reg_id = 2,
  1024. .idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
  1025. },
  1026. },
  1027. .slaves = omap2430_mcspi3_slaves,
  1028. .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves),
  1029. .class = &omap2430_mcspi_class,
  1030. .dev_attr = &omap_mcspi3_dev_attr,
  1031. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
  1032. };
  1033. /*
  1034. * usbhsotg
  1035. */
  1036. static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
  1037. .rev_offs = 0x0400,
  1038. .sysc_offs = 0x0404,
  1039. .syss_offs = 0x0408,
  1040. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
  1041. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1042. SYSC_HAS_AUTOIDLE),
  1043. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  1044. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  1045. .sysc_fields = &omap_hwmod_sysc_type1,
  1046. };
  1047. static struct omap_hwmod_class usbotg_class = {
  1048. .name = "usbotg",
  1049. .sysc = &omap2430_usbhsotg_sysc,
  1050. };
  1051. /* usb_otg_hs */
  1052. static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
  1053. { .name = "mc", .irq = 92 },
  1054. { .name = "dma", .irq = 93 },
  1055. };
  1056. static struct omap_hwmod omap2430_usbhsotg_hwmod = {
  1057. .name = "usb_otg_hs",
  1058. .mpu_irqs = omap2430_usbhsotg_mpu_irqs,
  1059. .mpu_irqs_cnt = ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs),
  1060. .main_clk = "usbhs_ick",
  1061. .prcm = {
  1062. .omap2 = {
  1063. .prcm_reg_id = 1,
  1064. .module_bit = OMAP2430_EN_USBHS_MASK,
  1065. .module_offs = CORE_MOD,
  1066. .idlest_reg_id = 1,
  1067. .idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
  1068. },
  1069. },
  1070. .masters = omap2430_usbhsotg_masters,
  1071. .masters_cnt = ARRAY_SIZE(omap2430_usbhsotg_masters),
  1072. .slaves = omap2430_usbhsotg_slaves,
  1073. .slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves),
  1074. .class = &usbotg_class,
  1075. /*
  1076. * Erratum ID: i479 idle_req / idle_ack mechanism potentially
  1077. * broken when autoidle is enabled
  1078. * workaround is to disable the autoidle bit at module level.
  1079. */
  1080. .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
  1081. | HWMOD_SWSUP_MSTANDBY,
  1082. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
  1083. };
  1084. static __initdata struct omap_hwmod *omap2430_hwmods[] = {
  1085. &omap2430_l3_main_hwmod,
  1086. &omap2430_l4_core_hwmod,
  1087. &omap2430_l4_wkup_hwmod,
  1088. &omap2430_mpu_hwmod,
  1089. &omap2430_iva_hwmod,
  1090. &omap2430_wd_timer2_hwmod,
  1091. &omap2430_uart1_hwmod,
  1092. &omap2430_uart2_hwmod,
  1093. &omap2430_uart3_hwmod,
  1094. &omap2430_i2c1_hwmod,
  1095. &omap2430_i2c2_hwmod,
  1096. /* gpio class */
  1097. &omap2430_gpio1_hwmod,
  1098. &omap2430_gpio2_hwmod,
  1099. &omap2430_gpio3_hwmod,
  1100. &omap2430_gpio4_hwmod,
  1101. &omap2430_gpio5_hwmod,
  1102. /* dma_system class*/
  1103. &omap2430_dma_system_hwmod,
  1104. /* mcspi class */
  1105. &omap2430_mcspi1_hwmod,
  1106. &omap2430_mcspi2_hwmod,
  1107. &omap2430_mcspi3_hwmod,
  1108. /* usbotg class*/
  1109. &omap2430_usbhsotg_hwmod,
  1110. NULL,
  1111. };
  1112. int __init omap2430_hwmod_init(void)
  1113. {
  1114. return omap_hwmod_init(omap2430_hwmods);
  1115. }