alarmUnprocessedDataOperation.c 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. /*
  2. * omap_hwmod_2xxx_ipblock_data.c - common IP block data for OMAP2xxx
  3. *
  4. * Copyright (C) 2011 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. #include <linux/platform_data/gpio-omap.h>
  12. #include <linux/omap-dma.h>
  13. #include <plat/dmtimer.h>
  14. #include <linux/platform_data/spi-omap2-mcspi.h>
  15. #include "omap_hwmod.h"
  16. #include "omap_hwmod_common_data.h"
  17. #include "cm-regbits-24xx.h"
  18. #include "prm-regbits-24xx.h"
  19. #include "wd_timer.h"
  20. struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
  21. { .irq = 48 + OMAP_INTC_START, },
  22. { .irq = -1 },
  23. };
  24. struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
  25. { .name = "dispc", .dma_req = 5 },
  26. { .dma_req = -1 }
  27. };
  28. /*
  29. * 'dispc' class
  30. * display controller
  31. */
  32. static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
  33. .rev_offs = 0x0000,
  34. .sysc_offs = 0x0010,
  35. .syss_offs = 0x0014,
  36. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  37. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  38. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  39. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  40. .sysc_fields = &omap_hwmod_sysc_type1,
  41. };
  42. struct omap_hwmod_class omap2_dispc_hwmod_class = {
  43. .name = "dispc",
  44. .sysc = &omap2_dispc_sysc,
  45. };
  46. /* OMAP2xxx Timer Common */
  47. static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
  48. .rev_offs = 0x0000,
  49. .sysc_offs = 0x0010,
  50. .syss_offs = 0x0014,
  51. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  52. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  53. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  54. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  55. .clockact = CLOCKACT_TEST_ICLK,
  56. .sysc_fields = &omap_hwmod_sysc_type1,
  57. };
  58. struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
  59. .name = "timer",
  60. .sysc = &omap2xxx_timer_sysc,
  61. };
  62. /*
  63. * 'wd_timer' class
  64. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  65. * overflow condition
  66. */
  67. static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
  68. .rev_offs = 0x0000,
  69. .sysc_offs = 0x0010,
  70. .syss_offs = 0x0014,
  71. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  72. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  73. .sysc_fields = &omap_hwmod_sysc_type1,
  74. };
  75. struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
  76. .name = "wd_timer",
  77. .sysc = &omap2xxx_wd_timer_sysc,
  78. .pre_shutdown = &omap2_wd_timer_disable,
  79. .reset = &omap2_wd_timer_reset,
  80. };
  81. /*
  82. * 'gpio' class
  83. * general purpose io module
  84. */
  85. static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
  86. .rev_offs = 0x0000,
  87. .sysc_offs = 0x0010,
  88. .syss_offs = 0x0014,
  89. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  90. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  91. SYSS_HAS_RESET_STATUS),
  92. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  93. .sysc_fields = &omap_hwmod_sysc_type1,
  94. };
  95. struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
  96. .name = "gpio",
  97. .sysc = &omap2xxx_gpio_sysc,
  98. .rev = 0,
  99. };
  100. /* system dma */
  101. static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
  102. .rev_offs = 0x0000,
  103. .sysc_offs = 0x002c,
  104. .syss_offs = 0x0028,
  105. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
  106. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
  107. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  108. .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  109. .sysc_fields = &omap_hwmod_sysc_type1,
  110. };
  111. struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
  112. .name = "dma",
  113. .sysc = &omap2xxx_dma_sysc,
  114. };
  115. /*
  116. * 'mailbox' class
  117. * mailbox module allowing communication between the on-chip processors
  118. * using a queued mailbox-interrupt mechanism.
  119. */
  120. static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
  121. .rev_offs = 0x000,
  122. .sysc_offs = 0x010,
  123. .syss_offs = 0x014,
  124. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  125. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  126. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  127. .sysc_fields = &omap_hwmod_sysc_type1,
  128. };
  129. struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
  130. .name = "mailbox",
  131. .sysc = &omap2xxx_mailbox_sysc,
  132. };
  133. /*
  134. * 'mcspi' class
  135. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  136. * bus
  137. */
  138. static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
  139. .rev_offs = 0x0000,
  140. .sysc_offs = 0x0010,
  141. .syss_offs = 0x0014,
  142. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  143. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  144. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  145. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  146. .sysc_fields = &omap_hwmod_sysc_type1,
  147. };
  148. struct omap_hwmod_class omap2xxx_mcspi_class = {
  149. .name = "mcspi",
  150. .sysc = &omap2xxx_mcspi_sysc,
  151. .rev = OMAP2_MCSPI_REV,
  152. };
  153. /*
  154. * 'gpmc' class
  155. * general purpose memory controller
  156. */
  157. static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
  158. .rev_offs = 0x0000,
  159. .sysc_offs = 0x0010,
  160. .syss_offs = 0x0014,
  161. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
  162. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  163. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  164. .sysc_fields = &omap_hwmod_sysc_type1,
  165. };
  166. static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
  167. .name = "gpmc",
  168. .sysc = &omap2xxx_gpmc_sysc,
  169. };
  170. /*
  171. * IP blocks
  172. */
  173. /* L3 */
  174. struct omap_hwmod omap2xxx_l3_main_hwmod = {
  175. .name = "l3_main",
  176. .class = &l3_hwmod_class,
  177. .flags = HWMOD_NO_IDLEST,
  178. };
  179. /* L4 CORE */
  180. struct omap_hwmod omap2xxx_l4_core_hwmod = {
  181. .name = "l4_core",
  182. .class = &l4_hwmod_class,
  183. .flags = HWMOD_NO_IDLEST,
  184. };
  185. /* L4 WKUP */
  186. struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
  187. .name = "l4_wkup",
  188. .class = &l4_hwmod_class,
  189. .flags = HWMOD_NO_IDLEST,
  190. };
  191. /* MPU */
  192. static struct omap_hwmod_irq_info omap2xxx_mpu_irqs[] = {
  193. { .name = "pmu", .irq = 3 + OMAP_INTC_START },
  194. { .irq = -1 }
  195. };
  196. struct omap_hwmod omap2xxx_mpu_hwmod = {
  197. .name = "mpu",
  198. .mpu_irqs = omap2xxx_mpu_irqs,
  199. .class = &mpu_hwmod_class,
  200. .main_clk = "mpu_ck",
  201. };
  202. /* IVA2 */
  203. struct omap_hwmod omap2xxx_iva_hwmod = {
  204. .name = "iva",
  205. .class = &iva_hwmod_class,
  206. };
  207. /* always-on timers dev attribute */
  208. static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
  209. .timer_capability = OMAP_TIMER_ALWON,
  210. };
  211. /* pwm timers dev attribute */
  212. static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
  213. .timer_capability = OMAP_TIMER_HAS_PWM,
  214. };
  215. /* timers with DSP interrupt dev attribute */
  216. static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
  217. .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
  218. };
  219. /* timer1 */
  220. struct omap_hwmod omap2xxx_timer1_hwmod = {
  221. .name = "timer1",
  222. .mpu_irqs = omap2_timer1_mpu_irqs,
  223. .main_clk = "gpt1_fck",
  224. .prcm = {
  225. .omap2 = {
  226. .prcm_reg_id = 1,
  227. .module_bit = OMAP24XX_EN_GPT1_SHIFT,
  228. .module_offs = WKUP_MOD,
  229. .idlest_reg_id = 1,
  230. .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
  231. },
  232. },
  233. .dev_attr = &capability_alwon_dev_attr,
  234. .class = &omap2xxx_timer_hwmod_class,
  235. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  236. };
  237. /* timer2 */
  238. struct omap_hwmod omap2xxx_timer2_hwmod = {
  239. .name = "timer2",
  240. .mpu_irqs = omap2_timer2_mpu_irqs,
  241. .main_clk = "gpt2_fck",
  242. .prcm = {
  243. .omap2 = {
  244. .prcm_reg_id = 1,
  245. .module_bit = OMAP24XX_EN_GPT2_SHIFT,
  246. .module_offs = CORE_MOD,
  247. .idlest_reg_id = 1,
  248. .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
  249. },
  250. },
  251. .class = &omap2xxx_timer_hwmod_class,
  252. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  253. };
  254. /* timer3 */
  255. struct omap_hwmod omap2xxx_timer3_hwmod = {
  256. .name = "timer3",
  257. .mpu_irqs = omap2_timer3_mpu_irqs,
  258. .main_clk = "gpt3_fck",
  259. .prcm = {
  260. .omap2 = {
  261. .prcm_reg_id = 1,
  262. .module_bit = OMAP24XX_EN_GPT3_SHIFT,
  263. .module_offs = CORE_MOD,
  264. .idlest_reg_id = 1,
  265. .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
  266. },
  267. },
  268. .class = &omap2xxx_timer_hwmod_class,
  269. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  270. };
  271. /* timer4 */
  272. struct omap_hwmod omap2xxx_timer4_hwmod = {
  273. .name = "timer4",
  274. .mpu_irqs = omap2_timer4_mpu_irqs,
  275. .main_clk = "gpt4_fck",
  276. .prcm = {
  277. .omap2 = {
  278. .prcm_reg_id = 1,
  279. .module_bit = OMAP24XX_EN_GPT4_SHIFT,