functionDefinition.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. .mpu_irqs = omap2_i2c1_mpu_irqs,
  95. .sdma_reqs = omap2_i2c1_sdma_reqs,
  96. .main_clk = "i2c1_fck",
  97. .prcm = {
  98. .omap2 = {
  99. .module_offs = CORE_MOD,
  100. .prcm_reg_id = 1,
  101. .module_bit = OMAP2420_EN_I2C1_SHIFT,
  102. .idlest_reg_id = 1,
  103. .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
  104. },
  105. },
  106. .class = &i2c_class,
  107. .dev_attr = &i2c_dev_attr,
  108. .flags = HWMOD_16BIT_REG,
  109. };
  110. /* I2C2 */
  111. static struct omap_hwmod omap2420_i2c2_hwmod = {
  112. .name = "i2c2",
  113. .mpu_irqs = omap2_i2c2_mpu_irqs,
  114. .sdma_reqs = omap2_i2c2_sdma_reqs,
  115. .main_clk = "i2c2_fck",
  116. .prcm = {
  117. .omap2 = {
  118. .module_offs = CORE_MOD,
  119. .prcm_reg_id = 1,
  120. .module_bit = OMAP2420_EN_I2C2_SHIFT,
  121. .idlest_reg_id = 1,
  122. .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
  123. },
  124. },
  125. .class = &i2c_class,
  126. .dev_attr = &i2c_dev_attr,
  127. .flags = HWMOD_16BIT_REG,
  128. };
  129. /* dma attributes */
  130. static struct omap_dma_dev_attr dma_dev_attr = {
  131. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  132. IS_CSSA_32 | IS_CDSA_32,
  133. .lch_count = 32,
  134. };
  135. static struct omap_hwmod omap2420_dma_system_hwmod = {
  136. .name = "dma",
  137. .class = &omap2xxx_dma_hwmod_class,
  138. .mpu_irqs = omap2_dma_system_irqs,
  139. .main_clk = "core_l3_ck",
  140. .dev_attr = &dma_dev_attr,
  141. .flags = HWMOD_NO_IDLEST,
  142. };
  143. /* mailbox */
  144. static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
  145. { .name = "dsp", .irq = 26 + OMAP_INTC_START, },
  146. { .name = "iva", .irq = 34 + OMAP_INTC_START, },
  147. { .irq = -1 },
  148. };
  149. static struct omap_hwmod omap2420_mailbox_hwmod = {
  150. .name = "mailbox",
  151. .class = &omap2xxx_mailbox_hwmod_class,
  152. .mpu_irqs = omap2420_mailbox_irqs,
  153. .main_clk = "mailboxes_ick",
  154. .prcm = {
  155. .omap2 = {
  156. .prcm_reg_id = 1,
  157. .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  158. .module_offs = CORE_MOD,
  159. .idlest_reg_id = 1,
  160. .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
  161. },
  162. },
  163. };
  164. /*
  165. * 'mcbsp' class
  166. * multi channel buffered serial port controller
  167. */
  168. static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
  169. .name = "mcbsp",
  170. };
  171. static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
  172. { .role = "pad_fck", .clk = "mcbsp_clks" },
  173. { .role = "prcm_fck", .clk = "func_96m_ck" },
  174. };
  175. /* mcbsp1 */
  176. static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
  177. { .name = "tx", .irq = 59 + OMAP_INTC_START, },
  178. { .name = "rx", .irq = 60 + OMAP_INTC_START, },
  179. { .irq = -1 },
  180. };
  181. static struct omap_hwmod omap2420_mcbsp1_hwmod = {
  182. .name = "mcbsp1",
  183. .class = &omap2420_mcbsp_hwmod_class,
  184. .mpu_irqs = omap2420_mcbsp1_irqs,
  185. .sdma_reqs = omap2_mcbsp1_sdma_reqs,
  186. .main_clk = "mcbsp1_fck",
  187. .prcm = {
  188. .omap2 = {
  189. .prcm_reg_id = 1,
  190. .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
  191. .module_offs = CORE_MOD,
  192. .idlest_reg_id = 1,
  193. .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
  194. },
  195. },
  196. .opt_clks = mcbsp_opt_clks,
  197. .opt_clks_cnt = ARRAY_SIZE(mcbsp_opt_clks),
  198. };
  199. /* mcbsp2 */
  200. static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
  201. { .name = "tx", .irq = 62 + OMAP_INTC_START, },
  202. { .name = "rx", .irq = 63 + OMAP_INTC_START, },
  203. { .irq = -1 },
  204. };
  205. static struct omap_hwmod omap2420_mcbsp2_hwmod = {
  206. .name = "mcbsp2",
  207. .class = &omap2420_mcbsp_hwmod_class,
  208. .mpu_irqs = omap2420_mcbsp2_irqs,
  209. .sdma_reqs = omap2_mcbsp2_sdma_reqs,
  210. .main_clk = "mcbsp2_fck",
  211. .prcm = {
  212. .omap2 = {
  213. .prcm_reg_id = 1,
  214. .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
  215. .module_offs = CORE_MOD,
  216. .idlest_reg_id = 1,
  217. .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
  218. },
  219. },
  220. .opt_clks = mcbsp_opt_clks,