omap_hwmod_2420_data.c 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  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 <plat/mcspi.h>
  22. #include <plat/l3_2xxx.h>
  23. #include <plat/l4_2xxx.h>
  24. #include "omap_hwmod_common_data.h"
  25. #include "cm-regbits-24xx.h"
  26. #include "prm-regbits-24xx.h"
  27. #include "wd_timer.h"
  28. /*
  29. * OMAP2420 hardware module integration data
  30. *
  31. * ALl of the data in this section should be autogeneratable from the
  32. * TI hardware database or other technical documentation. Data that
  33. * is driver-specific or driver-kernel integration-specific belongs
  34. * elsewhere.
  35. */
  36. static struct omap_hwmod omap2420_mpu_hwmod;
  37. static struct omap_hwmod omap2420_iva_hwmod;
  38. static struct omap_hwmod omap2420_l3_main_hwmod;
  39. static struct omap_hwmod omap2420_l4_core_hwmod;
  40. static struct omap_hwmod omap2420_dss_core_hwmod;
  41. static struct omap_hwmod omap2420_dss_dispc_hwmod;
  42. static struct omap_hwmod omap2420_dss_rfbi_hwmod;
  43. static struct omap_hwmod omap2420_dss_venc_hwmod;
  44. static struct omap_hwmod omap2420_wd_timer2_hwmod;
  45. static struct omap_hwmod omap2420_gpio1_hwmod;
  46. static struct omap_hwmod omap2420_gpio2_hwmod;
  47. static struct omap_hwmod omap2420_gpio3_hwmod;
  48. static struct omap_hwmod omap2420_gpio4_hwmod;
  49. static struct omap_hwmod omap2420_dma_system_hwmod;
  50. static struct omap_hwmod omap2420_mcspi1_hwmod;
  51. static struct omap_hwmod omap2420_mcspi2_hwmod;
  52. /* L3 -> L4_CORE interface */
  53. static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
  54. .master = &omap2420_l3_main_hwmod,
  55. .slave = &omap2420_l4_core_hwmod,
  56. .user = OCP_USER_MPU | OCP_USER_SDMA,
  57. };
  58. /* MPU -> L3 interface */
  59. static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
  60. .master = &omap2420_mpu_hwmod,
  61. .slave = &omap2420_l3_main_hwmod,
  62. .user = OCP_USER_MPU,
  63. };
  64. /* Slave interfaces on the L3 interconnect */
  65. static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
  66. &omap2420_mpu__l3_main,
  67. };
  68. /* DSS -> l3 */
  69. static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
  70. .master = &omap2420_dss_core_hwmod,
  71. .slave = &omap2420_l3_main_hwmod,
  72. .fw = {
  73. .omap2 = {
  74. .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
  75. .flags = OMAP_FIREWALL_L3,
  76. }
  77. },
  78. .user = OCP_USER_MPU | OCP_USER_SDMA,
  79. };
  80. /* Master interfaces on the L3 interconnect */
  81. static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
  82. &omap2420_l3_main__l4_core,
  83. };
  84. /* L3 */
  85. static struct omap_hwmod omap2420_l3_main_hwmod = {
  86. .name = "l3_main",
  87. .class = &l3_hwmod_class,
  88. .masters = omap2420_l3_main_masters,
  89. .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
  90. .slaves = omap2420_l3_main_slaves,
  91. .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
  92. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  93. .flags = HWMOD_NO_IDLEST,
  94. };
  95. static struct omap_hwmod omap2420_l4_wkup_hwmod;
  96. static struct omap_hwmod omap2420_uart1_hwmod;
  97. static struct omap_hwmod omap2420_uart2_hwmod;
  98. static struct omap_hwmod omap2420_uart3_hwmod;
  99. static struct omap_hwmod omap2420_i2c1_hwmod;
  100. static struct omap_hwmod omap2420_i2c2_hwmod;
  101. /* l4 core -> mcspi1 interface */
  102. static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = {
  103. {
  104. .pa_start = 0x48098000,
  105. .pa_end = 0x480980ff,
  106. .flags = ADDR_TYPE_RT,
  107. },
  108. };
  109. static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi1 = {
  110. .master = &omap2420_l4_core_hwmod,
  111. .slave = &omap2420_mcspi1_hwmod,
  112. .clk = "mcspi1_ick",
  113. .addr = omap2420_mcspi1_addr_space,
  114. .addr_cnt = ARRAY_SIZE(omap2420_mcspi1_addr_space),
  115. .user = OCP_USER_MPU | OCP_USER_SDMA,
  116. };
  117. /* l4 core -> mcspi2 interface */
  118. static struct omap_hwmod_addr_space omap2420_mcspi2_addr_space[] = {
  119. {
  120. .pa_start = 0x4809a000,
  121. .pa_end = 0x4809a0ff,
  122. .flags = ADDR_TYPE_RT,
  123. },
  124. };
  125. static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi2 = {
  126. .master = &omap2420_l4_core_hwmod,
  127. .slave = &omap2420_mcspi2_hwmod,
  128. .clk = "mcspi2_ick",
  129. .addr = omap2420_mcspi2_addr_space,
  130. .addr_cnt = ARRAY_SIZE(omap2420_mcspi2_addr_space),
  131. .user = OCP_USER_MPU | OCP_USER_SDMA,
  132. };
  133. /* L4_CORE -> L4_WKUP interface */
  134. static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
  135. .master = &omap2420_l4_core_hwmod,
  136. .slave = &omap2420_l4_wkup_hwmod,
  137. .user = OCP_USER_MPU | OCP_USER_SDMA,
  138. };
  139. /* L4 CORE -> UART1 interface */
  140. static struct omap_hwmod_addr_space omap2420_uart1_addr_space[] = {
  141. {
  142. .pa_start = OMAP2_UART1_BASE,
  143. .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
  144. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  145. },
  146. };
  147. static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
  148. .master = &omap2420_l4_core_hwmod,
  149. .slave = &omap2420_uart1_hwmod,
  150. .clk = "uart1_ick",
  151. .addr = omap2420_uart1_addr_space,
  152. .addr_cnt = ARRAY_SIZE(omap2420_uart1_addr_space),
  153. .user = OCP_USER_MPU | OCP_USER_SDMA,
  154. };
  155. /* L4 CORE -> UART2 interface */
  156. static struct omap_hwmod_addr_space omap2420_uart2_addr_space[] = {
  157. {
  158. .pa_start = OMAP2_UART2_BASE,
  159. .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
  160. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  161. },
  162. };
  163. static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
  164. .master = &omap2420_l4_core_hwmod,
  165. .slave = &omap2420_uart2_hwmod,
  166. .clk = "uart2_ick",
  167. .addr = omap2420_uart2_addr_space,
  168. .addr_cnt = ARRAY_SIZE(omap2420_uart2_addr_space),
  169. .user = OCP_USER_MPU | OCP_USER_SDMA,
  170. };
  171. /* L4 PER -> UART3 interface */
  172. static struct omap_hwmod_addr_space omap2420_uart3_addr_space[] = {
  173. {
  174. .pa_start = OMAP2_UART3_BASE,
  175. .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
  176. .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
  177. },
  178. };
  179. static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
  180. .master = &omap2420_l4_core_hwmod,
  181. .slave = &omap2420_uart3_hwmod,
  182. .clk = "uart3_ick",
  183. .addr = omap2420_uart3_addr_space,
  184. .addr_cnt = ARRAY_SIZE(omap2420_uart3_addr_space),
  185. .user = OCP_USER_MPU | OCP_USER_SDMA,
  186. };
  187. /* I2C IP block address space length (in bytes) */
  188. #define OMAP2_I2C_AS_LEN 128
  189. /* L4 CORE -> I2C1 interface */
  190. static struct omap_hwmod_addr_space omap2420_i2c1_addr_space[] = {
  191. {
  192. .pa_start = 0x48070000,
  193. .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
  194. .flags = ADDR_TYPE_RT,
  195. },
  196. };
  197. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
  198. .master = &omap2420_l4_core_hwmod,
  199. .slave = &omap2420_i2c1_hwmod,
  200. .clk = "i2c1_ick",
  201. .addr = omap2420_i2c1_addr_space,
  202. .addr_cnt = ARRAY_SIZE(omap2420_i2c1_addr_space),
  203. .user = OCP_USER_MPU | OCP_USER_SDMA,
  204. };
  205. /* L4 CORE -> I2C2 interface */
  206. static struct omap_hwmod_addr_space omap2420_i2c2_addr_space[] = {
  207. {
  208. .pa_start = 0x48072000,
  209. .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
  210. .flags = ADDR_TYPE_RT,
  211. },
  212. };
  213. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
  214. .master = &omap2420_l4_core_hwmod,
  215. .slave = &omap2420_i2c2_hwmod,
  216. .clk = "i2c2_ick",
  217. .addr = omap2420_i2c2_addr_space,
  218. .addr_cnt = ARRAY_SIZE(omap2420_i2c2_addr_space),
  219. .user = OCP_USER_MPU | OCP_USER_SDMA,
  220. };
  221. /* Slave interfaces on the L4_CORE interconnect */
  222. static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
  223. &omap2420_l3_main__l4_core,
  224. };
  225. /* Master interfaces on the L4_CORE interconnect */
  226. static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
  227. &omap2420_l4_core__l4_wkup,
  228. &omap2_l4_core__uart1,
  229. &omap2_l4_core__uart2,
  230. &omap2_l4_core__uart3,
  231. &omap2420_l4_core__i2c1,
  232. &omap2420_l4_core__i2c2
  233. };
  234. /* L4 CORE */
  235. static struct omap_hwmod omap2420_l4_core_hwmod = {
  236. .name = "l4_core",
  237. .class = &l4_hwmod_class,
  238. .masters = omap2420_l4_core_masters,
  239. .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
  240. .slaves = omap2420_l4_core_slaves,
  241. .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
  242. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  243. .flags = HWMOD_NO_IDLEST,
  244. };
  245. /* Slave interfaces on the L4_WKUP interconnect */
  246. static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
  247. &omap2420_l4_core__l4_wkup,
  248. };
  249. /* Master interfaces on the L4_WKUP interconnect */
  250. static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
  251. };
  252. /* L4 WKUP */
  253. static struct omap_hwmod omap2420_l4_wkup_hwmod = {
  254. .name = "l4_wkup",
  255. .class = &l4_hwmod_class,
  256. .masters = omap2420_l4_wkup_masters,
  257. .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
  258. .slaves = omap2420_l4_wkup_slaves,
  259. .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
  260. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  261. .flags = HWMOD_NO_IDLEST,
  262. };
  263. /* Master interfaces on the MPU device */
  264. static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
  265. &omap2420_mpu__l3_main,
  266. };
  267. /* MPU */
  268. static struct omap_hwmod omap2420_mpu_hwmod = {
  269. .name = "mpu",
  270. .class = &mpu_hwmod_class,
  271. .main_clk = "mpu_ck",
  272. .masters = omap2420_mpu_masters,
  273. .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
  274. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  275. };
  276. /*
  277. * IVA1 interface data
  278. */
  279. /* IVA <- L3 interface */
  280. static struct omap_hwmod_ocp_if omap2420_l3__iva = {
  281. .master = &omap2420_l3_main_hwmod,
  282. .slave = &omap2420_iva_hwmod,
  283. .clk = "iva1_ifck",
  284. .user = OCP_USER_MPU | OCP_USER_SDMA,
  285. };
  286. static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = {
  287. &omap2420_l3__iva,
  288. };
  289. /*
  290. * IVA2 (IVA2)
  291. */
  292. static struct omap_hwmod omap2420_iva_hwmod = {
  293. .name = "iva",
  294. .class = &iva_hwmod_class,
  295. .masters = omap2420_iva_masters,
  296. .masters_cnt = ARRAY_SIZE(omap2420_iva_masters),
  297. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
  298. };
  299. /* l4_wkup -> wd_timer2 */
  300. static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
  301. {
  302. .pa_start = 0x48022000,
  303. .pa_end = 0x4802207f,
  304. .flags = ADDR_TYPE_RT
  305. },
  306. };
  307. static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
  308. .master = &omap2420_l4_wkup_hwmod,
  309. .slave = &omap2420_wd_timer2_hwmod,
  310. .clk = "mpu_wdt_ick",
  311. .addr = omap2420_wd_timer2_addrs,
  312. .addr_cnt = ARRAY_SIZE(omap2420_wd_timer2_addrs),
  313. .user = OCP_USER_MPU | OCP_USER_SDMA,
  314. };
  315. /*
  316. * 'wd_timer' class
  317. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  318. * overflow condition
  319. */
  320. static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
  321. .rev_offs = 0x0000,
  322. .sysc_offs = 0x0010,
  323. .syss_offs = 0x0014,
  324. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  325. SYSC_HAS_AUTOIDLE),
  326. .sysc_fields = &omap_hwmod_sysc_type1,
  327. };
  328. static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
  329. .name = "wd_timer",
  330. .sysc = &omap2420_wd_timer_sysc,
  331. .pre_shutdown = &omap2_wd_timer_disable
  332. };
  333. /* wd_timer2 */
  334. static struct omap_hwmod_ocp_if *omap2420_wd_timer2_slaves[] = {
  335. &omap2420_l4_wkup__wd_timer2,
  336. };
  337. static struct omap_hwmod omap2420_wd_timer2_hwmod = {
  338. .name = "wd_timer2",
  339. .class = &omap2420_wd_timer_hwmod_class,
  340. .main_clk = "mpu_wdt_fck",
  341. .prcm = {
  342. .omap2 = {
  343. .prcm_reg_id = 1,
  344. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  345. .module_offs = WKUP_MOD,
  346. .idlest_reg_id = 1,
  347. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  348. },
  349. },
  350. .slaves = omap2420_wd_timer2_slaves,
  351. .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves),
  352. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  353. };
  354. /* UART */
  355. static struct omap_hwmod_class_sysconfig uart_sysc = {
  356. .rev_offs = 0x50,
  357. .sysc_offs = 0x54,
  358. .syss_offs = 0x58,
  359. .sysc_flags = (SYSC_HAS_SIDLEMODE |
  360. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  361. SYSC_HAS_AUTOIDLE),
  362. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  363. .sysc_fields = &omap_hwmod_sysc_type1,
  364. };
  365. static struct omap_hwmod_class uart_class = {
  366. .name = "uart",
  367. .sysc = &uart_sysc,
  368. };
  369. /* UART1 */
  370. static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
  371. { .irq = INT_24XX_UART1_IRQ, },
  372. };
  373. static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
  374. { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
  375. { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
  376. };
  377. static struct omap_hwmod_ocp_if *omap2420_uart1_slaves[] = {
  378. &omap2_l4_core__uart1,
  379. };
  380. static struct omap_hwmod omap2420_uart1_hwmod = {
  381. .name = "uart1",
  382. .mpu_irqs = uart1_mpu_irqs,
  383. .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
  384. .sdma_reqs = uart1_sdma_reqs,
  385. .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
  386. .main_clk = "uart1_fck",
  387. .prcm = {
  388. .omap2 = {
  389. .module_offs = CORE_MOD,
  390. .prcm_reg_id = 1,
  391. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  392. .idlest_reg_id = 1,
  393. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  394. },
  395. },
  396. .slaves = omap2420_uart1_slaves,
  397. .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
  398. .class = &uart_class,
  399. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  400. };
  401. /* UART2 */
  402. static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
  403. { .irq = INT_24XX_UART2_IRQ, },
  404. };
  405. static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
  406. { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
  407. { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
  408. };
  409. static struct omap_hwmod_ocp_if *omap2420_uart2_slaves[] = {
  410. &omap2_l4_core__uart2,
  411. };
  412. static struct omap_hwmod omap2420_uart2_hwmod = {
  413. .name = "uart2",
  414. .mpu_irqs = uart2_mpu_irqs,
  415. .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
  416. .sdma_reqs = uart2_sdma_reqs,
  417. .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
  418. .main_clk = "uart2_fck",
  419. .prcm = {
  420. .omap2 = {
  421. .module_offs = CORE_MOD,
  422. .prcm_reg_id = 1,
  423. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  424. .idlest_reg_id = 1,
  425. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  426. },
  427. },
  428. .slaves = omap2420_uart2_slaves,
  429. .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
  430. .class = &uart_class,
  431. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  432. };
  433. /* UART3 */
  434. static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
  435. { .irq = INT_24XX_UART3_IRQ, },
  436. };
  437. static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
  438. { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
  439. { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
  440. };
  441. static struct omap_hwmod_ocp_if *omap2420_uart3_slaves[] = {
  442. &omap2_l4_core__uart3,
  443. };
  444. static struct omap_hwmod omap2420_uart3_hwmod = {
  445. .name = "uart3",
  446. .mpu_irqs = uart3_mpu_irqs,
  447. .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
  448. .sdma_reqs = uart3_sdma_reqs,
  449. .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
  450. .main_clk = "uart3_fck",
  451. .prcm = {
  452. .omap2 = {
  453. .module_offs = CORE_MOD,
  454. .prcm_reg_id = 2,
  455. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  456. .idlest_reg_id = 2,
  457. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  458. },
  459. },
  460. .slaves = omap2420_uart3_slaves,
  461. .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
  462. .class = &uart_class,
  463. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  464. };
  465. /*
  466. * 'dss' class
  467. * display sub-system
  468. */
  469. static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
  470. .rev_offs = 0x0000,
  471. .sysc_offs = 0x0010,
  472. .syss_offs = 0x0014,
  473. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  474. .sysc_fields = &omap_hwmod_sysc_type1,
  475. };
  476. static struct omap_hwmod_class omap2420_dss_hwmod_class = {
  477. .name = "dss",
  478. .sysc = &omap2420_dss_sysc,
  479. };
  480. /* dss */
  481. static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
  482. { .irq = 25 },
  483. };
  484. static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
  485. { .name = "dispc", .dma_req = 5 },
  486. };
  487. /* dss */
  488. /* dss master ports */
  489. static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
  490. &omap2420_dss__l3,
  491. };
  492. static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
  493. {
  494. .pa_start = 0x48050000,
  495. .pa_end = 0x480503FF,
  496. .flags = ADDR_TYPE_RT
  497. },
  498. };
  499. /* l4_core -> dss */
  500. static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
  501. .master = &omap2420_l4_core_hwmod,
  502. .slave = &omap2420_dss_core_hwmod,
  503. .clk = "dss_ick",
  504. .addr = omap2420_dss_addrs,
  505. .addr_cnt = ARRAY_SIZE(omap2420_dss_addrs),
  506. .fw = {
  507. .omap2 = {
  508. .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
  509. .flags = OMAP_FIREWALL_L4,
  510. }
  511. },
  512. .user = OCP_USER_MPU | OCP_USER_SDMA,
  513. };
  514. /* dss slave ports */
  515. static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
  516. &omap2420_l4_core__dss,
  517. };
  518. static struct omap_hwmod_opt_clk dss_opt_clks[] = {
  519. { .role = "tv_clk", .clk = "dss_54m_fck" },
  520. { .role = "sys_clk", .clk = "dss2_fck" },
  521. };
  522. static struct omap_hwmod omap2420_dss_core_hwmod = {
  523. .name = "dss_core",
  524. .class = &omap2420_dss_hwmod_class,
  525. .main_clk = "dss1_fck", /* instead of dss_fck */
  526. .mpu_irqs = omap2420_dss_irqs,
  527. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dss_irqs),
  528. .sdma_reqs = omap2420_dss_sdma_chs,
  529. .sdma_reqs_cnt = ARRAY_SIZE(omap2420_dss_sdma_chs),
  530. .prcm = {
  531. .omap2 = {
  532. .prcm_reg_id = 1,
  533. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  534. .module_offs = CORE_MOD,
  535. .idlest_reg_id = 1,
  536. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  537. },
  538. },
  539. .opt_clks = dss_opt_clks,
  540. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  541. .slaves = omap2420_dss_slaves,
  542. .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
  543. .masters = omap2420_dss_masters,
  544. .masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
  545. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  546. .flags = HWMOD_NO_IDLEST,
  547. };
  548. /*
  549. * 'dispc' class
  550. * display controller
  551. */
  552. static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = {
  553. .rev_offs = 0x0000,
  554. .sysc_offs = 0x0010,
  555. .syss_offs = 0x0014,
  556. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  557. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  558. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  559. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  560. .sysc_fields = &omap_hwmod_sysc_type1,
  561. };
  562. static struct omap_hwmod_class omap2420_dispc_hwmod_class = {
  563. .name = "dispc",
  564. .sysc = &omap2420_dispc_sysc,
  565. };
  566. static struct omap_hwmod_addr_space omap2420_dss_dispc_addrs[] = {
  567. {
  568. .pa_start = 0x48050400,
  569. .pa_end = 0x480507FF,
  570. .flags = ADDR_TYPE_RT
  571. },
  572. };
  573. /* l4_core -> dss_dispc */
  574. static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = {
  575. .master = &omap2420_l4_core_hwmod,
  576. .slave = &omap2420_dss_dispc_hwmod,
  577. .clk = "dss_ick",
  578. .addr = omap2420_dss_dispc_addrs,
  579. .addr_cnt = ARRAY_SIZE(omap2420_dss_dispc_addrs),
  580. .fw = {
  581. .omap2 = {
  582. .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION,
  583. .flags = OMAP_FIREWALL_L4,
  584. }
  585. },
  586. .user = OCP_USER_MPU | OCP_USER_SDMA,
  587. };
  588. /* dss_dispc slave ports */
  589. static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = {
  590. &omap2420_l4_core__dss_dispc,
  591. };
  592. static struct omap_hwmod omap2420_dss_dispc_hwmod = {
  593. .name = "dss_dispc",
  594. .class = &omap2420_dispc_hwmod_class,
  595. .main_clk = "dss1_fck",
  596. .prcm = {
  597. .omap2 = {
  598. .prcm_reg_id = 1,
  599. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  600. .module_offs = CORE_MOD,
  601. .idlest_reg_id = 1,
  602. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  603. },
  604. },
  605. .slaves = omap2420_dss_dispc_slaves,
  606. .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
  607. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  608. .flags = HWMOD_NO_IDLEST,
  609. };
  610. /*
  611. * 'rfbi' class
  612. * remote frame buffer interface
  613. */
  614. static struct omap_hwmod_class_sysconfig omap2420_rfbi_sysc = {
  615. .rev_offs = 0x0000,
  616. .sysc_offs = 0x0010,
  617. .syss_offs = 0x0014,
  618. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  619. SYSC_HAS_AUTOIDLE),
  620. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  621. .sysc_fields = &omap_hwmod_sysc_type1,
  622. };
  623. static struct omap_hwmod_class omap2420_rfbi_hwmod_class = {
  624. .name = "rfbi",
  625. .sysc = &omap2420_rfbi_sysc,
  626. };
  627. static struct omap_hwmod_addr_space omap2420_dss_rfbi_addrs[] = {
  628. {
  629. .pa_start = 0x48050800,
  630. .pa_end = 0x48050BFF,
  631. .flags = ADDR_TYPE_RT
  632. },
  633. };
  634. /* l4_core -> dss_rfbi */
  635. static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = {
  636. .master = &omap2420_l4_core_hwmod,
  637. .slave = &omap2420_dss_rfbi_hwmod,
  638. .clk = "dss_ick",
  639. .addr = omap2420_dss_rfbi_addrs,
  640. .addr_cnt = ARRAY_SIZE(omap2420_dss_rfbi_addrs),
  641. .fw = {
  642. .omap2 = {
  643. .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
  644. .flags = OMAP_FIREWALL_L4,
  645. }
  646. },
  647. .user = OCP_USER_MPU | OCP_USER_SDMA,
  648. };
  649. /* dss_rfbi slave ports */
  650. static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = {
  651. &omap2420_l4_core__dss_rfbi,
  652. };
  653. static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
  654. .name = "dss_rfbi",
  655. .class = &omap2420_rfbi_hwmod_class,
  656. .main_clk = "dss1_fck",
  657. .prcm = {
  658. .omap2 = {
  659. .prcm_reg_id = 1,
  660. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  661. .module_offs = CORE_MOD,
  662. },
  663. },
  664. .slaves = omap2420_dss_rfbi_slaves,
  665. .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
  666. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  667. .flags = HWMOD_NO_IDLEST,
  668. };
  669. /*
  670. * 'venc' class
  671. * video encoder
  672. */
  673. static struct omap_hwmod_class omap2420_venc_hwmod_class = {
  674. .name = "venc",
  675. };
  676. /* dss_venc */
  677. static struct omap_hwmod_addr_space omap2420_dss_venc_addrs[] = {
  678. {
  679. .pa_start = 0x48050C00,
  680. .pa_end = 0x48050FFF,
  681. .flags = ADDR_TYPE_RT
  682. },
  683. };
  684. /* l4_core -> dss_venc */
  685. static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
  686. .master = &omap2420_l4_core_hwmod,
  687. .slave = &omap2420_dss_venc_hwmod,
  688. .clk = "dss_54m_fck",
  689. .addr = omap2420_dss_venc_addrs,
  690. .addr_cnt = ARRAY_SIZE(omap2420_dss_venc_addrs),
  691. .fw = {
  692. .omap2 = {
  693. .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION,
  694. .flags = OMAP_FIREWALL_L4,
  695. }
  696. },
  697. .user = OCP_USER_MPU | OCP_USER_SDMA,
  698. };
  699. /* dss_venc slave ports */
  700. static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = {
  701. &omap2420_l4_core__dss_venc,
  702. };
  703. static struct omap_hwmod omap2420_dss_venc_hwmod = {
  704. .name = "dss_venc",
  705. .class = &omap2420_venc_hwmod_class,
  706. .main_clk = "dss1_fck",
  707. .prcm = {
  708. .omap2 = {
  709. .prcm_reg_id = 1,
  710. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  711. .module_offs = CORE_MOD,
  712. },
  713. },
  714. .slaves = omap2420_dss_venc_slaves,
  715. .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves),
  716. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  717. .flags = HWMOD_NO_IDLEST,
  718. };
  719. /* I2C common */
  720. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  721. .rev_offs = 0x00,
  722. .sysc_offs = 0x20,
  723. .syss_offs = 0x10,
  724. .sysc_flags = SYSC_HAS_SOFTRESET,
  725. .sysc_fields = &omap_hwmod_sysc_type1,
  726. };
  727. static struct omap_hwmod_class i2c_class = {
  728. .name = "i2c",
  729. .sysc = &i2c_sysc,
  730. };
  731. static struct omap_i2c_dev_attr i2c_dev_attr;
  732. /* I2C1 */
  733. static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
  734. { .irq = INT_24XX_I2C1_IRQ, },
  735. };
  736. static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
  737. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
  738. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
  739. };
  740. static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = {
  741. &omap2420_l4_core__i2c1,
  742. };
  743. static struct omap_hwmod omap2420_i2c1_hwmod = {
  744. .name = "i2c1",
  745. .mpu_irqs = i2c1_mpu_irqs,
  746. .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
  747. .sdma_reqs = i2c1_sdma_reqs,
  748. .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
  749. .main_clk = "i2c1_fck",
  750. .prcm = {
  751. .omap2 = {
  752. .module_offs = CORE_MOD,
  753. .prcm_reg_id = 1,
  754. .module_bit = OMAP2420_EN_I2C1_SHIFT,
  755. .idlest_reg_id = 1,
  756. .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
  757. },
  758. },
  759. .slaves = omap2420_i2c1_slaves,
  760. .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
  761. .class = &i2c_class,
  762. .dev_attr = &i2c_dev_attr,
  763. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  764. .flags = HWMOD_16BIT_REG,
  765. };
  766. /* I2C2 */
  767. static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
  768. { .irq = INT_24XX_I2C2_IRQ, },
  769. };
  770. static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
  771. { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
  772. { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
  773. };
  774. static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = {
  775. &omap2420_l4_core__i2c2,
  776. };
  777. static struct omap_hwmod omap2420_i2c2_hwmod = {
  778. .name = "i2c2",
  779. .mpu_irqs = i2c2_mpu_irqs,
  780. .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
  781. .sdma_reqs = i2c2_sdma_reqs,
  782. .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
  783. .main_clk = "i2c2_fck",
  784. .prcm = {
  785. .omap2 = {
  786. .module_offs = CORE_MOD,
  787. .prcm_reg_id = 1,
  788. .module_bit = OMAP2420_EN_I2C2_SHIFT,
  789. .idlest_reg_id = 1,
  790. .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
  791. },
  792. },
  793. .slaves = omap2420_i2c2_slaves,
  794. .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves),
  795. .class = &i2c_class,
  796. .dev_attr = &i2c_dev_attr,
  797. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  798. .flags = HWMOD_16BIT_REG,
  799. };
  800. /* l4_wkup -> gpio1 */
  801. static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
  802. {
  803. .pa_start = 0x48018000,
  804. .pa_end = 0x480181ff,
  805. .flags = ADDR_TYPE_RT
  806. },
  807. };
  808. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
  809. .master = &omap2420_l4_wkup_hwmod,
  810. .slave = &omap2420_gpio1_hwmod,
  811. .clk = "gpios_ick",
  812. .addr = omap2420_gpio1_addr_space,
  813. .addr_cnt = ARRAY_SIZE(omap2420_gpio1_addr_space),
  814. .user = OCP_USER_MPU | OCP_USER_SDMA,
  815. };
  816. /* l4_wkup -> gpio2 */
  817. static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
  818. {
  819. .pa_start = 0x4801a000,
  820. .pa_end = 0x4801a1ff,
  821. .flags = ADDR_TYPE_RT
  822. },
  823. };
  824. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
  825. .master = &omap2420_l4_wkup_hwmod,
  826. .slave = &omap2420_gpio2_hwmod,
  827. .clk = "gpios_ick",
  828. .addr = omap2420_gpio2_addr_space,
  829. .addr_cnt = ARRAY_SIZE(omap2420_gpio2_addr_space),
  830. .user = OCP_USER_MPU | OCP_USER_SDMA,
  831. };
  832. /* l4_wkup -> gpio3 */
  833. static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
  834. {
  835. .pa_start = 0x4801c000,
  836. .pa_end = 0x4801c1ff,
  837. .flags = ADDR_TYPE_RT
  838. },
  839. };
  840. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
  841. .master = &omap2420_l4_wkup_hwmod,
  842. .slave = &omap2420_gpio3_hwmod,
  843. .clk = "gpios_ick",
  844. .addr = omap2420_gpio3_addr_space,
  845. .addr_cnt = ARRAY_SIZE(omap2420_gpio3_addr_space),
  846. .user = OCP_USER_MPU | OCP_USER_SDMA,
  847. };
  848. /* l4_wkup -> gpio4 */
  849. static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
  850. {
  851. .pa_start = 0x4801e000,
  852. .pa_end = 0x4801e1ff,
  853. .flags = ADDR_TYPE_RT
  854. },
  855. };
  856. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
  857. .master = &omap2420_l4_wkup_hwmod,
  858. .slave = &omap2420_gpio4_hwmod,
  859. .clk = "gpios_ick",
  860. .addr = omap2420_gpio4_addr_space,
  861. .addr_cnt = ARRAY_SIZE(omap2420_gpio4_addr_space),
  862. .user = OCP_USER_MPU | OCP_USER_SDMA,
  863. };
  864. /* gpio dev_attr */
  865. static struct omap_gpio_dev_attr gpio_dev_attr = {
  866. .bank_width = 32,
  867. .dbck_flag = false,
  868. };
  869. static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
  870. .rev_offs = 0x0000,
  871. .sysc_offs = 0x0010,
  872. .syss_offs = 0x0014,
  873. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  874. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  875. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  876. .sysc_fields = &omap_hwmod_sysc_type1,
  877. };
  878. /*
  879. * 'gpio' class
  880. * general purpose io module
  881. */
  882. static struct omap_hwmod_class omap242x_gpio_hwmod_class = {
  883. .name = "gpio",
  884. .sysc = &omap242x_gpio_sysc,
  885. .rev = 0,
  886. };
  887. /* gpio1 */
  888. static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = {
  889. { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
  890. };
  891. static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
  892. &omap2420_l4_wkup__gpio1,
  893. };
  894. static struct omap_hwmod omap2420_gpio1_hwmod = {
  895. .name = "gpio1",
  896. .mpu_irqs = omap242x_gpio1_irqs,
  897. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_irqs),
  898. .main_clk = "gpios_fck",
  899. .prcm = {
  900. .omap2 = {
  901. .prcm_reg_id = 1,
  902. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  903. .module_offs = WKUP_MOD,
  904. .idlest_reg_id = 1,
  905. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  906. },
  907. },
  908. .slaves = omap2420_gpio1_slaves,
  909. .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
  910. .class = &omap242x_gpio_hwmod_class,
  911. .dev_attr = &gpio_dev_attr,
  912. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  913. };
  914. /* gpio2 */
  915. static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = {
  916. { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
  917. };
  918. static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
  919. &omap2420_l4_wkup__gpio2,
  920. };
  921. static struct omap_hwmod omap2420_gpio2_hwmod = {
  922. .name = "gpio2",
  923. .mpu_irqs = omap242x_gpio2_irqs,
  924. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
  925. .main_clk = "gpios_fck",
  926. .prcm = {
  927. .omap2 = {
  928. .prcm_reg_id = 1,
  929. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  930. .module_offs = WKUP_MOD,
  931. .idlest_reg_id = 1,
  932. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  933. },
  934. },
  935. .slaves = omap2420_gpio2_slaves,
  936. .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
  937. .class = &omap242x_gpio_hwmod_class,
  938. .dev_attr = &gpio_dev_attr,
  939. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  940. };
  941. /* gpio3 */
  942. static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = {
  943. { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
  944. };
  945. static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
  946. &omap2420_l4_wkup__gpio3,
  947. };
  948. static struct omap_hwmod omap2420_gpio3_hwmod = {
  949. .name = "gpio3",
  950. .mpu_irqs = omap242x_gpio3_irqs,
  951. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
  952. .main_clk = "gpios_fck",
  953. .prcm = {
  954. .omap2 = {
  955. .prcm_reg_id = 1,
  956. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  957. .module_offs = WKUP_MOD,
  958. .idlest_reg_id = 1,
  959. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  960. },
  961. },
  962. .slaves = omap2420_gpio3_slaves,
  963. .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
  964. .class = &omap242x_gpio_hwmod_class,
  965. .dev_attr = &gpio_dev_attr,
  966. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  967. };
  968. /* gpio4 */
  969. static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = {
  970. { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
  971. };
  972. static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
  973. &omap2420_l4_wkup__gpio4,
  974. };
  975. static struct omap_hwmod omap2420_gpio4_hwmod = {
  976. .name = "gpio4",
  977. .mpu_irqs = omap242x_gpio4_irqs,
  978. .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
  979. .main_clk = "gpios_fck",
  980. .prcm = {
  981. .omap2 = {
  982. .prcm_reg_id = 1,
  983. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  984. .module_offs = WKUP_MOD,
  985. .idlest_reg_id = 1,
  986. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  987. },
  988. },
  989. .slaves = omap2420_gpio4_slaves,
  990. .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
  991. .class = &omap242x_gpio_hwmod_class,
  992. .dev_attr = &gpio_dev_attr,
  993. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  994. };
  995. /* system dma */
  996. static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = {
  997. .rev_offs = 0x0000,
  998. .sysc_offs = 0x002c,
  999. .syss_offs = 0x0028,
  1000. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
  1001. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
  1002. SYSC_HAS_AUTOIDLE),
  1003. .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  1004. .sysc_fields = &omap_hwmod_sysc_type1,
  1005. };
  1006. static struct omap_hwmod_class omap2420_dma_hwmod_class = {
  1007. .name = "dma",
  1008. .sysc = &omap2420_dma_sysc,
  1009. };
  1010. /* dma attributes */
  1011. static struct omap_dma_dev_attr dma_dev_attr = {
  1012. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  1013. IS_CSSA_32 | IS_CDSA_32,
  1014. .lch_count = 32,
  1015. };
  1016. static struct omap_hwmod_irq_info omap2420_dma_system_irqs[] = {
  1017. { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
  1018. { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
  1019. { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
  1020. { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
  1021. };
  1022. static struct omap_hwmod_addr_space omap2420_dma_system_addrs[] = {
  1023. {
  1024. .pa_start = 0x48056000,
  1025. .pa_end = 0x4a0560ff,
  1026. .flags = ADDR_TYPE_RT
  1027. },
  1028. };
  1029. /* dma_system -> L3 */
  1030. static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
  1031. .master = &omap2420_dma_system_hwmod,
  1032. .slave = &omap2420_l3_main_hwmod,
  1033. .clk = "core_l3_ck",
  1034. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1035. };
  1036. /* dma_system master ports */
  1037. static struct omap_hwmod_ocp_if *omap2420_dma_system_masters[] = {
  1038. &omap2420_dma_system__l3,
  1039. };
  1040. /* l4_core -> dma_system */
  1041. static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
  1042. .master = &omap2420_l4_core_hwmod,
  1043. .slave = &omap2420_dma_system_hwmod,
  1044. .clk = "sdma_ick",
  1045. .addr = omap2420_dma_system_addrs,
  1046. .addr_cnt = ARRAY_SIZE(omap2420_dma_system_addrs),
  1047. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1048. };
  1049. /* dma_system slave ports */
  1050. static struct omap_hwmod_ocp_if *omap2420_dma_system_slaves[] = {
  1051. &omap2420_l4_core__dma_system,
  1052. };
  1053. static struct omap_hwmod omap2420_dma_system_hwmod = {
  1054. .name = "dma",
  1055. .class = &omap2420_dma_hwmod_class,
  1056. .mpu_irqs = omap2420_dma_system_irqs,
  1057. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dma_system_irqs),
  1058. .main_clk = "core_l3_ck",
  1059. .slaves = omap2420_dma_system_slaves,
  1060. .slaves_cnt = ARRAY_SIZE(omap2420_dma_system_slaves),
  1061. .masters = omap2420_dma_system_masters,
  1062. .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters),
  1063. .dev_attr = &dma_dev_attr,
  1064. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1065. .flags = HWMOD_NO_IDLEST,
  1066. };
  1067. /*
  1068. * 'mcspi' class
  1069. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  1070. * bus
  1071. */
  1072. static struct omap_hwmod_class_sysconfig omap2420_mcspi_sysc = {
  1073. .rev_offs = 0x0000,
  1074. .sysc_offs = 0x0010,
  1075. .syss_offs = 0x0014,
  1076. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1077. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1078. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  1079. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1080. .sysc_fields = &omap_hwmod_sysc_type1,
  1081. };
  1082. static struct omap_hwmod_class omap2420_mcspi_class = {
  1083. .name = "mcspi",
  1084. .sysc = &omap2420_mcspi_sysc,
  1085. .rev = OMAP2_MCSPI_REV,
  1086. };
  1087. /* mcspi1 */
  1088. static struct omap_hwmod_irq_info omap2420_mcspi1_mpu_irqs[] = {
  1089. { .irq = 65 },
  1090. };
  1091. static struct omap_hwmod_dma_info omap2420_mcspi1_sdma_reqs[] = {
  1092. { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
  1093. { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
  1094. { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
  1095. { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
  1096. { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
  1097. { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
  1098. { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
  1099. { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
  1100. };
  1101. static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = {
  1102. &omap2420_l4_core__mcspi1,
  1103. };
  1104. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  1105. .num_chipselect = 4,
  1106. };
  1107. static struct omap_hwmod omap2420_mcspi1_hwmod = {
  1108. .name = "mcspi1_hwmod",
  1109. .mpu_irqs = omap2420_mcspi1_mpu_irqs,
  1110. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi1_mpu_irqs),
  1111. .sdma_reqs = omap2420_mcspi1_sdma_reqs,
  1112. .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi1_sdma_reqs),
  1113. .main_clk = "mcspi1_fck",
  1114. .prcm = {
  1115. .omap2 = {
  1116. .module_offs = CORE_MOD,
  1117. .prcm_reg_id = 1,
  1118. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  1119. .idlest_reg_id = 1,
  1120. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  1121. },
  1122. },
  1123. .slaves = omap2420_mcspi1_slaves,
  1124. .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
  1125. .class = &omap2420_mcspi_class,
  1126. .dev_attr = &omap_mcspi1_dev_attr,
  1127. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1128. };
  1129. /* mcspi2 */
  1130. static struct omap_hwmod_irq_info omap2420_mcspi2_mpu_irqs[] = {
  1131. { .irq = 66 },
  1132. };
  1133. static struct omap_hwmod_dma_info omap2420_mcspi2_sdma_reqs[] = {
  1134. { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
  1135. { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
  1136. { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
  1137. { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
  1138. };
  1139. static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = {
  1140. &omap2420_l4_core__mcspi2,
  1141. };
  1142. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  1143. .num_chipselect = 2,
  1144. };
  1145. static struct omap_hwmod omap2420_mcspi2_hwmod = {
  1146. .name = "mcspi2_hwmod",
  1147. .mpu_irqs = omap2420_mcspi2_mpu_irqs,
  1148. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi2_mpu_irqs),
  1149. .sdma_reqs = omap2420_mcspi2_sdma_reqs,
  1150. .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi2_sdma_reqs),
  1151. .main_clk = "mcspi2_fck",
  1152. .prcm = {
  1153. .omap2 = {
  1154. .module_offs = CORE_MOD,
  1155. .prcm_reg_id = 1,
  1156. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  1157. .idlest_reg_id = 1,
  1158. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  1159. },
  1160. },
  1161. .slaves = omap2420_mcspi2_slaves,
  1162. .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
  1163. .class = &omap2420_mcspi_class,
  1164. .dev_attr = &omap_mcspi2_dev_attr,
  1165. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1166. };
  1167. static __initdata struct omap_hwmod *omap2420_hwmods[] = {
  1168. &omap2420_l3_main_hwmod,
  1169. &omap2420_l4_core_hwmod,
  1170. &omap2420_l4_wkup_hwmod,
  1171. &omap2420_mpu_hwmod,
  1172. &omap2420_iva_hwmod,
  1173. &omap2420_wd_timer2_hwmod,
  1174. &omap2420_uart1_hwmod,
  1175. &omap2420_uart2_hwmod,
  1176. &omap2420_uart3_hwmod,
  1177. /* dss class */
  1178. &omap2420_dss_core_hwmod,
  1179. &omap2420_dss_dispc_hwmod,
  1180. &omap2420_dss_rfbi_hwmod,
  1181. &omap2420_dss_venc_hwmod,
  1182. /* i2c class */
  1183. &omap2420_i2c1_hwmod,
  1184. &omap2420_i2c2_hwmod,
  1185. /* gpio class */
  1186. &omap2420_gpio1_hwmod,
  1187. &omap2420_gpio2_hwmod,
  1188. &omap2420_gpio3_hwmod,
  1189. &omap2420_gpio4_hwmod,
  1190. /* dma_system class*/
  1191. &omap2420_dma_system_hwmod,
  1192. /* mcspi class */
  1193. &omap2420_mcspi1_hwmod,
  1194. &omap2420_mcspi2_hwmod,
  1195. NULL,
  1196. };
  1197. int __init omap2420_hwmod_init(void)
  1198. {
  1199. return omap_hwmod_init(omap2420_hwmods);
  1200. }