omap_hwmod_2430_data.c 31 KB

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