m5282.h 24 KB

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