omap_hwmod_2420_data.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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 <linux/i2c-omap.h>
  16. #include <linux/platform_data/spi-omap2-mcspi.h>
  17. #include <linux/omap-dma.h>
  18. #include <plat/dmtimer.h>
  19. #include "omap_hwmod.h"
  20. #include "l3_2xxx.h"
  21. #include "l4_2xxx.h"
  22. #include "omap_hwmod_common_data.h"
  23. #include "cm-regbits-24xx.h"
  24. #include "prm-regbits-24xx.h"
  25. #include "i2c.h"
  26. #include "mmc.h"
  27. #include "serial.h"
  28. #include "wd_timer.h"
  29. /*
  30. * OMAP2420 hardware module integration data
  31. *
  32. * All of the data in this section should be autogeneratable from the
  33. * TI hardware database or other technical documentation. Data that
  34. * is driver-specific or driver-kernel integration-specific belongs
  35. * elsewhere.
  36. */
  37. /*
  38. * IP blocks
  39. */
  40. /* IVA1 (IVA1) */
  41. static struct omap_hwmod_class iva1_hwmod_class = {
  42. .name = "iva1",
  43. };
  44. static struct omap_hwmod_rst_info omap2420_iva_resets[] = {
  45. { .name = "iva", .rst_shift = 8 },
  46. };
  47. static struct omap_hwmod omap2420_iva_hwmod = {
  48. .name = "iva",
  49. .class = &iva1_hwmod_class,
  50. .clkdm_name = "iva1_clkdm",
  51. .rst_lines = omap2420_iva_resets,
  52. .rst_lines_cnt = ARRAY_SIZE(omap2420_iva_resets),
  53. .main_clk = "iva1_ifck",
  54. };
  55. /* DSP */
  56. static struct omap_hwmod_class dsp_hwmod_class = {
  57. .name = "dsp",
  58. };
  59. static struct omap_hwmod_rst_info omap2420_dsp_resets[] = {
  60. { .name = "logic", .rst_shift = 0 },
  61. { .name = "mmu", .rst_shift = 1 },
  62. };
  63. static struct omap_hwmod omap2420_dsp_hwmod = {
  64. .name = "dsp",
  65. .class = &dsp_hwmod_class,
  66. .clkdm_name = "dsp_clkdm",
  67. .rst_lines = omap2420_dsp_resets,
  68. .rst_lines_cnt = ARRAY_SIZE(omap2420_dsp_resets),
  69. .main_clk = "dsp_fck",
  70. };
  71. /* I2C common */
  72. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  73. .rev_offs = 0x00,
  74. .sysc_offs = 0x20,
  75. .syss_offs = 0x10,
  76. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  77. .sysc_fields = &omap_hwmod_sysc_type1,
  78. };
  79. static struct omap_hwmod_class i2c_class = {
  80. .name = "i2c",
  81. .sysc = &i2c_sysc,
  82. .rev = OMAP_I2C_IP_VERSION_1,
  83. .reset = &omap_i2c_reset,
  84. };
  85. static struct omap_i2c_dev_attr i2c_dev_attr = {
  86. .flags = OMAP_I2C_FLAG_NO_FIFO |
  87. OMAP_I2C_FLAG_SIMPLE_CLOCK |
  88. OMAP_I2C_FLAG_16BIT_DATA_REG |
  89. OMAP_I2C_FLAG_BUS_SHIFT_2,
  90. };
  91. /* I2C1 */
  92. static struct omap_hwmod omap2420_i2c1_hwmod = {
  93. .name = "i2c1",
  94. .main_clk = "i2c1_fck",
  95. .prcm = {
  96. .omap2 = {
  97. .module_offs = CORE_MOD,
  98. .prcm_reg_id = 1,
  99. .module_bit = OMAP2420_EN_I2C1_SHIFT,
  100. .idlest_reg_id = 1,
  101. .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
  102. },
  103. },
  104. .class = &i2c_class,
  105. .dev_attr = &i2c_dev_attr,
  106. /*
  107. * From mach-omap2/pm24xx.c: "Putting MPU into the WFI state
  108. * while a transfer is active seems to cause the I2C block to
  109. * timeout. Why? Good question."
  110. */
  111. .flags = (HWMOD_16BIT_REG | HWMOD_BLOCK_WFI),
  112. };
  113. /* I2C2 */
  114. static struct omap_hwmod omap2420_i2c2_hwmod = {
  115. .name = "i2c2",
  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 omap2420_mailbox_hwmod = {
  146. .name = "mailbox",
  147. .class = &omap2xxx_mailbox_hwmod_class,
  148. .main_clk = "mailboxes_ick",
  149. .prcm = {
  150. .omap2 = {
  151. .prcm_reg_id = 1,
  152. .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  153. .module_offs = CORE_MOD,
  154. .idlest_reg_id = 1,
  155. .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
  156. },
  157. },
  158. };
  159. /*
  160. * 'mcbsp' class
  161. * multi channel buffered serial port controller
  162. */
  163. static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
  164. .name = "mcbsp",
  165. };
  166. static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
  167. { .role = "pad_fck", .clk = "mcbsp_clks" },
  168. { .role = "prcm_fck", .clk = "func_96m_ck" },
  169. };
  170. /* mcbsp1 */
  171. static struct omap_hwmod omap2420_mcbsp1_hwmod = {
  172. .name = "mcbsp1",
  173. .class = &omap2420_mcbsp_hwmod_class,
  174. .main_clk = "mcbsp1_fck",
  175. .prcm = {
  176. .omap2 = {
  177. .prcm_reg_id = 1,
  178. .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
  179. .module_offs = CORE_MOD,
  180. .idlest_reg_id = 1,
  181. .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
  182. },
  183. },
  184. .opt_clks = mcbsp_opt_clks,
  185. .opt_clks_cnt = ARRAY_SIZE(mcbsp_opt_clks),
  186. };
  187. /* mcbsp2 */
  188. static struct omap_hwmod omap2420_mcbsp2_hwmod = {
  189. .name = "mcbsp2",
  190. .class = &omap2420_mcbsp_hwmod_class,
  191. .main_clk = "mcbsp2_fck",
  192. .prcm = {
  193. .omap2 = {
  194. .prcm_reg_id = 1,
  195. .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
  196. .module_offs = CORE_MOD,
  197. .idlest_reg_id = 1,
  198. .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
  199. },
  200. },
  201. .opt_clks = mcbsp_opt_clks,
  202. .opt_clks_cnt = ARRAY_SIZE(mcbsp_opt_clks),
  203. };
  204. static struct omap_hwmod_class_sysconfig omap2420_msdi_sysc = {
  205. .rev_offs = 0x3c,
  206. .sysc_offs = 0x64,
  207. .syss_offs = 0x68,
  208. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  209. .sysc_fields = &omap_hwmod_sysc_type1,
  210. };
  211. static struct omap_hwmod_class omap2420_msdi_hwmod_class = {
  212. .name = "msdi",
  213. .sysc = &omap2420_msdi_sysc,
  214. .reset = &omap_msdi_reset,
  215. };
  216. /* msdi1 */
  217. static struct omap_hwmod omap2420_msdi1_hwmod = {
  218. .name = "msdi1",
  219. .class = &omap2420_msdi_hwmod_class,
  220. .main_clk = "mmc_fck",
  221. .prcm = {
  222. .omap2 = {
  223. .prcm_reg_id = 1,
  224. .module_bit = OMAP2420_EN_MMC_SHIFT,
  225. .module_offs = CORE_MOD,
  226. .idlest_reg_id = 1,
  227. .idlest_idle_bit = OMAP2420_ST_MMC_SHIFT,
  228. },
  229. },
  230. .flags = HWMOD_16BIT_REG,
  231. };
  232. /* HDQ1W/1-wire */
  233. static struct omap_hwmod omap2420_hdq1w_hwmod = {
  234. .name = "hdq1w",
  235. .main_clk = "hdq_fck",
  236. .prcm = {
  237. .omap2 = {
  238. .module_offs = CORE_MOD,
  239. .prcm_reg_id = 1,
  240. .module_bit = OMAP24XX_EN_HDQ_SHIFT,
  241. .idlest_reg_id = 1,
  242. .idlest_idle_bit = OMAP24XX_ST_HDQ_SHIFT,
  243. },
  244. },
  245. .class = &omap2_hdq1w_class,
  246. };
  247. /*
  248. * interfaces
  249. */
  250. /* L4 CORE -> I2C1 interface */
  251. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
  252. .master = &omap2xxx_l4_core_hwmod,
  253. .slave = &omap2420_i2c1_hwmod,
  254. .clk = "i2c1_ick",
  255. .user = OCP_USER_MPU | OCP_USER_SDMA,
  256. };
  257. /* L4 CORE -> I2C2 interface */
  258. static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
  259. .master = &omap2xxx_l4_core_hwmod,
  260. .slave = &omap2420_i2c2_hwmod,
  261. .clk = "i2c2_ick",
  262. .user = OCP_USER_MPU | OCP_USER_SDMA,
  263. };
  264. /* IVA <- L3 interface */
  265. static struct omap_hwmod_ocp_if omap2420_l3__iva = {
  266. .master = &omap2xxx_l3_main_hwmod,
  267. .slave = &omap2420_iva_hwmod,
  268. .clk = "core_l3_ck",
  269. .user = OCP_USER_MPU | OCP_USER_SDMA,
  270. };
  271. /* DSP <- L3 interface */
  272. static struct omap_hwmod_ocp_if omap2420_l3__dsp = {
  273. .master = &omap2xxx_l3_main_hwmod,
  274. .slave = &omap2420_dsp_hwmod,
  275. .clk = "dsp_ick",
  276. .user = OCP_USER_MPU | OCP_USER_SDMA,
  277. };
  278. /* l4_wkup -> timer1 */
  279. static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = {
  280. .master = &omap2xxx_l4_wkup_hwmod,
  281. .slave = &omap2xxx_timer1_hwmod,
  282. .clk = "gpt1_ick",
  283. .user = OCP_USER_MPU | OCP_USER_SDMA,
  284. };
  285. /* l4_wkup -> wd_timer2 */
  286. static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
  287. .master = &omap2xxx_l4_wkup_hwmod,
  288. .slave = &omap2xxx_wd_timer2_hwmod,
  289. .clk = "mpu_wdt_ick",
  290. .user = OCP_USER_MPU | OCP_USER_SDMA,
  291. };
  292. /* l4_wkup -> gpio1 */
  293. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
  294. .master = &omap2xxx_l4_wkup_hwmod,
  295. .slave = &omap2xxx_gpio1_hwmod,
  296. .clk = "gpios_ick",
  297. .user = OCP_USER_MPU | OCP_USER_SDMA,
  298. };
  299. /* l4_wkup -> gpio2 */
  300. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
  301. .master = &omap2xxx_l4_wkup_hwmod,
  302. .slave = &omap2xxx_gpio2_hwmod,
  303. .clk = "gpios_ick",
  304. .user = OCP_USER_MPU | OCP_USER_SDMA,
  305. };
  306. /* l4_wkup -> gpio3 */
  307. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
  308. .master = &omap2xxx_l4_wkup_hwmod,
  309. .slave = &omap2xxx_gpio3_hwmod,
  310. .clk = "gpios_ick",
  311. .user = OCP_USER_MPU | OCP_USER_SDMA,
  312. };
  313. /* l4_wkup -> gpio4 */
  314. static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
  315. .master = &omap2xxx_l4_wkup_hwmod,
  316. .slave = &omap2xxx_gpio4_hwmod,
  317. .clk = "gpios_ick",
  318. .user = OCP_USER_MPU | OCP_USER_SDMA,
  319. };
  320. /* dma_system -> L3 */
  321. static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
  322. .master = &omap2420_dma_system_hwmod,
  323. .slave = &omap2xxx_l3_main_hwmod,
  324. .clk = "core_l3_ck",
  325. .user = OCP_USER_MPU | OCP_USER_SDMA,
  326. };
  327. /* l4_core -> dma_system */
  328. static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
  329. .master = &omap2xxx_l4_core_hwmod,
  330. .slave = &omap2420_dma_system_hwmod,
  331. .clk = "sdma_ick",
  332. .addr = omap2_dma_system_addrs,
  333. .user = OCP_USER_MPU | OCP_USER_SDMA,
  334. };
  335. /* l4_core -> mailbox */
  336. static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
  337. .master = &omap2xxx_l4_core_hwmod,
  338. .slave = &omap2420_mailbox_hwmod,
  339. .user = OCP_USER_MPU | OCP_USER_SDMA,
  340. };
  341. /* l4_core -> mcbsp1 */
  342. static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = {
  343. .master = &omap2xxx_l4_core_hwmod,
  344. .slave = &omap2420_mcbsp1_hwmod,
  345. .clk = "mcbsp1_ick",
  346. .user = OCP_USER_MPU | OCP_USER_SDMA,
  347. };
  348. /* l4_core -> mcbsp2 */
  349. static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = {
  350. .master = &omap2xxx_l4_core_hwmod,
  351. .slave = &omap2420_mcbsp2_hwmod,
  352. .clk = "mcbsp2_ick",
  353. .user = OCP_USER_MPU | OCP_USER_SDMA,
  354. };
  355. /* l4_core -> msdi1 */
  356. static struct omap_hwmod_ocp_if omap2420_l4_core__msdi1 = {
  357. .master = &omap2xxx_l4_core_hwmod,
  358. .slave = &omap2420_msdi1_hwmod,
  359. .clk = "mmc_ick",
  360. .user = OCP_USER_MPU | OCP_USER_SDMA,
  361. };
  362. /* l4_core -> hdq1w interface */
  363. static struct omap_hwmod_ocp_if omap2420_l4_core__hdq1w = {
  364. .master = &omap2xxx_l4_core_hwmod,
  365. .slave = &omap2420_hdq1w_hwmod,
  366. .clk = "hdq_ick",
  367. .user = OCP_USER_MPU | OCP_USER_SDMA,
  368. .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE,
  369. };
  370. /* l4_wkup -> 32ksync_counter */
  371. static struct omap_hwmod_ocp_if omap2420_l4_wkup__counter_32k = {
  372. .master = &omap2xxx_l4_wkup_hwmod,
  373. .slave = &omap2xxx_counter_32k_hwmod,
  374. .clk = "sync_32k_ick",
  375. .user = OCP_USER_MPU | OCP_USER_SDMA,
  376. };
  377. static struct omap_hwmod_ocp_if omap2420_l3__gpmc = {
  378. .master = &omap2xxx_l3_main_hwmod,
  379. .slave = &omap2xxx_gpmc_hwmod,
  380. .clk = "core_l3_ck",
  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. &omap2420_l4_core__msdi1,
  424. &omap2xxx_l4_core__rng,
  425. &omap2xxx_l4_core__sham,
  426. &omap2xxx_l4_core__aes,
  427. &omap2420_l4_core__hdq1w,
  428. &omap2420_l4_wkup__counter_32k,
  429. &omap2420_l3__gpmc,
  430. NULL,
  431. };
  432. int __init omap2420_hwmod_init(void)
  433. {
  434. omap_hwmod_init();
  435. return omap_hwmod_register_links(omap2420_hwmod_ocp_ifs);
  436. }