m5227x.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. /*
  2. * MCF5227x Internal Memory Map
  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 __MCF5227X__
  26. #define __MCF5227X__
  27. /*********************************************************************
  28. * Interrupt Controller (INTC)
  29. *********************************************************************/
  30. #define INT0_LO_RSVD0 (0)
  31. #define INT0_LO_EPORT1 (1)
  32. #define INT0_LO_EPORT4 (4)
  33. #define INT0_LO_EPORT7 (7)
  34. #define INT0_LO_EDMA_00 (8)
  35. #define INT0_LO_EDMA_01 (9)
  36. #define INT0_LO_EDMA_02 (10)
  37. #define INT0_LO_EDMA_03 (11)
  38. #define INT0_LO_EDMA_04 (12)
  39. #define INT0_LO_EDMA_05 (13)
  40. #define INT0_LO_EDMA_06 (14)
  41. #define INT0_LO_EDMA_07 (15)
  42. #define INT0_LO_EDMA_08 (16)
  43. #define INT0_LO_EDMA_09 (17)
  44. #define INT0_LO_EDMA_10 (18)
  45. #define INT0_LO_EDMA_11 (19)
  46. #define INT0_LO_EDMA_12 (20)
  47. #define INT0_LO_EDMA_13 (21)
  48. #define INT0_LO_EDMA_14 (22)
  49. #define INT0_LO_EDMA_15 (23)
  50. #define INT0_LO_EDMA_ERR (24)
  51. #define INT0_LO_SCM_CWIC (25)
  52. #define INT0_LO_UART0 (26)
  53. #define INT0_LO_UART1 (27)
  54. #define INT0_LO_UART2 (28)
  55. #define INT0_LO_I2C (30)
  56. #define INT0_LO_DSPI (31)
  57. #define INT0_HI_DTMR0 (32)
  58. #define INT0_HI_DTMR1 (33)
  59. #define INT0_HI_DTMR2 (34)
  60. #define INT0_HI_DTMR3 (35)
  61. #define INT0_HI_SCMIR (62)
  62. #define INT0_HI_RTC_ISR (63)
  63. #define INT1_HI_CAN_BOFFINT (1)
  64. #define INT1_HI_CAN_ERRINT (3)
  65. #define INT1_HI_CAN_BUF0I (4)
  66. #define INT1_HI_CAN_BUF1I (5)
  67. #define INT1_HI_CAN_BUF2I (6)
  68. #define INT1_HI_CAN_BUF3I (7)
  69. #define INT1_HI_CAN_BUF4I (8)
  70. #define INT1_HI_CAN_BUF5I (9)
  71. #define INT1_HI_CAN_BUF6I (10)
  72. #define INT1_HI_CAN_BUF7I (11)
  73. #define INT1_HI_CAN_BUF8I (12)
  74. #define INT1_HI_CAN_BUF9I (13)
  75. #define INT1_HI_CAN_BUF10I (14)
  76. #define INT1_HI_CAN_BUF11I (15)
  77. #define INT1_HI_CAN_BUF12I (16)
  78. #define INT1_HI_CAN_BUF13I (17)
  79. #define INT1_HI_CAN_BUF14I (18)
  80. #define INT1_HI_CAN_BUF15I (19)
  81. #define INT1_HI_PIT0_PIF (43)
  82. #define INT1_HI_PIT1_PIF (44)
  83. #define INT1_HI_USBOTG_STS (47)
  84. #define INT1_HI_SSI_ISR (49)
  85. #define INT1_HI_PWM_INT (50)
  86. #define INT1_HI_LCDC_ISR (51)
  87. #define INT1_HI_CCM_UOCSR (53)
  88. #define INT1_HI_DSPI_EOQF (54)
  89. #define INT1_HI_DSPI_TFFF (55)
  90. #define INT1_HI_DSPI_TCF (56)
  91. #define INT1_HI_DSPI_TFUF (57)
  92. #define INT1_HI_DSPI_RFDF (58)
  93. #define INT1_HI_DSPI_RFOF (59)
  94. #define INT1_HI_DSPI_RFOF_TFUF (60)
  95. #define INT1_HI_TOUCH_ADC (61)
  96. #define INT1_HI_PLL_LOCKS (62)
  97. /* Bit definitions and macros for IPRH */
  98. #define INTC_IPRH_INT32 (0x00000001)
  99. #define INTC_IPRH_INT33 (0x00000002)
  100. #define INTC_IPRH_INT34 (0x00000004)
  101. #define INTC_IPRH_INT35 (0x00000008)
  102. #define INTC_IPRH_INT36 (0x00000010)
  103. #define INTC_IPRH_INT37 (0x00000020)
  104. #define INTC_IPRH_INT38 (0x00000040)
  105. #define INTC_IPRH_INT39 (0x00000080)
  106. #define INTC_IPRH_INT40 (0x00000100)
  107. #define INTC_IPRH_INT41 (0x00000200)
  108. #define INTC_IPRH_INT42 (0x00000400)
  109. #define INTC_IPRH_INT43 (0x00000800)
  110. #define INTC_IPRH_INT44 (0x00001000)
  111. #define INTC_IPRH_INT45 (0x00002000)
  112. #define INTC_IPRH_INT46 (0x00004000)
  113. #define INTC_IPRH_INT47 (0x00008000)
  114. #define INTC_IPRH_INT48 (0x00010000)
  115. #define INTC_IPRH_INT49 (0x00020000)
  116. #define INTC_IPRH_INT50 (0x00040000)
  117. #define INTC_IPRH_INT51 (0x00080000)
  118. #define INTC_IPRH_INT52 (0x00100000)
  119. #define INTC_IPRH_INT53 (0x00200000)
  120. #define INTC_IPRH_INT54 (0x00400000)
  121. #define INTC_IPRH_INT55 (0x00800000)
  122. #define INTC_IPRH_INT56 (0x01000000)
  123. #define INTC_IPRH_INT57 (0x02000000)
  124. #define INTC_IPRH_INT58 (0x04000000)
  125. #define INTC_IPRH_INT59 (0x08000000)
  126. #define INTC_IPRH_INT60 (0x10000000)
  127. #define INTC_IPRH_INT61 (0x20000000)
  128. #define INTC_IPRH_INT62 (0x40000000)
  129. #define INTC_IPRH_INT63 (0x80000000)
  130. /* Bit definitions and macros for IPRL */
  131. #define INTC_IPRL_INT0 (0x00000001)
  132. #define INTC_IPRL_INT1 (0x00000002)
  133. #define INTC_IPRL_INT2 (0x00000004)
  134. #define INTC_IPRL_INT3 (0x00000008)
  135. #define INTC_IPRL_INT4 (0x00000010)
  136. #define INTC_IPRL_INT5 (0x00000020)
  137. #define INTC_IPRL_INT6 (0x00000040)
  138. #define INTC_IPRL_INT7 (0x00000080)
  139. #define INTC_IPRL_INT8 (0x00000100)
  140. #define INTC_IPRL_INT9 (0x00000200)
  141. #define INTC_IPRL_INT10 (0x00000400)
  142. #define INTC_IPRL_INT11 (0x00000800)
  143. #define INTC_IPRL_INT12 (0x00001000)
  144. #define INTC_IPRL_INT13 (0x00002000)
  145. #define INTC_IPRL_INT14 (0x00004000)
  146. #define INTC_IPRL_INT15 (0x00008000)
  147. #define INTC_IPRL_INT16 (0x00010000)
  148. #define INTC_IPRL_INT17 (0x00020000)
  149. #define INTC_IPRL_INT18 (0x00040000)
  150. #define INTC_IPRL_INT19 (0x00080000)
  151. #define INTC_IPRL_INT20 (0x00100000)
  152. #define INTC_IPRL_INT21 (0x00200000)
  153. #define INTC_IPRL_INT22 (0x00400000)
  154. #define INTC_IPRL_INT23 (0x00800000)
  155. #define INTC_IPRL_INT24 (0x01000000)
  156. #define INTC_IPRL_INT25 (0x02000000)
  157. #define INTC_IPRL_INT26 (0x04000000)
  158. #define INTC_IPRL_INT27 (0x08000000)
  159. #define INTC_IPRL_INT28 (0x10000000)
  160. #define INTC_IPRL_INT29 (0x20000000)
  161. #define INTC_IPRL_INT30 (0x40000000)
  162. #define INTC_IPRL_INT31 (0x80000000)
  163. /* Bit definitions and macros for IMRH */
  164. #define INTC_IMRH_INT_MASK32 (0x00000001)
  165. #define INTC_IMRH_INT_MASK33 (0x00000002)
  166. #define INTC_IMRH_INT_MASK34 (0x00000004)
  167. #define INTC_IMRH_INT_MASK35 (0x00000008)
  168. #define INTC_IMRH_INT_MASK36 (0x00000010)
  169. #define INTC_IMRH_INT_MASK37 (0x00000020)
  170. #define INTC_IMRH_INT_MASK38 (0x00000040)
  171. #define INTC_IMRH_INT_MASK39 (0x00000080)
  172. #define INTC_IMRH_INT_MASK40 (0x00000100)
  173. #define INTC_IMRH_INT_MASK41 (0x00000200)
  174. #define INTC_IMRH_INT_MASK42 (0x00000400)
  175. #define INTC_IMRH_INT_MASK43 (0x00000800)
  176. #define INTC_IMRH_INT_MASK44 (0x00001000)
  177. #define INTC_IMRH_INT_MASK45 (0x00002000)
  178. #define INTC_IMRH_INT_MASK46 (0x00004000)
  179. #define INTC_IMRH_INT_MASK47 (0x00008000)
  180. #define INTC_IMRH_INT_MASK48 (0x00010000)
  181. #define INTC_IMRH_INT_MASK49 (0x00020000)
  182. #define INTC_IMRH_INT_MASK50 (0x00040000)
  183. #define INTC_IMRH_INT_MASK51 (0x00080000)
  184. #define INTC_IMRH_INT_MASK52 (0x00100000)
  185. #define INTC_IMRH_INT_MASK53 (0x00200000)
  186. #define INTC_IMRH_INT_MASK54 (0x00400000)
  187. #define INTC_IMRH_INT_MASK55 (0x00800000)
  188. #define INTC_IMRH_INT_MASK56 (0x01000000)
  189. #define INTC_IMRH_INT_MASK57 (0x02000000)
  190. #define INTC_IMRH_INT_MASK58 (0x04000000)
  191. #define INTC_IMRH_INT_MASK59 (0x08000000)
  192. #define INTC_IMRH_INT_MASK60 (0x10000000)
  193. #define INTC_IMRH_INT_MASK61 (0x20000000)
  194. #define INTC_IMRH_INT_MASK62 (0x40000000)
  195. #define INTC_IMRH_INT_MASK63 (0x80000000)
  196. /* Bit definitions and macros for IMRL */
  197. #define INTC_IMRL_INT_MASK0 (0x00000001)
  198. #define INTC_IMRL_INT_MASK1 (0x00000002)
  199. #define INTC_IMRL_INT_MASK2 (0x00000004)
  200. #define INTC_IMRL_INT_MASK3 (0x00000008)
  201. #define INTC_IMRL_INT_MASK4 (0x00000010)
  202. #define INTC_IMRL_INT_MASK5 (0x00000020)
  203. #define INTC_IMRL_INT_MASK6 (0x00000040)
  204. #define INTC_IMRL_INT_MASK7 (0x00000080)
  205. #define INTC_IMRL_INT_MASK8 (0x00000100)
  206. #define INTC_IMRL_INT_MASK9 (0x00000200)
  207. #define INTC_IMRL_INT_MASK10 (0x00000400)
  208. #define INTC_IMRL_INT_MASK11 (0x00000800)
  209. #define INTC_IMRL_INT_MASK12 (0x00001000)
  210. #define INTC_IMRL_INT_MASK13 (0x00002000)
  211. #define INTC_IMRL_INT_MASK14 (0x00004000)
  212. #define INTC_IMRL_INT_MASK15 (0x00008000)
  213. #define INTC_IMRL_INT_MASK16 (0x00010000)
  214. #define INTC_IMRL_INT_MASK17 (0x00020000)
  215. #define INTC_IMRL_INT_MASK18 (0x00040000)
  216. #define INTC_IMRL_INT_MASK19 (0x00080000)
  217. #define INTC_IMRL_INT_MASK20 (0x00100000)
  218. #define INTC_IMRL_INT_MASK21 (0x00200000)
  219. #define INTC_IMRL_INT_MASK22 (0x00400000)
  220. #define INTC_IMRL_INT_MASK23 (0x00800000)
  221. #define INTC_IMRL_INT_MASK24 (0x01000000)
  222. #define INTC_IMRL_INT_MASK25 (0x02000000)
  223. #define INTC_IMRL_INT_MASK26 (0x04000000)
  224. #define INTC_IMRL_INT_MASK27 (0x08000000)
  225. #define INTC_IMRL_INT_MASK28 (0x10000000)
  226. #define INTC_IMRL_INT_MASK29 (0x20000000)
  227. #define INTC_IMRL_INT_MASK30 (0x40000000)
  228. #define INTC_IMRL_INT_MASK31 (0x80000000)
  229. /* Bit definitions and macros for INTFRCH */
  230. #define INTC_INTFRCH_INTFRC32 (0x00000001)
  231. #define INTC_INTFRCH_INTFRC33 (0x00000002)
  232. #define INTC_INTFRCH_INTFRC34 (0x00000004)
  233. #define INTC_INTFRCH_INTFRC35 (0x00000008)
  234. #define INTC_INTFRCH_INTFRC36 (0x00000010)
  235. #define INTC_INTFRCH_INTFRC37 (0x00000020)
  236. #define INTC_INTFRCH_INTFRC38 (0x00000040)
  237. #define INTC_INTFRCH_INTFRC39 (0x00000080)
  238. #define INTC_INTFRCH_INTFRC40 (0x00000100)
  239. #define INTC_INTFRCH_INTFRC41 (0x00000200)
  240. #define INTC_INTFRCH_INTFRC42 (0x00000400)
  241. #define INTC_INTFRCH_INTFRC43 (0x00000800)
  242. #define INTC_INTFRCH_INTFRC44 (0x00001000)
  243. #define INTC_INTFRCH_INTFRC45 (0x00002000)
  244. #define INTC_INTFRCH_INTFRC46 (0x00004000)
  245. #define INTC_INTFRCH_INTFRC47 (0x00008000)
  246. #define INTC_INTFRCH_INTFRC48 (0x00010000)
  247. #define INTC_INTFRCH_INTFRC49 (0x00020000)
  248. #define INTC_INTFRCH_INTFRC50 (0x00040000)
  249. #define INTC_INTFRCH_INTFRC51 (0x00080000)
  250. #define INTC_INTFRCH_INTFRC52 (0x00100000)
  251. #define INTC_INTFRCH_INTFRC53 (0x00200000)
  252. #define INTC_INTFRCH_INTFRC54 (0x00400000)
  253. #define INTC_INTFRCH_INTFRC55 (0x00800000)
  254. #define INTC_INTFRCH_INTFRC56 (0x01000000)
  255. #define INTC_INTFRCH_INTFRC57 (0x02000000)
  256. #define INTC_INTFRCH_INTFRC58 (0x04000000)
  257. #define INTC_INTFRCH_INTFRC59 (0x08000000)
  258. #define INTC_INTFRCH_INTFRC60 (0x10000000)
  259. #define INTC_INTFRCH_INTFRC61 (0x20000000)
  260. #define INTC_INTFRCH_INTFRC62 (0x40000000)
  261. #define INTC_INTFRCH_INTFRC63 (0x80000000)
  262. /* Bit definitions and macros for INTFRCL */
  263. #define INTC_INTFRCL_INTFRC0 (0x00000001)
  264. #define INTC_INTFRCL_INTFRC1 (0x00000002)
  265. #define INTC_INTFRCL_INTFRC2 (0x00000004)
  266. #define INTC_INTFRCL_INTFRC3 (0x00000008)
  267. #define INTC_INTFRCL_INTFRC4 (0x00000010)
  268. #define INTC_INTFRCL_INTFRC5 (0x00000020)
  269. #define INTC_INTFRCL_INTFRC6 (0x00000040)
  270. #define INTC_INTFRCL_INTFRC7 (0x00000080)
  271. #define INTC_INTFRCL_INTFRC8 (0x00000100)
  272. #define INTC_INTFRCL_INTFRC9 (0x00000200)
  273. #define INTC_INTFRCL_INTFRC10 (0x00000400)
  274. #define INTC_INTFRCL_INTFRC11 (0x00000800)
  275. #define INTC_INTFRCL_INTFRC12 (0x00001000)
  276. #define INTC_INTFRCL_INTFRC13 (0x00002000)
  277. #define INTC_INTFRCL_INTFRC14 (0x00004000)
  278. #define INTC_INTFRCL_INTFRC15 (0x00008000)
  279. #define INTC_INTFRCL_INTFRC16 (0x00010000)
  280. #define INTC_INTFRCL_INTFRC17 (0x00020000)
  281. #define INTC_INTFRCL_INTFRC18 (0x00040000)
  282. #define INTC_INTFRCL_INTFRC19 (0x00080000)
  283. #define INTC_INTFRCL_INTFRC20 (0x00100000)
  284. #define INTC_INTFRCL_INTFRC21 (0x00200000)
  285. #define INTC_INTFRCL_INTFRC22 (0x00400000)
  286. #define INTC_INTFRCL_INTFRC23 (0x00800000)
  287. #define INTC_INTFRCL_INTFRC24 (0x01000000)
  288. #define INTC_INTFRCL_INTFRC25 (0x02000000)
  289. #define INTC_INTFRCL_INTFRC26 (0x04000000)
  290. #define INTC_INTFRCL_INTFRC27 (0x08000000)
  291. #define INTC_INTFRCL_INTFRC28 (0x10000000)
  292. #define INTC_INTFRCL_INTFRC29 (0x20000000)
  293. #define INTC_INTFRCL_INTFRC30 (0x40000000)
  294. #define INTC_INTFRCL_INTFRC31 (0x80000000)
  295. /* Bit definitions and macros for ICONFIG */
  296. #define INTC_ICONFIG_EMASK (0x0020)
  297. #define INTC_ICONFIG_ELVLPRI1 (0x0200)
  298. #define INTC_ICONFIG_ELVLPRI2 (0x0400)
  299. #define INTC_ICONFIG_ELVLPRI3 (0x0800)
  300. #define INTC_ICONFIG_ELVLPRI4 (0x1000)
  301. #define INTC_ICONFIG_ELVLPRI5 (0x2000)
  302. #define INTC_ICONFIG_ELVLPRI6 (0x4000)
  303. #define INTC_ICONFIG_ELVLPRI7 (0x8000)
  304. /* Bit definitions and macros for SIMR */
  305. #define INTC_SIMR_SIMR(x) (((x)&0x7F))
  306. /* Bit definitions and macros for CIMR */
  307. #define INTC_CIMR_CIMR(x) (((x)&0x7F))
  308. /* Bit definitions and macros for CLMASK */
  309. #define INTC_CLMASK_CLMASK(x) (((x)&0x0F))
  310. /* Bit definitions and macros for SLMASK */
  311. #define INTC_SLMASK_SLMASK(x) (((x)&0x0F))
  312. /* Bit definitions and macros for ICR group */
  313. #define INTC_ICR_IL(x) (((x)&0x07))
  314. /*********************************************************************
  315. * Reset Controller Module (RCM)
  316. *********************************************************************/
  317. /* Bit definitions and macros for RCR */
  318. #define RCM_RCR_FRCRSTOUT (0x40)
  319. #define RCM_RCR_SOFTRST (0x80)
  320. /* Bit definitions and macros for RSR */
  321. #define RCM_RSR_LOL (0x01)
  322. #define RCM_RSR_WDR_CORE (0x02)
  323. #define RCM_RSR_EXT (0x04)
  324. #define RCM_RSR_POR (0x08)
  325. #define RCM_RSR_SOFT (0x20)
  326. /*********************************************************************
  327. * Chip Configuration Module (CCM)
  328. *********************************************************************/
  329. /* Bit definitions and macros for CCR */
  330. #define CCM_CCR_DRAMSEL (0x0100)
  331. #define CCM_CCR_CSC_MASK (0xFF3F)
  332. #define CCM_CCR_CSC_FBCS5_CS4 (0x00C0)
  333. #define CCM_CCR_CSC_FBCS5_A22 (0x0080)
  334. #define CCM_CCR_CSC_FB_A23_A22 (0x0040)
  335. #define CCM_CCR_LIMP (0x0020)
  336. #define CCM_CCR_LOAD (0x0010)
  337. #define CCM_CCR_BOOTPS_MASK (0xFFF3)
  338. #define CCM_CCR_BOOTPS_PS16 (0x0008)
  339. #define CCM_CCR_BOOTPS_PS8 (0x0004)
  340. #define CCM_CCR_BOOTPS_PS32 (0x0000)
  341. #define CCM_CCR_OSCMODE_OSCBYPASS (0x0002)
  342. /* Bit definitions and macros for RCON */
  343. #define CCM_RCON_CSC_MASK (0xFF3F)
  344. #define CCM_RCON_CSC_FBCS5_CS4 (0x00C0)
  345. #define CCM_RCON_CSC_FBCS5_A22 (0x0080)
  346. #define CCM_RCON_CSC_FB_A23_A22 (0x0040)
  347. #define CCM_RCON_LIMP (0x0020)
  348. #define CCM_RCON_LOAD (0x0010)
  349. #define CCM_RCON_BOOTPS_MASK (0xFFF3)
  350. #define CCM_RCON_BOOTPS_PS16 (0x0008)
  351. #define CCM_RCON_BOOTPS_PS8 (0x0004)
  352. #define CCM_RCON_BOOTPS_PS32 (0x0000)
  353. #define CCM_RCON_OSCMODE_OSCBYPASS (0x0002)
  354. /* Bit definitions and macros for CIR */
  355. #define CCM_CIR_PRN(x) (((x)&0x003F)) /* Part revision number */
  356. #define CCM_CIR_PIN(x) (((x)&0x03FF)<<6) /* Part identification number */
  357. #define CCM_CIR_PIN_MASK (0xFFC0)
  358. #define CCM_CIR_PRN_MASK (0x003F)
  359. #define CCM_CIR_PIN_MCF52277 (0x0000)
  360. /* Bit definitions and macros for MISCCR */
  361. #define CCM_MISCCR_RTCSRC (0x4000)
  362. #define CCM_MISCCR_USBPUE (0x2000) /* USB transceiver pull-up */
  363. #define CCM_MISCCR_LIMP (0x1000) /* Limp mode enable */
  364. #define CCM_MISCCR_BME (0x0800) /* Bus monitor ext en bit */
  365. #define CCM_MISCCR_BMT_65536 (0)
  366. #define CCM_MISCCR_BMT_32768 (1)
  367. #define CCM_MISCCR_BMT_16384 (2)
  368. #define CCM_MISCCR_BMT_8192 (3)
  369. #define CCM_MISCCR_BMT_4096 (4)
  370. #define CCM_MISCCR_BMT_2048 (5)
  371. #define CCM_MISCCR_BMT_1024 (6)
  372. #define CCM_MISCCR_BMT_512 (7)
  373. #define CCM_MISCCR_SSIPUE (0x0080) /* SSI RXD/TXD pull enable */
  374. #define CCM_MISCCR_SSIPUS (0x0040) /* SSI RXD/TXD pull select */
  375. #define CCM_MISCCR_TIMDMA (0x0020) /* Timer DMA mux selection */
  376. #define CCM_MISCCR_SSISRC (0x0010) /* SSI clock source */
  377. #define CCM_MISCCR_LCDCHEN (0x0004) /* LCD Int CLK en */
  378. #define CCM_MISCCR_USBOC (0x0002) /* USB VBUS over-current sense pol */
  379. #define CCM_MISCCR_USBSRC (0x0001) /* USB clock source */
  380. /* Bit definitions and macros for CDR */
  381. #define CCM_CDR_USBDIV(x) (((x)&0x0003)<<12)
  382. #define CCM_CDR_LPDIV(x) (((x)&0x000F)<<8) /* Low power clk div */
  383. #define CCM_CDR_SSIDIV(x) (((x)&0x00FF)) /* SSI oversampling clk div */
  384. /* Bit definitions and macros for UOCSR */
  385. #define CCM_UOCSR_DPPD (0x2000) /* D+ 15Kohm pull-down (rd-only) */
  386. #define CCM_UOCSR_DMPD (0x1000) /* D- 15Kohm pull-down (rd-only) */
  387. #define CCM_UOCSR_CRG_VBUS (0x0400) /* VBUS charge resistor enabled (rd-only) */
  388. #define CCM_UOCSR_DCR_VBUS (0x0200) /* VBUS discharge resistor en (rd-only) */
  389. #define CCM_UOCSR_DPPU (0x0100) /* D+ pull-up for FS enabled (rd-only) */
  390. #define CCM_UOCSR_AVLD (0x0080) /* A-peripheral valid indicator */
  391. #define CCM_UOCSR_BVLD (0x0040) /* B-peripheral valid indicator */
  392. #define CCM_UOCSR_VVLD (0x0020) /* VBUS valid indicator */
  393. #define CCM_UOCSR_SEND (0x0010) /* Session end */
  394. #define CCM_UOCSR_WKUP (0x0004) /* USB OTG controller wake-up event */
  395. #define CCM_UOCSR_UOMIE (0x0002) /* USB OTG misc interrupt en */
  396. #define CCM_UOCSR_XPDE (0x0001) /* On-chip transceiver pull-down en */
  397. /*********************************************************************
  398. * General Purpose I/O Module (GPIO)
  399. *********************************************************************/
  400. /* Bit definitions and macros for PAR_BE */
  401. #define GPIO_PAR_BE_MASK (0x0F)
  402. #define GPIO_PAR_BE_BE3_BE3 (0x08)
  403. #define GPIO_PAR_BE_BE3_GPIO (0x00)
  404. #define GPIO_PAR_BE_BE2_BE2 (0x04)
  405. #define GPIO_PAR_BE_BE2_GPIO (0x00)
  406. #define GPIO_PAR_BE_BE1_BE1 (0x02)
  407. #define GPIO_PAR_BE_BE1_GPIO (0x00)
  408. #define GPIO_PAR_BE_BE0_BE0 (0x01)
  409. #define GPIO_PAR_BE_BE0_GPIO (0x00)
  410. /* Bit definitions and macros for PAR_CS */
  411. #define GPIO_PAR_CS_CS3 (0x10)
  412. #define GPIO_PAR_CS_CS2 (0x08)
  413. #define GPIO_PAR_CS_CS1_FBCS1 (0x06)
  414. #define GPIO_PAR_CS_CS1_SDCS1 (0x04)
  415. #define GPIO_PAR_CS_CS1_GPIO (0x00)
  416. #define GPIO_PAR_CS_CS0 (0x01)
  417. /* Bit definitions and macros for PAR_FBCTL */
  418. #define GPIO_PAR_FBCTL_OE (0x80)
  419. #define GPIO_PAR_FBCTL_TA (0x40)
  420. #define GPIO_PAR_FBCTL_RW (0x20)
  421. #define GPIO_PAR_FBCTL_TS_MASK (0xE7)
  422. #define GPIO_PAR_FBCTL_TS_FBTS (0x18)
  423. #define GPIO_PAR_FBCTL_TS_DMAACK (0x10)
  424. #define GPIO_PAR_FBCTL_TS_GPIO (0x00)
  425. /* Bit definitions and macros for PAR_FECI2C */
  426. #define GPIO_PAR_I2C_SCL_MASK (0xF3)
  427. #define GPIO_PAR_I2C_SCL_SCL (0x0C)
  428. #define GPIO_PAR_I2C_SCL_CANTXD (0x08)
  429. #define GPIO_PAR_I2C_SCL_U2TXD (0x04)
  430. #define GPIO_PAR_I2C_SCL_GPIO (0x00)
  431. #define GPIO_PAR_I2C_SDA_MASK (0xFC)
  432. #define GPIO_PAR_I2C_SDA_SDA (0x03)
  433. #define GPIO_PAR_I2C_SDA_CANRXD (0x02)
  434. #define GPIO_PAR_I2C_SDA_U2RXD (0x01)
  435. #define GPIO_PAR_I2C_SDA_GPIO (0x00)
  436. /* Bit definitions and macros for PAR_UART */
  437. #define GPIO_PAR_UART_U1CTS_MASK (0x3FFF)
  438. #define GPIO_PAR_UART_U1CTS_U1CTS (0xC000)
  439. #define GPIO_PAR_UART_U1CTS_SSIBCLK (0x8000)
  440. #define GPIO_PAR_UART_U1CTS_LCDCLS (0x4000)
  441. #define GPIO_PAR_UART_U1CTS_GPIO (0x0000)
  442. #define GPIO_PAR_UART_U1RTS_MASK (0xCFFF)
  443. #define GPIO_PAR_UART_U1RTS_U1RTS (0x3000)
  444. #define GPIO_PAR_UART_U1RTS_SSIFS (0x2000)
  445. #define GPIO_PAR_UART_U1RTS_LCDPS (0x1000)
  446. #define GPIO_PAR_UART_U1RTS_GPIO (0x0000)
  447. #define GPIO_PAR_UART_U1RXD_MASK (0xF3FF)
  448. #define GPIO_PAR_UART_U1RXD_U1RXD (0x0C00)
  449. #define GPIO_PAR_UART_U1RXD_SSIRXD (0x0800)
  450. #define GPIO_PAR_UART_U1RXD_GPIO (0x0000)
  451. #define GPIO_PAR_UART_U1TXD_MASK (0xFCFF)
  452. #define GPIO_PAR_UART_U1TXD_U1TXD (0x0300)
  453. #define GPIO_PAR_UART_U1TXD_SSITXD (0x0200)
  454. #define GPIO_PAR_UART_U1TXD_GPIO (0x0000)
  455. #define GPIO_PAR_UART_U0CTS_MASK (0xFF3F)
  456. #define GPIO_PAR_UART_U0CTS_U0CTS (0x00C0)
  457. #define GPIO_PAR_UART_U0CTS_T1OUT (0x0080)
  458. #define GPIO_PAR_UART_U0CTS_USBVBUSEN (0x0040)
  459. #define GPIO_PAR_UART_U0CTS_GPIO (0x0000)
  460. #define GPIO_PAR_UART_U0RTS_MASK (0xFFCF)
  461. #define GPIO_PAR_UART_U0RTS_U0RTS (0x0030)
  462. #define GPIO_PAR_UART_U0RTS_T1IN (0x0020)
  463. #define GPIO_PAR_UART_U0RTS_USBVBUSOC (0x0010)
  464. #define GPIO_PAR_UART_U0RTS_GPIO (0x0000)
  465. #define GPIO_PAR_UART_U0RXD_MASK (0xFFF3)
  466. #define GPIO_PAR_UART_U0RXD_U0RXD (0x000C)
  467. #define GPIO_PAR_UART_U0RXD_CANRX (0x0008)
  468. #define GPIO_PAR_UART_U0RXD_GPIO (0x0000)
  469. #define GPIO_PAR_UART_U0TXD_MASK (0xFFFC)
  470. #define GPIO_PAR_UART_U0TXD_U0TXD (0x0003)
  471. #define GPIO_PAR_UART_U0TXD_CANTX (0x0002)
  472. #define GPIO_PAR_UART_U0TXD_GPIO (0x0000)
  473. /* Bit definitions and macros for PAR_DSPI */
  474. #define GPIO_PAR_DSPI_PCS0_MASK (0x3F)
  475. #define GPIO_PAR_DSPI_PCS0_PCS0 (0x80)
  476. #define GPIO_PAR_DSPI_PCS0_U2RTS (0x40)
  477. #define GPIO_PAR_DSPI_PCS0_GPIO (0x00)
  478. #define GPIO_PAR_DSPI_SIN_MASK (0xCF)
  479. #define GPIO_PAR_DSPI_SIN_SIN (0x30)
  480. #define GPIO_PAR_DSPI_SIN_U2RXD (0x20)
  481. #define GPIO_PAR_DSPI_SIN_GPIO (0x00)
  482. #define GPIO_PAR_DSPI_SOUT_MASK (0xF3)
  483. #define GPIO_PAR_DSPI_SOUT_SOUT (0x0C)
  484. #define GPIO_PAR_DSPI_SOUT_U2TXD (0x08)
  485. #define GPIO_PAR_DSPI_SOUT_GPIO (0x00)
  486. #define GPIO_PAR_DSPI_SCK_MASK (0xFC)
  487. #define GPIO_PAR_DSPI_SCK_SCK (0x03)
  488. #define GPIO_PAR_DSPI_SCK_U2CTS (0x02)
  489. #define GPIO_PAR_DSPI_SCK_GPIO (0x00)
  490. /* Bit definitions and macros for PAR_TIMER */
  491. #define GPIO_PAR_TIMER_T3IN_MASK (0x3F)
  492. #define GPIO_PAR_TIMER_T3IN_T3IN (0xC0)
  493. #define GPIO_PAR_TIMER_T3IN_T3OUT (0x80)
  494. #define GPIO_PAR_TIMER_T3IN_SSIMCLK (0x40)
  495. #define GPIO_PAR_TIMER_T3IN_GPIO (0x00)
  496. #define GPIO_PAR_TIMER_T2IN_MASK (0xCF)
  497. #define GPIO_PAR_TIMER_T2IN_T2IN (0x30)
  498. #define GPIO_PAR_TIMER_T2IN_T2OUT (0x20)
  499. #define GPIO_PAR_TIMER_T2IN_DSPIPCS2 (0x10)
  500. #define GPIO_PAR_TIMER_T2IN_GPIO (0x00)
  501. #define GPIO_PAR_TIMER_T1IN_MASK (0xF3)
  502. #define GPIO_PAR_TIMER_T1IN_T1IN (0x0C)
  503. #define GPIO_PAR_TIMER_T1IN_T1OUT (0x08)
  504. #define GPIO_PAR_TIMER_T1IN_LCDCONTRAST (0x04)
  505. #define GPIO_PAR_TIMER_T1IN_GPIO (0x00)
  506. #define GPIO_PAR_TIMER_T0IN_MASK (0xFC)
  507. #define GPIO_PAR_TIMER_T0IN_T0IN (0x03)
  508. #define GPIO_PAR_TIMER_T0IN_T0OUT (0x02)
  509. #define GPIO_PAR_TIMER_T0IN_LCDREV (0x01)
  510. #define GPIO_PAR_TIMER_T0IN_GPIO (0x00)
  511. /* Bit definitions and macros for GPIO_PAR_LCDCTL */
  512. #define GPIO_PAR_LCDCTL_ACDOE_MASK (0xE7)
  513. #define GPIO_PAR_LCDCTL_ACDOE_ACDOE (0x18)
  514. #define GPIO_PAR_LCDCTL_ACDOE_SPLSPR (0x10)
  515. #define GPIO_PAR_LCDCTL_ACDOE_GPIO (0x00)
  516. #define GPIO_PAR_LCDCTL_FLM_VSYNC (0x04)
  517. #define GPIO_PAR_LCDCTL_LP_HSYNC (0x02)
  518. #define GPIO_PAR_LCDCTL_LSCLK (0x01)
  519. /* Bit definitions and macros for PAR_IRQ */
  520. #define GPIO_PAR_IRQ_IRQ4_MASK (0xF3)
  521. #define GPIO_PAR_IRQ_IRQ4_SSIINPCLK (0x0C)
  522. #define GPIO_PAR_IRQ_IRQ4_DMAREQ0 (0x08)
  523. #define GPIO_PAR_IRQ_IRQ4_GPIO (0x00)
  524. #define GPIO_PAR_IRQ_IRQ1_MASK (0xFC)
  525. #define GPIO_PAR_IRQ_IRQ1_PCIINT (0x03)
  526. #define GPIO_PAR_IRQ_IRQ1_USBCLKIN (0x02)
  527. #define GPIO_PAR_IRQ_IRQ1_SSICLKIN (0x01)
  528. #define GPIO_PAR_IRQ_IRQ1_GPIO (0x00)
  529. /* Bit definitions and macros for GPIO_PAR_LCDH */
  530. #define GPIO_PAR_LCDH_LD17_MASK (0xFFFFF3FF)
  531. #define GPIO_PAR_LCDH_LD17_LD17 (0x00000C00)
  532. #define GPIO_PAR_LCDH_LD17_LD11 (0x00000800)
  533. #define GPIO_PAR_LCDH_LD17_GPIO (0x00000000)
  534. #define GPIO_PAR_LCDH_LD16_MASK (0xFFFFFCFF)
  535. #define GPIO_PAR_LCDH_LD16_LD16 (0x00000300)
  536. #define GPIO_PAR_LCDH_LD16_LD10 (0x00000200)
  537. #define GPIO_PAR_LCDH_LD16_GPIO (0x00000000)
  538. #define GPIO_PAR_LCDH_LD15_MASK (0xFFFFFF3F)
  539. #define GPIO_PAR_LCDH_LD15_LD15 (0x000000C0)
  540. #define GPIO_PAR_LCDH_LD15_LD9 (0x00000080)
  541. #define GPIO_PAR_LCDH_LD15_GPIO (0x00000000)
  542. #define GPIO_PAR_LCDH_LD14_MASK (0xFFFFFFCF)
  543. #define GPIO_PAR_LCDH_LD14_LD14 (0x00000030)
  544. #define GPIO_PAR_LCDH_LD14_LD8 (0x00000020)
  545. #define GPIO_PAR_LCDH_LD14_GPIO (0x00000000)
  546. #define GPIO_PAR_LCDH_LD13_MASK (0xFFFFFFF3)
  547. #define GPIO_PAR_LCDH_LD13_LD13 (0x0000000C)
  548. #define GPIO_PAR_LCDH_LD13_CANTX (0x00000008)
  549. #define GPIO_PAR_LCDH_LD13_GPIO (0x00000000)
  550. #define GPIO_PAR_LCDH_LD12_MASK (0xFFFFFFFC)
  551. #define GPIO_PAR_LCDH_LD12_LD12 (0x00000003)
  552. #define GPIO_PAR_LCDH_LD12_CANRX (0x00000002)
  553. #define GPIO_PAR_LCDH_LD12_GPIO (0x00000000)
  554. /* Bit definitions and macros for GPIO_PAR_LCDL */
  555. #define GPIO_PAR_LCDL_LD11_MASK (0x3FFFFFFF)
  556. #define GPIO_PAR_LCDL_LD11_LD11 (0xC0000000)
  557. #define GPIO_PAR_LCDL_LD11_LD7 (0x80000000)
  558. #define GPIO_PAR_LCDL_LD11_GPIO (0x00000000)
  559. #define GPIO_PAR_LCDL_LD10_MASK (0xCFFFFFFF)
  560. #define GPIO_PAR_LCDL_LD10_LD10 (0x30000000)
  561. #define GPIO_PAR_LCDL_LD10_LD6 (0x20000000)
  562. #define GPIO_PAR_LCDL_LD10_GPIO (0x00000000)
  563. #define GPIO_PAR_LCDL_LD9_MASK (0xF3FFFFFF)
  564. #define GPIO_PAR_LCDL_LD9_LD9 (0x0C000000)
  565. #define GPIO_PAR_LCDL_LD9_LD5 (0x08000000)
  566. #define GPIO_PAR_LCDL_LD9_GPIO (0x00000000)
  567. #define GPIO_PAR_LCDL_LD8_MASK (0xFCFFFFFF)
  568. #define GPIO_PAR_LCDL_LD8_LD8 (0x03000000)
  569. #define GPIO_PAR_LCDL_LD8_LD4 (0x02000000)
  570. #define GPIO_PAR_LCDL_LD8_GPIO (0x00000000)
  571. #define GPIO_PAR_LCDL_LD7_MASK (0xFF3FFFFF)
  572. #define GPIO_PAR_LCDL_LD7_LD7 (0x00C00000)
  573. #define GPIO_PAR_LCDL_LD7_PWM7 (0x00800000)
  574. #define GPIO_PAR_LCDL_LD7_GPIO (0x00000000)
  575. #define GPIO_PAR_LCDL_LD6_MASK (0xFFCFFFFF)
  576. #define GPIO_PAR_LCDL_LD6_LD6 (0x00300000)
  577. #define GPIO_PAR_LCDL_LD6_PWM5 (0x00200000)
  578. #define GPIO_PAR_LCDL_LD6_GPIO (0x00000000)
  579. #define GPIO_PAR_LCDL_LD5_MASK (0xFFF3FFFF)
  580. #define GPIO_PAR_LCDL_LD5_LD5 (0x000C0000)
  581. #define GPIO_PAR_LCDL_LD5_LD3 (0x00080000)
  582. #define GPIO_PAR_LCDL_LD5_GPIO (0x00000000)
  583. #define GPIO_PAR_LCDL_LD4_MASK (0xFFFCFFFF)
  584. #define GPIO_PAR_LCDL_LD4_LD4 (0x00030000)
  585. #define GPIO_PAR_LCDL_LD4_LD2 (0x00020000)
  586. #define GPIO_PAR_LCDL_LD4_GPIO (0x00000000)
  587. #define GPIO_PAR_LCDL_LD3_MASK (0xFFFF3FFF)
  588. #define GPIO_PAR_LCDL_LD3_LD3 (0x0000C000)
  589. #define GPIO_PAR_LCDL_LD3_LD1 (0x00008000)
  590. #define GPIO_PAR_LCDL_LD3_GPIO (0x00000000)
  591. #define GPIO_PAR_LCDL_LD2_MASK (0xFFFFCFFF)
  592. #define GPIO_PAR_LCDL_LD2_LD2 (0x00003000)
  593. #define GPIO_PAR_LCDL_LD2_LD0 (0x00002000)
  594. #define GPIO_PAR_LCDL_LD2_GPIO (0x00000000)
  595. #define GPIO_PAR_LCDL_LD1_MASK (0xFFFFF3FF)
  596. #define GPIO_PAR_LCDL_LD1_LD1 (0x00000C00)
  597. #define GPIO_PAR_LCDL_LD1_PWM3 (0x00000800)
  598. #define GPIO_PAR_LCDL_LD1_GPIO (0x00000000)
  599. #define GPIO_PAR_LCDL_LD0_MASK (0xFFFFFCFF)
  600. #define GPIO_PAR_LCDL_LD0_LD0 (0x00000300)
  601. #define GPIO_PAR_LCDL_LD0_PWM1 (0x00000200)
  602. #define GPIO_PAR_LCDL_LD0_GPIO (0x00000000)
  603. /* Bit definitions and macros for MSCR_FB */
  604. #define GPIO_MSCR_FB_DUPPER_MASK (0xCF)
  605. #define GPIO_MSCR_FB_DUPPER_25V_33V (0x30)
  606. #define GPIO_MSCR_FB_DUPPER_FULL_18V (0x20)
  607. #define GPIO_MSCR_FB_DUPPER_OD (0x10)
  608. #define GPIO_MSCR_FB_DUPPER_HALF_18V (0x00)
  609. #define GPIO_MSCR_FB_DLOWER_MASK (0xF3)
  610. #define GPIO_MSCR_FB_DLOWER_25V_33V (0x0C)
  611. #define GPIO_MSCR_FB_DLOWER_FULL_18V (0x08)
  612. #define GPIO_MSCR_FB_DLOWER_OD (0x04)
  613. #define GPIO_MSCR_FB_DLOWER_HALF_18V (0x00)
  614. #define GPIO_MSCR_FB_ADDRCTL_MASK (0xFC)
  615. #define GPIO_MSCR_FB_ADDRCTL_25V_33V (0x03)
  616. #define GPIO_MSCR_FB_ADDRCTL_FULL_18V (0x02)
  617. #define GPIO_MSCR_FB_ADDRCTL_OD (0x01)
  618. #define GPIO_MSCR_FB_ADDRCTL_HALF_18V (0x00)
  619. /* Bit definitions and macros for MSCR_SDRAM */
  620. #define GPIO_MSCR_SDRAM_SDCLKB_MASK (0xCF)
  621. #define GPIO_MSCR_SDRAM_SDCLKB_25V_33V (0x30)
  622. #define GPIO_MSCR_SDRAM_SDCLKB_FULL_18V (0x20)
  623. #define GPIO_MSCR_SDRAM_SDCLKB_OD (0x10)
  624. #define GPIO_MSCR_SDRAM_SDCLKB_HALF_18V (0x00)
  625. #define GPIO_MSCR_SDRAM_SDCLK_MASK (0xF3)
  626. #define GPIO_MSCR_SDRAM_SDCLK_25V_33V (0x0C)
  627. #define GPIO_MSCR_SDRAM_SDCLK_FULL_18V (0x08)
  628. #define GPIO_MSCR_SDRAM_SDCLK_OPD (0x04)
  629. #define GPIO_MSCR_SDRAM_SDCLK_HALF_18V (0x00)
  630. #define GPIO_MSCR_SDRAM_SDCTL_MASK (0xFC)
  631. #define GPIO_MSCR_SDRAM_SDCTL_25V_33V (0x03)
  632. #define GPIO_MSCR_SDRAM_SDCTL_FULL_18V (0x02)
  633. #define GPIO_MSCR_SDRAM_SDCTL_OPD (0x01)
  634. #define GPIO_MSCR_SDRAM_SDCTL_HALF_18V (0x00)
  635. /* Bit definitions and macros for Drive Strength Control */
  636. #define DSCR_LOAD_50PF (0x03)
  637. #define DSCR_LOAD_30PF (0x02)
  638. #define DSCR_LOAD_20PF (0x01)
  639. #define DSCR_LOAD_10PF (0x00)
  640. /*********************************************************************
  641. * SDRAM Controller (SDRAMC)
  642. *********************************************************************/
  643. /* Bit definitions and macros for SDMR */
  644. #define SDRAMC_SDMR_DDR2_AD(x) (((x)&0x00003FFF)) /* Address for DDR2 */
  645. #define SDRAMC_SDMR_CMD (0x00010000) /* Command */
  646. #define SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18) /* Address */
  647. #define SDRAMC_SDMR_BK(x) (((x)&0x00000003)<<30) /* Bank Address */
  648. #define SDRAMC_SDMR_BK_LMR (0x00000000)
  649. #define SDRAMC_SDMR_BK_LEMR (0x40000000)
  650. /* Bit definitions and macros for SDCR */
  651. #define SDRAMC_SDCR_DPD (0x00000001) /* Deep Power-Down Mode */
  652. #define SDRAMC_SDCR_IPALL (0x00000002) /* Initiate Precharge All */
  653. #define SDRAMC_SDCR_IREF (0x00000004) /* Initiate Refresh */
  654. #define SDRAMC_SDCR_DQS_OE(x) (((x)&0x00000003)<<10) /* DQS Output Enable */
  655. #define SDRAMC_SDCR_MEM_PS (0x00002000) /* Data Port Size */
  656. #define SDRAMC_SDCR_REF_CNT(x) (((x)&0x0000003F)<<16) /* Periodic Refresh Counter */
  657. #define SDRAMC_SDCR_OE_RULE (0x00400000) /* Drive Rule Selection */
  658. #define SDRAMC_SDCR_ADDR_MUX(x) (((x)&0x00000003)<<24) /* Internal Address Mux Select */
  659. #define SDRAMC_SDCR_DDR2_MODE (0x08000000) /* DDR2 Mode Select */
  660. #define SDRAMC_SDCR_REF_EN (0x10000000) /* Refresh Enable */
  661. #define SDRAMC_SDCR_DDR_MODE (0x20000000) /* DDR Mode Select */
  662. #define SDRAMC_SDCR_CKE (0x40000000) /* Clock Enable */
  663. #define SDRAMC_SDCR_MODE_EN (0x80000000) /* SDRAM Mode Register Programming Enable */
  664. #define SDRAMC_SDCR_DQS_OE_BOTH (0x00000C000)
  665. /* Bit definitions and macros for SDCFG1 */
  666. #define SDRAMC_SDCFG1_WT_LAT(x) (((x)&0x00000007)<<4) /* Write Latency */
  667. #define SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8) /* Refresh to active delay */
  668. #define SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12) /* Precharge to active delay */
  669. #define SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16) /* Active to read/write delay */
  670. #define SDRAMC_SDCFG1_RD_LAT(x) (((x)&0x0000000F)<<20) /* Read CAS Latency */
  671. #define SDRAMC_SDCFG1_SWT2RWP(x) (((x)&0x00000007)<<24) /* Single write to read/write/precharge delay */
  672. #define SDRAMC_SDCFG1_SRD2RWP(x) (((x)&0x0000000F)<<28) /* Single read to read/write/precharge delay */
  673. /* Bit definitions and macros for SDCFG2 */
  674. #define SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16) /* Burst Length */
  675. #define SDRAMC_SDCFG2_BRD2W(x) (((x)&0x0000000F)<<20) /* Burst read to write delay */
  676. #define SDRAMC_SDCFG2_BWT2RWP(x) (((x)&0x0000000F)<<24) /* Burst write to read/write/precharge delay */
  677. #define SDRAMC_SDCFG2_BRD2RP(x) (((x)&0x0000000F)<<28) /* Burst read to read/precharge delay */
  678. /* Bit definitions and macros for SDCS group */
  679. #define SDRAMC_SDCS_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
  680. #define SDRAMC_SDCS_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
  681. #define SDRAMC_SDCS_BA(x) ((x)&0xFFF00000)
  682. #define SDRAMC_SDCS_CSSZ_DISABLE (0x00000000)
  683. #define SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
  684. #define SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
  685. #define SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
  686. #define SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
  687. #define SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
  688. #define SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
  689. #define SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
  690. #define SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
  691. #define SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
  692. #define SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
  693. #define SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
  694. #define SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
  695. #define SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
  696. /*********************************************************************
  697. * Phase Locked Loop (PLL)
  698. *********************************************************************/
  699. /* Bit definitions and macros for PCR */
  700. #define PLL_PCR_OUTDIV1(x) (((x)&0x0000000F)) /* Output divider for CPU clock frequency */
  701. #define PLL_PCR_OUTDIV2(x) (((x)&0x0000000F)<<4) /* Output divider for bus/flexbus clock frequency */
  702. #define PLL_PCR_OUTDIV3(x) (((x)&0x0000000F)<<8) /* Output divider for SDRAM clock frequency */
  703. #define PLL_PCR_OUTDIV5(x) (((x)&0x0000000F)<<16) /* Output divider for USB clock frequency */
  704. #define PLL_PCR_PFDR(x) (((x)&0x000000FF)<<24) /* Feedback divider for VCO frequency */
  705. #define PLL_PCR_PFDR_MASK (0x000F0000)
  706. #define PLL_PCR_OUTDIV5_MASK (0x000F0000)
  707. #define PLL_PCR_OUTDIV3_MASK (0x00000F00)
  708. #define PLL_PCR_OUTDIV2_MASK (0x000000F0)
  709. #define PLL_PCR_OUTDIV1_MASK (0x0000000F)
  710. /* Bit definitions and macros for PSR */
  711. #define PLL_PSR_LOCKS (0x00000001) /* PLL lost lock - sticky */
  712. #define PLL_PSR_LOCK (0x00000002) /* PLL lock status */
  713. #define PLL_PSR_LOLIRQ (0x00000004) /* PLL loss-of-lock interrupt enable */
  714. #define PLL_PSR_LOLRE (0x00000008) /* PLL loss-of-lock reset enable */
  715. /********************************************************************/
  716. #endif /* __MCF5227X__ */