mcf5225x_scm.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. /*
  2. * Copyright 2012 by Embedded Technologies s.r.o
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. #ifndef MCF5225X_SCM_H_
  33. #define MCF5225X_SCM_H_
  34. /* SCM Registers */
  35. #define MCF_SCM_IPSBAR (*(volatile uint32_t*)(0x40000000))
  36. #define MCF_SCM_RAMBAR (*(volatile uint32_t*)(0x40000008))
  37. #define MCF_SCM_PPMRH (*(volatile uint32_t*)(0x4000000C))
  38. #define MCF_SCM_CRSR (*(volatile uint8_t *)(0x40000010))
  39. #define MCF_SCM_CWCR (*(volatile uint8_t *)(0x40000011))
  40. #define MCF_SCM_CWSR (*(volatile uint8_t *)(0x40000013))
  41. #define MCF_SCM_DMAREQC (*(volatile uint32_t*)(0x40000014))
  42. #define MCF_SCM_PPMRL (*(volatile uint32_t*)(0x40000018))
  43. #define MCF_SCM_MPARK (*(volatile uint32_t*)(0x4000001C))
  44. #define MCF_SCM_MPR (*(volatile uint8_t *)(0x40000020))
  45. #define MCF_SCM_PPMRS (*(volatile uint8_t *)(0x40000021))
  46. #define MCF_SCM_PPMRC (*(volatile uint8_t *)(0x40000022))
  47. #define MCF_SCM_IPSBMT (*(volatile uint8_t *)(0x40000023))
  48. #define MCF_SCM_PACR0 (*(volatile uint8_t *)(0x40000024))
  49. #define MCF_SCM_PACR1 (*(volatile uint8_t *)(0x40000025))
  50. #define MCF_SCM_PACR2 (*(volatile uint8_t *)(0x40000026))
  51. #define MCF_SCM_PACR3 (*(volatile uint8_t *)(0x40000027))
  52. #define MCF_SCM_PACR4 (*(volatile uint8_t *)(0x40000028))
  53. #define MCF_SCM_PACR5 (*(volatile uint8_t *)(0x40000029))
  54. #define MCF_SCM_PACR6 (*(volatile uint8_t *)(0x4000002A))
  55. #define MCF_SCM_PACR7 (*(volatile uint8_t *)(0x4000002B))
  56. #define MCF_SCM_PACR8 (*(volatile uint8_t *)(0x4000002C))
  57. #define MCF_SCM_PACR10 (*(volatile uint8_t *)(0x4000002E))
  58. #define MCF_SCM_GPACR0 (*(volatile uint8_t *)(0x40000030))
  59. #define MCF_SCM_GPACR1 (*(volatile uint8_t *)(0x40000031))
  60. #define MCF_SCM_PACR(x) (*(volatile uint8_t *)(0x40000024 + ((x) * 0x1)))
  61. #define MCF_SCM_GPACR(x) (*(volatile uint8_t *)(0x40000030 + ((x) * 0x1)))
  62. /* MCF_SCM_IPSBAR */
  63. #define MCF_SCM_IPSBAR_V 0x1
  64. #define MCF_SCM_IPSBAR_BA(x) ((x) & 0xC0000000)
  65. /* MCF_SCM_RAMBAR */
  66. #define MCF_SCM_RAMBAR_BDE 0x200
  67. #define MCF_SCM_RAMBAR_BA(x) ((x) & 0xFFFF0000)
  68. /* MCF_SCM_PPMRH */
  69. #define MCF_SCM_PPMRH_CDGPIO 0x1
  70. #define MCF_SCM_PPMRH_CDEPORT 0x2
  71. #define MCF_SCM_PPMRH_CDPIT0 0x8
  72. #define MCF_SCM_PPMRH_CDPIT1 0x10
  73. #define MCF_SCM_PPMRH_CDADC 0x80
  74. #define MCF_SCM_PPMRH_CDGPT 0x100
  75. #define MCF_SCM_PPMRH_CDPWM 0x200
  76. #define MCF_SCM_PPMRH_CDCAN 0x400
  77. #define MCF_SCM_PPMRH_CDCFM 0x800
  78. /* MCF_SCM_CRSR */
  79. #define MCF_SCM_CRSR_EXT 0x80
  80. /* MCF_SCM_CWCR */
  81. #define MCF_SCM_CWCR_CWTIF 0x1
  82. #define MCF_SCM_CWCR_CWTAVAL 0x2
  83. #define MCF_SCM_CWCR_CWTA 0x4
  84. #define MCF_SCM_CWCR_CWT(x) (((x) & 0x7) << 0x3)
  85. #define MCF_SCM_CWCR_CWT_2_9 0
  86. #define MCF_SCM_CWCR_CWT_2_11 0x8
  87. #define MCF_SCM_CWCR_CWT_2_13 0x10
  88. #define MCF_SCM_CWCR_CWT_2_15 0x18
  89. #define MCF_SCM_CWCR_CWT_2_19 0x20
  90. #define MCF_SCM_CWCR_CWT_2_23 0x28
  91. #define MCF_SCM_CWCR_CWT_2_27 0x30
  92. #define MCF_SCM_CWCR_CWT_2_31 0x38
  93. #define MCF_SCM_CWCR_CWRI 0x40
  94. #define MCF_SCM_CWCR_CWE 0x80
  95. /* MCF_SCM_CWSR */
  96. #define MCF_SCM_CWSR_CWSR(x) (((x) & 0xFF) << 0)
  97. /* MCF_SCM_DMAREQC */
  98. #define MCF_SCM_DMAREQC_DMAC0(x) (((x) & 0xF) << 0)
  99. #define MCF_SCM_DMAREQC_DMAC1(x) (((x) & 0xF) << 0x4)
  100. #define MCF_SCM_DMAREQC_DMAC2(x) (((x) & 0xF) << 0x8)
  101. #define MCF_SCM_DMAREQC_DMAC3(x) (((x) & 0xF) << 0xC)
  102. /* MCF_SCM_PPMRL */
  103. #define MCF_SCM_PPMRL_CDG 0x2
  104. #define MCF_SCM_PPMRL_CDMINIBUS 0x8
  105. #define MCF_SCM_PPMRL_CDDMA 0x10
  106. #define MCF_SCM_PPMRL_CDUART0 0x20
  107. #define MCF_SCM_PPMRL_CDUART1 0x40
  108. #define MCF_SCM_PPMRL_CDUART2 0x80
  109. #define MCF_SCM_PPMRL_CDI2C0 0x200
  110. #define MCF_SCM_PPMRL_CDQSPI 0x400
  111. #define MCF_SCM_PPMRL_CDI2C1 0x800
  112. #define MCF_SCM_PPMRL_CDRTC 0x1000
  113. #define MCF_SCM_PPMRL_CDDTIM0 0x2000
  114. #define MCF_SCM_PPMRL_CDDTIM1 0x4000
  115. #define MCF_SCM_PPMRL_CDDTIM2 0x8000
  116. #define MCF_SCM_PPMRL_CDDTIM3 0x10000
  117. #define MCF_SCM_PPMRL_CDINTC0 0x20000
  118. #define MCF_SCM_PPMRL_CDINTC1 0x40000
  119. #define MCF_SCM_PPMRL_CDFEC 0x200000
  120. /* MCF_SCM_MPARK */
  121. #define MCF_SCM_MPARK_LCKOUT_TIME(x) (((x) & 0xF) << 0x8)
  122. #define MCF_SCM_MPARK_PRKLAST 0x1000
  123. #define MCF_SCM_MPARK_TIMEOUT 0x2000
  124. #define MCF_SCM_MPARK_FIXED 0x4000
  125. #define MCF_SCM_MPARK_M1_PRTY(x) (((x) & 0x3) << 0x10)
  126. #define MCF_SCM_MPARK_M0_PRTY(x) (((x) & 0x3) << 0x12)
  127. #define MCF_SCM_MPARK_M2_PRTY(x) (((x) & 0x3) << 0x14)
  128. #define MCF_SCM_MPARK_M3_PRTY(x) (((x) & 0x3) << 0x16)
  129. #define MCF_SCM_MPARK_BCR24BIT 0x1000000
  130. #define MCF_SCM_MPARK_M2_P_EN 0x2000000
  131. /* MCF_SCM_MPR */
  132. #define MCF_SCM_MPR_MPR(x) (((x) & 0xF) << 0)
  133. /* MCF_SCM_PPMRS */
  134. #define MCF_SCM_PPMRS_PPMRS(x) (((x) & 0x7F) << 0)
  135. #define MCF_SCM_PPMRS_DISABLE_ALL 0x40
  136. #define MCF_SCM_PPMRS_DISABLE_CFM 0x2B
  137. #define MCF_SCM_PPMRC_DISABLE_CAN 0x2A
  138. #define MCF_SCM_PPMRS_DISABLE_PWM 0x29
  139. #define MCF_SCM_PPMRS_DISABLE_GPT 0x28
  140. #define MCF_SCM_PPMRS_DISABLE_ADC 0x27
  141. #define MCF_SCM_PPMRS_DISABLE_PIT1 0x24
  142. #define MCF_SCM_PPMRS_DISABLE_PIT0 0x23
  143. #define MCF_SCM_PPMRS_DISABLE_EPORT 0x21
  144. #define MCF_SCM_PPMRS_DISABLE_PORTS 0x20
  145. #define MCF_SCM_PPMRS_DISABLE_FEC 0x15
  146. #define MCF_SCM_PPMRS_DISABLE_INTC1 0x12
  147. #define MCF_SCM_PPMRS_DISABLE_INTC0 0x11
  148. #define MCF_SCM_PPMRS_DISABLE_DTIM3 0x10
  149. #define MCF_SCM_PPMRS_DISABLE_DTIM2 0xF
  150. #define MCF_SCM_PPMRS_DISABLE_DTIM1 0xE
  151. #define MCF_SCM_PPMRS_DISABLE_DTIM0 0xD
  152. #define MCF_SCM_PPMRS_DISABLE_I2C1 0xB
  153. #define MCF_SCM_PPMRS_DISABLE_QSPI 0xA
  154. #define MCF_SCM_PPMRS_DISABLE_I2C0 0x9
  155. #define MCF_SCM_PPMRS_DISABLE_UART2 0x7
  156. #define MCF_SCM_PPMRS_DISABLE_UART1 0x6
  157. #define MCF_SCM_PPMRS_DISABLE_UART0 0x5
  158. #define MCF_SCM_PPMRS_DISABLE_DMA 0x4
  159. #define MCF_SCM_PPMRS_DISABLE_MINIBUS 0x3
  160. #define MCF_SCM_PPMRS_SET_CDG 0x1
  161. /* MCF_SCM_PPMRC */
  162. #define MCF_SCM_PPMRC_PPMRC(x) (((x) & 0x7F) << 0)
  163. #define MCF_SCM_PPMRC_ENABLE_ALL 0x40
  164. #define MCF_SCM_PPMRC_ENABLE_CFM 0x2B
  165. #define MCF_SCM_PPMRC_ENABLE_CAN 0x2A
  166. #define MCF_SCM_PPMRC_ENABLE_PWM 0x29
  167. #define MCF_SCM_PPMRC_ENABLE_GPT 0x28
  168. #define MCF_SCM_PPMRC_ENABLE_ADC 0x27
  169. #define MCF_SCM_PPMRC_ENABLE_PIT1 0x24
  170. #define MCF_SCM_PPMRC_ENABLE_PIT0 0x23
  171. #define MCF_SCM_PPMRC_ENABLE_EPORT 0x21
  172. #define MCF_SCM_PPMRC_ENABLE_PORTS 0x20
  173. #define MCF_SCM_PPMRC_ENABLE_FEC 0x15
  174. #define MCF_SCM_PPMRC_ENABLE_INTC1 0x12
  175. #define MCF_SCM_PPMRC_ENABLE_INTC0 0x11
  176. #define MCF_SCM_PPMRC_ENABLE_DTIM3 0x10
  177. #define MCF_SCM_PPMRC_ENABLE_DTIM2 0xF
  178. #define MCF_SCM_PPMRC_ENABLE_DTIM1 0xE
  179. #define MCF_SCM_PPMRC_ENABLE_DTIM0 0xD
  180. #define MCF_SCM_PPMRC_ENABLE_I2C1 0xB
  181. #define MCF_SCM_PPMRC_ENABLE_QSPI 0xA
  182. #define MCF_SCM_PPMRC_ENABLE_I2C0 0x9
  183. #define MCF_SCM_PPMRC_ENABLE_UART2 0x7
  184. #define MCF_SCM_PPMRC_ENABLE_UART1 0x6
  185. #define MCF_SCM_PPMRC_ENABLE_UART0 0x5
  186. #define MCF_SCM_PPMRC_ENABLE_DMA 0x4
  187. #define MCF_SCM_PPMRC_ENABLE_MINIBUS 0x3
  188. #define MCF_SCM_PPMRC_CLEAR_CDG 0x1
  189. /* MCF_SCM_IPSBMT */
  190. #define MCF_SCM_IPSBMT_BMT(x) (((x) & 0x7) << 0)
  191. #define MCF_SCM_IPSBMT_BMT_CYCLES_1024 0
  192. #define MCF_SCM_IPSBMT_BMT_CYCLES_512 0x1
  193. #define MCF_SCM_IPSBMT_BMT_CYCLES_256 0x2
  194. #define MCF_SCM_IPSBMT_BMT_CYCLES_128 0x3
  195. #define MCF_SCM_IPSBMT_BMT_CYCLES_64 0x4
  196. #define MCF_SCM_IPSBMT_BMT_CYCLES_32 0x5
  197. #define MCF_SCM_IPSBMT_BMT_CYCLES_16 0x6
  198. #define MCF_SCM_IPSBMT_BMT_CYCLES_8 0x7
  199. #define MCF_SCM_IPSBMT_BME 0x8
  200. /* MCF_SCM_PACR */
  201. #define MCF_SCM_PACR_ACCESS_CTRL0(x) (((x) & 0x7) << 0)
  202. #define MCF_SCM_PACR_LOCK0 0x8
  203. #define MCF_SCM_PACR_ACCESS_CTRL1(x) (((x) & 0x7) << 0x4)
  204. #define MCF_SCM_PACR_LOCK1 0x80
  205. /* MCF_SCM_PACR10 */
  206. #define MCF_SCM_PACR10_ACCESS_CTRL0(x) (((x) & 0x7) << 0)
  207. #define MCF_SCM_PACR10_LOCK0 0x8
  208. #define MCF_SCM_PACR10_ACCESS_CTRL1(x) (((x) & 0x7) << 0x4)
  209. #define MCF_SCM_PACR10_LOCK1 0x80
  210. /* MCF_SCM_GPACR */
  211. #define MCF_SCM_GPACR_ACCESS_CTRL(x) (((x) & 0xF) << 0)
  212. #define MCF_SCM_GPACR_LOCK 0x80
  213. #endif /* MCF5225X_SCM_H_ */