m5235.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  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. * 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 mcf5235_h
  26. #define mcf5235_h
  27. /****************************************************************************/
  28. /*********************************************************************
  29. * System Control Module (SCM)
  30. *********************************************************************/
  31. /* Bit definition and macros for SCM_IPSBAR */
  32. #define SCM_IPSBAR_BA(x) (((x)&0x03)<<30)
  33. #define SCM_IPSBAR_V (0x00000001)
  34. /* Bit definition and macros for SCM_RAMBAR */
  35. #define SCM_RAMBAR_BA(x) (((x)&0xFFFF)<<16)
  36. #define SCM_RAMBAR_BDE (0x00000200)
  37. /* Bit definition and macros for SCM_CRSR */
  38. #define SCM_CRSR_EXT (0x80)
  39. /* Bit definitions and macros for SCM_CWCR */
  40. #define SCM_CWCR_CWE (0x80)
  41. #define SCM_CWCR_CWRI (0x40)
  42. #define SCM_CWCR_CWT(x) (((x)&0x07)<<3)
  43. #define SCM_CWCR_CWTA (0x04)
  44. #define SCM_CWCR_CWTAVAL (0x02)
  45. #define SCM_CWCR_CWTIC (0x01)
  46. /* Bit definitions and macros for SCM_LPICR */
  47. #define SCM_LPICR_ENBSTOP (0x80)
  48. #define SCM_LPICR_XLPM_IPL(x) (((x)&0x07)<<4)
  49. #define SCM_LPICR_XLPM_IPL_ANY (0x00)
  50. #define SCM_LPICR_XLPM_IPL_L2_7 (0x10)
  51. #define SCM_LPICR_XLPM_IPL_L3_7 (0x20)
  52. #define SCM_LPICR_XLPM_IPL_L4_7 (0x30)
  53. #define SCM_LPICR_XLPM_IPL_L5_7 (0x40)
  54. #define SCM_LPICR_XLPM_IPL_L6_7 (0x50)
  55. #define SCM_LPICR_XLPM_IPL_L7 (0x70)
  56. /* Bit definitions and macros for SCM_DMAREQC */
  57. #define SCM_DMAREQC_EXT(x) (((x)&0x0F)<<16)
  58. #define SCM_DMAREQC_EXT_ETPU (0x00080000)
  59. #define SCM_DMAREQC_EXT_EXTDREQ2 (0x00040000)
  60. #define SCM_DMAREQC_EXT_EXTDREQ1 (0x00020000)
  61. #define SCM_DMAREQC_EXT_EXTDREQ0 (0x00010000)
  62. #define SCM_DMAREQC_DMAC3(x) (((x)&0x0F)<<12)
  63. #define SCM_DMAREQC_DMAC2(x) (((x)&0x0F)<<8)
  64. #define SCM_DMAREQC_DMAC1(x) (((x)&0x0F)<<4)
  65. #define SCM_DMAREQC_DMAC0(x) (((x)&0x0F))
  66. #define SCM_DMAREQC_DMACn_DTMR0 (0x04)
  67. #define SCM_DMAREQC_DMACn_DTMR1 (0x05)
  68. #define SCM_DMAREQC_DMACn_DTMR2 (0x06)
  69. #define SCM_DMAREQC_DMACn_DTMR3 (0x07)
  70. #define SCM_DMAREQC_DMACn_UART0RX (0x08)
  71. #define SCM_DMAREQC_DMACn_UART1RX (0x09)
  72. #define SCM_DMAREQC_DMACn_UART2RX (0x0A)
  73. #define SCM_DMAREQC_DMACn_UART0TX (0x0C)
  74. #define SCM_DMAREQC_DMACn_UART1TX (0x0D)
  75. #define SCM_DMAREQC_DMACn_UART3TX (0x0E)
  76. /* Bit definitions and macros for SCM_MPARK */
  77. #define SCM_MPARK_M2_P_EN (0x02000000)
  78. #define SCM_MPARK_M3_PRTY_MSK (0x00C00000)
  79. #define SCM_MPARK_M3_PRTY_4TH (0x00000000)
  80. #define SCM_MPARK_M3_PRTY_3RD (0x00400000)
  81. #define SCM_MPARK_M3_PRTY_2ND (0x00800000)
  82. #define SCM_MPARK_M3_PRTY_1ST (0x00C00000)
  83. #define SCM_MPARK_M2_PRTY_MSK (0x00300000)
  84. #define SCM_MPARK_M2_PRTY_4TH (0x00000000)
  85. #define SCM_MPARK_M2_PRTY_3RD (0x00100000)
  86. #define SCM_MPARK_M2_PRTY_2ND (0x00200000)
  87. #define SCM_MPARK_M2_PRTY_1ST (0x00300000)
  88. #define SCM_MPARK_M0_PRTY_MSK (0x000C0000)
  89. #define SCM_MPARK_M0_PRTY_4TH (0x00000000)
  90. #define SCM_MPARK_M0_PRTY_3RD (0x00040000)
  91. #define SCM_MPARK_M0_PRTY_2ND (0x00080000)
  92. #define SCM_MPARK_M0_PRTY_1ST (0x000C0000)
  93. #define SCM_MPARK_FIXED (0x00004000)
  94. #define SCM_MPARK_TIMEOUT (0x00002000)
  95. #define SCM_MPARK_PRKLAST (0x00001000)
  96. #define SCM_MPARK_LCKOUT_TIME(x) (((x)&0x0F)<<8)
  97. /* Bit definitions and macros for SCM_MPR */
  98. #define SCM_MPR_MPR3 (0x08)
  99. #define SCM_MPR_MPR2 (0x04)
  100. #define SCM_MPR_MPR1 (0x02)
  101. #define SCM_MPR_MPR0 (0x01)
  102. /* Bit definitions and macros for SCM_PACRn */
  103. #define SCM_PACRn_LOCK1 (0x80)
  104. #define SCM_PACRn_ACCESSCTRL1(x) (((x)&0x07)<<4)
  105. #define SCM_PACRn_LOCK0 (0x08)
  106. #define SCM_PACRn_ACCESSCTRL0(x) (((x)&0x07))
  107. /* Bit definitions and macros for SCM_GPACR */
  108. #define SCM_PACRn_LOCK (0x80)
  109. #define SCM_PACRn_ACCESSCTRL0(x) (((x)&0x07))
  110. /*********************************************************************
  111. * SDRAM Controller (SDRAMC)
  112. *********************************************************************/
  113. /* Bit definitions and macros for SDRAMC_DCR */
  114. #define SDRAMC_DCR_NAM (0x2000)
  115. #define SDRAMC_DCR_COC (0x1000)
  116. #define SDRAMC_DCR_IS (0x0800)
  117. #define SDRAMC_DCR_RTIM_MASK (0x0C00)
  118. #define SDRAMC_DCR_RTIM_3CLKS (0x0000)
  119. #define SDRAMC_DCR_RTIM_6CLKS (0x0200)
  120. #define SDRAMC_DCR_RTIM_9CLKS (0x0400)
  121. #define SDRAMC_DCR_RC(x) (((x)&0xFF)<<8)
  122. /* Bit definitions and macros for SDRAMC_DARCn */
  123. #define SDRAMC_DARCn_BA(x) (((x)&0xFFFC)<<18)
  124. #define SDRAMC_DARCn_RE (0x00008000)
  125. #define SDRAMC_DARCn_CASL_MASK (0x00003000)
  126. #define SDRAMC_DARCn_CASL_C0 (0x00000000)
  127. #define SDRAMC_DARCn_CASL_C1 (0x00001000)
  128. #define SDRAMC_DARCn_CASL_C2 (0x00002000)
  129. #define SDRAMC_DARCn_CASL_C3 (0x00003000)
  130. #define SDRAMC_DARCn_CBM_MASK (0x00000700)
  131. #define SDRAMC_DARCn_CBM_CMD17 (0x00000000)
  132. #define SDRAMC_DARCn_CBM_CMD18 (0x00000100)
  133. #define SDRAMC_DARCn_CBM_CMD19 (0x00000200)
  134. #define SDRAMC_DARCn_CBM_CMD20 (0x00000300)
  135. #define SDRAMC_DARCn_CBM_CMD21 (0x00000400)
  136. #define SDRAMC_DARCn_CBM_CMD22 (0x00000500)
  137. #define SDRAMC_DARCn_CBM_CMD23 (0x00000600)
  138. #define SDRAMC_DARCn_CBM_CMD24 (0x00000700)
  139. #define SDRAMC_DARCn_IMRS (0x00000040)
  140. #define SDRAMC_DARCn_PS_MASK (0x00000030)
  141. #define SDRAMC_DARCn_PS_32 (0x00000000)
  142. #define SDRAMC_DARCn_PS_16 (0x00000010)
  143. #define SDRAMC_DARCn_PS_8 (0x00000020)
  144. #define SDRAMC_DARCn_IP (0x00000008)
  145. /* Bit definitions and macros for SDRAMC_DMRn */
  146. #define SDRAMC_DMRn_BAM(x) (((x)&0x3FFF)<<18)
  147. #define SDRAMC_DMRn_WP (0x00000100)
  148. #define SDRAMC_DMRn_V (0x00000001)
  149. /*********************************************************************
  150. * FlexBus Chip Selects (FBCS)
  151. *********************************************************************/
  152. /* Bit definitions and macros for FBCS_CSMR */
  153. #define FBCS_CSMR_BAM(x) (((x)&0xFFFF)<<16)
  154. #define FBCS_CSMR_BAM_4G (0xFFFF0000)
  155. #define FBCS_CSMR_BAM_2G (0x7FFF0000)
  156. #define FBCS_CSMR_BAM_1G (0x3FFF0000)
  157. #define FBCS_CSMR_BAM_1024M (0x3FFF0000)
  158. #define FBCS_CSMR_BAM_512M (0x1FFF0000)
  159. #define FBCS_CSMR_BAM_256M (0x0FFF0000)
  160. #define FBCS_CSMR_BAM_128M (0x07FF0000)
  161. #define FBCS_CSMR_BAM_64M (0x03FF0000)
  162. #define FBCS_CSMR_BAM_32M (0x01FF0000)
  163. #define FBCS_CSMR_BAM_16M (0x00FF0000)
  164. #define FBCS_CSMR_BAM_8M (0x007F0000)
  165. #define FBCS_CSMR_BAM_4M (0x003F0000)
  166. #define FBCS_CSMR_BAM_2M (0x001F0000)
  167. #define FBCS_CSMR_BAM_1M (0x000F0000)
  168. #define FBCS_CSMR_BAM_1024K (0x000F0000)
  169. #define FBCS_CSMR_BAM_512K (0x00070000)
  170. #define FBCS_CSMR_BAM_256K (0x00030000)
  171. #define FBCS_CSMR_BAM_128K (0x00010000)
  172. #define FBCS_CSMR_BAM_64K (0x00000000)
  173. #define FBCS_CSMR_WP (0x00000100)
  174. #define FBCS_CSMR_V (0x00000001)
  175. /* Bit definitions and macros for FBCS_CSCR */
  176. #define FBCS_CSCR_SRWS(x) (((x)&0x03)<<14)
  177. #define FBCS_CSCR_IWS(x) (((x)&0x0F)<<10)
  178. #define FBCS_CSCR_AA (0x0100)
  179. #define FBCS_CSCR_PS_MASK (0x00C0)
  180. #define FBCS_CSCR_PS_32 (0x0000)
  181. #define FBCS_CSCR_PS_16 (0x0080)
  182. #define FBCS_CSCR_PS_8 (0x0040)
  183. #define FBCS_CSCR_BEM (0x0020)
  184. #define FBCS_CSCR_BSTR (0x0010)
  185. #define FBCS_CSCR_BSTW (0x0008)
  186. #define FBCS_CSCR_SWWS(x) ((x)&0x07)
  187. /*********************************************************************
  188. * Queued Serial Peripheral Interface (QSPI)
  189. *********************************************************************/
  190. /* Bit definitions and macros for QSPI_QMR */
  191. #define QSPI_QMR_MSTR (0x8000)
  192. #define QSPI_QMR_DOHIE (0x4000)
  193. #define QSPI_QMR_BITS(x) (((x)&0x000F)<<10)
  194. #define QSPI_QMR_CPOL (0x0200)
  195. #define QSPI_QMR_CPHA (0x0100)
  196. #define QSPI_QMR_BAUD(x) ((x)&0x00FF)
  197. /* Bit definitions and macros for QSPI_QDLYR */
  198. #define QSPI_QDLYR_SPE (0x8000)
  199. #define QSPI_QDLYR_QCD(x) (((x)&0x007F)<<8)
  200. #define QSPI_QDLYR_DTL(x) ((x)&0x00FF)
  201. /* Bit definitions and macros for QSPI_QWR */
  202. #define QSPI_QWR_HALT (0x8000)
  203. #define QSPI_QWR_WREN (0x4000)
  204. #define QSPI_QWR_WRTO (0x2000)
  205. #define QSPI_QWR_CSIV (0x1000)
  206. #define QSPI_QWR_ENDQP(x) (((x)&0x000F)<<8)
  207. #define QSPI_QWR_NEWQP(x) ((x)&0x000F)
  208. /* Bit definitions and macros for QSPI_QIR */
  209. #define QSPI_QIR_WCEFB (0x8000)
  210. #define QSPI_QIR_ABRTB (0x4000)
  211. #define QSPI_QIR_ABRTL (0x1000)
  212. #define QSPI_QIR_WCEFE (0x0800)
  213. #define QSPI_QIR_ABRTE (0x0400)
  214. #define QSPI_QIR_SPIFE (0x0100)
  215. #define QSPI_QIR_WCEF (0x0008)
  216. #define QSPI_QIR_ABRT (0x0004)
  217. #define QSPI_QIR_SPIF (0x0001)
  218. /* Bit definitions and macros for QSPI_QAR */
  219. #define QSPI_QAR_ADDR(x) ((x)&0x003F)
  220. /* Bit definitions and macros for QSPI_QDR */
  221. #define QSPI_QDR_CONT (0x8000)
  222. #define QSPI_QDR_BITSE (0x4000)
  223. #define QSPI_QDR_DT (0x2000)
  224. #define QSPI_QDR_DSCK (0x1000)
  225. #define QSPI_QDR_QSPI_CS3 (0x0800)
  226. #define QSPI_QDR_QSPI_CS2 (0x0400)
  227. #define QSPI_QDR_QSPI_CS1 (0x0200)
  228. #define QSPI_QDR_QSPI_CS0 (0x0100)
  229. /*********************************************************************
  230. * Interrupt Controller (INTC)
  231. *********************************************************************/
  232. #define INT0_LO_RSVD0 (0)
  233. #define INT0_LO_EPORT1 (1)
  234. #define INT0_LO_EPORT2 (2)
  235. #define INT0_LO_EPORT3 (3)
  236. #define INT0_LO_EPORT4 (4)
  237. #define INT0_LO_EPORT5 (5)
  238. #define INT0_LO_EPORT6 (6)
  239. #define INT0_LO_EPORT7 (7)
  240. #define INT0_LO_SCM (8)
  241. #define INT0_LO_DMA0 (9)
  242. #define INT0_LO_DMA1 (10)
  243. #define INT0_LO_DMA2 (11)
  244. #define INT0_LO_DMA3 (12)
  245. #define INT0_LO_UART0 (13)
  246. #define INT0_LO_UART1 (14)
  247. #define INT0_LO_UART2 (15)
  248. #define INT0_LO_RSVD1 (16)
  249. #define INT0_LO_I2C (17)
  250. #define INT0_LO_QSPI (18)
  251. #define INT0_LO_DTMR0 (19)
  252. #define INT0_LO_DTMR1 (20)
  253. #define INT0_LO_DTMR2 (21)
  254. #define INT0_LO_DTMR3 (22)
  255. #define INT0_LO_FEC_TXF (23)
  256. #define INT0_LO_FEC_TXB (24)
  257. #define INT0_LO_FEC_UN (25)
  258. #define INT0_LO_FEC_RL (26)
  259. #define INT0_LO_FEC_RXF (27)
  260. #define INT0_LO_FEC_RXB (28)
  261. #define INT0_LO_FEC_MII (29)
  262. #define INT0_LO_FEC_LC (30)
  263. #define INT0_LO_FEC_HBERR (31)
  264. #define INT0_HI_FEC_GRA (32)
  265. #define INT0_HI_FEC_EBERR (33)
  266. #define INT0_HI_FEC_BABT (34)
  267. #define INT0_HI_FEC_BABR (35)
  268. #define INT0_HI_PIT0 (36)
  269. #define INT0_HI_PIT1 (37)
  270. #define INT0_HI_PIT2 (38)
  271. #define INT0_HI_PIT3 (39)
  272. #define INT0_HI_RNG (40)
  273. #define INT0_HI_SKHA (41)
  274. #define INT0_HI_MDHA (42)
  275. #define INT0_HI_CAN1_BUF0I (43)
  276. #define INT0_HI_CAN1_BUF1I (44)
  277. #define INT0_HI_CAN1_BUF2I (45)
  278. #define INT0_HI_CAN1_BUF3I (46)
  279. #define INT0_HI_CAN1_BUF4I (47)
  280. #define INT0_HI_CAN1_BUF5I (48)
  281. #define INT0_HI_CAN1_BUF6I (49)
  282. #define INT0_HI_CAN1_BUF7I (50)
  283. #define INT0_HI_CAN1_BUF8I (51)
  284. #define INT0_HI_CAN1_BUF9I (52)
  285. #define INT0_HI_CAN1_BUF10I (53)
  286. #define INT0_HI_CAN1_BUF11I (54)
  287. #define INT0_HI_CAN1_BUF12I (55)
  288. #define INT0_HI_CAN1_BUF13I (56)
  289. #define INT0_HI_CAN1_BUF14I (57)
  290. #define INT0_HI_CAN1_BUF15I (58)
  291. #define INT0_HI_CAN1_ERRINT (59)
  292. #define INT0_HI_CAN1_BOFFINT (60)
  293. /* 60-63 Reserved */
  294. /* 0 - 7 Reserved */
  295. #define INT1_LO_CAN1_BUF0I (8)
  296. #define INT1_LO_CAN1_BUF1I (9)
  297. #define INT1_LO_CAN1_BUF2I (10)
  298. #define INT1_LO_CAN1_BUF3I (11)
  299. #define INT1_LO_CAN1_BUF4I (12)
  300. #define INT1_LO_CAN1_BUF5I (13)
  301. #define INT1_LO_CAN1_BUF6I (14)
  302. #define INT1_LO_CAN1_BUF7I (15)
  303. #define INT1_LO_CAN1_BUF8I (16)
  304. #define INT1_LO_CAN1_BUF9I (17)
  305. #define INT1_LO_CAN1_BUF10I (18)
  306. #define INT1_LO_CAN1_BUF11I (19)
  307. #define INT1_LO_CAN1_BUF12I (20)
  308. #define INT1_LO_CAN1_BUF13I (21)
  309. #define INT1_LO_CAN1_BUF14I (22)
  310. #define INT1_LO_CAN1_BUF15I (23)
  311. #define INT1_LO_CAN1_ERRINT (24)
  312. #define INT1_LO_CAN1_BOFFINT (25)
  313. /* 26 Reserved */
  314. #define INT1_LO_ETPU_TC0F (27)
  315. #define INT1_LO_ETPU_TC1F (28)
  316. #define INT1_LO_ETPU_TC2F (29)
  317. #define INT1_LO_ETPU_TC3F (30)
  318. #define INT1_LO_ETPU_TC4F (31)
  319. #define INT1_HI_ETPU_TC5F (32)
  320. #define INT1_HI_ETPU_TC6F (33)
  321. #define INT1_HI_ETPU_TC7F (34)
  322. #define INT1_HI_ETPU_TC8F (35)
  323. #define INT1_HI_ETPU_TC9F (36)
  324. #define INT1_HI_ETPU_TC10F (37)
  325. #define INT1_HI_ETPU_TC11F (38)
  326. #define INT1_HI_ETPU_TC12F (39)
  327. #define INT1_HI_ETPU_TC13F (40)
  328. #define INT1_HI_ETPU_TC14F (41)
  329. #define INT1_HI_ETPU_TC15F (42)
  330. #define INT1_HI_ETPU_TC16F (43)
  331. #define INT1_HI_ETPU_TC17F (44)
  332. #define INT1_HI_ETPU_TC18F (45)
  333. #define INT1_HI_ETPU_TC19F (46)
  334. #define INT1_HI_ETPU_TC20F (47)
  335. #define INT1_HI_ETPU_TC21F (48)
  336. #define INT1_HI_ETPU_TC22F (49)
  337. #define INT1_HI_ETPU_TC23F (50)
  338. #define INT1_HI_ETPU_TC24F (51)
  339. #define INT1_HI_ETPU_TC25F (52)
  340. #define INT1_HI_ETPU_TC26F (53)
  341. #define INT1_HI_ETPU_TC27F (54)
  342. #define INT1_HI_ETPU_TC28F (55)
  343. #define INT1_HI_ETPU_TC29F (56)
  344. #define INT1_HI_ETPU_TC30F (57)
  345. #define INT1_HI_ETPU_TC31F (58)
  346. #define INT1_HI_ETPU_TGIF (59)
  347. /* Bit definitions and macros for INTC_IPRH */
  348. #define INTC_IPRH_INT63 (0x80000000)
  349. #define INTC_IPRH_INT62 (0x40000000)
  350. #define INTC_IPRH_INT61 (0x20000000)
  351. #define INTC_IPRH_INT60 (0x10000000)
  352. #define INTC_IPRH_INT59 (0x08000000)
  353. #define INTC_IPRH_INT58 (0x04000000)
  354. #define INTC_IPRH_INT57 (0x02000000)
  355. #define INTC_IPRH_INT56 (0x01000000)
  356. #define INTC_IPRH_INT55 (0x00800000)
  357. #define INTC_IPRH_INT54 (0x00400000)
  358. #define INTC_IPRH_INT53 (0x00200000)
  359. #define INTC_IPRH_INT52 (0x00100000)
  360. #define INTC_IPRH_INT51 (0x00080000)
  361. #define INTC_IPRH_INT50 (0x00040000)
  362. #define INTC_IPRH_INT49 (0x00020000)
  363. #define INTC_IPRH_INT48 (0x00010000)
  364. #define INTC_IPRH_INT47 (0x00008000)
  365. #define INTC_IPRH_INT46 (0x00004000)
  366. #define INTC_IPRH_INT45 (0x00002000)
  367. #define INTC_IPRH_INT44 (0x00001000)
  368. #define INTC_IPRH_INT43 (0x00000800)
  369. #define INTC_IPRH_INT42 (0x00000400)
  370. #define INTC_IPRH_INT41 (0x00000200)
  371. #define INTC_IPRH_INT40 (0x00000100)
  372. #define INTC_IPRH_INT39 (0x00000080)
  373. #define INTC_IPRH_INT38 (0x00000040)
  374. #define INTC_IPRH_INT37 (0x00000020)
  375. #define INTC_IPRH_INT36 (0x00000010)
  376. #define INTC_IPRH_INT35 (0x00000008)
  377. #define INTC_IPRH_INT34 (0x00000004)
  378. #define INTC_IPRH_INT33 (0x00000002)
  379. #define INTC_IPRH_INT32 (0x00000001)
  380. /* Bit definitions and macros for INTC_IPRL */
  381. #define INTC_IPRL_INT31 (0x80000000)
  382. #define INTC_IPRL_INT30 (0x40000000)
  383. #define INTC_IPRL_INT29 (0x20000000)
  384. #define INTC_IPRL_INT28 (0x10000000)
  385. #define INTC_IPRL_INT27 (0x08000000)
  386. #define INTC_IPRL_INT26 (0x04000000)
  387. #define INTC_IPRL_INT25 (0x02000000)
  388. #define INTC_IPRL_INT24 (0x01000000)
  389. #define INTC_IPRL_INT23 (0x00800000)
  390. #define INTC_IPRL_INT22 (0x00400000)
  391. #define INTC_IPRL_INT21 (0x00200000)
  392. #define INTC_IPRL_INT20 (0x00100000)
  393. #define INTC_IPRL_INT19 (0x00080000)
  394. #define INTC_IPRL_INT18 (0x00040000)
  395. #define INTC_IPRL_INT17 (0x00020000)
  396. #define INTC_IPRL_INT16 (0x00010000)
  397. #define INTC_IPRL_INT15 (0x00008000)
  398. #define INTC_IPRL_INT14 (0x00004000)
  399. #define INTC_IPRL_INT13 (0x00002000)
  400. #define INTC_IPRL_INT12 (0x00001000)
  401. #define INTC_IPRL_INT11 (0x00000800)
  402. #define INTC_IPRL_INT10 (0x00000400)
  403. #define INTC_IPRL_INT9 (0x00000200)
  404. #define INTC_IPRL_INT8 (0x00000100)
  405. #define INTC_IPRL_INT7 (0x00000080)
  406. #define INTC_IPRL_INT6 (0x00000040)
  407. #define INTC_IPRL_INT5 (0x00000020)
  408. #define INTC_IPRL_INT4 (0x00000010)
  409. #define INTC_IPRL_INT3 (0x00000008)
  410. #define INTC_IPRL_INT2 (0x00000004)
  411. #define INTC_IPRL_INT1 (0x00000002)
  412. #define INTC_IPRL_INT0 (0x00000001)
  413. /* Bit definitions and macros for INTC_IRLR */
  414. #define INTC_IRLRn(x) (((x)&0x7F)<<1)
  415. /* Bit definitions and macros for INTC_IACKLPRn */
  416. #define INTC_IACKLPRn_LEVEL(x) (((x)&0x07)<<4)
  417. #define INTC_IACKLPRn_PRI(x) ((x)&0x0F)
  418. /* Bit definitions and macros for INTC_ICRnx */
  419. #define INTC_ICRnx_IL(x) (((x)&0x07)<<3)
  420. #define INTC_ICRnx_IP(x) ((x)&0x07)
  421. /*********************************************************************
  422. * General Purpose I/O (GPIO)
  423. *********************************************************************/
  424. /* Bit definitions and macros for GPIO_PODR */
  425. #define GPIO_PODR_ADDR(x) (((x)&0x07)<<5)
  426. #define GPIO_PODR_ADDR_MASK (0xE0)
  427. #define GPIO_PODR_BS(x) ((x)&0x0F)
  428. #define GPIO_PODR_BS_MASK (0x0F)
  429. #define GPIO_PODR_CS(x) (((x)&0x7F)<<1)
  430. #define GPIO_PODR_CS_MASK (0xFE)
  431. #define GPIO_PODR_SDRAM(X) ((x)&0x3F)
  432. #define GPIO_PODR_SDRAM_MASK (0x3F)
  433. #define GPIO_PODR_FECI2C(x) GPIO_PODR_BS(x)
  434. #define GPIO_PODR_FECI2C_MASK GPIO_PODR_BS_MASK
  435. #define GPIO_PODR_UARTH(x) ((x)&0x03)
  436. #define GPIO_PODR_UARTH_MASK (0x03)
  437. #define GPIO_PODR_QSPI(x) ((x)&0x1F)
  438. #define GPIO_PODR_QSPI_MASK (0x1F)
  439. #define GPIO_PODR_ETPU(x) ((x)&0x07)
  440. #define GPIO_PODR_ETPU_MASK (0x07)
  441. /* Bit definitions and macros for GPIO_PDDR */
  442. #define GPIO_PDDR_ADDR(x) GPIO_PODR_ADDR(x)
  443. #define GPIO_PDDR_ADDR_MASK GPIO_PODR_ADDR_MASK
  444. #define GPIO_PDDR_BS(x) GPIO_PODR_BS(x)
  445. #define GPIO_PDDR_BS_MASK GPIO_PODR_BS_MASK
  446. #define GPIO_PDDR_CS(x) GPIO_PODR_CS(x)
  447. #define GPIO_PDDR_CS_MASK GPIO_PODR_CS_MASK
  448. #define GPIO_PDDR_SDRAM(X) GPIO_PODR_SDRAM(X)
  449. #define GPIO_PDDR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  450. #define GPIO_PDDR_FECI2C(x) GPIO_PDDR_BS(x)
  451. #define GPIO_PDDR_FECI2C_MASK GPIO_PDDR_BS_MASK
  452. #define GPIO_PDDR_UARTH(x) GPIO_PODR_UARTH(x)
  453. #define GPIO_PDDR_UARTH_MASK GPIO_PODR_UARTH_MASK
  454. #define GPIO_PDDR_QSPI(x) GPIO_PODR_QSPI(x)
  455. #define GPIO_PDDR_QSPI_MASK GPIO_PODR_QSPI_MASK
  456. #define GPIO_PDDR_ETPU(x) GPIO_PODR_ETPU(x)
  457. #define GPIO_PDDR_ETPU_MASK GPIO_PODR_ETPU_MASK
  458. /* Bit definitions and macros for GPIO_PPDSDR */
  459. #define GPIO_PPDSDR_ADDR(x) GPIO_PODR_ADDR(x)
  460. #define GPIO_PPDSDR_ADDR_MASK GPIO_PODR_ADDR_MASK
  461. #define GPIO_PPDSDR_BS(x) GPIO_PODR_BS(x)
  462. #define GPIO_PPDSDR_BS_MASK GPIO_PODR_BS_MASK
  463. #define GPIO_PPDSDR_CS(x) GPIO_PODR_CS(x)
  464. #define GPIO_PPDSDR_CS_MASK GPIO_PODR_CS_MASK
  465. #define GPIO_PPDSDR_SDRAM(X) GPIO_PODR_SDRAM(X)
  466. #define GPIO_PPDSDR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  467. #define GPIO_PPDSDR_FECI2C(x) GPIO_PPDSDR_BS(x)
  468. #define GPIO_PPDSDR_FECI2C_MASK GPIO_PPDSDR_BS_MASK
  469. #define GPIO_PPDSDR_UARTH(x) GPIO_PODR_UARTH(x)
  470. #define GPIO_PPDSDR_UARTH_MASK GPIO_PODR_UARTH_MASK
  471. #define GPIO_PPDSDR_QSPI(x) GPIO_PODR_QSPI(x)
  472. #define GPIO_PPDSDR_QSPI_MASK GPIO_PODR_QSPI_MASK
  473. #define GPIO_PPDSDR_ETPU(x) GPIO_PODR_ETPU(x)
  474. #define GPIO_PPDSDR_ETPU_MASK GPIO_PODR_ETPU_MASK
  475. /* Bit definitions and macros for GPIO_PCLRR */
  476. #define GPIO_PCLRR_ADDR(x) GPIO_PODR_ADDR(x)
  477. #define GPIO_PCLRR_ADDR_MASK GPIO_PODR_ADDR_MASK
  478. #define GPIO_PCLRR_BS(x) GPIO_PODR_BS(x)
  479. #define GPIO_PCLRR_BS_MASK GPIO_PODR_BS_MASK
  480. #define GPIO_PCLRR_CS(x) GPIO_PODR_CS(x)
  481. #define GPIO_PCLRR_CS_MASK GPIO_PODR_CS_MASK
  482. #define GPIO_PCLRR_SDRAM(X) GPIO_PODR_SDRAM(X)
  483. #define GPIO_PCLRR_SDRAM_MASK GPIO_PODR_SDRAM_MASK
  484. #define GPIO_PCLRR_FECI2C(x) GPIO_PCLRR_BS(x)
  485. #define GPIO_PCLRR_FECI2C_MASK GPIO_PCLRR_BS_MASK
  486. #define GPIO_PCLRR_UARTH(x) GPIO_PODR_UARTH(x)
  487. #define GPIO_PCLRR_UARTH_MASK GPIO_PODR_UARTH_MASK
  488. #define GPIO_PCLRR_QSPI(x) GPIO_PODR_QSPI(x)
  489. #define GPIO_PCLRR_QSPI_MASK GPIO_PODR_QSPI_MASK
  490. #define GPIO_PCLRR_ETPU(x) GPIO_PODR_ETPU(x)
  491. #define GPIO_PCLRR_ETPU_MASK GPIO_PODR_ETPU_MASK
  492. /* Bit definitions and macros for GPIO_PAR */
  493. #define GPIO_PAR_AD_ADDR23 (0x80)
  494. #define GPIO_PAR_AD_ADDR22 (0x40)
  495. #define GPIO_PAR_AD_ADDR21 (0x20)
  496. #define GPIO_PAR_AD_DATAL (0x01)
  497. #define GPIO_PAR_BUSCTL_OE (0x4000)
  498. #define GPIO_PAR_BUSCTL_TA (0x1000)
  499. #define GPIO_PAR_BUSCTL_TEA(x) (((x)&0x03)<<10)
  500. #define GPIO_PAR_BUSCTL_TEA_MASK (0x0C00)
  501. #define GPIO_PAR_BUSCTL_TEA_GPIO (0x0400)
  502. #define GPIO_PAR_BUSCTL_TEA_DREQ1 (0x0800)
  503. #define GPIO_PAR_BUSCTL_TEA_EXTBUS (0x0C00)
  504. #define GPIO_PAR_BUSCTL_RWB (0x0100)
  505. #define GPIO_PAR_BUSCTL_TSIZ1 (0x0040)
  506. #define GPIO_PAR_BUSCTL_TSIZ0 (0x0010)
  507. #define GPIO_PAR_BUSCTL_TS(x) (((x)&0x03)<<2)
  508. #define GPIO_PAR_BUSCTL_TS_MASK (0x0C)
  509. #define GPIO_PAR_BUSCTL_TS_GPIO (0x04)
  510. #define GPIO_PAR_BUSCTL_TS_DACK2 (0x08)
  511. #define GPIO_PAR_BUSCTL_TS_EXTBUS (0x0C)
  512. #define GPIO_PAR_BUSCTL_TIP(x) ((x)&0x03)
  513. #define GPIO_PAR_BUSCTL_TIP_MASK (0x03)
  514. #define GPIO_PAR_BUSCTL_TIP_GPIO (0x01)
  515. #define GPIO_PAR_BUSCTL_TIP_DREQ0 (0x02)
  516. #define GPIO_PAR_BUSCTL_TIP_EXTBUS (0x03)
  517. #define GPIO_PAR_BS(x) ((x)&0x0F)
  518. #define GPIO_PAR_BS_MASK (0x0F)
  519. #define GPIO_PAR_CS(x) (((x)&0x7F)<<1)
  520. #define GPIO_PAR_CS_MASK (0xFE)
  521. #define GPIO_PAR_CS_CS7 (0x80)
  522. #define GPIO_PAR_CS_CS6 (0x40)
  523. #define GPIO_PAR_CS_CS5 (0x20)
  524. #define GPIO_PAR_CS_CS4 (0x10)
  525. #define GPIO_PAR_CS_CS3 (0x08)
  526. #define GPIO_PAR_CS_CS2 (0x04)
  527. #define GPIO_PAR_CS_CS1 (0x02)
  528. #define GPIO_PAR_CS_SD3 GPIO_PAR_CS_CS3
  529. #define GPIO_PAR_CS_SD2 GPIO_PAR_CS_CS2
  530. #define GPIO_PAR_SDRAM_CSSDCS(x) (((x)&0x03)<<6)
  531. #define GPIO_PAR_SDRAM_CSSDCS_MASK (0xC0)
  532. #define GPIO_PAR_SDRAM_SDWE (0x20)
  533. #define GPIO_PAR_SDRAM_SCAS (0x10)
  534. #define GPIO_PAR_SDRAM_SRAS (0x08)
  535. #define GPIO_PAR_SDRAM_SCKE (0x04)
  536. #define GPIO_PAR_SDRAM_SDCS(x) ((x)&0x03)
  537. #define GPIO_PAR_SDRAM_SDCS_MASK (0x03)
  538. #define GPIO_PAR_FECI2C_EMDC(x) (((x)&0x03)<<6)
  539. #define GPIO_PAR_FECI2C_EMDC_MASK (0xC0)
  540. #define GPIO_PAR_FECI2C_EMDC_U2TXD (0x40)
  541. #define GPIO_PAR_FECI2C_EMDC_I2CSCL (0x80)
  542. #define GPIO_PAR_FECI2C_EMDC_FECEMDC (0xC0)
  543. #define GPIO_PAR_FECI2C_EMDIO(x) (((x)&0x03)<<4)
  544. #define GPIO_PAR_FECI2C_EMDIO_MASK (0x30)
  545. #define GPIO_PAR_FECI2C_EMDIO_U2RXD (0x10)
  546. #define GPIO_PAR_FECI2C_EMDIO_I2CSDA (0x20)
  547. #define GPIO_PAR_FECI2C_EMDIO_FECEMDIO (0x30)
  548. #define GPIO_PAR_FECI2C_SCL(x) (((x)&0x03)<<2)
  549. #define GPIO_PAR_FECI2C_SCL_MASK (0x0C)
  550. #define GPIO_PAR_FECI2C_SCL_CAN0RX (0x08)
  551. #define GPIO_PAR_FECI2C_SCL_I2CSCL (0x0C)
  552. #define GPIO_PAR_FECI2C_SDA(x) ((x)&0x03)
  553. #define GPIO_PAR_FECI2C_SDA_MASK (0x03)
  554. #define GPIO_PAR_FECI2C_SDA_CAN0TX (0x02)
  555. #define GPIO_PAR_FECI2C_SDA_I2CSDA (0x03)
  556. #define GPIO_PAR_UART_DREQ2 (0x8000)
  557. #define GPIO_PAR_UART_CAN1EN (0x4000)
  558. #define GPIO_PAR_UART_U2RXD (0x2000)
  559. #define GPIO_PAR_UART_U2TXD (0x1000)
  560. #define GPIO_PAR_UART_U1RXD(x) (((x)&0x03)<<10)
  561. #define GPIO_PAR_UART_U1RXD_MASK (0x0C00)
  562. #define GPIO_PAR_UART_U1RXD_CAN0RX (0x0800)
  563. #define GPIO_PAR_UART_U1RXD_U1RXD (0x0C00)
  564. #define GPIO_PAR_UART_U1TXD(x) (((x)&0x03)<<8)
  565. #define GPIO_PAR_UART_U1TXD_MASK (0x0300)
  566. #define GPIO_PAR_UART_U1TXD_CAN0TX (0x0200)
  567. #define GPIO_PAR_UART_U1TXD_U1TXD (0x0300)
  568. #define GPIO_PAR_UART_U1CTS(x) (((x)&0x03)<<6)
  569. #define GPIO_PAR_UART_U1CTS_MASK (0x00C0)
  570. #define GPIO_PAR_UART_U1CTS_U2CTS (0x0080)
  571. #define GPIO_PAR_UART_U1CTS_U1CTS (0x00C0)
  572. #define GPIO_PAR_UART_U1RTS(x) (((x)&0x03)<<4)
  573. #define GPIO_PAR_UART_U1RTS_MASK (0x0030)
  574. #define GPIO_PAR_UART_U1RTS_U2RTS (0x0020)
  575. #define GPIO_PAR_UART_U1RTS_U1RTS (0x0030)
  576. #define GPIO_PAR_UART_U0RXD (0x0008)
  577. #define GPIO_PAR_UART_U0TXD (0x0004)
  578. #define GPIO_PAR_UART_U0CTS (0x0002)
  579. #define GPIO_PAR_UART_U0RTS (0x0001)
  580. #define GPIO_PAR_QSPI_CS1(x) (((x)&0x03)<<6)
  581. #define GPIO_PAR_QSPI_CS1_MASK (0xC0)
  582. #define GPIO_PAR_QSPI_CS1_SDRAMSCKE (0x80)
  583. #define GPIO_PAR_QSPI_CS1_QSPICS1 (0xC0)
  584. #define GPIO_PAR_QSPI_CS0 (0x20)
  585. #define GPIO_PAR_QSPI_DIN(x) (((x)&0x03)<<3)
  586. #define GPIO_PAR_QSPI_DIN_MASK (0x18)
  587. #define GPIO_PAR_QSPI_DIN_I2CSDA (0x10)
  588. #define GPIO_PAR_QSPI_DIN_QSPIDIN (0x18)
  589. #define GPIO_PAR_QSPI_DOUT (0x04)
  590. #define GPIO_PAR_QSPI_SCK(x) ((x)&0x03)
  591. #define GPIO_PAR_QSPI_SCK_MASK (0x03)
  592. #define GPIO_PAR_QSPI_SCK_I2CSCL (0x02)
  593. #define GPIO_PAR_QSPI_SCK_QSPISCK (0x03)
  594. #define GPIO_PAR_DT3IN(x) (((x)&0x03)<<14)
  595. #define GPIO_PAR_DT3IN_MASK (0xC000)
  596. #define GPIO_PAR_DT3IN_QSPICS2 (0x4000)
  597. #define GPIO_PAR_DT3IN_U2CTS (0x8000)
  598. #define GPIO_PAR_DT3IN_DT3IN (0xC000)
  599. #define GPIO_PAR_DT2IN(x) (((x)&0x03)<<12)
  600. #define GPIO_PAR_DT2IN_MASK (0x3000)
  601. #define GPIO_PAR_DT2IN_DT2OUT (0x1000)
  602. #define GPIO_PAR_DT2IN_DREQ2 (0x2000)
  603. #define GPIO_PAR_DT2IN_DT2IN (0x3000)
  604. #define GPIO_PAR_DT1IN(x) (((x)&0x03)<<10)
  605. #define GPIO_PAR_DT1IN_MASK (0x0C00)
  606. #define GPIO_PAR_DT1IN_DT1OUT (0x0400)
  607. #define GPIO_PAR_DT1IN_DREQ1 (0x0800)
  608. #define GPIO_PAR_DT1IN_DT1IN (0x0C00)
  609. #define GPIO_PAR_DT0IN(x) (((x)&0x03)<<8)
  610. #define GPIO_PAR_DT0IN_MASK (0x0300)
  611. #define GPIO_PAR_DT0IN_DREQ0 (0x0200)
  612. #define GPIO_PAR_DT0IN_DT0IN (0x0300)
  613. #define GPIO_PAR_DT3OUT(x) (((x)&0x03)<<6)
  614. #define GPIO_PAR_DT3OUT_MASK (0x00C0)
  615. #define GPIO_PAR_DT3OUT_QSPICS3 (0x0040)
  616. #define GPIO_PAR_DT3OUT_U2RTS (0x0080)
  617. #define GPIO_PAR_DT3OUT_DT3OUT (0x00C0)
  618. #define GPIO_PAR_DT2OUT(x) (((x)&0x03)<<4)
  619. #define GPIO_PAR_DT2OUT_MASK (0x0030)
  620. #define GPIO_PAR_DT2OUT_DACK2 (0x0020)
  621. #define GPIO_PAR_DT2OUT_DT2OUT (0x0030)
  622. #define GPIO_PAR_DT1OUT(x) (((x)&0x03)<<2)
  623. #define GPIO_PAR_DT1OUT_MASK (0x000C)
  624. #define GPIO_PAR_DT1OUT_DACK1 (0x0008)
  625. #define GPIO_PAR_DT1OUT_DT1OUT (0x000C)
  626. #define GPIO_PAR_DT0OUT(x) ((x)&0x03)
  627. #define GPIO_PAR_DT0OUT_MASK (0x0003)
  628. #define GPIO_PAR_DT0OUT_DACK0 (0x0002)
  629. #define GPIO_PAR_DT0OUT_DT0OUT (0x0003)
  630. #define GPIO_PAR_ETPU_TCRCLK (0x04)
  631. #define GPIO_PAR_ETPU_UTPU_ODIS (0x02)
  632. #define GPIO_PAR_ETPU_LTPU_ODIS (0x01)
  633. /* Bit definitions and macros for GPIO_DSCR */
  634. #define GPIO_DSCR_EIM_EIM1 (0x10)
  635. #define GPIO_DSCR_EIM_EIM0 (0x01)
  636. #define GPIO_DSCR_ETPU_ETPU31_24 (0x40)
  637. #define GPIO_DSCR_ETPU_ETPU23_16 (0x10)
  638. #define GPIO_DSCR_ETPU_ETPU15_8 (0x04)
  639. #define GPIO_DSCR_ETPU_ETPU7_0 (0x01)
  640. #define GPIO_DSCR_FECI2C_FEC (0x10)
  641. #define GPIO_DSCR_FECI2C_I2C (0x01)
  642. #define GPIO_DSCR_UART_IRQ (0x40)
  643. #define GPIO_DSCR_UART_UART2 (0x10)
  644. #define GPIO_DSCR_UART_UART1 (0x04)
  645. #define GPIO_DSCR_UART_UART0 (0x01)
  646. #define GPIO_DSCR_QSPI_QSPI (0x01)
  647. #define GPIO_DSCR_TIMER (0x01)
  648. /*********************************************************************
  649. * Chip Configuration Module (CCM)
  650. *********************************************************************/
  651. /* Bit definitions and macros for CCM_RCR */
  652. #define CCM_RCR_SOFTRST (0x80)
  653. #define CCM_RCR_FRCRSTOUT (0x40)
  654. /* Bit definitions and macros for CCM_RSR */
  655. #define CCM_RSR_SOFT (0x20)
  656. #define CCM_RSR_WDR (0x10)
  657. #define CCM_RSR_POR (0x08)
  658. #define CCM_RSR_EXT (0x04)
  659. #define CCM_RSR_LOC (0x02)
  660. #define CCM_RSR_LOL (0x01)
  661. /* Bit definitions and macros for CCM_CCR */
  662. #define CCM_CCR_LOAD (0x8000)
  663. #define CCM_CCR_SZEN (0x0040)
  664. #define CCM_CCR_PSTEN (0x0020)
  665. #define CCM_CCR_BME (0x0008)
  666. #define CCM_CCR_BMT(x) ((x)&0x07)
  667. #define CCM_CCR_BMT_MASK (0x0007)
  668. #define CCM_CCR_BMT_64K (0x0000)
  669. #define CCM_CCR_BMT_32K (0x0001)
  670. #define CCM_CCR_BMT_16K (0x0002)
  671. #define CCM_CCR_BMT_8K (0x0003)
  672. #define CCM_CCR_BMT_4K (0x0004)
  673. #define CCM_CCR_BMT_2K (0x0005)
  674. #define CCM_CCR_BMT_1K (0x0006)
  675. #define CCM_CCR_BMT_512 (0x0007)
  676. /* Bit definitions and macros for CCM_RCON */
  677. #define CCM_RCON_RCSC(x) (((x)&0x0003)<<8)
  678. #define CCM_RCON_RLOAD (0x0020)
  679. #define CCM_RCON_BOOTPS(x) (((x)&0x0003)<<3)
  680. #define CCM_RCON_BOOTPS_MASK (0x0018)
  681. #define CCM_RCON_BOOTPS_32 (0x0018)
  682. #define CCM_RCON_BOOTPS_16 (0x0008)
  683. #define CCM_RCON_BOOTPS_8 (0x0010)
  684. #define CCM_RCON_MODE (0x0001)
  685. /* Bit definitions and macros for CCM_CIR */
  686. #define CCM_CIR_PIN(x) (((x)&0x03FF)<<6)
  687. #define CCM_CIR_PRN(x) ((x)&0x003F)
  688. /*********************************************************************
  689. * PLL Clock Module
  690. *********************************************************************/
  691. /* Bit definitions and macros for PLL_SYNCR */
  692. #define PLL_SYNCR_MFD(x) (((x)&0x07)<<24)
  693. #define PLL_SYNCR_MFD_MASK (0x07000000)
  694. #define PLL_SYNCR_RFC(x) (((x)&0x07)<<19)
  695. #define PLL_SYNCR_RFC_MASK (0x00380000)
  696. #define PLL_SYNCR_LOCEN (0x00040000)
  697. #define PLL_SYNCR_LOLRE (0x00020000)
  698. #define PLL_SYNCR_LOCRE (0x00010000)
  699. #define PLL_SYNCR_DISCLK (0x00008000)
  700. #define PLL_SYNCR_LOLIRQ (0x00004000)
  701. #define PLL_SYNCR_LOCIRQ (0x00002000)
  702. #define PLL_SYNCR_RATE (0x00001000)
  703. #define PLL_SYNCR_DEPTH(x) (((x)&0x03)<<10)
  704. #define PLL_SYNCR_EXP(x) ((x)&0x03FF)
  705. /* Bit definitions and macros for PLL_SYNSR */
  706. #define PLL_SYNSR_LOLF (0x00000200)
  707. #define PLL_SYNSR_LOC (0x00000100)
  708. #define PLL_SYNSR_MODE (0x00000080)
  709. #define PLL_SYNSR_PLLSEL (0x00000040)
  710. #define PLL_SYNSR_PLLREF (0x00000020)
  711. #define PLL_SYNSR_LOCKS (0x00000010)
  712. #define PLL_SYNSR_LOCK (0x00000008)
  713. #define PLL_SYNSR_LOCF (0x00000004)
  714. #define PLL_SYNSR_CALDONE (0x00000002)
  715. #define PLL_SYNSR_CALPASS (0x00000001)
  716. /*********************************************************************
  717. * Edge Port
  718. *********************************************************************/
  719. #define EPORT_EPPAR_EPPA7(x) (((x)&0x03)<<14)
  720. #define EPORT_EPPAR_EPPA6(x) (((x)&0x03)<<12)
  721. #define EPORT_EPPAR_EPPA5(x) (((x)&0x03)<<10)
  722. #define EPORT_EPPAR_EPPA4(x) (((x)&0x03)<<8)
  723. #define EPORT_EPPAR_EPPA3(x) (((x)&0x03)<<6)
  724. #define EPORT_EPPAR_EPPA2(x) (((x)&0x03)<<4)
  725. #define EPORT_EPPAR_EPPA1(x) (((x)&0x03)<<2)
  726. #define EPORT_EPDDR_EPDD7(x) EPORT_EPPAR_EPPA7(x)
  727. #define EPORT_EPDDR_EPDD6(x) EPORT_EPPAR_EPPA6(x)
  728. #define EPORT_EPDDR_EPDD5(x) EPORT_EPPAR_EPPA5(x)
  729. #define EPORT_EPDDR_EPDD4(x) EPORT_EPPAR_EPPA4(x)
  730. #define EPORT_EPDDR_EPDD3(x) EPORT_EPPAR_EPPA3(x)
  731. #define EPORT_EPDDR_EPDD2(x) EPORT_EPPAR_EPPA2(x)
  732. #define EPORT_EPDDR_EPDD1(x) EPORT_EPPAR_EPPA1(x)
  733. #define EPORT_EPIER_EPIE7 (0x80)
  734. #define EPORT_EPIER_EPIE6 (0x40)
  735. #define EPORT_EPIER_EPIE5 (0x20)
  736. #define EPORT_EPIER_EPIE4 (0x10)
  737. #define EPORT_EPIER_EPIE3 (0x08)
  738. #define EPORT_EPIER_EPIE2 (0x04)
  739. #define EPORT_EPIER_EPIE1 (0x02)
  740. #define EPORT_EPDR_EPDR7 EPORT_EPIER_EPIE7
  741. #define EPORT_EPDR_EPDR6 EPORT_EPIER_EPIE6
  742. #define EPORT_EPDR_EPDR5 EPORT_EPIER_EPIE5
  743. #define EPORT_EPDR_EPDR4 EPORT_EPIER_EPIE4
  744. #define EPORT_EPDR_EPDR3 EPORT_EPIER_EPIE3
  745. #define EPORT_EPDR_EPDR2 EPORT_EPIER_EPIE2
  746. #define EPORT_EPDR_EPDR1 EPORT_EPIER_EPIE1
  747. #define EPORT_EPPDR_EPPDR7 EPORT_EPIER_EPIE7
  748. #define EPORT_EPPDR_EPPDR6 EPORT_EPIER_EPIE6
  749. #define EPORT_EPPDR_EPPDR5 EPORT_EPIER_EPIE5
  750. #define EPORT_EPPDR_EPPDR4 EPORT_EPIER_EPIE4
  751. #define EPORT_EPPDR_EPPDR3 EPORT_EPIER_EPIE3
  752. #define EPORT_EPPDR_EPPDR2 EPORT_EPIER_EPIE2
  753. #define EPORT_EPPDR_EPPDR1 EPORT_EPIER_EPIE1
  754. /*********************************************************************
  755. * Watchdog Timer Modules (WTM)
  756. *********************************************************************/
  757. /* Bit definitions and macros for WTM_WCR */
  758. #define WTM_WCR_WAIT (0x0008)
  759. #define WTM_WCR_DOZE (0x0004)
  760. #define WTM_WCR_HALTED (0x0002)
  761. #define WTM_WCR_EN (0x0001)
  762. /*********************************************************************
  763. * FlexCAN Module (CAN)
  764. *********************************************************************/
  765. /* Bit definitions and macros for CAN_CANMCR */
  766. #define CANMCR_MDIS (0x80000000)
  767. #define CANMCR_FRZ (0x40000000)
  768. #define CANMCR_HALT (0x10000000)
  769. #define CANMCR_NORDY (0x08000000)
  770. #define CANMCR_SOFTRST (0x02000000)
  771. #define CANMCR_FRZACK (0x01000000)
  772. #define CANMCR_SUPV (0x00800000)
  773. #define CANMCR_LPMACK (0x00100000)
  774. #define CANMCR_MAXMB(x) (((x)&0x0F))
  775. /* Bit definitions and macros for CAN_CANCTRL */
  776. #define CANCTRL_PRESDIV(x) (((x)&0xFF)<<24)
  777. #define CANCTRL_RJW(x) (((x)&0x03)<<22)
  778. #define CANCTRL_PSEG1(x) (((x)&0x07)<<19)
  779. #define CANCTRL_PSEG2(x) (((x)&0x07)<<16)
  780. #define CANCTRL_BOFFMSK (0x00008000)
  781. #define CANCTRL_ERRMSK (0x00004000)
  782. #define CANCTRL_CLKSRC (0x00002000)
  783. #define CANCTRL_LPB (0x00001000)
  784. #define CANCTRL_SMP (0x00000080)
  785. #define CANCTRL_BOFFREC (0x00000040)
  786. #define CANCTRL_TSYNC (0x00000020)
  787. #define CANCTRL_LBUF (0x00000010)
  788. #define CANCTRL_LOM (0x00000008)
  789. #define CANCTRL_PROPSEG(x) (((x)&0x07))
  790. /* Bit definitions and macros for CAN_TIMER */
  791. #define TIMER_TIMER(x) ((x)&0xFFFF)
  792. /* Bit definitions and macros for CAN_RXGMASK */
  793. #define RXGMASK_MI(x) ((x)&0x1FFFFFFF)
  794. /* Bit definitions and macros for CAN_ERRCNT */
  795. #define ERRCNT_TXECTR(x) (((x)&0xFF))
  796. #define ERRCNT_RXECTR(x) (((x)&0xFF)<<8)
  797. /* Bit definitions and macros for CAN_ERRSTAT */
  798. #define ERRSTAT_BITERR1 (0x00008000)
  799. #define ERRSTAT_BITERR0 (0x00004000)
  800. #define ERRSTAT_ACKERR (0x00002000)
  801. #define ERRSTAT_CRCERR (0x00001000)
  802. #define ERRSTAT_FRMERR (0x00000800)
  803. #define ERRSTAT_STFERR (0x00000400)
  804. #define ERRSTAT_TXWRN (0x00000200)
  805. #define ERRSTAT_RXWRN (0x00000100)
  806. #define ERRSTAT_IDLE (0x00000080)
  807. #define ERRSTAT_TXRX (0x00000040)
  808. #define ERRSTAT_FLT_BUSOFF (0x00000020)
  809. #define ERRSTAT_FLT_PASSIVE (0x00000010)
  810. #define ERRSTAT_FLT_ACTIVE (0x00000000)
  811. #define ERRSTAT_BOFFINT (0x00000004)
  812. #define ERRSTAT_ERRINT (0x00000002)
  813. /* Bit definitions and macros for CAN_IMASK */
  814. #define IMASK_BUF15M (0x00008000)
  815. #define IMASK_BUF14M (0x00004000)
  816. #define IMASK_BUF13M (0x00002000)
  817. #define IMASK_BUF12M (0x00001000)
  818. #define IMASK_BUF11M (0x00000800)
  819. #define IMASK_BUF10M (0x00000400)
  820. #define IMASK_BUF9M (0x00000200)
  821. #define IMASK_BUF8M (0x00000100)
  822. #define IMASK_BUF7M (0x00000080)
  823. #define IMASK_BUF6M (0x00000040)
  824. #define IMASK_BUF5M (0x00000020)
  825. #define IMASK_BUF4M (0x00000010)
  826. #define IMASK_BUF3M (0x00000008)
  827. #define IMASK_BUF2M (0x00000004)
  828. #define IMASK_BUF1M (0x00000002)
  829. #define IMASK_BUF0M (0x00000001)
  830. /* Bit definitions and macros for CAN_IFLAG */
  831. #define IFLAG_BUF15I (0x00008000)
  832. #define IFLAG_BUF14I (0x00004000)
  833. #define IFLAG_BUF13I (0x00002000)
  834. #define IFLAG_BUF12I (0x00001000)
  835. #define IFLAG_BUF11I (0x00000800)
  836. #define IFLAG_BUF10I (0x00000400)
  837. #define IFLAG_BUF9I (0x00000200)
  838. #define IFLAG_BUF8I (0x00000100)
  839. #define IFLAG_BUF7I (0x00000080)
  840. #define IFLAG_BUF6I (0x00000040)
  841. #define IFLAG_BUF5I (0x00000020)
  842. #define IFLAG_BUF4I (0x00000010)
  843. #define IFLAG_BUF3I (0x00000008)
  844. #define IFLAG_BUF2I (0x00000004)
  845. #define IFLAG_BUF1I (0x00000002)
  846. #define IFLAG_BUF0I (0x00000001)
  847. #endif /* mcf5235_h */