m527xsim.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. /****************************************************************************/
  2. /*
  3. * m527xsim.h -- ColdFire 5270/5271 System Integration Module support.
  4. *
  5. * (C) Copyright 2004, Greg Ungerer (gerg@snapgear.com)
  6. */
  7. /****************************************************************************/
  8. #ifndef m527xsim_h
  9. #define m527xsim_h
  10. /****************************************************************************/
  11. /*
  12. * Define the 5270/5271 SIM register set addresses.
  13. */
  14. #define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
  15. #define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 1 */
  16. #define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
  17. #define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
  18. #define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
  19. #define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
  20. #define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
  21. #define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
  22. #define MCFINTC_IRLR 0x18 /* */
  23. #define MCFINTC_IACKL 0x19 /* */
  24. #define MCFINTC_ICR0 0x40 /* Base ICR register */
  25. #define MCFINT_VECBASE 64 /* Vector base number */
  26. #define MCFINT_UART0 13 /* Interrupt number for UART0 */
  27. #define MCFINT_UART1 14 /* Interrupt number for UART1 */
  28. #define MCFINT_UART2 15 /* Interrupt number for UART2 */
  29. #define MCFINT_PIT1 36 /* Interrupt number for PIT1 */
  30. /*
  31. * SDRAM configuration registers.
  32. */
  33. #ifdef CONFIG_M5271
  34. #define MCFSIM_DCR 0x40 /* SDRAM control */
  35. #define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
  36. #define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
  37. #define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
  38. #define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
  39. #endif
  40. #ifdef CONFIG_M5275
  41. #define MCFSIM_DMR 0x40 /* SDRAM mode */
  42. #define MCFSIM_DCR 0x44 /* SDRAM control */
  43. #define MCFSIM_DCFG1 0x48 /* SDRAM configuration 1 */
  44. #define MCFSIM_DCFG2 0x4c /* SDRAM configuration 2 */
  45. #define MCFSIM_DBAR0 0x50 /* SDRAM base address 0 */
  46. #define MCFSIM_DMR0 0x54 /* SDRAM address mask 0 */
  47. #define MCFSIM_DBAR1 0x58 /* SDRAM base address 1 */
  48. #define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */
  49. #endif
  50. #ifdef CONFIG_M5271
  51. #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000)
  52. #define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001)
  53. #define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002)
  54. #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003)
  55. #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004)
  56. #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005)
  57. #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006)
  58. #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007)
  59. #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008)
  60. #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009)
  61. #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A)
  62. #define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B)
  63. #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010)
  64. #define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011)
  65. #define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012)
  66. #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013)
  67. #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014)
  68. #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015)
  69. #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016)
  70. #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017)
  71. #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018)
  72. #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019)
  73. #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A)
  74. #define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B)
  75. #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020)
  76. #define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021)
  77. #define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022)
  78. #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023)
  79. #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024)
  80. #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025)
  81. #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026)
  82. #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027)
  83. #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028)
  84. #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029)
  85. #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A)
  86. #define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B)
  87. #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030)
  88. #define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031)
  89. #define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032)
  90. #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033)
  91. #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034)
  92. #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035)
  93. #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036)
  94. #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037)
  95. #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038)
  96. #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039)
  97. #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A)
  98. #define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B)
  99. /*
  100. * Generic GPIO support
  101. */
  102. #define MCFGPIO_PODR MCFGPIO_PODR_ADDR
  103. #define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR
  104. #define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR
  105. #define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR
  106. #define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR
  107. #define MCFGPIO_PIN_MAX 100
  108. #define MCFGPIO_IRQ_MAX 8
  109. #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
  110. #endif
  111. #ifdef CONFIG_M5275
  112. #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004)
  113. #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100005)
  114. #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100008)
  115. #define MCFGPIO_PODR_FEC0H (MCF_IPSBAR + 0x10000A)
  116. #define MCFGPIO_PODR_FEC0L (MCF_IPSBAR + 0x10000B)
  117. #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x10000C)
  118. #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000D)
  119. #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x10000E)
  120. #define MCFGPIO_PODR_TIMERH (MCF_IPSBAR + 0x10000F)
  121. #define MCFGPIO_PODR_TIMERL (MCF_IPSBAR + 0x100010)
  122. #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100011)
  123. #define MCFGPIO_PODR_FEC1H (MCF_IPSBAR + 0x100012)
  124. #define MCFGPIO_PODR_FEC1L (MCF_IPSBAR + 0x100013)
  125. #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100014)
  126. #define MCFGPIO_PODR_IRQ (MCF_IPSBAR + 0x100015)
  127. #define MCFGPIO_PODR_USBH (MCF_IPSBAR + 0x100016)
  128. #define MCFGPIO_PODR_USBL (MCF_IPSBAR + 0x100017)
  129. #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100018)
  130. #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100020)
  131. #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100021)
  132. #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100024)
  133. #define MCFGPIO_PDDR_FEC0H (MCF_IPSBAR + 0x100026)
  134. #define MCFGPIO_PDDR_FEC0L (MCF_IPSBAR + 0x100027)
  135. #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100028)
  136. #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x100029)
  137. #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x10002A)
  138. #define MCFGPIO_PDDR_TIMERH (MCF_IPSBAR + 0x10002B)
  139. #define MCFGPIO_PDDR_TIMERL (MCF_IPSBAR + 0x10002C)
  140. #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x10002D)
  141. #define MCFGPIO_PDDR_FEC1H (MCF_IPSBAR + 0x10002E)
  142. #define MCFGPIO_PDDR_FEC1L (MCF_IPSBAR + 0x10002F)
  143. #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100030)
  144. #define MCFGPIO_PDDR_IRQ (MCF_IPSBAR + 0x100031)
  145. #define MCFGPIO_PDDR_USBH (MCF_IPSBAR + 0x100032)
  146. #define MCFGPIO_PDDR_USBL (MCF_IPSBAR + 0x100033)
  147. #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100034)
  148. #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x10003C)
  149. #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x10003D)
  150. #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100040)
  151. #define MCFGPIO_PPDSDR_FEC0H (MCF_IPSBAR + 0x100042)
  152. #define MCFGPIO_PPDSDR_FEC0L (MCF_IPSBAR + 0x100043)
  153. #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100044)
  154. #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x100045)
  155. #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100046)
  156. #define MCFGPIO_PPDSDR_TIMERH (MCF_IPSBAR + 0x100047)
  157. #define MCFGPIO_PPDSDR_TIMERL (MCF_IPSBAR + 0x100048)
  158. #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100049)
  159. #define MCFGPIO_PPDSDR_FEC1H (MCF_IPSBAR + 0x10004A)
  160. #define MCFGPIO_PPDSDR_FEC1L (MCF_IPSBAR + 0x10004B)
  161. #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x10004C)
  162. #define MCFGPIO_PPDSDR_IRQ (MCF_IPSBAR + 0x10004D)
  163. #define MCFGPIO_PPDSDR_USBH (MCF_IPSBAR + 0x10004E)
  164. #define MCFGPIO_PPDSDR_USBL (MCF_IPSBAR + 0x10004F)
  165. #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100050)
  166. #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100058)
  167. #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100059)
  168. #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x10005C)
  169. #define MCFGPIO_PCLRR_FEC0H (MCF_IPSBAR + 0x10005E)
  170. #define MCFGPIO_PCLRR_FEC0L (MCF_IPSBAR + 0x10005F)
  171. #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100060)
  172. #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x100061)
  173. #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100062)
  174. #define MCFGPIO_PCLRR_TIMERH (MCF_IPSBAR + 0x100063)
  175. #define MCFGPIO_PCLRR_TIMERL (MCF_IPSBAR + 0x100064)
  176. #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100065)
  177. #define MCFGPIO_PCLRR_FEC1H (MCF_IPSBAR + 0x100066)
  178. #define MCFGPIO_PCLRR_FEC1L (MCF_IPSBAR + 0x100067)
  179. #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100068)
  180. #define MCFGPIO_PCLRR_IRQ (MCF_IPSBAR + 0x100069)
  181. #define MCFGPIO_PCLRR_USBH (MCF_IPSBAR + 0x10006A)
  182. #define MCFGPIO_PCLRR_USBL (MCF_IPSBAR + 0x10006B)
  183. #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x10006C)
  184. /*
  185. * Generic GPIO support
  186. */
  187. #define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL
  188. #define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL
  189. #define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL
  190. #define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL
  191. #define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL
  192. #define MCFGPIO_PIN_MAX 148
  193. #define MCFGPIO_IRQ_MAX 8
  194. #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
  195. #endif
  196. /*
  197. * EPort
  198. */
  199. #define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002)
  200. #define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004)
  201. #define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005)
  202. /*
  203. * GPIO pins setups to enable the UARTs.
  204. */
  205. #ifdef CONFIG_M5271
  206. #define MCF_GPIO_PAR_UART 0x100048 /* PAR UART address */
  207. #define UART0_ENABLE_MASK 0x000f
  208. #define UART1_ENABLE_MASK 0x0ff0
  209. #define UART2_ENABLE_MASK 0x3000
  210. #endif
  211. #ifdef CONFIG_M5275
  212. #define MCF_GPIO_PAR_UART 0x10007c /* PAR UART address */
  213. #define UART0_ENABLE_MASK 0x000f
  214. #define UART1_ENABLE_MASK 0x00f0
  215. #define UART2_ENABLE_MASK 0x3f00
  216. #endif
  217. /*
  218. * Reset Controll Unit (relative to IPSBAR).
  219. */
  220. #define MCF_RCR 0x110000
  221. #define MCF_RSR 0x110001
  222. #define MCF_RCR_SWRESET 0x80 /* Software reset bit */
  223. #define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
  224. /****************************************************************************/
  225. #endif /* m527xsim_h */