m5235.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /*
  2. * mcf5329.h -- Definitions for Freescale Coldfire 5329
  3. *
  4. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef mcf5235_h
  10. #define mcf5235_h
  11. /****************************************************************************/
  12. /*********************************************************************
  13. * System Control Module (SCM)
  14. *********************************************************************/
  15. /* Bit definition and macros for SCM_IPSBAR */
  16. #define SCM_IPSBAR_BA(x) (((x)&0x03)<<30)
  17. #define SCM_IPSBAR_V (0x00000001)
  18. /* Bit definition and macros for SCM_RAMBAR */
  19. #define SCM_RAMBAR_BA(x) (((x)&0xFFFF)<<16)
  20. #define SCM_RAMBAR_BDE (0x00000200)
  21. /* Bit definition and macros for SCM_CRSR */
  22. #define SCM_CRSR_EXT (0x80)
  23. /* Bit definitions and macros for SCM_CWCR */
  24. #define SCM_CWCR_CWE (0x80)
  25. #define SCM_CWCR_CWRI (0x40)
  26. #define SCM_CWCR_CWT(x) (((x)&0x07)<<3)
  27. #define SCM_CWCR_CWTA (0x04)
  28. #define SCM_CWCR_CWTAVAL (0x02)
  29. #define SCM_CWCR_CWTIC (0x01)
  30. /* Bit definitions and macros for SCM_LPICR */
  31. #define SCM_LPICR_ENBSTOP (0x80)
  32. #define SCM_LPICR_XLPM_IPL(x) (((x)&0x07)<<4)
  33. #define SCM_LPICR_XLPM_IPL_ANY (0x00)
  34. #define SCM_LPICR_XLPM_IPL_L2_7 (0x10)
  35. #define SCM_LPICR_XLPM_IPL_L3_7 (0x20)
  36. #define SCM_LPICR_XLPM_IPL_L4_7 (0x30)
  37. #define SCM_LPICR_XLPM_IPL_L5_7 (0x40)
  38. #define SCM_LPICR_XLPM_IPL_L6_7 (0x50)
  39. #define SCM_LPICR_XLPM_IPL_L7 (0x70)
  40. /* Bit definitions and macros for SCM_DMAREQC */
  41. #define SCM_DMAREQC_EXT(x) (((x)&0x0F)<<16)
  42. #define SCM_DMAREQC_EXT_ETPU (0x00080000)
  43. #define SCM_DMAREQC_EXT_EXTDREQ2 (0x00040000)
  44. #define SCM_DMAREQC_EXT_EXTDREQ1 (0x00020000)
  45. #define SCM_DMAREQC_EXT_EXTDREQ0 (0x00010000)
  46. #define SCM_DMAREQC_DMAC3(x) (((x)&0x0F)<<12)
  47. #define SCM_DMAREQC_DMAC2(x) (((x)&0x0F)<<8)
  48. #define SCM_DMAREQC_DMAC1(x) (((x)&0x0F)<<4)
  49. #define SCM_DMAREQC_DMAC0(x) (((x)&0x0F))
  50. #define SCM_DMAREQC_DMACn_DTMR0 (0x04)
  51. #define SCM_DMAREQC_DMACn_DTMR1 (0x05)
  52. #define SCM_DMAREQC_DMACn_DTMR2 (0x06)
  53. #define SCM_DMAREQC_DMACn_DTMR3 (0x07)
  54. #define SCM_DMAREQC_DMACn_UART0RX (0x08)
  55. #define SCM_DMAREQC_DMACn_UART1RX (0x09)
  56. #define SCM_DMAREQC_DMACn_UART2RX (0x0A)
  57. #define SCM_DMAREQC_DMACn_UART0TX (0x0C)
  58. #define SCM_DMAREQC_DMACn_UART1TX (0x0D)
  59. #define SCM_DMAREQC_DMACn_UART3TX (0x0E)
  60. /* Bit definitions and macros for SCM_MPARK */
  61. #define SCM_MPARK_M2_P_EN (0x02000000)
  62. #define SCM_MPARK_M3_PRTY_MSK (0x00C00000)
  63. #define SCM_MPARK_M3_PRTY_4TH (0x00000000)
  64. #define SCM_MPARK_M3_PRTY_3RD (0x00400000)
  65. #define SCM_MPARK_M3_PRTY_2ND (0x00800000)
  66. #define SCM_MPARK_M3_PRTY_1ST (0x00C00000)
  67. #define SCM_MPARK_M2_PRTY_MSK (0x00300000)
  68. #define SCM_MPARK_M2_PRTY_4TH (0x00000000)
  69. #define SCM_MPARK_M2_PRTY_3RD (0x00100000)
  70. #define SCM_MPARK_M2_PRTY_2ND (0x00200000)
  71. #define SCM_MPARK_M2_PRTY_1ST (0x00300000)
  72. #define SCM_MPARK_M0_PRTY_MSK (0x000C0000)
  73. #define SCM_MPARK_M0_PRTY_4TH (0x00000000)
  74. #define SCM_MPARK_M0_PRTY_3RD (0x00040000)
  75. #define SCM_MPARK_M0_PRTY_2ND (0x00080000)
  76. #define SCM_MPARK_M0_PRTY_1ST (0x000C0000)
  77. #define SCM_MPARK_FIXED (0x00004000)
  78. #define SCM_MPARK_TIMEOUT (0x00002000)
  79. #define SCM_MPARK_PRKLAST (0x00001000)
  80. #define SCM_MPARK_LCKOUT_TIME(x) (((x)&0x0F)<<8)
  81. /* Bit definitions and macros for SCM_MPR */
  82. #define SCM_MPR_MPR3 (0x08)
  83. #define SCM_MPR_MPR2 (0x04)
  84. #define SCM_MPR_MPR1 (0x02)
  85. #define SCM_MPR_MPR0 (0x01)
  86. /* Bit definitions and macros for SCM_PACRn */
  87. #define SCM_PACRn_LOCK1 (0x80)
  88. #define SCM_PACRn_ACCESSCTRL1(x) (((x)&0x07)<<4)
  89. #define SCM_PACRn_LOCK0 (0x08)
  90. #define SCM_PACRn_ACCESSCTRL0(x) (((x)&0x07))
  91. /* Bit definitions and macros for SCM_GPACR */
  92. #define SCM_PACRn_LOCK (0x80)
  93. #define SCM_PACRn_ACCESSCTRL0(x) (((x)&0x07))
  94. /*********************************************************************
  95. * SDRAM Controller (SDRAMC)
  96. *********************************************************************/
  97. /* Bit definitions and macros for SDRAMC_DCR */
  98. #define SDRAMC_DCR_NAM (0x2000)
  99. #define SDRAMC_DCR_COC (0x1000)
  100. #define SDRAMC_DCR_IS (0x0800)
  101. #define SDRAMC_DCR_RTIM_MASK (0x0C00)
  102. #define SDRAMC_DCR_RTIM_3CLKS (0x0000)
  103. #define SDRAMC_DCR_RTIM_6CLKS (0x0200)
  104. #define SDRAMC_DCR_RTIM_9CLKS (0x0400)
  105. #define SDRAMC_DCR_RC(x) (((x)&0xFF)<<8)
  106. /* Bit definitions and macros for SDRAMC_DARCn */
  107. #define SDRAMC_DARCn_BA(x) ((x)&0xFFFC0000)
  108. #define SDRAMC_DARCn_RE (0x00008000)
  109. #define SDRAMC_DARCn_CASL_MASK (0x00003000)
  110. #define SDRAMC_DARCn_CASL_C0 (0x00000000)
  111. #define SDRAMC_DARCn_CASL_C1 (0x00001000)
  112. #define SDRAMC_DARCn_CASL_C2 (0x00002000)
  113. #define SDRAMC_DARCn_CASL_C3 (0x00003000)
  114. #define SDRAMC_DARCn_CBM_MASK (0x00000700)
  115. #define SDRAMC_DARCn_CBM_CMD17 (0x00000000)
  116. #define SDRAMC_DARCn_CBM_CMD18 (0x00000100)
  117. #define SDRAMC_DARCn_CBM_CMD19 (0x00000200)
  118. #define SDRAMC_DARCn_CBM_CMD20 (0x00000300)
  119. #define SDRAMC_DARCn_CBM_CMD21 (0x00000400)
  120. #define SDRAMC_DARCn_CBM_CMD22 (0x00000500)
  121. #define SDRAMC_DARCn_CBM_CMD23 (0x00000600)
  122. #define SDRAMC_DARCn_CBM_CMD24 (0x00000700)
  123. #define SDRAMC_DARCn_IMRS (0x00000040)
  124. #define SDRAMC_DARCn_PS_MASK (0x00000030)
  125. #define SDRAMC_DARCn_PS_32 (0x00000000)
  126. #define SDRAMC_DARCn_PS_16 (0x00000010)
  127. #define SDRAMC_DARCn_PS_8 (0x00000020)
  128. #define SDRAMC_DARCn_IP (0x00000008)
  129. /* Bit definitions and macros for SDRAMC_DMRn */
  130. #define SDRAMC_DMRn_BAM(x) (((x)&0x3FFF)<<18)
  131. #define SDRAMC_DMRn_WP (0x00000100)
  132. #define SDRAMC_DMRn_V (0x00000001)
  133. /*********************************************************************
  134. * Interrupt Controller (INTC)
  135. *********************************************************************/
  136. #define INT0_LO_RSVD0 (0)
  137. #define INT0_LO_EPORT1 (1)
  138. #define INT0_LO_EPORT2 (2)
  139. #define INT0_LO_EPORT3 (3)
  140. #define INT0_LO_EPORT4 (4)
  141. #define INT0_LO_EPORT5 (5)
  142. #define INT0_LO_EPORT6 (6)
  143. #define INT0_LO_EPORT7 (7)
  144. #define INT0_LO_SCM (8)
  145. #define INT0_LO_DMA0 (9)
  146. #define INT0_LO_DMA1 (10)
  147. #define INT0_LO_DMA2 (11)
  148. #define INT0_LO_DMA3 (12)
  149. #define INT0_LO_UART0 (13)
  150. #define INT0_LO_UART1 (14)
  151. #define INT0_LO_UART2 (15)
  152. #define INT0_LO_RSVD1 (16)
  153. #define INT0_LO_I2C (17)
  154. #define INT0_LO_QSPI (18)
  155. #define INT0_LO_DTMR0 (19)
  156. #define INT0_LO_DTMR1 (20)
  157. #define INT0_LO_DTMR2 (21)
  158. #define INT0_LO_DTMR3 (22)
  159. #define INT0_LO_FEC_TXF (23)
  160. #define INT0_LO_FEC_TXB (24)
  161. #define INT0_LO_FEC_UN (25)
  162. #define INT0_LO_FEC_RL (26)
  163. #define INT0_LO_FEC_RXF (27)
  164. #define INT0_LO_FEC_RXB (28)
  165. #define INT0_LO_FEC_MII (29)
  166. #define INT0_LO_FEC_LC (30)
  167. #define INT0_LO_FEC_HBERR (31)
  168. #define INT0_HI_FEC_GRA (32)
  169. #define INT0_HI_FEC_EBERR (33)
  170. #define INT0_HI_FEC_BABT (34)
  171. #define INT0_HI_FEC_BABR (35)
  172. #define INT0_HI_PIT0 (36)
  173. #define INT0_HI_PIT1 (37)
  174. #define INT0_HI_PIT2 (38)
  175. #define INT0_HI_PIT3 (39)
  176. #define INT0_HI_RNG (40)
  177. #define INT0_HI_SKHA (41)
  178. #define INT0_HI_MDHA (42)
  179. #define INT0_HI_CAN1_BUF0I (43)
  180. #define INT0_HI_CAN1_BUF1I (44)
  181. #define INT0_HI_CAN1_BUF2I (45)
  182. #define INT0_HI_CAN1_BUF3I (46)
  183. #define INT0_HI_CAN1_BUF4I (47)
  184. #define INT0_HI_CAN1_BUF5I (48)
  185. #define INT0_HI_CAN1_BUF6I (49)
  186. #define INT0_HI_CAN1_BUF7I (50)
  187. #define INT0_HI_CAN1_BUF8I (51)
  188. #define INT0_HI_CAN1_BUF9I (52)
  189. #define INT0_HI_CAN1_BUF10I (53)
  190. #define INT0_HI_CAN1_BUF11I (54)
  191. #define INT0_HI_CAN1_BUF12I (55)
  192. #define INT0_HI_CAN1_BUF13I (56)
  193. #define INT0_HI_CAN1_BUF14I (57)
  194. #define INT0_HI_CAN1_BUF15I (58)
  195. #define INT0_HI_CAN1_ERRINT (59)
  196. #define INT0_HI_CAN1_BOFFINT (60)
  197. /* 60-63 Reserved */
  198. /* 0 - 7 Reserved */
  199. #define INT1_LO_CAN1_BUF0I (8)
  200. #define INT1_LO_CAN1_BUF1I (9)
  201. #define INT1_LO_CAN1_BUF2I (10)
  202. #define INT1_LO_CAN1_BUF3I (11)
  203. #define INT1_LO_CAN1_BUF4I (12)
  204. #define INT1_LO_CAN1_BUF5I (13)
  205. #define INT1_LO_CAN1_BUF6I (14)
  206. #define INT1_LO_CAN1_BUF7I (15)
  207. #define INT1_LO_CAN1_BUF8I (16)
  208. #define INT1_LO_CAN1_BUF9I (17)
  209. #define INT1_LO_CAN1_BUF10I (18)
  210. #define INT1_LO_CAN1_BUF11I (19)
  211. #define INT1_LO_CAN1_BUF12I (20)
  212. #define INT1_LO_CAN1_BUF13I (21)
  213. #define INT1_LO_CAN1_BUF14I (22)
  214. #define INT1_LO_CAN1_BUF15I (23)
  215. #define INT1_LO_CAN1_ERRINT (24)
  216. #define INT1_LO_CAN1_BOFFINT (25)
  217. /* 26 Reserved */
  218. #define INT1_LO_ETPU_TC0F (27)
  219. #define INT1_LO_ETPU_TC1F (28)
  220. #define INT1_LO_ETPU_TC2F (29)
  221. #define INT1_LO_ETPU_TC3F (30)
  222. #define INT1_LO_ETPU_TC4F (31)
  223. #define INT1_HI_ETPU_TC5F (32)
  224. #define INT1_HI_ETPU_TC6F (33)
  225. #define INT1_HI_ETPU_TC7F (34)
  226. #define INT1_HI_ETPU_TC8F (35)
  227. #define INT1_HI_ETPU_TC9F (36)
  228. #define INT1_HI_ETPU_TC10F (37)
  229. #define INT1_HI_ETPU_TC11F (38)
  230. #define INT1_HI_ETPU_TC12F (39)
  231. #define INT1_HI_ETPU_TC13F (40)
  232. #define INT1_HI_ETPU_TC14F (41)
  233. #define INT1_HI_ETPU_TC15F (42)
  234. #define INT1_HI_ETPU_TC16F (43)
  235. #define INT1_HI_ETPU_TC17F (44)
  236. #define INT1_HI_ETPU_TC18F (45)
  237. #define INT1_HI_ETPU_TC19F (46)
  238. #define INT1_HI_ETPU_TC20F (47)
  239. #define INT1_HI_ETPU_TC21F (48)
  240. #define INT1_HI_ETPU_TC22F (49)
  241. #define INT1_HI_ETPU_TC23F (50)
  242. #define INT1_HI_ETPU_TC24F (51)
  243. #define INT1_HI_ETPU_TC25F (52)
  244. #define INT1_HI_ETPU_TC26F (53)
  245. #define INT1_HI_ETPU_TC27F (54)
  246. #define INT1_HI_ETPU_TC28F (55)
  247. #define INT1_HI_ETPU_TC29F (56)
  248. #define INT1_HI_ETPU_TC30F (57)
  249. #define INT1_HI_ETPU_TC31F (58)
  250. #define INT1_HI_ETPU_TGIF (59)
  251. /*********************************************************************
  252. * General Purpose I/O (GPIO)
  253. *********************************************************************/
  254. /* Bit definitions and macros for GPIO_PODR */
  255. #define GPIO_PODR_ADDR(x) (((x)&0x07)<<5)
  256. #define GPIO_PODR_ADDR_MASK (0xE0)
  257. #define GPIO_PODR_BS(x) ((x)&0x0F)
  258. #define GPIO_PODR_BS_MASK (0x0F)
  259. #define GPIO_PODR_CS(x) (((x)&0x7F)<<1)
  260. #define GPIO_PODR_CS_MASK (0xFE)
  261. #define GPIO_PODR_SDRAM(X) ((x)&0x3F)
  262. #define GPIO_PODR_SDRAM_MASK (0x3F)
  263. #define GPIO_PODR_FECI2C(x) GPIO_PODR_BS(x)
  264. #define GPIO_PODR_FECI2C_MASK GPIO_PODR_BS_MASK
  265. #define GPIO_PODR_UARTH(x) ((x)&0x03)
  266. #define GPIO_PODR_UARTH_MASK (0x03)
  267. #define GPIO_PODR_QSPI(x) ((x)&0x1F)
  268. #define GPIO_PODR_QSPI_MASK (0x1F)
  269. #define GPIO_PODR_ETPU(x) ((x)&0x07)
  270. #define GPIO_PODR_ETPU_MASK (0x07)
  271. /* Bit definitions and macros for GPIO_PDDR */
  272. #define GPIO_PDDR_ADDR(x) GPIO_PODR_ADDR(x)
  273. #define GPIO_PDDR_ADDR_MASK GPIO_PODR_ADDR_MASK
  274. #define GPIO_PDDR_BS(x) GPIO_PODR_BS(x)
  275. #define GPIO_PDDR_BS_MASK GPIO_PODR_BS_MASK
  276. #define GPIO_PDDR_CS(x) GPIO_PODR_CS(x)
  277. #define GPIO_PDDR_CS_MASK GPIO_PODR_CS_MASK
  278. #define GPIO_PDDR_SDRAM(X) GPIO_PODR_SDRAM(X)
  279. #define GPIO_PDDR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  280. #define GPIO_PDDR_FECI2C(x) GPIO_PDDR_BS(x)
  281. #define GPIO_PDDR_FECI2C_MASK GPIO_PDDR_BS_MASK
  282. #define GPIO_PDDR_UARTH(x) GPIO_PODR_UARTH(x)
  283. #define GPIO_PDDR_UARTH_MASK GPIO_PODR_UARTH_MASK
  284. #define GPIO_PDDR_QSPI(x) GPIO_PODR_QSPI(x)
  285. #define GPIO_PDDR_QSPI_MASK GPIO_PODR_QSPI_MASK
  286. #define GPIO_PDDR_ETPU(x) GPIO_PODR_ETPU(x)
  287. #define GPIO_PDDR_ETPU_MASK GPIO_PODR_ETPU_MASK
  288. /* Bit definitions and macros for GPIO_PPDSDR */
  289. #define GPIO_PPDSDR_ADDR(x) GPIO_PODR_ADDR(x)
  290. #define GPIO_PPDSDR_ADDR_MASK GPIO_PODR_ADDR_MASK
  291. #define GPIO_PPDSDR_BS(x) GPIO_PODR_BS(x)
  292. #define GPIO_PPDSDR_BS_MASK GPIO_PODR_BS_MASK
  293. #define GPIO_PPDSDR_CS(x) GPIO_PODR_CS(x)
  294. #define GPIO_PPDSDR_CS_MASK GPIO_PODR_CS_MASK
  295. #define GPIO_PPDSDR_SDRAM(X) GPIO_PODR_SDRAM(X)
  296. #define GPIO_PPDSDR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  297. #define GPIO_PPDSDR_FECI2C(x) GPIO_PPDSDR_BS(x)
  298. #define GPIO_PPDSDR_FECI2C_MASK GPIO_PPDSDR_BS_MASK
  299. #define GPIO_PPDSDR_UARTH(x) GPIO_PODR_UARTH(x)
  300. #define GPIO_PPDSDR_UARTH_MASK GPIO_PODR_UARTH_MASK
  301. #define GPIO_PPDSDR_QSPI(x) GPIO_PODR_QSPI(x)
  302. #define GPIO_PPDSDR_QSPI_MASK GPIO_PODR_QSPI_MASK
  303. #define GPIO_PPDSDR_ETPU(x) GPIO_PODR_ETPU(x)
  304. #define GPIO_PPDSDR_ETPU_MASK GPIO_PODR_ETPU_MASK
  305. /* Bit definitions and macros for GPIO_PCLRR */
  306. #define GPIO_PCLRR_ADDR(x) GPIO_PODR_ADDR(x)
  307. #define GPIO_PCLRR_ADDR_MASK GPIO_PODR_ADDR_MASK
  308. #define GPIO_PCLRR_BS(x) GPIO_PODR_BS(x)
  309. #define GPIO_PCLRR_BS_MASK GPIO_PODR_BS_MASK
  310. #define GPIO_PCLRR_CS(x) GPIO_PODR_CS(x)
  311. #define GPIO_PCLRR_CS_MASK GPIO_PODR_CS_MASK
  312. #define GPIO_PCLRR_SDRAM(X) GPIO_PODR_SDRAM(X)
  313. #define GPIO_PCLRR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  314. #define GPIO_PCLRR_FECI2C(x) GPIO_PCLRR_BS(x)
  315. #define GPIO_PCLRR_FECI2C_MASK GPIO_PCLRR_BS_MASK
  316. #define GPIO_PCLRR_UARTH(x) GPIO_PODR_UARTH(x)
  317. #define GPIO_PCLRR_UARTH_MASK GPIO_PODR_UARTH_MASK
  318. #define GPIO_PCLRR_QSPI(x) GPIO_PODR_QSPI(x)
  319. #define GPIO_PCLRR_QSPI_MASK GPIO_PODR_QSPI_MASK
  320. #define GPIO_PCLRR_ETPU(x) GPIO_PODR_ETPU(x)
  321. #define GPIO_PCLRR_ETPU_MASK GPIO_PODR_ETPU_MASK
  322. /* Bit definitions and macros for GPIO_PAR */
  323. #define GPIO_PAR_AD_ADDR23 (0x80)
  324. #define GPIO_PAR_AD_ADDR22 (0x40)
  325. #define GPIO_PAR_AD_ADDR21 (0x20)
  326. #define GPIO_PAR_AD_DATAL (0x01)
  327. #define GPIO_PAR_BUSCTL_OE (0x4000)
  328. #define GPIO_PAR_BUSCTL_TA (0x1000)
  329. #define GPIO_PAR_BUSCTL_TEA(x) (((x)&0x03)<<10)
  330. #define GPIO_PAR_BUSCTL_TEA_MASK (0x0C00)
  331. #define GPIO_PAR_BUSCTL_TEA_GPIO (0x0400)
  332. #define GPIO_PAR_BUSCTL_TEA_DREQ1 (0x0800)
  333. #define GPIO_PAR_BUSCTL_TEA_EXTBUS (0x0C00)
  334. #define GPIO_PAR_BUSCTL_RWB (0x0100)
  335. #define GPIO_PAR_BUSCTL_TSIZ1 (0x0040)
  336. #define GPIO_PAR_BUSCTL_TSIZ0 (0x0010)
  337. #define GPIO_PAR_BUSCTL_TS(x) (((x)&0x03)<<2)
  338. #define GPIO_PAR_BUSCTL_TS_MASK (0x0C)
  339. #define GPIO_PAR_BUSCTL_TS_GPIO (0x04)
  340. #define GPIO_PAR_BUSCTL_TS_DACK2 (0x08)
  341. #define GPIO_PAR_BUSCTL_TS_EXTBUS (0x0C)
  342. #define GPIO_PAR_BUSCTL_TIP(x) ((x)&0x03)
  343. #define GPIO_PAR_BUSCTL_TIP_MASK (0x03)
  344. #define GPIO_PAR_BUSCTL_TIP_GPIO (0x01)
  345. #define GPIO_PAR_BUSCTL_TIP_DREQ0 (0x02)
  346. #define GPIO_PAR_BUSCTL_TIP_EXTBUS (0x03)
  347. #define GPIO_PAR_BS(x) ((x)&0x0F)
  348. #define GPIO_PAR_BS_MASK (0x0F)
  349. #define GPIO_PAR_CS(x) (((x)&0x7F)<<1)
  350. #define GPIO_PAR_CS_MASK (0xFE)
  351. #define GPIO_PAR_CS_CS7 (0x80)
  352. #define GPIO_PAR_CS_CS6 (0x40)
  353. #define GPIO_PAR_CS_CS5 (0x20)
  354. #define GPIO_PAR_CS_CS4 (0x10)
  355. #define GPIO_PAR_CS_CS3 (0x08)
  356. #define GPIO_PAR_CS_CS2 (0x04)
  357. #define GPIO_PAR_CS_CS1 (0x02)
  358. #define GPIO_PAR_CS_SD3 GPIO_PAR_CS_CS3
  359. #define GPIO_PAR_CS_SD2 GPIO_PAR_CS_CS2
  360. #define GPIO_PAR_SDRAM_CSSDCS(x) (((x)&0x03)<<6)
  361. #define GPIO_PAR_SDRAM_CSSDCS_MASK (0xC0)
  362. #define GPIO_PAR_SDRAM_SDWE (0x20)
  363. #define GPIO_PAR_SDRAM_SCAS (0x10)
  364. #define GPIO_PAR_SDRAM_SRAS (0x08)
  365. #define GPIO_PAR_SDRAM_SCKE (0x04)
  366. #define GPIO_PAR_SDRAM_SDCS(x) ((x)&0x03)
  367. #define GPIO_PAR_SDRAM_SDCS_MASK (0x03)
  368. #define GPIO_PAR_FECI2C_EMDC(x) (((x)&0x03)<<6)
  369. #define GPIO_PAR_FECI2C_EMDC_MASK (0xC0)
  370. #define GPIO_PAR_FECI2C_EMDC_U2TXD (0x40)
  371. #define GPIO_PAR_FECI2C_EMDC_I2CSCL (0x80)
  372. #define GPIO_PAR_FECI2C_EMDC_FECEMDC (0xC0)
  373. #define GPIO_PAR_FECI2C_EMDIO(x) (((x)&0x03)<<4)
  374. #define GPIO_PAR_FECI2C_EMDIO_MASK (0x30)
  375. #define GPIO_PAR_FECI2C_EMDIO_U2RXD (0x10)
  376. #define GPIO_PAR_FECI2C_EMDIO_I2CSDA (0x20)
  377. #define GPIO_PAR_FECI2C_EMDIO_FECEMDIO (0x30)
  378. #define GPIO_PAR_FECI2C_SCL(x) (((x)&0x03)<<2)
  379. #define GPIO_PAR_FECI2C_SCL_MASK (0x0C)
  380. #define GPIO_PAR_FECI2C_SCL_CAN0RX (0x08)
  381. #define GPIO_PAR_FECI2C_SCL_I2CSCL (0x0C)
  382. #define GPIO_PAR_FECI2C_SDA(x) ((x)&0x03)
  383. #define GPIO_PAR_FECI2C_SDA_MASK (0x03)
  384. #define GPIO_PAR_FECI2C_SDA_CAN0TX (0x02)
  385. #define GPIO_PAR_FECI2C_SDA_I2CSDA (0x03)
  386. #define GPIO_PAR_UART_DREQ2 (0x8000)
  387. #define GPIO_PAR_UART_CAN1EN (0x4000)
  388. #define GPIO_PAR_UART_U2RXD (0x2000)
  389. #define GPIO_PAR_UART_U2TXD (0x1000)
  390. #define GPIO_PAR_UART_U1RXD(x) (((x)&0x03)<<10)
  391. #define GPIO_PAR_UART_U1RXD_MASK (0x0C00)
  392. #define GPIO_PAR_UART_U1RXD_CAN0RX (0x0800)
  393. #define GPIO_PAR_UART_U1RXD_U1RXD (0x0C00)
  394. #define GPIO_PAR_UART_U1TXD(x) (((x)&0x03)<<8)
  395. #define GPIO_PAR_UART_U1TXD_MASK (0x0300)
  396. #define GPIO_PAR_UART_U1TXD_CAN0TX (0x0200)
  397. #define GPIO_PAR_UART_U1TXD_U1TXD (0x0300)
  398. #define GPIO_PAR_UART_U1CTS(x) (((x)&0x03)<<6)
  399. #define GPIO_PAR_UART_U1CTS_MASK (0x00C0)
  400. #define GPIO_PAR_UART_U1CTS_U2CTS (0x0080)
  401. #define GPIO_PAR_UART_U1CTS_U1CTS (0x00C0)
  402. #define GPIO_PAR_UART_U1RTS(x) (((x)&0x03)<<4)
  403. #define GPIO_PAR_UART_U1RTS_MASK (0x0030)
  404. #define GPIO_PAR_UART_U1RTS_U2RTS (0x0020)
  405. #define GPIO_PAR_UART_U1RTS_U1RTS (0x0030)
  406. #define GPIO_PAR_UART_U0RXD (0x0008)
  407. #define GPIO_PAR_UART_U0TXD (0x0004)
  408. #define GPIO_PAR_UART_U0CTS (0x0002)
  409. #define GPIO_PAR_UART_U0RTS (0x0001)
  410. #define GPIO_PAR_QSPI_CS1(x) (((x)&0x03)<<6)
  411. #define GPIO_PAR_QSPI_CS1_MASK (0xC0)
  412. #define GPIO_PAR_QSPI_CS1_SDRAMSCKE (0x80)
  413. #define GPIO_PAR_QSPI_CS1_QSPICS1 (0xC0)
  414. #define GPIO_PAR_QSPI_CS0 (0x20)
  415. #define GPIO_PAR_QSPI_DIN(x) (((x)&0x03)<<3)
  416. #define GPIO_PAR_QSPI_DIN_MASK (0x18)
  417. #define GPIO_PAR_QSPI_DIN_I2CSDA (0x10)
  418. #define GPIO_PAR_QSPI_DIN_QSPIDIN (0x18)
  419. #define GPIO_PAR_QSPI_DOUT (0x04)
  420. #define GPIO_PAR_QSPI_SCK(x) ((x)&0x03)
  421. #define GPIO_PAR_QSPI_SCK_MASK (0x03)
  422. #define GPIO_PAR_QSPI_SCK_I2CSCL (0x02)
  423. #define GPIO_PAR_QSPI_SCK_QSPISCK (0x03)
  424. #define GPIO_PAR_DT3IN(x) (((x)&0x03)<<14)
  425. #define GPIO_PAR_DT3IN_MASK (0xC000)
  426. #define GPIO_PAR_DT3IN_QSPICS2 (0x4000)
  427. #define GPIO_PAR_DT3IN_U2CTS (0x8000)
  428. #define GPIO_PAR_DT3IN_DT3IN (0xC000)
  429. #define GPIO_PAR_DT2IN(x) (((x)&0x03)<<12)
  430. #define GPIO_PAR_DT2IN_MASK (0x3000)
  431. #define GPIO_PAR_DT2IN_DT2OUT (0x1000)
  432. #define GPIO_PAR_DT2IN_DREQ2 (0x2000)
  433. #define GPIO_PAR_DT2IN_DT2IN (0x3000)
  434. #define GPIO_PAR_DT1IN(x) (((x)&0x03)<<10)
  435. #define GPIO_PAR_DT1IN_MASK (0x0C00)
  436. #define GPIO_PAR_DT1IN_DT1OUT (0x0400)
  437. #define GPIO_PAR_DT1IN_DREQ1 (0x0800)
  438. #define GPIO_PAR_DT1IN_DT1IN (0x0C00)
  439. #define GPIO_PAR_DT0IN(x) (((x)&0x03)<<8)
  440. #define GPIO_PAR_DT0IN_MASK (0x0300)
  441. #define GPIO_PAR_DT0IN_DREQ0 (0x0200)
  442. #define GPIO_PAR_DT0IN_DT0IN (0x0300)
  443. #define GPIO_PAR_DT3OUT(x) (((x)&0x03)<<6)
  444. #define GPIO_PAR_DT3OUT_MASK (0x00C0)
  445. #define GPIO_PAR_DT3OUT_QSPICS3 (0x0040)
  446. #define GPIO_PAR_DT3OUT_U2RTS (0x0080)
  447. #define GPIO_PAR_DT3OUT_DT3OUT (0x00C0)
  448. #define GPIO_PAR_DT2OUT(x) (((x)&0x03)<<4)
  449. #define GPIO_PAR_DT2OUT_MASK (0x0030)
  450. #define GPIO_PAR_DT2OUT_DACK2 (0x0020)
  451. #define GPIO_PAR_DT2OUT_DT2OUT (0x0030)
  452. #define GPIO_PAR_DT1OUT(x) (((x)&0x03)<<2)
  453. #define GPIO_PAR_DT1OUT_MASK (0x000C)
  454. #define GPIO_PAR_DT1OUT_DACK1 (0x0008)
  455. #define GPIO_PAR_DT1OUT_DT1OUT (0x000C)
  456. #define GPIO_PAR_DT0OUT(x) ((x)&0x03)
  457. #define GPIO_PAR_DT0OUT_MASK (0x0003)
  458. #define GPIO_PAR_DT0OUT_DACK0 (0x0002)
  459. #define GPIO_PAR_DT0OUT_DT0OUT (0x0003)
  460. #define GPIO_PAR_ETPU_TCRCLK (0x04)
  461. #define GPIO_PAR_ETPU_UTPU_ODIS (0x02)
  462. #define GPIO_PAR_ETPU_LTPU_ODIS (0x01)
  463. /* Bit definitions and macros for GPIO_DSCR */
  464. #define GPIO_DSCR_EIM_EIM1 (0x10)
  465. #define GPIO_DSCR_EIM_EIM0 (0x01)
  466. #define GPIO_DSCR_ETPU_ETPU31_24 (0x40)
  467. #define GPIO_DSCR_ETPU_ETPU23_16 (0x10)
  468. #define GPIO_DSCR_ETPU_ETPU15_8 (0x04)
  469. #define GPIO_DSCR_ETPU_ETPU7_0 (0x01)
  470. #define GPIO_DSCR_FECI2C_FEC (0x10)
  471. #define GPIO_DSCR_FECI2C_I2C (0x01)
  472. #define GPIO_DSCR_UART_IRQ (0x40)
  473. #define GPIO_DSCR_UART_UART2 (0x10)
  474. #define GPIO_DSCR_UART_UART1 (0x04)
  475. #define GPIO_DSCR_UART_UART0 (0x01)
  476. #define GPIO_DSCR_QSPI_QSPI (0x01)
  477. #define GPIO_DSCR_TIMER (0x01)
  478. /*********************************************************************
  479. * Chip Configuration Module (CCM)
  480. *********************************************************************/
  481. /* Bit definitions and macros for CCM_RCR */
  482. #define CCM_RCR_SOFTRST (0x80)
  483. #define CCM_RCR_FRCRSTOUT (0x40)
  484. /* Bit definitions and macros for CCM_RSR */
  485. #define CCM_RSR_SOFT (0x20)
  486. #define CCM_RSR_WDR (0x10)
  487. #define CCM_RSR_POR (0x08)
  488. #define CCM_RSR_EXT (0x04)
  489. #define CCM_RSR_LOC (0x02)
  490. #define CCM_RSR_LOL (0x01)
  491. /* Bit definitions and macros for CCM_CCR */
  492. #define CCM_CCR_LOAD (0x8000)
  493. #define CCM_CCR_SZEN (0x0040)
  494. #define CCM_CCR_PSTEN (0x0020)
  495. #define CCM_CCR_BME (0x0008)
  496. #define CCM_CCR_BMT(x) ((x)&0x07)
  497. #define CCM_CCR_BMT_MASK (0x0007)
  498. #define CCM_CCR_BMT_64K (0x0000)
  499. #define CCM_CCR_BMT_32K (0x0001)
  500. #define CCM_CCR_BMT_16K (0x0002)
  501. #define CCM_CCR_BMT_8K (0x0003)
  502. #define CCM_CCR_BMT_4K (0x0004)
  503. #define CCM_CCR_BMT_2K (0x0005)
  504. #define CCM_CCR_BMT_1K (0x0006)
  505. #define CCM_CCR_BMT_512 (0x0007)
  506. /* Bit definitions and macros for CCM_RCON */
  507. #define CCM_RCON_RCSC(x) (((x)&0x0003)<<8)
  508. #define CCM_RCON_RLOAD (0x0020)
  509. #define CCM_RCON_BOOTPS(x) (((x)&0x0003)<<3)
  510. #define CCM_RCON_BOOTPS_MASK (0x0018)
  511. #define CCM_RCON_BOOTPS_32 (0x0018)
  512. #define CCM_RCON_BOOTPS_16 (0x0008)
  513. #define CCM_RCON_BOOTPS_8 (0x0010)
  514. #define CCM_RCON_MODE (0x0001)
  515. /* Bit definitions and macros for CCM_CIR */
  516. #define CCM_CIR_PIN(x) (((x) & 0xFFC0) >> 6)
  517. #define CCM_CIR_PRN(x) ((x) & 0x003F)
  518. /*********************************************************************
  519. * PLL Clock Module
  520. *********************************************************************/
  521. /* Bit definitions and macros for PLL_SYNCR */
  522. #define PLL_SYNCR_MFD(x) (((x)&0x07)<<24)
  523. #define PLL_SYNCR_MFD_MASK (0x07000000)
  524. #define PLL_SYNCR_RFC(x) (((x)&0x07)<<19)
  525. #define PLL_SYNCR_RFC_MASK (0x00380000)
  526. #define PLL_SYNCR_LOCEN (0x00040000)
  527. #define PLL_SYNCR_LOLRE (0x00020000)
  528. #define PLL_SYNCR_LOCRE (0x00010000)
  529. #define PLL_SYNCR_DISCLK (0x00008000)
  530. #define PLL_SYNCR_LOLIRQ (0x00004000)
  531. #define PLL_SYNCR_LOCIRQ (0x00002000)
  532. #define PLL_SYNCR_RATE (0x00001000)
  533. #define PLL_SYNCR_DEPTH(x) (((x)&0x03)<<10)
  534. #define PLL_SYNCR_EXP(x) ((x)&0x03FF)
  535. /* Bit definitions and macros for PLL_SYNSR */
  536. #define PLL_SYNSR_LOLF (0x00000200)
  537. #define PLL_SYNSR_LOC (0x00000100)
  538. #define PLL_SYNSR_MODE (0x00000080)
  539. #define PLL_SYNSR_PLLSEL (0x00000040)
  540. #define PLL_SYNSR_PLLREF (0x00000020)
  541. #define PLL_SYNSR_LOCKS (0x00000010)
  542. #define PLL_SYNSR_LOCK (0x00000008)
  543. #define PLL_SYNSR_LOCF (0x00000004)
  544. #define PLL_SYNSR_CALDONE (0x00000002)
  545. #define PLL_SYNSR_CALPASS (0x00000001)
  546. /*********************************************************************
  547. * Watchdog Timer Modules (WTM)
  548. *********************************************************************/
  549. /* Bit definitions and macros for WTM_WCR */
  550. #define WTM_WCR_WAIT (0x0008)
  551. #define WTM_WCR_DOZE (0x0004)
  552. #define WTM_WCR_HALTED (0x0002)
  553. #define WTM_WCR_EN (0x0001)
  554. #endif /* mcf5235_h */