psc.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * DaVinci Power & Sleep Controller (PSC) defines
  3. *
  4. * Copyright (C) 2006 Texas Instruments.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  12. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  14. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  15. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  16. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  18. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. *
  22. * You should have received a copy of the GNU General Public License along
  23. * with this program; if not, write to the Free Software Foundation, Inc.,
  24. * 675 Mass Ave, Cambridge, MA 02139, USA.
  25. *
  26. */
  27. #ifndef __ASM_ARCH_PSC_H
  28. #define __ASM_ARCH_PSC_H
  29. /* Power and Sleep Controller (PSC) Domains */
  30. #define DAVINCI_GPSC_ARMDOMAIN 0
  31. #define DAVINCI_GPSC_DSPDOMAIN 1
  32. #define DAVINCI_LPSC_VPSSMSTR 0
  33. #define DAVINCI_LPSC_VPSSSLV 1
  34. #define DAVINCI_LPSC_TPCC 2
  35. #define DAVINCI_LPSC_TPTC0 3
  36. #define DAVINCI_LPSC_TPTC1 4
  37. #define DAVINCI_LPSC_EMAC 5
  38. #define DAVINCI_LPSC_EMAC_WRAPPER 6
  39. #define DAVINCI_LPSC_USB 9
  40. #define DAVINCI_LPSC_ATA 10
  41. #define DAVINCI_LPSC_VLYNQ 11
  42. #define DAVINCI_LPSC_UHPI 12
  43. #define DAVINCI_LPSC_DDR_EMIF 13
  44. #define DAVINCI_LPSC_AEMIF 14
  45. #define DAVINCI_LPSC_MMC_SD 15
  46. #define DAVINCI_LPSC_McBSP 17
  47. #define DAVINCI_LPSC_I2C 18
  48. #define DAVINCI_LPSC_UART0 19
  49. #define DAVINCI_LPSC_UART1 20
  50. #define DAVINCI_LPSC_UART2 21
  51. #define DAVINCI_LPSC_SPI 22
  52. #define DAVINCI_LPSC_PWM0 23
  53. #define DAVINCI_LPSC_PWM1 24
  54. #define DAVINCI_LPSC_PWM2 25
  55. #define DAVINCI_LPSC_GPIO 26
  56. #define DAVINCI_LPSC_TIMER0 27
  57. #define DAVINCI_LPSC_TIMER1 28
  58. #define DAVINCI_LPSC_TIMER2 29
  59. #define DAVINCI_LPSC_SYSTEM_SUBSYS 30
  60. #define DAVINCI_LPSC_ARM 31
  61. #define DAVINCI_LPSC_SCR2 32
  62. #define DAVINCI_LPSC_SCR3 33
  63. #define DAVINCI_LPSC_SCR4 34
  64. #define DAVINCI_LPSC_CROSSBAR 35
  65. #define DAVINCI_LPSC_CFG27 36
  66. #define DAVINCI_LPSC_CFG3 37
  67. #define DAVINCI_LPSC_CFG5 38
  68. #define DAVINCI_LPSC_GEM 39
  69. #define DAVINCI_LPSC_IMCOP 40
  70. #define DM355_LPSC_TIMER3 5
  71. #define DM355_LPSC_SPI1 6
  72. #define DM355_LPSC_MMC_SD1 7
  73. #define DM355_LPSC_McBSP1 8
  74. #define DM355_LPSC_PWM3 10
  75. #define DM355_LPSC_SPI2 11
  76. #define DM355_LPSC_RTO 12
  77. #define DM355_LPSC_VPSS_DAC 41
  78. /* DM365 */
  79. #define DM365_LPSC_TIMER3 5
  80. #define DM365_LPSC_SPI1 6
  81. #define DM365_LPSC_MMC_SD1 7
  82. #define DM365_LPSC_McBSP1 8
  83. #define DM365_LPSC_PWM3 10
  84. #define DM365_LPSC_SPI2 11
  85. #define DM365_LPSC_RTO 12
  86. #define DM365_LPSC_TIMER4 17
  87. #define DM365_LPSC_SPI0 22
  88. #define DM365_LPSC_SPI3 38
  89. #define DM365_LPSC_SPI4 39
  90. #define DM365_LPSC_EMAC 40
  91. #define DM365_LPSC_VOICE_CODEC 44
  92. #define DM365_LPSC_DAC_CLK 46
  93. #define DM365_LPSC_VPSSMSTR 47
  94. #define DM365_LPSC_MJCP 50
  95. /*
  96. * LPSC Assignments
  97. */
  98. #define DM646X_LPSC_ARM 0
  99. #define DM646X_LPSC_C64X_CPU 1
  100. #define DM646X_LPSC_HDVICP0 2
  101. #define DM646X_LPSC_HDVICP1 3
  102. #define DM646X_LPSC_TPCC 4
  103. #define DM646X_LPSC_TPTC0 5
  104. #define DM646X_LPSC_TPTC1 6
  105. #define DM646X_LPSC_TPTC2 7
  106. #define DM646X_LPSC_TPTC3 8
  107. #define DM646X_LPSC_PCI 13
  108. #define DM646X_LPSC_EMAC 14
  109. #define DM646X_LPSC_VDCE 15
  110. #define DM646X_LPSC_VPSSMSTR 16
  111. #define DM646X_LPSC_VPSSSLV 17
  112. #define DM646X_LPSC_TSIF0 18
  113. #define DM646X_LPSC_TSIF1 19
  114. #define DM646X_LPSC_DDR_EMIF 20
  115. #define DM646X_LPSC_AEMIF 21
  116. #define DM646X_LPSC_McASP0 22
  117. #define DM646X_LPSC_McASP1 23
  118. #define DM646X_LPSC_CRGEN0 24
  119. #define DM646X_LPSC_CRGEN1 25
  120. #define DM646X_LPSC_UART0 26
  121. #define DM646X_LPSC_UART1 27
  122. #define DM646X_LPSC_UART2 28
  123. #define DM646X_LPSC_PWM0 29
  124. #define DM646X_LPSC_PWM1 30
  125. #define DM646X_LPSC_I2C 31
  126. #define DM646X_LPSC_SPI 32
  127. #define DM646X_LPSC_GPIO 33
  128. #define DM646X_LPSC_TIMER0 34
  129. #define DM646X_LPSC_TIMER1 35
  130. #define DM646X_LPSC_ARM_INTC 45
  131. /* PSC0 defines */
  132. #define DA8XX_LPSC0_TPCC 0
  133. #define DA8XX_LPSC0_TPTC0 1
  134. #define DA8XX_LPSC0_TPTC1 2
  135. #define DA8XX_LPSC0_EMIF25 3
  136. #define DA8XX_LPSC0_SPI0 4
  137. #define DA8XX_LPSC0_MMC_SD 5
  138. #define DA8XX_LPSC0_AINTC 6
  139. #define DA8XX_LPSC0_ARM_RAM_ROM 7
  140. #define DA8XX_LPSC0_SECU_MGR 8
  141. #define DA8XX_LPSC0_UART0 9
  142. #define DA8XX_LPSC0_SCR0_SS 10
  143. #define DA8XX_LPSC0_SCR1_SS 11
  144. #define DA8XX_LPSC0_SCR2_SS 12
  145. #define DA8XX_LPSC0_PRUSS 13
  146. #define DA8XX_LPSC0_ARM 14
  147. #define DA8XX_LPSC0_GEM 15
  148. /* PSC1 defines */
  149. #define DA850_LPSC1_TPCC1 0
  150. #define DA8XX_LPSC1_USB20 1
  151. #define DA8XX_LPSC1_USB11 2
  152. #define DA8XX_LPSC1_GPIO 3
  153. #define DA8XX_LPSC1_UHPI 4
  154. #define DA8XX_LPSC1_CPGMAC 5
  155. #define DA8XX_LPSC1_EMIF3C 6
  156. #define DA8XX_LPSC1_McASP0 7
  157. #define DA830_LPSC1_McASP1 8
  158. #define DA850_LPSC1_SATA 8
  159. #define DA830_LPSC1_McASP2 9
  160. #define DA850_LPSC1_VPIF 9
  161. #define DA8XX_LPSC1_SPI1 10
  162. #define DA8XX_LPSC1_I2C 11
  163. #define DA8XX_LPSC1_UART1 12
  164. #define DA8XX_LPSC1_UART2 13
  165. #define DA850_LPSC1_McBSP0 14
  166. #define DA850_LPSC1_McBSP1 15
  167. #define DA8XX_LPSC1_LCDC 16
  168. #define DA8XX_LPSC1_PWM 17
  169. #define DA850_LPSC1_MMC_SD1 18
  170. #define DA8XX_LPSC1_ECAP 20
  171. #define DA830_LPSC1_EQEP 21
  172. #define DA850_LPSC1_TPTC2 21
  173. #define DA8XX_LPSC1_SCR_P0_SS 24
  174. #define DA8XX_LPSC1_SCR_P1_SS 25
  175. #define DA8XX_LPSC1_CR_P3_SS 26
  176. #define DA8XX_LPSC1_L3_CBA_RAM 31
  177. /* PSC register offsets */
  178. #define EPCPR 0x070
  179. #define PTCMD 0x120
  180. #define PTSTAT 0x128
  181. #define PDSTAT 0x200
  182. #define PDCTL 0x300
  183. #define MDSTAT 0x800
  184. #define MDCTL 0xA00
  185. /* PSC module states */
  186. #define PSC_STATE_SWRSTDISABLE 0
  187. #define PSC_STATE_SYNCRST 1
  188. #define PSC_STATE_DISABLE 2
  189. #define PSC_STATE_ENABLE 3
  190. #define MDSTAT_STATE_MASK 0x3f
  191. #define PDSTAT_STATE_MASK 0x1f
  192. #define MDCTL_LRST BIT(8)
  193. #define MDCTL_FORCE BIT(31)
  194. #define PDCTL_NEXT BIT(0)
  195. #define PDCTL_EPCGOOD BIT(8)
  196. #endif /* __ASM_ARCH_PSC_H */