omap_hwmod_2420_data.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. /*
  2. * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
  3. *
  4. * Copyright (C) 2009-2011 Nokia Corporation
  5. * Copyright (C) 2012 Texas Instruments, Inc.
  6. * Paul Walmsley
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * XXX handle crossbar/shared link difference for L3?
  13. * XXX these should be marked initdata for multi-OMAP kernels
  14. */
  15. #include <plat/omap_hwmod.h>
  16. #include <mach/irqs.h>
  17. #include <plat/cpu.h>
  18. #include <plat/dma.h>
  19. #include <plat/serial.h>
  20. #include <plat/i2c.h>
  21. #include <plat/gpio.h>
  22. #include <plat/mcspi.h>
  23. #include <plat/dmtimer.h>
  24. #include <plat/l3_2xxx.h>
  25. #include <plat/l4_2xxx.h>
  26. #include "omap_hwmod_common_data.h"
  27. #include "cm-regbits-24xx.h"
  28. #include "prm-regbits-24xx.h"
  29. #include "wd_timer.h"
  30. /*
  31. * OMAP2420 hardware module integration data
  32. *
  33. * All of the data in this section should be autogeneratable from the
  34. * TI hardware database or other technical documentation. Data that
  35. * is driver-specific or driver-kernel integration-specific belongs
  36. * elsewhere.
  37. */
  38. /*
  39. * IP blocks
  40. */
  41. /* IVA1 (IVA1) */
  42. static struct omap_hwmod_class iva1_hwmod_class = {
  43. .name = "iva1",
  44. };
  45. static struct omap_hwmod_rst_info omap2420_iva_resets[] = {
  46. { .name = "iva", .rst_shift = 8 },
  47. };
  48. static struct omap_hwmod omap2420_iva_hwmod = {
  49. .name = "iva",
  50. .class = &iva1_hwmod_class,
  51. .clkdm_name = "iva1_clkdm",
  52. .rst_lines = omap2420_iva_resets,
  53. .rst_lines_cnt = ARRAY_SIZE(omap2420_iva_resets),
  54. .main_clk = "iva1_ifck",
  55. };
  56. /* DSP */
  57. static struct omap_hwmod_class dsp_hwmod_class = {
  58. .name = "dsp",
  59. };
  60. static struct omap_hwmod_rst_info omap2420_dsp_resets[] = {
  61. { .name = "logic", .rst_shift = 0 },
  62. { .name = "mmu", .rst_shift = 1 },
  63. };
  64. static struct omap_hwmod omap2420_dsp_hwmod = {
  65. .name = "dsp",
  66. .class = &dsp_hwmod_class,
  67. .clkdm_name = "dsp_clkdm",
  68. .rst_lines = omap2420_dsp_resets,
  69. .rst_lines_cnt = ARRAY_SIZE(omap2420_dsp_resets),
  70. .main_clk = "dsp_fck",
  71. };
  72. /* I2C common */
  73. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  74. .rev_offs = 0x00,
  75. .sysc_offs = 0x20,
  76. .syss_offs = 0x10,
  77. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  78. .sysc_fields = &omap_hwmod_sysc_type1,
  79. };
  80. static struct omap_hwmod_class i2c_class = {
  81. .name = "i2c",
  82. .sysc = &i2c_sysc,
  83. .rev = OMAP_I2C_IP_VERSION_1,
  84. .reset = &omap_i2c_reset,
  85. };
  86. static struct omap_i2c_dev_attr i2c_dev_attr = {
  87. .flags = OMAP_I2C_FLAG_NO_FIFO |
  88. OMAP_I2C_FLAG_SIMPLE_CLOCK |
  89. OMAP_I2C_FLAG_16BIT_DATA_REG |
  90. OMAP_I2C_FLAG_BUS_SHIFT_2,
  91. };
  92. /* I2C1 */
  93. static struct omap_hwmod omap2420_i2c1_hwmod = {
  94. .name = "i2c1",
  95. .mpu_irqs = omap2_i2c1_mpu_irqs,
  96. .sdma_reqs = omap2_i2c1_sdma_reqs,
  97. .main_clk = "i2c1_fck",
  98. .prcm = {
  99. .omap2 = {
  100. .module_offs = CORE_MOD,
  101. .prcm_reg_id = 1,
  102. .module_bit = OMAP2420_EN_I2C1_SHIFT,
  103. .idlest_reg_id = 1,
  104. .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
  105. },
  106. },
  107. .class = &i2c_class,
  108. .dev_attr = &i2c_dev_attr,
  109. .flags = HWMOD_16BIT_REG,
  110. };
  111. /* I2C2 */
  112. static struct omap_hwmod omap2420_i2c2_hwmod = {
  113. .name = "i2c2",
  114. .mpu_irqs = omap2_i2c2_mpu_irqs,
  115. .sdma_reqs = omap2_i2c2_sdma_reqs,
  116. .main_clk = "i2c2_fck",
  117. .prcm = {
  118. .omap2 = {
  119. .module_offs = CORE_MOD,
  120. .prcm_reg_id = 1,
  121. .module_bit = OMAP2420_EN_I2C2_SHIFT,
  122. .idlest_reg_id = 1,
  123. .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
  124. },
  125. },
  126. .class = &i2c_class,
  127. .dev_attr = &i2c_dev_attr,
  128. .flags = HWMOD_16BIT_REG,
  129. };
  130. /* dma attributes */
  131. static struct omap_dma_dev_attr dma_dev_attr = {
  132. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  133. IS_CSSA_32 | IS_CDSA_32,
  134. .lch_count = 32,
  135. };
  136. static struct omap_hwmod omap2420_dma_system_hwmod = {
  137. .name = "dma",
  138. .class = &omap2xxx_dma_hwmod_class,
  139. .mpu_irqs = omap2_dma_system_irqs,
  140. .main_clk = "core_l3_ck",
  141. .dev_attr = &dma_dev_attr,
  142. .flags = HWMOD_NO_IDLEST,
  143. };
  144. /* mailbox */
  145. static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
  146. { .name = "dsp", .irq = 26 },
  147. { .name = "iva", .irq = 34 },
  148. { .irq = -1 }
  149. };
  150. static struct omap_hwmod omap2420_mailbox_hwmod = {
  151. .name = "mailbox",
  152. .class = &omap2xxx_mailbox_hwmod_class,
  153. .mpu_irqs = omap2420_mailbox_irqs,
  154. .main_clk = "mailboxes_ick",
  155. .prcm = {
  156. .omap2 = {
  157. .prcm_reg_id = 1,
  158. .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  159. .module_offs = CORE_MOD,
  160. .idlest_reg_id = 1,
  161. .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
  162. },
  163. },
  164. };
  165. /*
  166. * 'mcbsp' class
  167. * multi channel buffered serial port controller
  168. */
  169. static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
  170. .name = "mcbsp",
  171. };
  172. /* mcbsp1 */
  173. static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
  174. { .name = "tx", .irq = 59 },
  175. { .name = "rx", .irq = 60 },
  176. { .irq = -1 }
  177. };
  178. static struct omap_hwmod omap2420_mcbsp1_hwmod = {
  179. .name = "mcbsp1",
  180. .class = &omap2420_mcbsp_hwmod_class,
  181. .mpu_irqs = omap2420_mcbsp1_irqs,
  182. .sdma_reqs = omap2_mcbsp1_sdma_reqs,
  183. .main_clk = "mcbsp1_fck",
  184. .prcm = {
  185. .omap2 = {
  186. .prcm_reg_id = 1,
  187. .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
  188. .module_offs = CORE_MOD,
  189. .idlest_reg_id = 1,
  190. .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
  191. },
  192. },
  193. };
  194. /* mcbsp2 */
  195. static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
  196. { .name = "tx", .irq = 62 },
  197. { .name = "rx", .irq = 63 },
  198. { .irq = -1 }
  199. };
  200. static struct omap_hwmod omap2420_mcbsp2_hwmod = {
  201. .name = "mcbsp2",
  202. .class = &omap2420_mcbsp_hwmod_class,
  203. .mpu_irqs = omap2420_mcbsp2_irqs,
  204. .sdma_reqs = omap2_mcbsp2_sdma_reqs,
  205. .main_clk = "mcbsp2_fck",
  206. .prcm = {
  207. .omap2 = {
  208. .prcm_reg_id = 1,
  209. .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
  210. .module_offs = CORE_MOD,
  211. .idlest_reg_id = 1,
  212. .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
  213. },
  214. },
  215. };
  216. /*
  217. * interfaces
  218. */
  219. /* L4 CORE -> I2C1 interface */
  220. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
  221. .master = &omap2xxx_l4_core_hwmod,
  222. .slave = &omap2420_i2c1_hwmod,
  223. .clk = "i2c1_ick",
  224. .addr = omap2_i2c1_addr_space,
  225. .user = OCP_USER_MPU | OCP_USER_SDMA,
  226. };
  227. /* L4 CORE -> I2C2 interface */
  228. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
  229. .master = &omap2xxx_l4_core_hwmod,
  230. .slave = &omap2420_i2c2_hwmod,
  231. .clk = "i2c2_ick",
  232. .addr = omap2_i2c2_addr_space,
  233. .user = OCP_USER_MPU | OCP_USER_SDMA,
  234. };
  235. /* IVA <- L3 interface */
  236. static struct omap_hwmod_ocp_if omap2420_l3__iva = {
  237. .master = &omap2xxx_l3_main_hwmod,
  238. .slave = &omap2420_iva_hwmod,
  239. .clk = "core_l3_ck",
  240. .user = OCP_USER_MPU | OCP_USER_SDMA,
  241. };
  242. /* DSP <- L3 interface */
  243. static struct omap_hwmod_ocp_if omap2420_l3__dsp = {
  244. .master = &omap2xxx_l3_main_hwmod,
  245. .slave = &omap2420_dsp_hwmod,
  246. .clk = "dsp_ick",
  247. .user = OCP_USER_MPU | OCP_USER_SDMA,
  248. };
  249. static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = {
  250. {
  251. .pa_start = 0x48028000,
  252. .pa_end = 0x48028000 + SZ_1K - 1,
  253. .flags = ADDR_TYPE_RT
  254. },
  255. { }
  256. };
  257. /* l4_wkup -> timer1 */
  258. static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = {
  259. .master = &omap2xxx_l4_wkup_hwmod,
  260. .slave = &omap2xxx_timer1_hwmod,
  261. .clk = "gpt1_ick",
  262. .addr = omap2420_timer1_addrs,
  263. .user = OCP_USER_MPU | OCP_USER_SDMA,
  264. };
  265. /* l4_wkup -> wd_timer2 */
  266. static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
  267. {
  268. .pa_start = 0x48022000,
  269. .pa_end = 0x4802207f,
  270. .flags = ADDR_TYPE_RT
  271. },
  272. { }
  273. };
  274. static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
  275. .master = &omap2xxx_l4_wkup_hwmod,
  276. .slave = &omap2xxx_wd_timer2_hwmod,
  277. .clk = "mpu_wdt_ick",
  278. .addr = omap2420_wd_timer2_addrs,
  279. .user = OCP_USER_MPU | OCP_USER_SDMA,
  280. };
  281. /* l4_wkup -> gpio1 */
  282. static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
  283. {
  284. .pa_start = 0x48018000,
  285. .pa_end = 0x480181ff,
  286. .flags = ADDR_TYPE_RT
  287. },
  288. { }
  289. };
  290. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
  291. .master = &omap2xxx_l4_wkup_hwmod,
  292. .slave = &omap2xxx_gpio1_hwmod,
  293. .clk = "gpios_ick",
  294. .addr = omap2420_gpio1_addr_space,
  295. .user = OCP_USER_MPU | OCP_USER_SDMA,
  296. };
  297. /* l4_wkup -> gpio2 */
  298. static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
  299. {
  300. .pa_start = 0x4801a000,
  301. .pa_end = 0x4801a1ff,
  302. .flags = ADDR_TYPE_RT
  303. },
  304. { }
  305. };
  306. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
  307. .master = &omap2xxx_l4_wkup_hwmod,
  308. .slave = &omap2xxx_gpio2_hwmod,
  309. .clk = "gpios_ick",
  310. .addr = omap2420_gpio2_addr_space,
  311. .user = OCP_USER_MPU | OCP_USER_SDMA,
  312. };
  313. /* l4_wkup -> gpio3 */
  314. static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
  315. {
  316. .pa_start = 0x4801c000,
  317. .pa_end = 0x4801c1ff,
  318. .flags = ADDR_TYPE_RT
  319. },
  320. { }
  321. };
  322. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
  323. .master = &omap2xxx_l4_wkup_hwmod,
  324. .slave = &omap2xxx_gpio3_hwmod,
  325. .clk = "gpios_ick",
  326. .addr = omap2420_gpio3_addr_space,
  327. .user = OCP_USER_MPU | OCP_USER_SDMA,
  328. };
  329. /* l4_wkup -> gpio4 */
  330. static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
  331. {
  332. .pa_start = 0x4801e000,
  333. .pa_end = 0x4801e1ff,
  334. .flags = ADDR_TYPE_RT
  335. },
  336. { }
  337. };
  338. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
  339. .master = &omap2xxx_l4_wkup_hwmod,
  340. .slave = &omap2xxx_gpio4_hwmod,
  341. .clk = "gpios_ick",
  342. .addr = omap2420_gpio4_addr_space,
  343. .user = OCP_USER_MPU | OCP_USER_SDMA,
  344. };
  345. /* dma_system -> L3 */
  346. static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
  347. .master = &omap2420_dma_system_hwmod,
  348. .slave = &omap2xxx_l3_main_hwmod,
  349. .clk = "core_l3_ck",
  350. .user = OCP_USER_MPU | OCP_USER_SDMA,
  351. };
  352. /* l4_core -> dma_system */
  353. static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
  354. .master = &omap2xxx_l4_core_hwmod,
  355. .slave = &omap2420_dma_system_hwmod,
  356. .clk = "sdma_ick",
  357. .addr = omap2_dma_system_addrs,
  358. .user = OCP_USER_MPU | OCP_USER_SDMA,
  359. };
  360. /* l4_core -> mailbox */
  361. static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
  362. .master = &omap2xxx_l4_core_hwmod,
  363. .slave = &omap2420_mailbox_hwmod,
  364. .addr = omap2_mailbox_addrs,
  365. .user = OCP_USER_MPU | OCP_USER_SDMA,
  366. };
  367. /* l4_core -> mcbsp1 */
  368. static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = {
  369. .master = &omap2xxx_l4_core_hwmod,
  370. .slave = &omap2420_mcbsp1_hwmod,
  371. .clk = "mcbsp1_ick",
  372. .addr = omap2_mcbsp1_addrs,
  373. .user = OCP_USER_MPU | OCP_USER_SDMA,
  374. };
  375. /* l4_core -> mcbsp2 */
  376. static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = {
  377. .master = &omap2xxx_l4_core_hwmod,
  378. .slave = &omap2420_mcbsp2_hwmod,
  379. .clk = "mcbsp2_ick",
  380. .addr = omap2xxx_mcbsp2_addrs,
  381. .user = OCP_USER_MPU | OCP_USER_SDMA,
  382. };
  383. static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
  384. &omap2xxx_l3_main__l4_core,
  385. &omap2xxx_mpu__l3_main,
  386. &omap2xxx_dss__l3,
  387. &omap2xxx_l4_core__mcspi1,
  388. &omap2xxx_l4_core__mcspi2,
  389. &omap2xxx_l4_core__l4_wkup,
  390. &omap2_l4_core__uart1,
  391. &omap2_l4_core__uart2,
  392. &omap2_l4_core__uart3,
  393. &omap2420_l4_core__i2c1,
  394. &omap2420_l4_core__i2c2,
  395. &omap2420_l3__iva,
  396. &omap2420_l3__dsp,
  397. &omap2420_l4_wkup__timer1,
  398. &omap2xxx_l4_core__timer2,
  399. &omap2xxx_l4_core__timer3,
  400. &omap2xxx_l4_core__timer4,
  401. &omap2xxx_l4_core__timer5,
  402. &omap2xxx_l4_core__timer6,
  403. &omap2xxx_l4_core__timer7,
  404. &omap2xxx_l4_core__timer8,
  405. &omap2xxx_l4_core__timer9,
  406. &omap2xxx_l4_core__timer10,
  407. &omap2xxx_l4_core__timer11,
  408. &omap2xxx_l4_core__timer12,
  409. &omap2420_l4_wkup__wd_timer2,
  410. &omap2xxx_l4_core__dss,
  411. &omap2xxx_l4_core__dss_dispc,
  412. &omap2xxx_l4_core__dss_rfbi,
  413. &omap2xxx_l4_core__dss_venc,
  414. &omap2420_l4_wkup__gpio1,
  415. &omap2420_l4_wkup__gpio2,
  416. &omap2420_l4_wkup__gpio3,
  417. &omap2420_l4_wkup__gpio4,
  418. &omap2420_dma_system__l3,
  419. &omap2420_l4_core__dma_system,
  420. &omap2420_l4_core__mailbox,
  421. &omap2420_l4_core__mcbsp1,
  422. &omap2420_l4_core__mcbsp2,
  423. NULL,
  424. };
  425. int __init omap2420_hwmod_init(void)
  426. {
  427. return omap_hwmod_register_links(omap2420_hwmod_ocp_ifs);
  428. }