m5282.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. * mcf5282.h -- Definitions for Motorola Coldfire 5282
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. /****************************************************************************/
  23. #ifndef m5282_h
  24. #define m5282_h
  25. /*********************************************************************
  26. * PLL Clock Module
  27. *********************************************************************/
  28. /* Bit definitions and macros for PLL_SYNCR */
  29. #define PLL_SYNCR_LOLRE (0x8000)
  30. #define PLL_SYNCR_MFD2 (0x4000)
  31. #define PLL_SYNCR_MFD1 (0x2000)
  32. #define PLL_SYNCR_MFD0 (0x1000)
  33. #define PLL_SYNCR_LOCRE (0x0800)
  34. #define PLL_SYNCR_RFC2 (0x0400)
  35. #define PLL_SYNCR_RFC1 (0x0200)
  36. #define PLL_SYNCR_RFC0 (0x0100)
  37. #define PLL_SYNCR_LOCEN (0x0080)
  38. #define PLL_SYNCR_DISCLK (0x0040)
  39. #define PLL_SYNCR_FWKUP (0x0020)
  40. #define PLL_SYNCR_STPMD1 (0x0008)
  41. #define PLL_SYNCR_STPMD0 (0x0004)
  42. /* Bit definitions and macros for PLL_SYNSR */
  43. #define PLL_SYNSR_MODE (0x0080)
  44. #define PLL_SYNSR_PLLSEL (0x0040)
  45. #define PLL_SYNSR_PLLREF (0x0020)
  46. #define PLL_SYNSR_LOCKS (0x0010)
  47. #define PLL_SYNSR_LOCK (0x0008)
  48. #define PLL_SYNSR_LOCS (0x0004)
  49. /*********************************************************************
  50. * Interrupt Controller (INTC)
  51. *********************************************************************/
  52. #define INT0_LO_RSVD0 (0)
  53. #define INT0_LO_EPORT1 (1)
  54. #define INT0_LO_EPORT2 (2)
  55. #define INT0_LO_EPORT3 (3)
  56. #define INT0_LO_EPORT4 (4)
  57. #define INT0_LO_EPORT5 (5)
  58. #define INT0_LO_EPORT6 (6)
  59. #define INT0_LO_EPORT7 (7)
  60. #define INT0_LO_SCM_SWT1 (8)
  61. #define INT0_LO_DMA_00 (9)
  62. #define INT0_LO_DMA_01 (10)
  63. #define INT0_LO_DMA_02 (11)
  64. #define INT0_LO_DMA_03 (12)
  65. #define INT0_LO_UART0 (13)
  66. #define INT0_LO_UART1 (14)
  67. #define INT0_LO_UART2 (15)
  68. #define INT0_LO_RSVD1 (16)
  69. #define INT0_LO_I2C (17)
  70. #define INT0_LO_QSPI (18)
  71. #define INT0_LO_DTMR0 (19)
  72. #define INT0_LO_DTMR1 (20)
  73. #define INT0_LO_DTMR2 (21)
  74. #define INT0_LO_DTMR3 (22)
  75. #define INT0_LO_FEC_TXF (23)
  76. #define INT0_LO_FEC_TXB (24)
  77. #define INT0_LO_FEC_UN (25)
  78. #define INT0_LO_FEC_RL (26)
  79. #define INT0_LO_FEC_RXF (27)
  80. #define INT0_LO_FEC_RXB (28)
  81. #define INT0_LO_FEC_MII (29)
  82. #define INT0_LO_FEC_LC (30)
  83. #define INT0_LO_FEC_HBERR (31)
  84. #define INT0_HI_FEC_GRA (32)
  85. #define INT0_HI_FEC_EBERR (33)
  86. #define INT0_HI_FEC_BABT (34)
  87. #define INT0_HI_FEC_BABR (35)
  88. #define INT0_HI_PMM_LVDF (36)
  89. #define INT0_HI_QADC_CF1 (37)
  90. #define INT0_HI_QADC_CF2 (38)
  91. #define INT0_HI_QADC_PF1 (39)
  92. #define INT0_HI_QADC_PF2 (40)
  93. #define INT0_HI_GPTA_TOF (41)
  94. #define INT0_HI_GPTA_PAIF (42)
  95. #define INT0_HI_GPTA_PAOVF (43)
  96. #define INT0_HI_GPTA_C0F (44)
  97. #define INT0_HI_GPTA_C1F (45)
  98. #define INT0_HI_GPTA_C2F (46)
  99. #define INT0_HI_GPTA_C3F (47)
  100. #define INT0_HI_GPTB_TOF (48)
  101. #define INT0_HI_GPTB_PAIF (49)
  102. #define INT0_HI_GPTB_PAOVF (50)
  103. #define INT0_HI_GPTB_C0F (51)
  104. #define INT0_HI_GPTB_C1F (52)
  105. #define INT0_HI_GPTB_C2F (53)
  106. #define INT0_HI_GPTB_C3F (54)
  107. #define INT0_HI_PIT0 (55)
  108. #define INT0_HI_PIT1 (56)
  109. #define INT0_HI_PIT2 (57)
  110. #define INT0_HI_PIT3 (58)
  111. #define INT0_HI_CFM_CBEIF (59)
  112. #define INT0_HI_CFM_CCIF (60)
  113. #define INT0_HI_CFM_PVIF (61)
  114. #define INT0_HI_CFM_AEIF (62)
  115. /*
  116. * Size of internal RAM
  117. */
  118. #define INT_RAM_SIZE 65536
  119. /* General Purpose I/O Module GPIO */
  120. #define MCFGPIO_PORTA (*(vu_char *) (CONFIG_SYS_MBAR+0x100000))
  121. #define MCFGPIO_PORTB (*(vu_char *) (CONFIG_SYS_MBAR+0x100001))
  122. #define MCFGPIO_PORTC (*(vu_char *) (CONFIG_SYS_MBAR+0x100002))
  123. #define MCFGPIO_PORTD (*(vu_char *) (CONFIG_SYS_MBAR+0x100003))
  124. #define MCFGPIO_PORTE (*(vu_char *) (CONFIG_SYS_MBAR+0x100004))
  125. #define MCFGPIO_PORTF (*(vu_char *) (CONFIG_SYS_MBAR+0x100005))
  126. #define MCFGPIO_PORTG (*(vu_char *) (CONFIG_SYS_MBAR+0x100006))
  127. #define MCFGPIO_PORTH (*(vu_char *) (CONFIG_SYS_MBAR+0x100007))
  128. #define MCFGPIO_PORTJ (*(vu_char *) (CONFIG_SYS_MBAR+0x100008))
  129. #define MCFGPIO_PORTDD (*(vu_char *) (CONFIG_SYS_MBAR+0x100009))
  130. #define MCFGPIO_PORTEH (*(vu_char *) (CONFIG_SYS_MBAR+0x10000A))
  131. #define MCFGPIO_PORTEL (*(vu_char *) (CONFIG_SYS_MBAR+0x10000B))
  132. #define MCFGPIO_PORTAS (*(vu_char *) (CONFIG_SYS_MBAR+0x10000C))
  133. #define MCFGPIO_PORTQS (*(vu_char *) (CONFIG_SYS_MBAR+0x10000D))
  134. #define MCFGPIO_PORTSD (*(vu_char *) (CONFIG_SYS_MBAR+0x10000E))
  135. #define MCFGPIO_PORTTC (*(vu_char *) (CONFIG_SYS_MBAR+0x10000F))
  136. #define MCFGPIO_PORTTD (*(vu_char *) (CONFIG_SYS_MBAR+0x100010))
  137. #define MCFGPIO_PORTUA (*(vu_char *) (CONFIG_SYS_MBAR+0x100011))
  138. #define MCFGPIO_DDRA (*(vu_char *) (CONFIG_SYS_MBAR+0x100014))
  139. #define MCFGPIO_DDRB (*(vu_char *) (CONFIG_SYS_MBAR+0x100015))
  140. #define MCFGPIO_DDRC (*(vu_char *) (CONFIG_SYS_MBAR+0x100016))
  141. #define MCFGPIO_DDRD (*(vu_char *) (CONFIG_SYS_MBAR+0x100017))
  142. #define MCFGPIO_DDRE (*(vu_char *) (CONFIG_SYS_MBAR+0x100018))
  143. #define MCFGPIO_DDRF (*(vu_char *) (CONFIG_SYS_MBAR+0x100019))
  144. #define MCFGPIO_DDRG (*(vu_char *) (CONFIG_SYS_MBAR+0x10001A))
  145. #define MCFGPIO_DDRH (*(vu_char *) (CONFIG_SYS_MBAR+0x10001B))
  146. #define MCFGPIO_DDRJ (*(vu_char *) (CONFIG_SYS_MBAR+0x10001C))
  147. #define MCFGPIO_DDRDD (*(vu_char *) (CONFIG_SYS_MBAR+0x10001D))
  148. #define MCFGPIO_DDREH (*(vu_char *) (CONFIG_SYS_MBAR+0x10001E))
  149. #define MCFGPIO_DDREL (*(vu_char *) (CONFIG_SYS_MBAR+0x10001F))
  150. #define MCFGPIO_DDRAS (*(vu_char *) (CONFIG_SYS_MBAR+0x100020))
  151. #define MCFGPIO_DDRQS (*(vu_char *) (CONFIG_SYS_MBAR+0x100021))
  152. #define MCFGPIO_DDRSD (*(vu_char *) (CONFIG_SYS_MBAR+0x100022))
  153. #define MCFGPIO_DDRTC (*(vu_char *) (CONFIG_SYS_MBAR+0x100023))
  154. #define MCFGPIO_DDRTD (*(vu_char *) (CONFIG_SYS_MBAR+0x100024))
  155. #define MCFGPIO_DDRUA (*(vu_char *) (CONFIG_SYS_MBAR+0x100025))
  156. #define MCFGPIO_PORTAP (*(vu_char *) (CONFIG_SYS_MBAR+0x100028))
  157. #define MCFGPIO_PORTBP (*(vu_char *) (CONFIG_SYS_MBAR+0x100029))
  158. #define MCFGPIO_PORTCP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002A))
  159. #define MCFGPIO_PORTDP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002B))
  160. #define MCFGPIO_PORTEP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002C))
  161. #define MCFGPIO_PORTFP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002D))
  162. #define MCFGPIO_PORTGP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002E))
  163. #define MCFGPIO_PORTHP (*(vu_char *) (CONFIG_SYS_MBAR+0x10002F))
  164. #define MCFGPIO_PORTJP (*(vu_char *) (CONFIG_SYS_MBAR+0x100030))
  165. #define MCFGPIO_PORTDDP (*(vu_char *) (CONFIG_SYS_MBAR+0x100031))
  166. #define MCFGPIO_PORTEHP (*(vu_char *) (CONFIG_SYS_MBAR+0x100032))
  167. #define MCFGPIO_PORTELP (*(vu_char *) (CONFIG_SYS_MBAR+0x100033))
  168. #define MCFGPIO_PORTASP (*(vu_char *) (CONFIG_SYS_MBAR+0x100034))
  169. #define MCFGPIO_PORTQSP (*(vu_char *) (CONFIG_SYS_MBAR+0x100035))
  170. #define MCFGPIO_PORTSDP (*(vu_char *) (CONFIG_SYS_MBAR+0x100036))
  171. #define MCFGPIO_PORTTCP (*(vu_char *) (CONFIG_SYS_MBAR+0x100037))
  172. #define MCFGPIO_PORTTDP (*(vu_char *) (CONFIG_SYS_MBAR+0x100038))
  173. #define MCFGPIO_PORTUAP (*(vu_char *) (CONFIG_SYS_MBAR+0x100039))
  174. #define MCFGPIO_SETA (*(vu_char *) (CONFIG_SYS_MBAR+0x100028))
  175. #define MCFGPIO_SETB (*(vu_char *) (CONFIG_SYS_MBAR+0x100029))
  176. #define MCFGPIO_SETC (*(vu_char *) (CONFIG_SYS_MBAR+0x10002A))
  177. #define MCFGPIO_SETD (*(vu_char *) (CONFIG_SYS_MBAR+0x10002B))
  178. #define MCFGPIO_SETE (*(vu_char *) (CONFIG_SYS_MBAR+0x10002C))
  179. #define MCFGPIO_SETF (*(vu_char *) (CONFIG_SYS_MBAR+0x10002D))
  180. #define MCFGPIO_SETG (*(vu_char *) (CONFIG_SYS_MBAR+0x10002E))
  181. #define MCFGPIO_SETH (*(vu_char *) (CONFIG_SYS_MBAR+0x10002F))
  182. #define MCFGPIO_SETJ (*(vu_char *) (CONFIG_SYS_MBAR+0x100030))
  183. #define MCFGPIO_SETDD (*(vu_char *) (CONFIG_SYS_MBAR+0x100031))
  184. #define MCFGPIO_SETEH (*(vu_char *) (CONFIG_SYS_MBAR+0x100032))
  185. #define MCFGPIO_SETEL (*(vu_char *) (CONFIG_SYS_MBAR+0x100033))
  186. #define MCFGPIO_SETAS (*(vu_char *) (CONFIG_SYS_MBAR+0x100034))
  187. #define MCFGPIO_SETQS (*(vu_char *) (CONFIG_SYS_MBAR+0x100035))
  188. #define MCFGPIO_SETSD (*(vu_char *) (CONFIG_SYS_MBAR+0x100036))
  189. #define MCFGPIO_SETTC (*(vu_char *) (CONFIG_SYS_MBAR+0x100037))
  190. #define MCFGPIO_SETTD (*(vu_char *) (CONFIG_SYS_MBAR+0x100038))
  191. #define MCFGPIO_SETUA (*(vu_char *) (CONFIG_SYS_MBAR+0x100039))
  192. #define MCFGPIO_CLRA (*(vu_char *) (CONFIG_SYS_MBAR+0x10003C))
  193. #define MCFGPIO_CLRB (*(vu_char *) (CONFIG_SYS_MBAR+0x10003D))
  194. #define MCFGPIO_CLRC (*(vu_char *) (CONFIG_SYS_MBAR+0x10003E))
  195. #define MCFGPIO_CLRD (*(vu_char *) (CONFIG_SYS_MBAR+0x10003F))
  196. #define MCFGPIO_CLRE (*(vu_char *) (CONFIG_SYS_MBAR+0x100040))
  197. #define MCFGPIO_CLRF (*(vu_char *) (CONFIG_SYS_MBAR+0x100041))
  198. #define MCFGPIO_CLRG (*(vu_char *) (CONFIG_SYS_MBAR+0x100042))
  199. #define MCFGPIO_CLRH (*(vu_char *) (CONFIG_SYS_MBAR+0x100043))
  200. #define MCFGPIO_CLRJ (*(vu_char *) (CONFIG_SYS_MBAR+0x100044))
  201. #define MCFGPIO_CLRDD (*(vu_char *) (CONFIG_SYS_MBAR+0x100045))
  202. #define MCFGPIO_CLREH (*(vu_char *) (CONFIG_SYS_MBAR+0x100046))
  203. #define MCFGPIO_CLREL (*(vu_char *) (CONFIG_SYS_MBAR+0x100047))
  204. #define MCFGPIO_CLRAS (*(vu_char *) (CONFIG_SYS_MBAR+0x100048))
  205. #define MCFGPIO_CLRQS (*(vu_char *) (CONFIG_SYS_MBAR+0x100049))
  206. #define MCFGPIO_CLRSD (*(vu_char *) (CONFIG_SYS_MBAR+0x10004A))
  207. #define MCFGPIO_CLRTC (*(vu_char *) (CONFIG_SYS_MBAR+0x10004B))
  208. #define MCFGPIO_CLRTD (*(vu_char *) (CONFIG_SYS_MBAR+0x10004C))
  209. #define MCFGPIO_CLRUA (*(vu_char *) (CONFIG_SYS_MBAR+0x10004D))
  210. #define MCFGPIO_PBCDPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100050))
  211. #define MCFGPIO_PFPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100051))
  212. #define MCFGPIO_PEPAR (*(vu_short *)(CONFIG_SYS_MBAR+0x100052))
  213. #define MCFGPIO_PJPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100054))
  214. #define MCFGPIO_PSDPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100055))
  215. #define MCFGPIO_PASPAR (*(vu_short *)(CONFIG_SYS_MBAR+0x100056))
  216. #define MCFGPIO_PEHLPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100058))
  217. #define MCFGPIO_PQSPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x100059))
  218. #define MCFGPIO_PTCPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x10005A))
  219. #define MCFGPIO_PTDPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x10005B))
  220. #define MCFGPIO_PUAPAR (*(vu_char *) (CONFIG_SYS_MBAR+0x10005C))
  221. /* Bit level definitions and macros */
  222. #define MCFGPIO_PORT7 (0x80)
  223. #define MCFGPIO_PORT6 (0x40)
  224. #define MCFGPIO_PORT5 (0x20)
  225. #define MCFGPIO_PORT4 (0x10)
  226. #define MCFGPIO_PORT3 (0x08)
  227. #define MCFGPIO_PORT2 (0x04)
  228. #define MCFGPIO_PORT1 (0x02)
  229. #define MCFGPIO_PORT0 (0x01)
  230. #define MCFGPIO_PORT(x) (0x01<<x)
  231. #define MCFGPIO_DDR7 (0x80)
  232. #define MCFGPIO_DDR6 (0x40)
  233. #define MCFGPIO_DDR5 (0x20)
  234. #define MCFGPIO_DDR4 (0x10)
  235. #define MCFGPIO_DDR3 (0x08)
  236. #define MCFGPIO_DDR2 (0x04)
  237. #define MCFGPIO_DDR1 (0x02)
  238. #define MCFGPIO_DDR0 (0x01)
  239. #define MCFGPIO_DDR(x) (0x01<<x)
  240. #define MCFGPIO_Px7 (0x80)
  241. #define MCFGPIO_Px6 (0x40)
  242. #define MCFGPIO_Px5 (0x20)
  243. #define MCFGPIO_Px4 (0x10)
  244. #define MCFGPIO_Px3 (0x08)
  245. #define MCFGPIO_Px2 (0x04)
  246. #define MCFGPIO_Px1 (0x02)
  247. #define MCFGPIO_Px0 (0x01)
  248. #define MCFGPIO_Px(x) (0x01<<x)
  249. #define MCFGPIO_PBCDPAR_PBPA (0x80)
  250. #define MCFGPIO_PBCDPAR_PCDPA (0x40)
  251. #define MCFGPIO_PEPAR_PEPA7 (0x4000)
  252. #define MCFGPIO_PEPAR_PEPA6 (0x1000)
  253. #define MCFGPIO_PEPAR_PEPA5 (0x0400)
  254. #define MCFGPIO_PEPAR_PEPA4 (0x0100)
  255. #define MCFGPIO_PEPAR_PEPA3 (0x0040)
  256. #define MCFGPIO_PEPAR_PEPA2 (0x0010)
  257. #define MCFGPIO_PEPAR_PEPA1(x) (((x)&0x3)<<2)
  258. #define MCFGPIO_PEPAR_PEPA0(x) (((x)&0x3))
  259. #define MCFGPIO_PFPAR_PFPA7 (0x80)
  260. #define MCFGPIO_PFPAR_PFPA6 (0x40)
  261. #define MCFGPIO_PFPAR_PFPA5 (0x20)
  262. #define MCFGPIO_PJPAR_PJPA7 (0x80)
  263. #define MCFGPIO_PJPAR_PJPA6 (0x40)
  264. #define MCFGPIO_PJPAR_PJPA5 (0x20)
  265. #define MCFGPIO_PJPAR_PJPA4 (0x10)
  266. #define MCFGPIO_PJPAR_PJPA3 (0x08)
  267. #define MCFGPIO_PJPAR_PJPA2 (0x04)
  268. #define MCFGPIO_PJPAR_PJPA1 (0x02)
  269. #define MCFGPIO_PJPAR_PJPA0 (0x01)
  270. #define MCFGPIO_PJPAR_PJPA(x) (0x01<<x)
  271. #define MCFGPIO_PSDPAR_PSDPA (0x80)
  272. #define MCFGPIO_PASPAR_PASPA5(x) (((x)&0x3)<<10)
  273. #define MCFGPIO_PASPAR_PASPA4(x) (((x)&0x3)<<8)
  274. #define MCFGPIO_PASPAR_PASPA3(x) (((x)&0x3)<<6)
  275. #define MCFGPIO_PASPAR_PASPA2(x) (((x)&0x3)<<4)
  276. #define MCFGPIO_PASPAR_PASPA1(x) (((x)&0x3)<<2)
  277. #define MCFGPIO_PASPAR_PASPA0(x) (((x)&0x3))
  278. #define MCFGPIO_PEHLPAR_PEHPA (0x80)
  279. #define MCFGPIO_PEHLPAR_PELPA (0x40)
  280. #define MCFGPIO_PQSPAR_PQSPA6 (0x40)
  281. #define MCFGPIO_PQSPAR_PQSPA5 (0x20)
  282. #define MCFGPIO_PQSPAR_PQSPA4 (0x10)
  283. #define MCFGPIO_PQSPAR_PQSPA3 (0x08)
  284. #define MCFGPIO_PQSPAR_PQSPA2 (0x04)
  285. #define MCFGPIO_PQSPAR_PQSPA1 (0x02)
  286. #define MCFGPIO_PQSPAR_PQSPA0 (0x01)
  287. #define MCFGPIO_PQSPAR_PQSPA(x) (0x01<<x)
  288. #define MCFGPIO_PTCPAR_PTCPA3(x) (((x)&0x3)<<6)
  289. #define MCFGPIO_PTCPAR_PTCPA2(x) (((x)&0x3)<<4)
  290. #define MCFGPIO_PTCPAR_PTCPA1(x) (((x)&0x3)<<2)
  291. #define MCFGPIO_PTCPAR_PTCPA0(x) (((x)&0x3))
  292. #define MCFGPIO_PTDPAR_PTDPA3(x) (((x)&0x3)<<6)
  293. #define MCFGPIO_PTDPAR_PTDPA2(x) (((x)&0x3)<<4)
  294. #define MCFGPIO_PTDPAR_PTDPA1(x) (((x)&0x3)<<2)
  295. #define MCFGPIO_PTDPAR_PTDPA0(x) (((x)&0x3))
  296. #define MCFGPIO_PUAPAR_PUAPA3 (0x08)
  297. #define MCFGPIO_PUAPAR_PUAPA2 (0x04)
  298. #define MCFGPIO_PUAPAR_PUAPA1 (0x02)
  299. #define MCFGPIO_PUAPAR_PUAPA0 (0x01)
  300. /* System Conrol Module SCM */
  301. #define MCFSCM_RAMBAR (*(vu_long *) (CONFIG_SYS_MBAR+0x00000008))
  302. #define MCFSCM_CRSR (*(vu_char *) (CONFIG_SYS_MBAR+0x00000010))
  303. #define MCFSCM_CWCR (*(vu_char *) (CONFIG_SYS_MBAR+0x00000011))
  304. #define MCFSCM_LPICR (*(vu_char *) (CONFIG_SYS_MBAR+0x00000012))
  305. #define MCFSCM_CWSR (*(vu_char *) (CONFIG_SYS_MBAR+0x00000013))
  306. #define MCFSCM_MPARK (*(vu_long *) (CONFIG_SYS_MBAR+0x0000001C))
  307. #define MCFSCM_MPR (*(vu_char *) (CONFIG_SYS_MBAR+0x00000020))
  308. #define MCFSCM_PACR0 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000024))
  309. #define MCFSCM_PACR1 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000025))
  310. #define MCFSCM_PACR2 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000026))
  311. #define MCFSCM_PACR3 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000027))
  312. #define MCFSCM_PACR4 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000028))
  313. #define MCFSCM_PACR5 (*(vu_char *) (CONFIG_SYS_MBAR+0x0000002A))
  314. #define MCFSCM_PACR6 (*(vu_char *) (CONFIG_SYS_MBAR+0x0000002B))
  315. #define MCFSCM_PACR7 (*(vu_char *) (CONFIG_SYS_MBAR+0x0000002C))
  316. #define MCFSCM_PACR8 (*(vu_char *) (CONFIG_SYS_MBAR+0x0000002E))
  317. #define MCFSCM_GPACR0 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000030))
  318. #define MCFSCM_GPACR1 (*(vu_char *) (CONFIG_SYS_MBAR+0x00000031))
  319. #define MCFSCM_CRSR_EXT (0x80)
  320. #define MCFSCM_CRSR_CWDR (0x20)
  321. #define MCFSCM_RAMBAR_BA(x) ((x)&0xFFFF0000)
  322. #define MCFSCM_RAMBAR_BDE (0x00000200)
  323. /* Reset Controller Module RCM */
  324. #define MCFRESET_RCR (*(vu_char *) (CONFIG_SYS_MBAR+0x00110000))
  325. #define MCFRESET_RSR (*(vu_char *) (CONFIG_SYS_MBAR+0x00110001))
  326. #define MCFRESET_RCR_SOFTRST (0x80)
  327. #define MCFRESET_RCR_FRCRSTOUT (0x40)
  328. #define MCFRESET_RCR_LVDF (0x10)
  329. #define MCFRESET_RCR_LVDIE (0x08)
  330. #define MCFRESET_RCR_LVDRE (0x04)
  331. #define MCFRESET_RCR_LVDE (0x01)
  332. #define MCFRESET_RSR_LVD (0x40)
  333. #define MCFRESET_RSR_SOFT (0x20)
  334. #define MCFRESET_RSR_WDR (0x10)
  335. #define MCFRESET_RSR_POR (0x08)
  336. #define MCFRESET_RSR_EXT (0x04)
  337. #define MCFRESET_RSR_LOC (0x02)
  338. #define MCFRESET_RSR_LOL (0x01)
  339. #define MCFRESET_RSR_ALL (0x7F)
  340. #define MCFRESET_RCR_SOFTRST (0x80)
  341. #define MCFRESET_RCR_FRCRSTOUT (0x40)
  342. /* Chip Configuration Module CCM */
  343. #define MCFCCM_CCR (*(vu_short *)(CONFIG_SYS_MBAR+0x00110004))
  344. #define MCFCCM_RCON (*(vu_short *)(CONFIG_SYS_MBAR+0x00110008))
  345. #define MCFCCM_CIR (*(vu_short *)(CONFIG_SYS_MBAR+0x0011000A))
  346. /* Bit level definitions and macros */
  347. #define MCFCCM_CCR_LOAD (0x8000)
  348. #define MCFCCM_CCR_MODE(x) (((x)&0x0007)<<8)
  349. #define MCFCCM_CCR_SZEN (0x0040)
  350. #define MCFCCM_CCR_PSTEN (0x0020)
  351. #define MCFCCM_CCR_BME (0x0008)
  352. #define MCFCCM_CCR_BMT(x) (((x)&0x0007))
  353. #define MCFCCM_CIR_PIN_MASK (0xFF00)
  354. #define MCFCCM_CIR_PRN_MASK (0x00FF)
  355. /* Clock Module */
  356. #define MCFCLOCK_SYNCR (*(vu_short *)(CONFIG_SYS_MBAR+0x120000))
  357. #define MCFCLOCK_SYNSR (*(vu_char *) (CONFIG_SYS_MBAR+0x120002))
  358. #define MCFCLOCK_SYNCR_MFD(x) (((x)&0x0007)<<12)
  359. #define MCFCLOCK_SYNCR_RFD(x) (((x)&0x0007)<<8)
  360. #define MCFCLOCK_SYNSR_LOCK 0x08
  361. #define MCFSDRAMC_DCR (*(vu_short *)(CONFIG_SYS_MBAR+0x00000040))
  362. #define MCFSDRAMC_DACR0 (*(vu_long *) (CONFIG_SYS_MBAR+0x00000048))
  363. #define MCFSDRAMC_DMR0 (*(vu_long *) (CONFIG_SYS_MBAR+0x0000004c))
  364. #define MCFSDRAMC_DACR1 (*(vu_long *) (CONFIG_SYS_MBAR+0x00000050))
  365. #define MCFSDRAMC_DMR1 (*(vu_long *) (CONFIG_SYS_MBAR+0x00000054))
  366. #define MCFSDRAMC_DCR_NAM (0x2000)
  367. #define MCFSDRAMC_DCR_COC (0x1000)
  368. #define MCFSDRAMC_DCR_IS (0x0800)
  369. #define MCFSDRAMC_DCR_RTIM_3 (0x0000)
  370. #define MCFSDRAMC_DCR_RTIM_6 (0x0200)
  371. #define MCFSDRAMC_DCR_RTIM_9 (0x0400)
  372. #define MCFSDRAMC_DCR_RC(x) ((x)&0x01FF)
  373. #define MCFSDRAMC_DACR_BASE(x) ((x)&0xFFFC0000)
  374. #define MCFSDRAMC_DACR_RE (0x00008000)
  375. #define MCFSDRAMC_DACR_CASL(x) (((x)&0x03)<<12)
  376. #define MCFSDRAMC_DACR_CBM(x) (((x)&0x07)<<8)
  377. #define MCFSDRAMC_DACR_PS_32 (0x00000000)
  378. #define MCFSDRAMC_DACR_PS_16 (0x00000020)
  379. #define MCFSDRAMC_DACR_PS_8 (0x00000010)
  380. #define MCFSDRAMC_DACR_IP (0x00000008)
  381. #define MCFSDRAMC_DACR_IMRS (0x00000040)
  382. #define MCFSDRAMC_DMR_BAM_16M (0x00FC0000)
  383. #define MCFSDRAMC_DMR_WP (0x00000100)
  384. #define MCFSDRAMC_DMR_CI (0x00000040)
  385. #define MCFSDRAMC_DMR_AM (0x00000020)
  386. #define MCFSDRAMC_DMR_SC (0x00000010)
  387. #define MCFSDRAMC_DMR_SD (0x00000008)
  388. #define MCFSDRAMC_DMR_UC (0x00000004)
  389. #define MCFSDRAMC_DMR_UD (0x00000002)
  390. #define MCFSDRAMC_DMR_V (0x00000001)
  391. #define MCFWTM_WCR (*(vu_short *)(CONFIG_SYS_MBAR+0x00140000))
  392. #define MCFWTM_WMR (*(vu_short *)(CONFIG_SYS_MBAR+0x00140002))
  393. #define MCFWTM_WCNTR (*(vu_short *)(CONFIG_SYS_MBAR+0x00140004))
  394. #define MCFWTM_WSR (*(vu_short *)(CONFIG_SYS_MBAR+0x00140006))
  395. /*********************************************************************
  396. * General Purpose Timer (GPT) Module
  397. *********************************************************************/
  398. #define MCFGPTA_GPTIOS (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0000))
  399. #define MCFGPTA_GPTCFORC (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0001))
  400. #define MCFGPTA_GPTOC3M (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0002))
  401. #define MCFGPTA_GPTOC3D (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0003))
  402. #define MCFGPTA_GPTCNT (*(vu_short *)(CONFIG_SYS_MBAR+0x1A0004))
  403. #define MCFGPTA_GPTSCR1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0006))
  404. #define MCFGPTA_GPTTOV (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0008))
  405. #define MCFGPTA_GPTCTL1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0009))
  406. #define MCFGPTA_GPTCTL2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A000B))
  407. #define MCFGPTA_GPTIE (*(vu_char *)(CONFIG_SYS_MBAR+0x1A000C))
  408. #define MCFGPTA_GPTSCR2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A000D))
  409. #define MCFGPTA_GPTFLG1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A000E))
  410. #define MCFGPTA_GPTFLG2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1A000F))
  411. #define MCFGPTA_GPTC0 (*(vu_short *)(CONFIG_SYS_MBAR+0x1A0010))
  412. #define MCFGPTA_GPTC1 (*(vu_short *)(CONFIG_SYS_MBAR+0x1A0012))
  413. #define MCFGPTA_GPTC2 (*(vu_short *)(CONFIG_SYS_MBAR+0x1A0014))
  414. #define MCFGPTA_GPTC3 (*(vu_short *)(CONFIG_SYS_MBAR+0x1A0016))
  415. #define MCFGPTA_GPTPACTL (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0018))
  416. #define MCFGPTA_GPTPAFLG (*(vu_char *)(CONFIG_SYS_MBAR+0x1A0019))
  417. #define MCFGPTA_GPTPACNT (*(vu_short *)(CONFIG_SYS_MBAR+0x1A001A))
  418. #define MCFGPTA_GPTPORT (*(vu_char *)(CONFIG_SYS_MBAR+0x1A001D))
  419. #define MCFGPTA_GPTDDR (*(vu_char *)(CONFIG_SYS_MBAR+0x1A001E))
  420. #define MCFGPTB_GPTIOS (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0000))
  421. #define MCFGPTB_GPTCFORC (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0001))
  422. #define MCFGPTB_GPTOC3M (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0002))
  423. #define MCFGPTB_GPTOC3D (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0003))
  424. #define MCFGPTB_GPTCNT (*(vu_short *)(CONFIG_SYS_MBAR+0x1B0004))
  425. #define MCFGPTB_GPTSCR1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0006))
  426. #define MCFGPTB_GPTTOV (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0008))
  427. #define MCFGPTB_GPTCTL1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0009))
  428. #define MCFGPTB_GPTCTL2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B000B))
  429. #define MCFGPTB_GPTIE (*(vu_char *)(CONFIG_SYS_MBAR+0x1B000C))
  430. #define MCFGPTB_GPTSCR2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B000D))
  431. #define MCFGPTB_GPTFLG1 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B000E))
  432. #define MCFGPTB_GPTFLG2 (*(vu_char *)(CONFIG_SYS_MBAR+0x1B000F))
  433. #define MCFGPTB_GPTC0 (*(vu_short *)(CONFIG_SYS_MBAR+0x1B0010))
  434. #define MCFGPTB_GPTC1 (*(vu_short *)(CONFIG_SYS_MBAR+0x1B0012))
  435. #define MCFGPTB_GPTC2 (*(vu_short *)(CONFIG_SYS_MBAR+0x1B0014))
  436. #define MCFGPTB_GPTC3 (*(vu_short *)(CONFIG_SYS_MBAR+0x1B0016))
  437. #define MCFGPTB_GPTPACTL (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0018))
  438. #define MCFGPTB_GPTPAFLG (*(vu_char *)(CONFIG_SYS_MBAR+0x1B0019))
  439. #define MCFGPTB_GPTPACNT (*(vu_short *)(CONFIG_SYS_MBAR+0x1B001A))
  440. #define MCFGPTB_GPTPORT (*(vu_char *)(CONFIG_SYS_MBAR+0x1B001D))
  441. #define MCFGPTB_GPTDDR (*(vu_char *)(CONFIG_SYS_MBAR+0x1B001E))
  442. /* Bit level definitions and macros */
  443. #define MCFGPT_GPTIOS_IOS3 (0x08)
  444. #define MCFGPT_GPTIOS_IOS2 (0x04)
  445. #define MCFGPT_GPTIOS_IOS1 (0x02)
  446. #define MCFGPT_GPTIOS_IOS0 (0x01)
  447. #define MCFGPT_GPTCFORC_FOC3 (0x08)
  448. #define MCFGPT_GPTCFORC_FOC2 (0x04)
  449. #define MCFGPT_GPTCFORC_FOC1 (0x02)
  450. #define MCFGPT_GPTCFORC_FOC0 (0x01)
  451. #define MCFGPT_GPTOC3M_OC3M3 (0x08)
  452. #define MCFGPT_GPTOC3M_OC3M2 (0x04)
  453. #define MCFGPT_GPTOC3M_OC3M1 (0x02)
  454. #define MCFGPT_GPTOC3M_OC3M0 (0x01)
  455. #define MCFGPT_GPTOC3M_OC3D(x) (((x)&0x04))
  456. #define MCFGPT_GPTSCR1_GPTEN (0x80)
  457. #define MCFGPT_GPTSCR1_TFFCA (0x10)
  458. #define MCFGPT_GPTTOV3 (0x08)
  459. #define MCFGPT_GPTTOV2 (0x04)
  460. #define MCFGPT_GPTTOV1 (0x02)
  461. #define MCFGPT_GPTTOV0 (0x01)
  462. #define MCFGPT_GPTCTL_OMOL3(x) (((x)&0x03)<<6)
  463. #define MCFGPT_GPTCTL_OMOL2(x) (((x)&0x03)<<4)
  464. #define MCFGPT_GPTCTL_OMOL1(x) (((x)&0x03)<<2)
  465. #define MCFGPT_GPTCTL_OMOL0(x) (((x)&0x03))
  466. #define MCFGPT_GPTCTL2_EDG3(x) (((x)&0x03)<<6)
  467. #define MCFGPT_GPTCTL2_EDG2(x) (((x)&0x03)<<4)
  468. #define MCFGPT_GPTCTL2_EDG1(x) (((x)&0x03)<<2)
  469. #define MCFGPT_GPTCTL2_EDG0(x) (((x)&0x03))
  470. #define MCFGPT_GPTIE_C3I (0x08)
  471. #define MCFGPT_GPTIE_C2I (0x04)
  472. #define MCFGPT_GPTIE_C1I (0x02)
  473. #define MCFGPT_GPTIE_C0I (0x01)
  474. #define MCFGPT_GPTSCR2_TOI (0x80)
  475. #define MCFGPT_GPTSCR2_PUPT (0x20)
  476. #define MCFGPT_GPTSCR2_RDPT (0x10)
  477. #define MCFGPT_GPTSCR2_TCRE (0x08)
  478. #define MCFGPT_GPTSCR2_PR(x) (((x)&0x07))
  479. #define MCFGPT_GPTFLG1_C3F (0x08)
  480. #define MCFGPT_GPTFLG1_C2F (0x04)
  481. #define MCFGPT_GPTFLG1_C1F (0x02)
  482. #define MCFGPT_GPTFLG1_C0F (0x01)
  483. #define MCFGPT_GPTFLG2_TOF (0x80)
  484. #define MCFGPT_GPTFLG2_C3F (0x08)
  485. #define MCFGPT_GPTFLG2_C2F (0x04)
  486. #define MCFGPT_GPTFLG2_C1F (0x02)
  487. #define MCFGPT_GPTFLG2_C0F (0x01)
  488. #define MCFGPT_GPTPACTL_PAE (0x40)
  489. #define MCFGPT_GPTPACTL_PAMOD (0x20)
  490. #define MCFGPT_GPTPACTL_PEDGE (0x10)
  491. #define MCFGPT_GPTPACTL_CLK_PACLK (0x04)
  492. #define MCFGPT_GPTPACTL_CLK_PACLK256 (0x08)
  493. #define MCFGPT_GPTPACTL_CLK_PACLK65536 (0x0C)
  494. #define MCFGPT_GPTPACTL_CLK(x) (((x)&0x03)<<2)
  495. #define MCFGPT_GPTPACTL_PAOVI (0x02)
  496. #define MCFGPT_GPTPACTL_PAI (0x01)
  497. #define MCFGPT_GPTPAFLG_PAOVF (0x02)
  498. #define MCFGPT_GPTPAFLG_PAIF (0x01)
  499. #define MCFGPT_GPTPORT_PORTT3 (0x08)
  500. #define MCFGPT_GPTPORT_PORTT2 (0x04)
  501. #define MCFGPT_GPTPORT_PORTT1 (0x02)
  502. #define MCFGPT_GPTPORT_PORTT0 (0x01)
  503. #define MCFGPT_GPTDDR_DDRT3 (0x08)
  504. #define MCFGPT_GPTDDR_DDRT2 (0x04)
  505. #define MCFGPT_GPTDDR_DDRT1 (0x02)
  506. #define MCFGPT_GPTDDR_DDRT0 (0x01)
  507. /* Coldfire Flash Module CFM */
  508. #define MCFCFM_MCR (*(vu_short *)(CONFIG_SYS_MBAR+0x1D0000))
  509. #define MCFCFM_MCR_LOCK (0x0400)
  510. #define MCFCFM_MCR_PVIE (0x0200)
  511. #define MCFCFM_MCR_AEIE (0x0100)
  512. #define MCFCFM_MCR_CBEIE (0x0080)
  513. #define MCFCFM_MCR_CCIE (0x0040)
  514. #define MCFCFM_MCR_KEYACC (0x0020)
  515. #define MCFCFM_CLKD (*(vu_char *)(CONFIG_SYS_MBAR+0x1D0002))
  516. #define MCFCFM_SEC (*(vu_long*) (CONFIG_SYS_MBAR+0x1D0008))
  517. #define MCFCFM_SEC_KEYEN (0x80000000)
  518. #define MCFCFM_SEC_SECSTAT (0x40000000)
  519. #define MCFCFM_PROT (*(vu_long*) (CONFIG_SYS_MBAR+0x1D0010))
  520. #define MCFCFM_SACC (*(vu_long*) (CONFIG_SYS_MBAR+0x1D0014))
  521. #define MCFCFM_DACC (*(vu_long*) (CONFIG_SYS_MBAR+0x1D0018))
  522. #define MCFCFM_USTAT (*(vu_char*) (CONFIG_SYS_MBAR+0x1D0020))
  523. #define MCFCFM_USTAT_CBEIF 0x80
  524. #define MCFCFM_USTAT_CCIF 0x40
  525. #define MCFCFM_USTAT_PVIOL 0x20
  526. #define MCFCFM_USTAT_ACCERR 0x10
  527. #define MCFCFM_USTAT_BLANK 0x04
  528. #define MCFCFM_CMD (*(vu_char*) (CONFIG_SYS_MBAR+0x1D0024))
  529. #define MCFCFM_CMD_ERSVER 0x05
  530. #define MCFCFM_CMD_PGERSVER 0x06
  531. #define MCFCFM_CMD_PGM 0x20
  532. #define MCFCFM_CMD_PGERS 0x40
  533. #define MCFCFM_CMD_MASERS 0x41
  534. /****************************************************************************/
  535. #endif /* m5282_h */