realizationOfDataCalculation.c 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /*
  2. * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 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/asoc-ti-mcbsp.h>
  17. #include <linux/platform_data/spi-omap2-mcspi.h>
  18. #include <linux/omap-dma.h>
  19. #include <plat/dmtimer.h>
  20. #include "omap_hwmod.h"
  21. #include "mmc.h"
  22. #include "l3_2xxx.h"
  23. #include "soc.h"
  24. #include "omap_hwmod_common_data.h"
  25. #include "prm-regbits-24xx.h"
  26. #include "cm-regbits-24xx.h"
  27. #include "i2c.h"
  28. #include "wd_timer.h"
  29. /*
  30. * OMAP2430 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. /* IVA2 (IVA2) */
  41. static struct omap_hwmod_rst_info omap2430_iva_resets[] = {
  42. { .name = "logic", .rst_shift = 0 },
  43. { .name = "mmu", .rst_shift = 1 },
  44. };
  45. static struct omap_hwmod omap2430_iva_hwmod = {
  46. .name = "iva",
  47. .class = &iva_hwmod_class,
  48. .clkdm_name = "dsp_clkdm",
  49. .rst_lines = omap2430_iva_resets,
  50. .rst_lines_cnt = ARRAY_SIZE(omap2430_iva_resets),
  51. .main_clk = "dsp_fck",
  52. };
  53. /* I2C common */
  54. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  55. .rev_offs = 0x00,
  56. .sysc_offs = 0x20,
  57. .syss_offs = 0x10,
  58. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  59. SYSS_HAS_RESET_STATUS),
  60. .sysc_fields = &omap_hwmod_sysc_type1,
  61. };
  62. static struct omap_hwmod_class i2c_class = {
  63. .name = "i2c",
  64. .sysc = &i2c_sysc,
  65. .rev = OMAP_I2C_IP_VERSION_1,
  66. .reset = &omap_i2c_reset,
  67. };
  68. static struct omap_i2c_dev_attr i2c_dev_attr = {
  69. .fifo_depth = 8, /* bytes */
  70. .flags = OMAP_I2C_FLAG_BUS_SHIFT_2 |
  71. OMAP_I2C_FLAG_FORCE_19200_INT_CLK,
  72. };
  73. /* I2C1 */
  74. static struct omap_hwmod omap2430_i2c1_hwmod = {
  75. .name = "i2c1",
  76. .flags = HWMOD_16BIT_REG,
  77. .mpu_irqs = omap2_i2c1_mpu_irqs,
  78. .sdma_reqs = omap2_i2c1_sdma_reqs,
  79. .main_clk = "i2chs1_fck",
  80. .prcm = {
  81. .omap2 = {
  82. /*
  83. * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
  84. * I2CHS IP's do not follow the usual pattern.
  85. * prcm_reg_id alone cannot be used to program
  86. * the iclk and fclk. Needs to be handled using
  87. * additional flags when clk handling is moved
  88. * to hwmod framework.
  89. */
  90. .module_offs = CORE_MOD,
  91. .prcm_reg_id = 1,
  92. .module_bit = OMAP2430_EN_I2CHS1_SHIFT,
  93. .idlest_reg_id = 1,
  94. .idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
  95. },
  96. },
  97. .class = &i2c_class,
  98. .dev_attr = &i2c_dev_attr,
  99. };
  100. /* I2C2 */
  101. static struct omap_hwmod omap2430_i2c2_hwmod = {
  102. .name = "i2c2",
  103. .flags = HWMOD_16BIT_REG,
  104. .mpu_irqs = omap2_i2c2_mpu_irqs,
  105. .sdma_reqs = omap2_i2c2_sdma_reqs,
  106. .main_clk = "i2chs2_fck",
  107. .prcm = {
  108. .omap2 = {
  109. .module_offs = CORE_MOD,
  110. .prcm_reg_id = 1,
  111. .module_bit = OMAP2430_EN_I2CHS2_SHIFT,
  112. .idlest_reg_id = 1,
  113. .idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
  114. },
  115. },
  116. .class = &i2c_class,
  117. .dev_attr = &i2c_dev_attr,
  118. };
  119. /* gpio5 */
  120. static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
  121. { .irq = 33 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK5 */
  122. { .irq = -1 },
  123. };
  124. static struct omap_hwmod omap2430_gpio5_hwmod = {
  125. .name = "gpio5",
  126. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  127. .mpu_irqs = omap243x_gpio5_irqs,
  128. .main_clk = "gpio5_fck",
  129. .prcm = {
  130. .omap2 = {
  131. .prcm_reg_id = 2,
  132. .module_bit = OMAP2430_EN_GPIO5_SHIFT,
  133. .module_offs = CORE_MOD,
  134. .idlest_reg_id = 2,
  135. .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
  136. },
  137. },
  138. .class = &omap2xxx_gpio_hwmod_class,
  139. .dev_attr = &omap2xxx_gpio_dev_attr,
  140. };
  141. /* dma attributes */
  142. static struct omap_dma_dev_attr dma_dev_attr = {
  143. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  144. IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
  145. .lch_count = 32,
  146. };
  147. static struct omap_hwmod omap2430_dma_system_hwmod = {
  148. .name = "dma",
  149. .class = &omap2xxx_dma_hwmod_class,
  150. .mpu_irqs = omap2_dma_system_irqs,
  151. .main_clk = "core_l3_ck",
  152. .dev_attr = &dma_dev_attr,
  153. .flags = HWMOD_NO_IDLEST,
  154. };
  155. /* mailbox */
  156. static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
  157. { .irq = 26 + OMAP_INTC_START, },
  158. { .irq = -1 },
  159. };
  160. static struct omap_hwmod omap2430_mailbox_hwmod = {
  161. .name = "mailbox",
  162. .class = &omap2xxx_mailbox_hwmod_class,
  163. .mpu_irqs = omap2430_mailbox_irqs,
  164. .main_clk = "mailboxes_ick",
  165. .prcm = {
  166. .omap2 = {
  167. .prcm_reg_id = 1,
  168. .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
  169. .module_offs = CORE_MOD,
  170. .idlest_reg_id = 1,
  171. .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
  172. },
  173. },
  174. };
  175. /* mcspi3 */
  176. static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
  177. { .irq = 91 + OMAP_INTC_START, },
  178. { .irq = -1 },
  179. };
  180. static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
  181. { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
  182. { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
  183. { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
  184. { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
  185. { .dma_req = -1 }
  186. };
  187. static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
  188. .num_chipselect = 2,
  189. };
  190. static struct omap_hwmod omap2430_mcspi3_hwmod = {
  191. .name = "mcspi3",
  192. .mpu_irqs = omap2430_mcspi3_mpu_irqs,
  193. .sdma_reqs = omap2430_mcspi3_sdma_reqs,
  194. .main_clk = "mcspi3_fck",
  195. .prcm = {
  196. .omap2 = {
  197. .module_offs = CORE_MOD,
  198. .prcm_reg_id = 2,
  199. .module_bit = OMAP2430_EN_MCSPI3_SHIFT,
  200. .idlest_reg_id = 2,
  201. .idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
  202. },
  203. },
  204. .class = &omap2xxx_mcspi_class,
  205. .dev_attr = &omap_mcspi3_dev_attr,
  206. };
  207. /* usbhsotg */
  208. static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
  209. .rev_offs = 0x0400,
  210. .sysc_offs = 0x0404,
  211. .syss_offs = 0x0408,
  212. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
  213. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  214. SYSC_HAS_AUTOIDLE),
  215. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  216. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  217. .sysc_fields = &omap_hwmod_sysc_type1,
  218. };
  219. static struct omap_hwmod_class usbotg_class = {
  220. .name = "usbotg",
  221. .sysc = &omap2430_usbhsotg_sysc,
  222. };
  223. /* usb_otg_hs */
  224. static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
  225. { .name = "mc", .irq = 92 + OMAP_INTC_START, },
  226. { .name = "dma", .irq = 93 + OMAP_INTC_START, },
  227. { .irq = -1 },
  228. };