m5227x.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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. /* Interrupt Controller (INTC) */
  28. #define INT0_LO_RSVD0 (0)
  29. #define INT0_LO_EPORT1 (1)
  30. #define INT0_LO_EPORT4 (4)
  31. #define INT0_LO_EPORT7 (7)
  32. #define INT0_LO_EDMA_00 (8)
  33. #define INT0_LO_EDMA_01 (9)
  34. #define INT0_LO_EDMA_02 (10)
  35. #define INT0_LO_EDMA_03 (11)
  36. #define INT0_LO_EDMA_04 (12)
  37. #define INT0_LO_EDMA_05 (13)
  38. #define INT0_LO_EDMA_06 (14)
  39. #define INT0_LO_EDMA_07 (15)
  40. #define INT0_LO_EDMA_08 (16)
  41. #define INT0_LO_EDMA_09 (17)
  42. #define INT0_LO_EDMA_10 (18)
  43. #define INT0_LO_EDMA_11 (19)
  44. #define INT0_LO_EDMA_12 (20)
  45. #define INT0_LO_EDMA_13 (21)
  46. #define INT0_LO_EDMA_14 (22)
  47. #define INT0_LO_EDMA_15 (23)
  48. #define INT0_LO_EDMA_ERR (24)
  49. #define INT0_LO_SCM_CWIC (25)
  50. #define INT0_LO_UART0 (26)
  51. #define INT0_LO_UART1 (27)
  52. #define INT0_LO_UART2 (28)
  53. #define INT0_LO_I2C (30)
  54. #define INT0_LO_DSPI (31)
  55. #define INT0_HI_DTMR0 (32)
  56. #define INT0_HI_DTMR1 (33)
  57. #define INT0_HI_DTMR2 (34)
  58. #define INT0_HI_DTMR3 (35)
  59. #define INT0_HI_SCMIR (62)
  60. #define INT0_HI_RTC_ISR (63)
  61. #define INT1_HI_CAN_BOFFINT (1)
  62. #define INT1_HI_CAN_ERRINT (3)
  63. #define INT1_HI_CAN_BUF0I (4)
  64. #define INT1_HI_CAN_BUF1I (5)
  65. #define INT1_HI_CAN_BUF2I (6)
  66. #define INT1_HI_CAN_BUF3I (7)
  67. #define INT1_HI_CAN_BUF4I (8)
  68. #define INT1_HI_CAN_BUF5I (9)
  69. #define INT1_HI_CAN_BUF6I (10)
  70. #define INT1_HI_CAN_BUF7I (11)
  71. #define INT1_HI_CAN_BUF8I (12)
  72. #define INT1_HI_CAN_BUF9I (13)
  73. #define INT1_HI_CAN_BUF10I (14)
  74. #define INT1_HI_CAN_BUF11I (15)
  75. #define INT1_HI_CAN_BUF12I (16)
  76. #define INT1_HI_CAN_BUF13I (17)
  77. #define INT1_HI_CAN_BUF14I (18)
  78. #define INT1_HI_CAN_BUF15I (19)
  79. #define INT1_HI_PIT0_PIF (43)
  80. #define INT1_HI_PIT1_PIF (44)
  81. #define INT1_HI_USBOTG_STS (47)
  82. #define INT1_HI_SSI_ISR (49)
  83. #define INT1_HI_PWM_INT (50)
  84. #define INT1_HI_LCDC_ISR (51)
  85. #define INT1_HI_CCM_UOCSR (53)
  86. #define INT1_HI_DSPI_EOQF (54)
  87. #define INT1_HI_DSPI_TFFF (55)
  88. #define INT1_HI_DSPI_TCF (56)
  89. #define INT1_HI_DSPI_TFUF (57)
  90. #define INT1_HI_DSPI_RFDF (58)
  91. #define INT1_HI_DSPI_RFOF (59)
  92. #define INT1_HI_DSPI_RFOF_TFUF (60)
  93. #define INT1_HI_TOUCH_ADC (61)
  94. #define INT1_HI_PLL_LOCKS (62)
  95. /*********************************************************************
  96. * Reset Controller Module (RCM)
  97. *********************************************************************/
  98. /* Bit definitions and macros for RCR */
  99. #define RCM_RCR_FRCRSTOUT (0x40)
  100. #define RCM_RCR_SOFTRST (0x80)
  101. /* Bit definitions and macros for RSR */
  102. #define RCM_RSR_LOL (0x01)
  103. #define RCM_RSR_WDR_CORE (0x02)
  104. #define RCM_RSR_EXT (0x04)
  105. #define RCM_RSR_POR (0x08)
  106. #define RCM_RSR_SOFT (0x20)
  107. /*********************************************************************
  108. * Chip Configuration Module (CCM)
  109. *********************************************************************/
  110. /* Bit definitions and macros for CCR */
  111. #define CCM_CCR_DRAMSEL (0x0100)
  112. #define CCM_CCR_CSC_UNMASK (0xFF3F)
  113. #define CCM_CCR_CSC_FBCS5_CS4 (0x00C0)
  114. #define CCM_CCR_CSC_FBCS5_A22 (0x0080)
  115. #define CCM_CCR_CSC_FB_A23_A22 (0x0040)
  116. #define CCM_CCR_LIMP (0x0020)
  117. #define CCM_CCR_LOAD (0x0010)
  118. #define CCM_CCR_BOOTPS_UNMASK (0xFFF3)
  119. #define CCM_CCR_BOOTPS_PS16 (0x0008)
  120. #define CCM_CCR_BOOTPS_PS8 (0x0004)
  121. #define CCM_CCR_BOOTPS_PS32 (0x0000)
  122. #define CCM_CCR_OSCMODE_OSCBYPASS (0x0002)
  123. /* Bit definitions and macros for RCON */
  124. #define CCM_RCON_CSC_UNMASK (0xFF3F)
  125. #define CCM_RCON_CSC_FBCS5_CS4 (0x00C0)
  126. #define CCM_RCON_CSC_FBCS5_A22 (0x0080)
  127. #define CCM_RCON_CSC_FB_A23_A22 (0x0040)
  128. #define CCM_RCON_LIMP (0x0020)
  129. #define CCM_RCON_LOAD (0x0010)
  130. #define CCM_RCON_BOOTPS_UNMASK (0xFFF3)
  131. #define CCM_RCON_BOOTPS_PS16 (0x0008)
  132. #define CCM_RCON_BOOTPS_PS8 (0x0004)
  133. #define CCM_RCON_BOOTPS_PS32 (0x0000)
  134. #define CCM_RCON_OSCMODE_OSCBYPASS (0x0002)
  135. /* Bit definitions and macros for CIR */
  136. #define CCM_CIR_PIN(x) (((x) & 0xFFC0) >> 6)
  137. #define CCM_CIR_PRN(x) ((x) & 0x003F)
  138. #define CCM_CIR_PIN_MCF52277 (0x0000)
  139. /* Bit definitions and macros for MISCCR */
  140. #define CCM_MISCCR_RTCSRC (0x4000)
  141. #define CCM_MISCCR_USBPUE (0x2000) /* USB transceiver pull-up */
  142. #define CCM_MISCCR_LIMP (0x1000) /* Limp mode enable */
  143. #define CCM_MISCCR_BME (0x0800) /* Bus monitor ext en bit */
  144. #define CCM_MISCCR_BMT_65536 (0)
  145. #define CCM_MISCCR_BMT_32768 (1)
  146. #define CCM_MISCCR_BMT_16384 (2)
  147. #define CCM_MISCCR_BMT_8192 (3)
  148. #define CCM_MISCCR_BMT_4096 (4)
  149. #define CCM_MISCCR_BMT_2048 (5)
  150. #define CCM_MISCCR_BMT_1024 (6)
  151. #define CCM_MISCCR_BMT_512 (7)
  152. #define CCM_MISCCR_SSIPUE (0x0080) /* SSI RXD/TXD pull enable */
  153. #define CCM_MISCCR_SSIPUS (0x0040) /* SSI RXD/TXD pull select */
  154. #define CCM_MISCCR_TIMDMA (0x0020) /* Timer DMA mux selection */
  155. #define CCM_MISCCR_SSISRC (0x0010) /* SSI clock source */
  156. #define CCM_MISCCR_LCDCHEN (0x0004) /* LCD Int CLK en */
  157. #define CCM_MISCCR_USBOC (0x0002) /* USB VBUS over-current sense pol */
  158. #define CCM_MISCCR_USBSRC (0x0001) /* USB clock source */
  159. /* Bit definitions and macros for CDR */
  160. #define CCM_CDR_USBDIV(x) (((x)&0x0003)<<12)
  161. #define CCM_CDR_LPDIV(x) (((x)&0x000F)<<8) /* Low power clk div */
  162. #define CCM_CDR_SSIDIV(x) (((x)&0x00FF)) /* SSI oversampling clk div */
  163. /* Bit definitions and macros for UOCSR */
  164. #define CCM_UOCSR_DPPD (0x2000) /* D+ 15Kohm pull-down (rd-only) */
  165. #define CCM_UOCSR_DMPD (0x1000) /* D- 15Kohm pull-down (rd-only) */
  166. #define CCM_UOCSR_CRG_VBUS (0x0400) /* VBUS charge resistor enabled (rd-only) */
  167. #define CCM_UOCSR_DCR_VBUS (0x0200) /* VBUS discharge resistor en (rd-only) */
  168. #define CCM_UOCSR_DPPU (0x0100) /* D+ pull-up for FS enabled (rd-only) */
  169. #define CCM_UOCSR_AVLD (0x0080) /* A-peripheral valid indicator */
  170. #define CCM_UOCSR_BVLD (0x0040) /* B-peripheral valid indicator */
  171. #define CCM_UOCSR_VVLD (0x0020) /* VBUS valid indicator */
  172. #define CCM_UOCSR_SEND (0x0010) /* Session end */
  173. #define CCM_UOCSR_WKUP (0x0004) /* USB OTG controller wake-up event */
  174. #define CCM_UOCSR_UOMIE (0x0002) /* USB OTG misc interrupt en */
  175. #define CCM_UOCSR_XPDE (0x0001) /* On-chip transceiver pull-down en */
  176. /*********************************************************************
  177. * General Purpose I/O Module (GPIO)
  178. *********************************************************************/
  179. /* Bit definitions and macros for PAR_BE */
  180. #define GPIO_PAR_BE_UNMASK (0x0F)
  181. #define GPIO_PAR_BE_BE3_BE3 (0x08)
  182. #define GPIO_PAR_BE_BE3_GPIO (0x00)
  183. #define GPIO_PAR_BE_BE2_BE2 (0x04)
  184. #define GPIO_PAR_BE_BE2_GPIO (0x00)
  185. #define GPIO_PAR_BE_BE1_BE1 (0x02)
  186. #define GPIO_PAR_BE_BE1_GPIO (0x00)
  187. #define GPIO_PAR_BE_BE0_BE0 (0x01)
  188. #define GPIO_PAR_BE_BE0_GPIO (0x00)
  189. /* Bit definitions and macros for PAR_CS */
  190. #define GPIO_PAR_CS_CS3 (0x10)
  191. #define GPIO_PAR_CS_CS2 (0x08)
  192. #define GPIO_PAR_CS_CS1_FBCS1 (0x06)
  193. #define GPIO_PAR_CS_CS1_SDCS1 (0x04)
  194. #define GPIO_PAR_CS_CS1_GPIO (0x00)
  195. #define GPIO_PAR_CS_CS0 (0x01)
  196. /* Bit definitions and macros for PAR_FBCTL */
  197. #define GPIO_PAR_FBCTL_OE (0x80)
  198. #define GPIO_PAR_FBCTL_TA (0x40)
  199. #define GPIO_PAR_FBCTL_RW (0x20)
  200. #define GPIO_PAR_FBCTL_TS_UNMASK (0xE7)
  201. #define GPIO_PAR_FBCTL_TS_FBTS (0x18)
  202. #define GPIO_PAR_FBCTL_TS_DMAACK (0x10)
  203. #define GPIO_PAR_FBCTL_TS_GPIO (0x00)
  204. /* Bit definitions and macros for PAR_FECI2C */
  205. #define GPIO_PAR_I2C_SCL_UNMASK (0xF3)
  206. #define GPIO_PAR_I2C_SCL_SCL (0x0C)
  207. #define GPIO_PAR_I2C_SCL_CANTXD (0x08)
  208. #define GPIO_PAR_I2C_SCL_U2TXD (0x04)
  209. #define GPIO_PAR_I2C_SCL_GPIO (0x00)
  210. #define GPIO_PAR_I2C_SDA_UNMASK (0xFC)
  211. #define GPIO_PAR_I2C_SDA_SDA (0x03)
  212. #define GPIO_PAR_I2C_SDA_CANRXD (0x02)
  213. #define GPIO_PAR_I2C_SDA_U2RXD (0x01)
  214. #define GPIO_PAR_I2C_SDA_GPIO (0x00)
  215. /* Bit definitions and macros for PAR_UART */
  216. #define GPIO_PAR_UART_U1CTS_UNMASK (0x3FFF)
  217. #define GPIO_PAR_UART_U1CTS_U1CTS (0xC000)
  218. #define GPIO_PAR_UART_U1CTS_SSIBCLK (0x8000)
  219. #define GPIO_PAR_UART_U1CTS_LCDCLS (0x4000)
  220. #define GPIO_PAR_UART_U1CTS_GPIO (0x0000)
  221. #define GPIO_PAR_UART_U1RTS_UNMASK (0xCFFF)
  222. #define GPIO_PAR_UART_U1RTS_U1RTS (0x3000)
  223. #define GPIO_PAR_UART_U1RTS_SSIFS (0x2000)
  224. #define GPIO_PAR_UART_U1RTS_LCDPS (0x1000)
  225. #define GPIO_PAR_UART_U1RTS_GPIO (0x0000)
  226. #define GPIO_PAR_UART_U1RXD_UNMASK (0xF3FF)
  227. #define GPIO_PAR_UART_U1RXD_U1RXD (0x0C00)
  228. #define GPIO_PAR_UART_U1RXD_SSIRXD (0x0800)
  229. #define GPIO_PAR_UART_U1RXD_GPIO (0x0000)
  230. #define GPIO_PAR_UART_U1TXD_UNMASK (0xFCFF)
  231. #define GPIO_PAR_UART_U1TXD_U1TXD (0x0300)
  232. #define GPIO_PAR_UART_U1TXD_SSITXD (0x0200)
  233. #define GPIO_PAR_UART_U1TXD_GPIO (0x0000)
  234. #define GPIO_PAR_UART_U0CTS_UNMASK (0xFF3F)
  235. #define GPIO_PAR_UART_U0CTS_U0CTS (0x00C0)
  236. #define GPIO_PAR_UART_U0CTS_T1OUT (0x0080)
  237. #define GPIO_PAR_UART_U0CTS_USBVBUSEN (0x0040)
  238. #define GPIO_PAR_UART_U0CTS_GPIO (0x0000)
  239. #define GPIO_PAR_UART_U0RTS_UNMASK (0xFFCF)
  240. #define GPIO_PAR_UART_U0RTS_U0RTS (0x0030)
  241. #define GPIO_PAR_UART_U0RTS_T1IN (0x0020)
  242. #define GPIO_PAR_UART_U0RTS_USBVBUSOC (0x0010)
  243. #define GPIO_PAR_UART_U0RTS_GPIO (0x0000)
  244. #define GPIO_PAR_UART_U0RXD_UNMASK (0xFFF3)
  245. #define GPIO_PAR_UART_U0RXD_U0RXD (0x000C)
  246. #define GPIO_PAR_UART_U0RXD_CANRX (0x0008)
  247. #define GPIO_PAR_UART_U0RXD_GPIO (0x0000)
  248. #define GPIO_PAR_UART_U0TXD_UNMASK (0xFFFC)
  249. #define GPIO_PAR_UART_U0TXD_U0TXD (0x0003)
  250. #define GPIO_PAR_UART_U0TXD_CANTX (0x0002)
  251. #define GPIO_PAR_UART_U0TXD_GPIO (0x0000)
  252. /* Bit definitions and macros for PAR_DSPI */
  253. #define GPIO_PAR_DSPI_PCS0_UNMASK (0x3F)
  254. #define GPIO_PAR_DSPI_PCS0_PCS0 (0xC0)
  255. #define GPIO_PAR_DSPI_PCS0_U2RTS (0x80)
  256. #define GPIO_PAR_DSPI_PCS0_GPIO (0x00)
  257. #define GPIO_PAR_DSPI_SIN_UNMASK (0xCF)
  258. #define GPIO_PAR_DSPI_SIN_SIN (0x30)
  259. #define GPIO_PAR_DSPI_SIN_U2RXD (0x20)
  260. #define GPIO_PAR_DSPI_SIN_GPIO (0x00)
  261. #define GPIO_PAR_DSPI_SOUT_UNMASK (0xF3)
  262. #define GPIO_PAR_DSPI_SOUT_SOUT (0x0C)
  263. #define GPIO_PAR_DSPI_SOUT_U2TXD (0x08)
  264. #define GPIO_PAR_DSPI_SOUT_GPIO (0x00)
  265. #define GPIO_PAR_DSPI_SCK_UNMASK (0xFC)
  266. #define GPIO_PAR_DSPI_SCK_SCK (0x03)
  267. #define GPIO_PAR_DSPI_SCK_U2CTS (0x02)
  268. #define GPIO_PAR_DSPI_SCK_GPIO (0x00)
  269. /* Bit definitions and macros for PAR_TIMER */
  270. #define GPIO_PAR_TIMER_T3IN_UNMASK (0x3F)
  271. #define GPIO_PAR_TIMER_T3IN_T3IN (0xC0)
  272. #define GPIO_PAR_TIMER_T3IN_T3OUT (0x80)
  273. #define GPIO_PAR_TIMER_T3IN_SSIMCLK (0x40)
  274. #define GPIO_PAR_TIMER_T3IN_GPIO (0x00)
  275. #define GPIO_PAR_TIMER_T2IN_UNMASK (0xCF)
  276. #define GPIO_PAR_TIMER_T2IN_T2IN (0x30)
  277. #define GPIO_PAR_TIMER_T2IN_T2OUT (0x20)
  278. #define GPIO_PAR_TIMER_T2IN_DSPIPCS2 (0x10)
  279. #define GPIO_PAR_TIMER_T2IN_GPIO (0x00)
  280. #define GPIO_PAR_TIMER_T1IN_UNMASK (0xF3)
  281. #define GPIO_PAR_TIMER_T1IN_T1IN (0x0C)
  282. #define GPIO_PAR_TIMER_T1IN_T1OUT (0x08)
  283. #define GPIO_PAR_TIMER_T1IN_LCDCONTRAST (0x04)
  284. #define GPIO_PAR_TIMER_T1IN_GPIO (0x00)
  285. #define GPIO_PAR_TIMER_T0IN_UNMASK (0xFC)
  286. #define GPIO_PAR_TIMER_T0IN_T0IN (0x03)
  287. #define GPIO_PAR_TIMER_T0IN_T0OUT (0x02)
  288. #define GPIO_PAR_TIMER_T0IN_LCDREV (0x01)
  289. #define GPIO_PAR_TIMER_T0IN_GPIO (0x00)
  290. /* Bit definitions and macros for GPIO_PAR_LCDCTL */
  291. #define GPIO_PAR_LCDCTL_ACDOE_UNMASK (0xE7)
  292. #define GPIO_PAR_LCDCTL_ACDOE_ACDOE (0x18)
  293. #define GPIO_PAR_LCDCTL_ACDOE_SPLSPR (0x10)
  294. #define GPIO_PAR_LCDCTL_ACDOE_GPIO (0x00)
  295. #define GPIO_PAR_LCDCTL_FLM_VSYNC (0x04)
  296. #define GPIO_PAR_LCDCTL_LP_HSYNC (0x02)
  297. #define GPIO_PAR_LCDCTL_LSCLK (0x01)
  298. /* Bit definitions and macros for PAR_IRQ */
  299. #define GPIO_PAR_IRQ_IRQ4_UNMASK (0xF3)
  300. #define GPIO_PAR_IRQ_IRQ4_SSIINPCLK (0x0C)
  301. #define GPIO_PAR_IRQ_IRQ4_DMAREQ0 (0x08)
  302. #define GPIO_PAR_IRQ_IRQ4_GPIO (0x00)
  303. #define GPIO_PAR_IRQ_IRQ1_UNMASK (0xFC)
  304. #define GPIO_PAR_IRQ_IRQ1_PCIINT (0x03)
  305. #define GPIO_PAR_IRQ_IRQ1_USBCLKIN (0x02)
  306. #define GPIO_PAR_IRQ_IRQ1_SSICLKIN (0x01)
  307. #define GPIO_PAR_IRQ_IRQ1_GPIO (0x00)
  308. /* Bit definitions and macros for GPIO_PAR_LCDH */
  309. #define GPIO_PAR_LCDH_LD17_UNMASK (0xFFFFF3FF)
  310. #define GPIO_PAR_LCDH_LD17_LD17 (0x00000C00)
  311. #define GPIO_PAR_LCDH_LD17_LD11 (0x00000800)
  312. #define GPIO_PAR_LCDH_LD17_GPIO (0x00000000)
  313. #define GPIO_PAR_LCDH_LD16_UNMASK (0xFFFFFCFF)
  314. #define GPIO_PAR_LCDH_LD16_LD16 (0x00000300)
  315. #define GPIO_PAR_LCDH_LD16_LD10 (0x00000200)
  316. #define GPIO_PAR_LCDH_LD16_GPIO (0x00000000)
  317. #define GPIO_PAR_LCDH_LD15_UNMASK (0xFFFFFF3F)
  318. #define GPIO_PAR_LCDH_LD15_LD15 (0x000000C0)
  319. #define GPIO_PAR_LCDH_LD15_LD9 (0x00000080)
  320. #define GPIO_PAR_LCDH_LD15_GPIO (0x00000000)
  321. #define GPIO_PAR_LCDH_LD14_UNMASK (0xFFFFFFCF)
  322. #define GPIO_PAR_LCDH_LD14_LD14 (0x00000030)
  323. #define GPIO_PAR_LCDH_LD14_LD8 (0x00000020)
  324. #define GPIO_PAR_LCDH_LD14_GPIO (0x00000000)
  325. #define GPIO_PAR_LCDH_LD13_UNMASK (0xFFFFFFF3)
  326. #define GPIO_PAR_LCDH_LD13_LD13 (0x0000000C)
  327. #define GPIO_PAR_LCDH_LD13_CANTX (0x00000008)
  328. #define GPIO_PAR_LCDH_LD13_GPIO (0x00000000)
  329. #define GPIO_PAR_LCDH_LD12_UNMASK (0xFFFFFFFC)
  330. #define GPIO_PAR_LCDH_LD12_LD12 (0x00000003)
  331. #define GPIO_PAR_LCDH_LD12_CANRX (0x00000002)
  332. #define GPIO_PAR_LCDH_LD12_GPIO (0x00000000)
  333. /* Bit definitions and macros for GPIO_PAR_LCDL */
  334. #define GPIO_PAR_LCDL_LD11_UNMASK (0x3FFFFFFF)
  335. #define GPIO_PAR_LCDL_LD11_LD11 (0xC0000000)
  336. #define GPIO_PAR_LCDL_LD11_LD7 (0x80000000)
  337. #define GPIO_PAR_LCDL_LD11_GPIO (0x00000000)
  338. #define GPIO_PAR_LCDL_LD10_UNMASK (0xCFFFFFFF)
  339. #define GPIO_PAR_LCDL_LD10_LD10 (0x30000000)
  340. #define GPIO_PAR_LCDL_LD10_LD6 (0x20000000)
  341. #define GPIO_PAR_LCDL_LD10_GPIO (0x00000000)
  342. #define GPIO_PAR_LCDL_LD9_UNMASK (0xF3FFFFFF)
  343. #define GPIO_PAR_LCDL_LD9_LD9 (0x0C000000)
  344. #define GPIO_PAR_LCDL_LD9_LD5 (0x08000000)
  345. #define GPIO_PAR_LCDL_LD9_GPIO (0x00000000)
  346. #define GPIO_PAR_LCDL_LD8_UNMASK (0xFCFFFFFF)
  347. #define GPIO_PAR_LCDL_LD8_LD8 (0x03000000)
  348. #define GPIO_PAR_LCDL_LD8_LD4 (0x02000000)
  349. #define GPIO_PAR_LCDL_LD8_GPIO (0x00000000)
  350. #define GPIO_PAR_LCDL_LD7_UNMASK (0xFF3FFFFF)
  351. #define GPIO_PAR_LCDL_LD7_LD7 (0x00C00000)
  352. #define GPIO_PAR_LCDL_LD7_PWM7 (0x00800000)
  353. #define GPIO_PAR_LCDL_LD7_GPIO (0x00000000)
  354. #define GPIO_PAR_LCDL_LD6_UNMASK (0xFFCFFFFF)
  355. #define GPIO_PAR_LCDL_LD6_LD6 (0x00300000)
  356. #define GPIO_PAR_LCDL_LD6_PWM5 (0x00200000)
  357. #define GPIO_PAR_LCDL_LD6_GPIO (0x00000000)
  358. #define GPIO_PAR_LCDL_LD5_UNMASK (0xFFF3FFFF)
  359. #define GPIO_PAR_LCDL_LD5_LD5 (0x000C0000)
  360. #define GPIO_PAR_LCDL_LD5_LD3 (0x00080000)
  361. #define GPIO_PAR_LCDL_LD5_GPIO (0x00000000)
  362. #define GPIO_PAR_LCDL_LD4_UNMASK (0xFFFCFFFF)
  363. #define GPIO_PAR_LCDL_LD4_LD4 (0x00030000)
  364. #define GPIO_PAR_LCDL_LD4_LD2 (0x00020000)
  365. #define GPIO_PAR_LCDL_LD4_GPIO (0x00000000)
  366. #define GPIO_PAR_LCDL_LD3_UNMASK (0xFFFF3FFF)
  367. #define GPIO_PAR_LCDL_LD3_LD3 (0x0000C000)
  368. #define GPIO_PAR_LCDL_LD3_LD1 (0x00008000)
  369. #define GPIO_PAR_LCDL_LD3_GPIO (0x00000000)
  370. #define GPIO_PAR_LCDL_LD2_UNMASK (0xFFFFCFFF)
  371. #define GPIO_PAR_LCDL_LD2_LD2 (0x00003000)
  372. #define GPIO_PAR_LCDL_LD2_LD0 (0x00002000)
  373. #define GPIO_PAR_LCDL_LD2_GPIO (0x00000000)
  374. #define GPIO_PAR_LCDL_LD1_UNMASK (0xFFFFF3FF)
  375. #define GPIO_PAR_LCDL_LD1_LD1 (0x00000C00)
  376. #define GPIO_PAR_LCDL_LD1_PWM3 (0x00000800)
  377. #define GPIO_PAR_LCDL_LD1_GPIO (0x00000000)
  378. #define GPIO_PAR_LCDL_LD0_UNMASK (0xFFFFFCFF)
  379. #define GPIO_PAR_LCDL_LD0_LD0 (0x00000300)
  380. #define GPIO_PAR_LCDL_LD0_PWM1 (0x00000200)
  381. #define GPIO_PAR_LCDL_LD0_GPIO (0x00000000)
  382. /* Bit definitions and macros for MSCR_FB */
  383. #define GPIO_MSCR_FB_DUPPER_UNMASK (0xCF)
  384. #define GPIO_MSCR_FB_DUPPER_25V_33V (0x30)
  385. #define GPIO_MSCR_FB_DUPPER_FULL_18V (0x20)
  386. #define GPIO_MSCR_FB_DUPPER_OD (0x10)
  387. #define GPIO_MSCR_FB_DUPPER_HALF_18V (0x00)
  388. #define GPIO_MSCR_FB_DLOWER_UNMASK (0xF3)
  389. #define GPIO_MSCR_FB_DLOWER_25V_33V (0x0C)
  390. #define GPIO_MSCR_FB_DLOWER_FULL_18V (0x08)
  391. #define GPIO_MSCR_FB_DLOWER_OD (0x04)
  392. #define GPIO_MSCR_FB_DLOWER_HALF_18V (0x00)
  393. #define GPIO_MSCR_FB_ADDRCTL_UNMASK (0xFC)
  394. #define GPIO_MSCR_FB_ADDRCTL_25V_33V (0x03)
  395. #define GPIO_MSCR_FB_ADDRCTL_FULL_18V (0x02)
  396. #define GPIO_MSCR_FB_ADDRCTL_OD (0x01)
  397. #define GPIO_MSCR_FB_ADDRCTL_HALF_18V (0x00)
  398. /* Bit definitions and macros for MSCR_SDRAM */
  399. #define GPIO_MSCR_SDRAM_SDCLKB_UNMASK (0xCF)
  400. #define GPIO_MSCR_SDRAM_SDCLKB_25V_33V (0x30)
  401. #define GPIO_MSCR_SDRAM_SDCLKB_FULL_18V (0x20)
  402. #define GPIO_MSCR_SDRAM_SDCLKB_OD (0x10)
  403. #define GPIO_MSCR_SDRAM_SDCLKB_HALF_18V (0x00)
  404. #define GPIO_MSCR_SDRAM_SDCLK_UNMASK (0xF3)
  405. #define GPIO_MSCR_SDRAM_SDCLK_25V_33V (0x0C)
  406. #define GPIO_MSCR_SDRAM_SDCLK_FULL_18V (0x08)
  407. #define GPIO_MSCR_SDRAM_SDCLK_OPD (0x04)
  408. #define GPIO_MSCR_SDRAM_SDCLK_HALF_18V (0x00)
  409. #define GPIO_MSCR_SDRAM_SDCTL_UNMASK (0xFC)
  410. #define GPIO_MSCR_SDRAM_SDCTL_25V_33V (0x03)
  411. #define GPIO_MSCR_SDRAM_SDCTL_FULL_18V (0x02)
  412. #define GPIO_MSCR_SDRAM_SDCTL_OPD (0x01)
  413. #define GPIO_MSCR_SDRAM_SDCTL_HALF_18V (0x00)
  414. /* Bit definitions and macros for Drive Strength Control */
  415. #define DSCR_LOAD_50PF (0x03)
  416. #define DSCR_LOAD_30PF (0x02)
  417. #define DSCR_LOAD_20PF (0x01)
  418. #define DSCR_LOAD_10PF (0x00)
  419. /*********************************************************************
  420. * SDRAM Controller (SDRAMC)
  421. *********************************************************************/
  422. /* Bit definitions and macros for SDMR */
  423. #define SDRAMC_SDMR_DDR2_AD(x) (((x)&0x00003FFF)) /* Address for DDR2 */
  424. #define SDRAMC_SDMR_CMD (0x00010000) /* Command */
  425. #define SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18) /* Address */
  426. #define SDRAMC_SDMR_BK(x) (((x)&0x00000003)<<30) /* Bank Address */
  427. #define SDRAMC_SDMR_BK_LMR (0x00000000)
  428. #define SDRAMC_SDMR_BK_LEMR (0x40000000)
  429. /* Bit definitions and macros for SDCR */
  430. #define SDRAMC_SDCR_DPD (0x00000001) /* Deep Power-Down Mode */
  431. #define SDRAMC_SDCR_IPALL (0x00000002) /* Initiate Precharge All */
  432. #define SDRAMC_SDCR_IREF (0x00000004) /* Initiate Refresh */
  433. #define SDRAMC_SDCR_DQS_OE(x) (((x)&0x00000003)<<10) /* DQS Output Enable */
  434. #define SDRAMC_SDCR_MEM_PS (0x00002000) /* Data Port Size */
  435. #define SDRAMC_SDCR_REF_CNT(x) (((x)&0x0000003F)<<16) /* Periodic Refresh Counter */
  436. #define SDRAMC_SDCR_OE_RULE (0x00400000) /* Drive Rule Selection */
  437. #define SDRAMC_SDCR_ADDR_MUX(x) (((x)&0x00000003)<<24) /* Internal Address Mux Select */
  438. #define SDRAMC_SDCR_DDR2_MODE (0x08000000) /* DDR2 Mode Select */
  439. #define SDRAMC_SDCR_REF_EN (0x10000000) /* Refresh Enable */
  440. #define SDRAMC_SDCR_DDR_MODE (0x20000000) /* DDR Mode Select */
  441. #define SDRAMC_SDCR_CKE (0x40000000) /* Clock Enable */
  442. #define SDRAMC_SDCR_MODE_EN (0x80000000) /* SDRAM Mode Register Programming Enable */
  443. #define SDRAMC_SDCR_DQS_OE_BOTH (0x00000C000)
  444. /* Bit definitions and macros for SDCFG1 */
  445. #define SDRAMC_SDCFG1_WT_LAT(x) (((x)&0x00000007)<<4) /* Write Latency */
  446. #define SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8) /* Refresh to active delay */
  447. #define SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12) /* Precharge to active delay */
  448. #define SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16) /* Active to read/write delay */
  449. #define SDRAMC_SDCFG1_RD_LAT(x) (((x)&0x0000000F)<<20) /* Read CAS Latency */
  450. #define SDRAMC_SDCFG1_SWT2RWP(x) (((x)&0x00000007)<<24) /* Single write to read/write/precharge delay */
  451. #define SDRAMC_SDCFG1_SRD2RWP(x) (((x)&0x0000000F)<<28) /* Single read to read/write/precharge delay */
  452. /* Bit definitions and macros for SDCFG2 */
  453. #define SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16) /* Burst Length */
  454. #define SDRAMC_SDCFG2_BRD2W(x) (((x)&0x0000000F)<<20) /* Burst read to write delay */
  455. #define SDRAMC_SDCFG2_BWT2RWP(x) (((x)&0x0000000F)<<24) /* Burst write to read/write/precharge delay */
  456. #define SDRAMC_SDCFG2_BRD2RP(x) (((x)&0x0000000F)<<28) /* Burst read to read/precharge delay */
  457. /* Bit definitions and macros for SDCS group */
  458. #define SDRAMC_SDCS_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
  459. #define SDRAMC_SDCS_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
  460. #define SDRAMC_SDCS_BA(x) ((x)&0xFFF00000)
  461. #define SDRAMC_SDCS_CSSZ_DISABLE (0x00000000)
  462. #define SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
  463. #define SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
  464. #define SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
  465. #define SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
  466. #define SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
  467. #define SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
  468. #define SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
  469. #define SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
  470. #define SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
  471. #define SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
  472. #define SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
  473. #define SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
  474. #define SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
  475. /*********************************************************************
  476. * Phase Locked Loop (PLL)
  477. *********************************************************************/
  478. /* Bit definitions and macros for PCR */
  479. #define PLL_PCR_OUTDIV1(x) (((x)&0x0000000F)) /* Output divider for CPU clock frequency */
  480. #define PLL_PCR_OUTDIV2(x) (((x)&0x0000000F)<<4) /* Output divider for bus/flexbus clock frequency */
  481. #define PLL_PCR_OUTDIV3(x) (((x)&0x0000000F)<<8) /* Output divider for SDRAM clock frequency */
  482. #define PLL_PCR_OUTDIV5(x) (((x)&0x0000000F)<<16) /* Output divider for USB clock frequency */
  483. #define PLL_PCR_PFDR(x) (((x)&0x000000FF)<<24) /* Feedback divider for VCO frequency */
  484. #define PLL_PCR_PFDR_MASK (0x000F0000)
  485. #define PLL_PCR_OUTDIV5_MASK (0x000F0000)
  486. #define PLL_PCR_OUTDIV3_MASK (0x00000F00)
  487. #define PLL_PCR_OUTDIV2_MASK (0x000000F0)
  488. #define PLL_PCR_OUTDIV1_MASK (0x0000000F)
  489. /* Bit definitions and macros for PSR */
  490. #define PLL_PSR_LOCKS (0x00000001) /* PLL lost lock - sticky */
  491. #define PLL_PSR_LOCK (0x00000002) /* PLL lock status */
  492. #define PLL_PSR_LOLIRQ (0x00000004) /* PLL loss-of-lock interrupt enable */
  493. #define PLL_PSR_LOLRE (0x00000008) /* PLL loss-of-lock reset enable */
  494. /********************************************************************/
  495. #endif /* __MCF5227X__ */