omap_hwmod_2420_data.c 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  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. * 'mailbox' class
  1069. * mailbox module allowing communication between the on-chip processors
  1070. * using a queued mailbox-interrupt mechanism.
  1071. */
  1072. static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
  1073. .rev_offs = 0x000,
  1074. .sysc_offs = 0x010,
  1075. .syss_offs = 0x014,
  1076. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1077. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  1078. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1079. .sysc_fields = &omap_hwmod_sysc_type1,
  1080. };
  1081. static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
  1082. .name = "mailbox",
  1083. .sysc = &omap2420_mailbox_sysc,
  1084. };
  1085. /* mailbox */
  1086. static struct omap_hwmod omap2420_mailbox_hwmod;
  1087. static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
  1088. { .name = "dsp", .irq = 26 },
  1089. { .name = "iva", .irq = 34 },
  1090. };
  1091. static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
  1092. {
  1093. .pa_start = 0x48094000,
  1094. .pa_end = 0x480941ff,
  1095. .flags = ADDR_TYPE_RT,
  1096. },
  1097. };
  1098. /* l4_core -> mailbox */
  1099. static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
  1100. .master = &omap2420_l4_core_hwmod,
  1101. .slave = &omap2420_mailbox_hwmod,
  1102. .addr = omap2420_mailbox_addrs,
  1103. .addr_cnt = ARRAY_SIZE(omap2420_mailbox_addrs),
  1104. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1105. };
  1106. /* mailbox slave ports */
  1107. static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
  1108. &omap2420_l4_core__mailbox,
  1109. };
  1110. static struct omap_hwmod omap2420_mailbox_hwmod = {
  1111. .name = "mailbox",
  1112. .class = &omap2420_mailbox_hwmod_class,
  1113. .mpu_irqs = omap2420_mailbox_irqs,
  1114. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mailbox_irqs),
  1115. .main_clk = "mailboxes_ick",
  1116. .prcm = {
  1117. .omap2 = {
  1118. .prcm_reg_id = 1,
  1119. .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  1120. .module_offs = CORE_MOD,
  1121. .idlest_reg_id = 1,
  1122. .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
  1123. },
  1124. },
  1125. .slaves = omap2420_mailbox_slaves,
  1126. .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
  1127. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1128. };
  1129. /*
  1130. * 'mcspi' class
  1131. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  1132. * bus
  1133. */
  1134. static struct omap_hwmod_class_sysconfig omap2420_mcspi_sysc = {
  1135. .rev_offs = 0x0000,
  1136. .sysc_offs = 0x0010,
  1137. .syss_offs = 0x0014,
  1138. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1139. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1140. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  1141. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1142. .sysc_fields = &omap_hwmod_sysc_type1,
  1143. };
  1144. static struct omap_hwmod_class omap2420_mcspi_class = {
  1145. .name = "mcspi",
  1146. .sysc = &omap2420_mcspi_sysc,
  1147. .rev = OMAP2_MCSPI_REV,
  1148. };
  1149. /* mcspi1 */
  1150. static struct omap_hwmod_irq_info omap2420_mcspi1_mpu_irqs[] = {
  1151. { .irq = 65 },
  1152. };
  1153. static struct omap_hwmod_dma_info omap2420_mcspi1_sdma_reqs[] = {
  1154. { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
  1155. { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
  1156. { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
  1157. { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
  1158. { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
  1159. { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
  1160. { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
  1161. { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
  1162. };
  1163. static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = {
  1164. &omap2420_l4_core__mcspi1,
  1165. };
  1166. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  1167. .num_chipselect = 4,
  1168. };
  1169. static struct omap_hwmod omap2420_mcspi1_hwmod = {
  1170. .name = "mcspi1_hwmod",
  1171. .mpu_irqs = omap2420_mcspi1_mpu_irqs,
  1172. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi1_mpu_irqs),
  1173. .sdma_reqs = omap2420_mcspi1_sdma_reqs,
  1174. .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi1_sdma_reqs),
  1175. .main_clk = "mcspi1_fck",
  1176. .prcm = {
  1177. .omap2 = {
  1178. .module_offs = CORE_MOD,
  1179. .prcm_reg_id = 1,
  1180. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  1181. .idlest_reg_id = 1,
  1182. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  1183. },
  1184. },
  1185. .slaves = omap2420_mcspi1_slaves,
  1186. .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
  1187. .class = &omap2420_mcspi_class,
  1188. .dev_attr = &omap_mcspi1_dev_attr,
  1189. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1190. };
  1191. /* mcspi2 */
  1192. static struct omap_hwmod_irq_info omap2420_mcspi2_mpu_irqs[] = {
  1193. { .irq = 66 },
  1194. };
  1195. static struct omap_hwmod_dma_info omap2420_mcspi2_sdma_reqs[] = {
  1196. { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
  1197. { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
  1198. { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
  1199. { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
  1200. };
  1201. static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = {
  1202. &omap2420_l4_core__mcspi2,
  1203. };
  1204. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  1205. .num_chipselect = 2,
  1206. };
  1207. static struct omap_hwmod omap2420_mcspi2_hwmod = {
  1208. .name = "mcspi2_hwmod",
  1209. .mpu_irqs = omap2420_mcspi2_mpu_irqs,
  1210. .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi2_mpu_irqs),
  1211. .sdma_reqs = omap2420_mcspi2_sdma_reqs,
  1212. .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi2_sdma_reqs),
  1213. .main_clk = "mcspi2_fck",
  1214. .prcm = {
  1215. .omap2 = {
  1216. .module_offs = CORE_MOD,
  1217. .prcm_reg_id = 1,
  1218. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  1219. .idlest_reg_id = 1,
  1220. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  1221. },
  1222. },
  1223. .slaves = omap2420_mcspi2_slaves,
  1224. .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
  1225. .class = &omap2420_mcspi_class,
  1226. .dev_attr = &omap_mcspi2_dev_attr,
  1227. .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
  1228. };
  1229. static __initdata struct omap_hwmod *omap2420_hwmods[] = {
  1230. &omap2420_l3_main_hwmod,
  1231. &omap2420_l4_core_hwmod,
  1232. &omap2420_l4_wkup_hwmod,
  1233. &omap2420_mpu_hwmod,
  1234. &omap2420_iva_hwmod,
  1235. &omap2420_wd_timer2_hwmod,
  1236. &omap2420_uart1_hwmod,
  1237. &omap2420_uart2_hwmod,
  1238. &omap2420_uart3_hwmod,
  1239. /* dss class */
  1240. &omap2420_dss_core_hwmod,
  1241. &omap2420_dss_dispc_hwmod,
  1242. &omap2420_dss_rfbi_hwmod,
  1243. &omap2420_dss_venc_hwmod,
  1244. /* i2c class */
  1245. &omap2420_i2c1_hwmod,
  1246. &omap2420_i2c2_hwmod,
  1247. /* gpio class */
  1248. &omap2420_gpio1_hwmod,
  1249. &omap2420_gpio2_hwmod,
  1250. &omap2420_gpio3_hwmod,
  1251. &omap2420_gpio4_hwmod,
  1252. /* dma_system class*/
  1253. &omap2420_dma_system_hwmod,
  1254. /* mailbox class */
  1255. &omap2420_mailbox_hwmod,
  1256. /* mcspi class */
  1257. &omap2420_mcspi1_hwmod,
  1258. &omap2420_mcspi2_hwmod,
  1259. NULL,
  1260. };
  1261. int __init omap2420_hwmod_init(void)
  1262. {
  1263. return omap_hwmod_init(omap2420_hwmods);
  1264. }