m5275.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*
  2. * MCF5275 Internal Memory Map
  3. *
  4. * Copyright (C) 2003-2004, Greg Ungerer (gerg@snapgear.com)
  5. * Copyright (C) 2004-2008 Arthur Shipkowski (art@videon-central.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __M5275_H__
  26. #define __M5275_H__
  27. /*
  28. * Define the 5275 SIM register set addresses. These are similar,
  29. * but not quite identical to the 5282 registers and offsets.
  30. */
  31. #define MCF_GPIO_PAR_UART 0x10007c
  32. #define UART0_ENABLE_MASK 0x000f
  33. #define UART1_ENABLE_MASK 0x00f0
  34. #define UART2_ENABLE_MASK 0x3f00
  35. #define MCF_GPIO_PAR_FECI2C 0x100082
  36. #define PAR_SDA_ENABLE_MASK 0x0003
  37. #define PAR_SCL_ENABLE_MASK 0x000c
  38. #define MCFSIM_WRRR 0x140000
  39. #define MCFSIM_SDCR 0x40
  40. /*********************************************************************
  41. * SDRAM Controller (SDRAMC)
  42. *********************************************************************/
  43. /* Register read/write macros */
  44. #define MCF_SDRAMC_SDMR (*(vuint32*)(void*)(&__IPSBAR[0x000040]))
  45. #define MCF_SDRAMC_SDCR (*(vuint32*)(void*)(&__IPSBAR[0x000044]))
  46. #define MCF_SDRAMC_SDCFG1 (*(vuint32*)(void*)(&__IPSBAR[0x000048]))
  47. #define MCF_SDRAMC_SDCFG2 (*(vuint32*)(void*)(&__IPSBAR[0x00004C]))
  48. #define MCF_SDRAMC_SDBAR0 (*(vuint32*)(void*)(&__IPSBAR[0x000050]))
  49. #define MCF_SDRAMC_SDBAR1 (*(vuint32*)(void*)(&__IPSBAR[0x000058]))
  50. #define MCF_SDRAMC_SDMR0 (*(vuint32*)(void*)(&__IPSBAR[0x000054]))
  51. #define MCF_SDRAMC_SDMR1 (*(vuint32*)(void*)(&__IPSBAR[0x00005C]))
  52. /* Bit definitions and macros for MCF_SDRAMC_SDMR */
  53. #define MCF_SDRAMC_SDMR_CMD (0x00010000)
  54. #define MCF_SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18)
  55. #define MCF_SDRAMC_SDMR_BNKAD(x) (((x)&0x00000003)<<30)
  56. #define MCF_SDRAMC_SDMR_BNKAD_LMR (0x00000000)
  57. #define MCF_SDRAMC_SDMR_BNKAD_LEMR (0x40000000)
  58. /* Bit definitions and macros for MCF_SDRAMC_SDCR */
  59. #define MCF_SDRAMC_SDCR_IPALL (0x00000002)
  60. #define MCF_SDRAMC_SDCR_IREF (0x00000004)
  61. #define MCF_SDRAMC_SDCR_DQS_OE(x) (((x)&0x00000003)<<10)
  62. #define MCF_SDRAMC_SDCR_DQP_BP (0x00008000)
  63. #define MCF_SDRAMC_SDCR_RCNT(x) (((x)&0x0000003F)<<16)
  64. #define MCF_SDRAMC_SDCR_MUX(x) (((x)&0x00000003)<<24)
  65. #define MCF_SDRAMC_SDCR_REF (0x10000000)
  66. #define MCF_SDRAMC_SDCR_CKE (0x40000000)
  67. #define MCF_SDRAMC_SDCR_MODE_EN (0x80000000)
  68. /* Bit definitions and macros for MCF_SDRAMC_SDCFG1 */
  69. #define MCF_SDRAMC_SDCFG1_WTLAT(x) (((x)&0x00000007)<<4)
  70. #define MCF_SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8)
  71. #define MCF_SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12)
  72. #define MCF_SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16)
  73. #define MCF_SDRAMC_SDCFG1_RDLAT(x) (((x)&0x0000000F)<<20)
  74. #define MCF_SDRAMC_SDCFG1_SWT2RD(x) (((x)&0x00000007)<<24)
  75. #define MCF_SDRAMC_SDCFG1_SRD2RW(x) (((x)&0x0000000F)<<28)
  76. /* Bit definitions and macros for MCF_SDRAMC_SDCFG2 */
  77. #define MCF_SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16)
  78. #define MCF_SDRAMC_SDCFG2_BRD2WT(x) (((x)&0x0000000F)<<20)
  79. #define MCF_SDRAMC_SDCFG2_BWT2RW(x) (((x)&0x0000000F)<<24)
  80. #define MCF_SDRAMC_SDCFG2_BRD2PRE(x) (((x)&0x0000000F)<<28)
  81. /* Bit definitions and macros for MCF_SDRAMC_SDBARn */
  82. #define MCF_SDRAMC_SDBARn_BASE(x) (((x)&0x00003FFF)<<18)
  83. #define MCF_SDRAMC_SDBARn_BA(x) ((x)&0xFFFF0000)
  84. /* Bit definitions and macros for MCF_SDRAMC_SDMRn */
  85. #define MCF_SDRAMC_SDMRn_V (0x00000001)
  86. #define MCF_SDRAMC_SDMRn_WP (0x00000080)
  87. #define MCF_SDRAMC_SDMRn_MASK(x) (((x)&0x00003FFF)<<18)
  88. #define MCF_SDRAMC_SDMRn_BAM_4G (0xFFFF0000)
  89. #define MCF_SDRAMC_SDMRn_BAM_2G (0x7FFF0000)
  90. #define MCF_SDRAMC_SDMRn_BAM_1G (0x3FFF0000)
  91. #define MCF_SDRAMC_SDMRn_BAM_1024M (0x3FFF0000)
  92. #define MCF_SDRAMC_SDMRn_BAM_512M (0x1FFF0000)
  93. #define MCF_SDRAMC_SDMRn_BAM_256M (0x0FFF0000)
  94. #define MCF_SDRAMC_SDMRn_BAM_128M (0x07FF0000)
  95. #define MCF_SDRAMC_SDMRn_BAM_64M (0x03FF0000)
  96. #define MCF_SDRAMC_SDMRn_BAM_32M (0x01FF0000)
  97. #define MCF_SDRAMC_SDMRn_BAM_16M (0x00FF0000)
  98. #define MCF_SDRAMC_SDMRn_BAM_8M (0x007F0000)
  99. #define MCF_SDRAMC_SDMRn_BAM_4M (0x003F0000)
  100. #define MCF_SDRAMC_SDMRn_BAM_2M (0x001F0000)
  101. #define MCF_SDRAMC_SDMRn_BAM_1M (0x000F0000)
  102. #define MCF_SDRAMC_SDMRn_BAM_1024K (0x000F0000)
  103. #define MCF_SDRAMC_SDMRn_BAM_512K (0x00070000)
  104. #define MCF_SDRAMC_SDMRn_BAM_256K (0x00030000)
  105. #define MCF_SDRAMC_SDMRn_BAM_128K (0x00010000)
  106. #define MCF_SDRAMC_SDMRn_BAM_64K (0x00000000)
  107. /*********************************************************************
  108. * Interrupt Controller (INTC)
  109. ********************************************************************/
  110. #define INT0_LO_RSVD0 (0)
  111. #define INT0_LO_EPORT1 (1)
  112. #define INT0_LO_EPORT2 (2)
  113. #define INT0_LO_EPORT3 (3)
  114. #define INT0_LO_EPORT4 (4)
  115. #define INT0_LO_EPORT5 (5)
  116. #define INT0_LO_EPORT6 (6)
  117. #define INT0_LO_EPORT7 (7)
  118. #define INT0_LO_SCM (8)
  119. #define INT0_LO_DMA0 (9)
  120. #define INT0_LO_DMA1 (10)
  121. #define INT0_LO_DMA2 (11)
  122. #define INT0_LO_DMA3 (12)
  123. #define INT0_LO_UART0 (13)
  124. #define INT0_LO_UART1 (14)
  125. #define INT0_LO_UART2 (15)
  126. #define INT0_LO_RSVD1 (16)
  127. #define INT0_LO_I2C (17)
  128. #define INT0_LO_QSPI (18)
  129. #define INT0_LO_DTMR0 (19)
  130. #define INT0_LO_DTMR1 (20)
  131. #define INT0_LO_DTMR2 (21)
  132. #define INT0_LO_DTMR3 (22)
  133. #define INT0_LO_FEC0_TXF (23)
  134. #define INT0_LO_FEC0_TXB (24)
  135. #define INT0_LO_FEC0_UN (25)
  136. #define INT0_LO_FEC0_RL (26)
  137. #define INT0_LO_FEC0_RXF (27)
  138. #define INT0_LO_FEC0_RXB (28)
  139. #define INT0_LO_FEC0_MII (29)
  140. #define INT0_LO_FEC0_LC (30)
  141. #define INT0_LO_FEC0_HBERR (31)
  142. #define INT0_HI_FEC0_GRA (32)
  143. #define INT0_HI_FEC0_EBERR (33)
  144. #define INT0_HI_FEC0_BABT (34)
  145. #define INT0_HI_FEC0_BABR (35)
  146. #define INT0_HI_PIT0 (36)
  147. #define INT0_HI_PIT1 (37)
  148. #define INT0_HI_PIT2 (38)
  149. #define INT0_HI_PIT3 (39)
  150. #define INT0_HI_RNG (40)
  151. #define INT0_HI_SKHA (41)
  152. #define INT0_HI_MDHA (42)
  153. #define INT0_HI_USB (43)
  154. #define INT0_HI_USB_EP0 (44)
  155. #define INT0_HI_USB_EP1 (45)
  156. #define INT0_HI_USB_EP2 (46)
  157. #define INT0_HI_USB_EP3 (47)
  158. /* 48-63 Reserved */
  159. /* 0-22 Reserved */
  160. #define INT1_LO_FEC1_TXF (23)
  161. #define INT1_LO_FEC1_TXB (24)
  162. #define INT1_LO_FEC1_UN (25)
  163. #define INT1_LO_FEC1_RL (26)
  164. #define INT1_LO_FEC1_RXF (27)
  165. #define INT1_LO_FEC1_RXB (28)
  166. #define INT1_LO_FEC1_MII (29)
  167. #define INT1_LO_FEC1_LC (30)
  168. #define INT1_LO_FEC1_HBERR (31)
  169. #define INT1_HI_FEC1_GRA (32)
  170. #define INT1_HI_FEC1_EBERR (33)
  171. #define INT1_HI_FEC1_BABT (34)
  172. #define INT1_HI_FEC1_BABR (35)
  173. /* 36-63 Reserved */
  174. /* Bit definitions and macros for RCR */
  175. #define RCM_RCR_FRCRSTOUT (0x40)
  176. #define RCM_RCR_SOFTRST (0x80)
  177. #define FMPLL_SYNSR_LOCK (0x00000008)
  178. #endif /* __M5275_H__ */