m5445x.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889
  1. /*
  2. * MCF5445x Internal Memory Map
  3. *
  4. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __MCF5445X__
  10. #define __MCF5445X__
  11. /*********************************************************************
  12. * Interrupt Controller (INTC)
  13. *********************************************************************/
  14. #define INT0_LO_RSVD0 (0)
  15. #define INT0_LO_EPORT1 (1)
  16. #define INT0_LO_EPORT2 (2)
  17. #define INT0_LO_EPORT3 (3)
  18. #define INT0_LO_EPORT4 (4)
  19. #define INT0_LO_EPORT5 (5)
  20. #define INT0_LO_EPORT6 (6)
  21. #define INT0_LO_EPORT7 (7)
  22. #define INT0_LO_EDMA_00 (8)
  23. #define INT0_LO_EDMA_01 (9)
  24. #define INT0_LO_EDMA_02 (10)
  25. #define INT0_LO_EDMA_03 (11)
  26. #define INT0_LO_EDMA_04 (12)
  27. #define INT0_LO_EDMA_05 (13)
  28. #define INT0_LO_EDMA_06 (14)
  29. #define INT0_LO_EDMA_07 (15)
  30. #define INT0_LO_EDMA_08 (16)
  31. #define INT0_LO_EDMA_09 (17)
  32. #define INT0_LO_EDMA_10 (18)
  33. #define INT0_LO_EDMA_11 (19)
  34. #define INT0_LO_EDMA_12 (20)
  35. #define INT0_LO_EDMA_13 (21)
  36. #define INT0_LO_EDMA_14 (22)
  37. #define INT0_LO_EDMA_15 (23)
  38. #define INT0_LO_EDMA_ERR (24)
  39. #define INT0_LO_SCM (25)
  40. #define INT0_LO_UART0 (26)
  41. #define INT0_LO_UART1 (27)
  42. #define INT0_LO_UART2 (28)
  43. #define INT0_LO_RSVD1 (29)
  44. #define INT0_LO_I2C (30)
  45. #define INT0_LO_QSPI (31)
  46. #define INT0_HI_DTMR0 (32)
  47. #define INT0_HI_DTMR1 (33)
  48. #define INT0_HI_DTMR2 (34)
  49. #define INT0_HI_DTMR3 (35)
  50. #define INT0_HI_FEC0_TXF (36)
  51. #define INT0_HI_FEC0_TXB (37)
  52. #define INT0_HI_FEC0_UN (38)
  53. #define INT0_HI_FEC0_RL (39)
  54. #define INT0_HI_FEC0_RXF (40)
  55. #define INT0_HI_FEC0_RXB (41)
  56. #define INT0_HI_FEC0_MII (42)
  57. #define INT0_HI_FEC0_LC (43)
  58. #define INT0_HI_FEC0_HBERR (44)
  59. #define INT0_HI_FEC0_GRA (45)
  60. #define INT0_HI_FEC0_EBERR (46)
  61. #define INT0_HI_FEC0_BABT (47)
  62. #define INT0_HI_FEC0_BABR (48)
  63. #define INT0_HI_FEC1_TXF (49)
  64. #define INT0_HI_FEC1_TXB (50)
  65. #define INT0_HI_FEC1_UN (51)
  66. #define INT0_HI_FEC1_RL (52)
  67. #define INT0_HI_FEC1_RXF (53)
  68. #define INT0_HI_FEC1_RXB (54)
  69. #define INT0_HI_FEC1_MII (55)
  70. #define INT0_HI_FEC1_LC (56)
  71. #define INT0_HI_FEC1_HBERR (57)
  72. #define INT0_HI_FEC1_GRA (58)
  73. #define INT0_HI_FEC1_EBERR (59)
  74. #define INT0_HI_FEC1_BABT (60)
  75. #define INT0_HI_FEC1_BABR (61)
  76. #define INT0_HI_SCMIR (62)
  77. #define INT0_HI_RTC_ISR (63)
  78. #define INT1_HI_DSPI_EOQF (33)
  79. #define INT1_HI_DSPI_TFFF (34)
  80. #define INT1_HI_DSPI_TCF (35)
  81. #define INT1_HI_DSPI_TFUF (36)
  82. #define INT1_HI_DSPI_RFDF (37)
  83. #define INT1_HI_DSPI_RFOF (38)
  84. #define INT1_HI_DSPI_RFOF_TFUF (39)
  85. #define INT1_HI_RNG_EI (40)
  86. #define INT1_HI_PIT0_PIF (43)
  87. #define INT1_HI_PIT1_PIF (44)
  88. #define INT1_HI_PIT2_PIF (45)
  89. #define INT1_HI_PIT3_PIF (46)
  90. #define INT1_HI_USBOTG_USBSTS (47)
  91. #define INT1_HI_SSI_ISR (49)
  92. #define INT1_HI_CCM_UOCSR (53)
  93. #define INT1_HI_ATA_ISR (54)
  94. #define INT1_HI_PCI_SCR (55)
  95. #define INT1_HI_PCI_ASR (56)
  96. #define INT1_HI_PLL_LOCKS (57)
  97. /*********************************************************************
  98. * Watchdog Timer Modules (WTM)
  99. *********************************************************************/
  100. /* Bit definitions and macros for WCR */
  101. #define WTM_WCR_EN (0x0001)
  102. #define WTM_WCR_HALTED (0x0002)
  103. #define WTM_WCR_DOZE (0x0004)
  104. #define WTM_WCR_WAIT (0x0008)
  105. /*********************************************************************
  106. * Serial Boot Facility (SBF)
  107. *********************************************************************/
  108. /* Bit definitions and macros for SBFCR */
  109. #define SBF_SBFCR_BLDIV(x) (((x)&0x000F)) /* Boot loader clock divider */
  110. #define SBF_SBFCR_FR (0x0010) /* Fast read */
  111. /*********************************************************************
  112. * Reset Controller Module (RCM)
  113. *********************************************************************/
  114. /* Bit definitions and macros for RCR */
  115. #define RCM_RCR_FRCRSTOUT (0x40)
  116. #define RCM_RCR_SOFTRST (0x80)
  117. /* Bit definitions and macros for RSR */
  118. #define RCM_RSR_LOL (0x01)
  119. #define RCM_RSR_WDR_CORE (0x02)
  120. #define RCM_RSR_EXT (0x04)
  121. #define RCM_RSR_POR (0x08)
  122. #define RCM_RSR_SOFT (0x20)
  123. /*********************************************************************
  124. * Chip Configuration Module (CCM)
  125. *********************************************************************/
  126. /* Bit definitions and macros for CCR_360 */
  127. #define CCM_CCR_360_PLLMULT2(x) (((x)&0x0003)) /* 2-Bit PLL clock mode */
  128. #define CCM_CCR_360_PCISLEW (0x0004) /* PCI pad slew rate mode */
  129. #define CCM_CCR_360_PCIMODE (0x0008) /* PCI host/agent mode */
  130. #define CCM_CCR_360_PLLMODE (0x0010) /* PLL Mode */
  131. #define CCM_CCR_360_FBCONFIG(x) (((x)&0x0007)<<5) /* Flexbus/PCI port size configuration */
  132. #define CCM_CCR_360_PLLMULT3(x) (((x)&0x0007)) /* 3-Bit PLL Clock Mode */
  133. #define CCM_CCR_360_OSCMODE (0x0008) /* Oscillator Clock Mode */
  134. #define CCM_CCR_360_FBCONFIG_MASK (0x00E0)
  135. #define CCM_CCR_360_PLLMULT2_MASK (0x0003)
  136. #define CCM_CCR_360_PLLMULT3_MASK (0x0007)
  137. #define CCM_CCR_360_FBCONFIG_NM_NP_32 (0x0000)
  138. #define CCM_CCR_360_FBCONFIG_NM_NP_8 (0x0020)
  139. #define CCM_CCR_360_FBCONFIG_NM_NP_16 (0x0040)
  140. #define CCM_CCR_360_FBCONFIG_M_P_16 (0x0060)
  141. #define CCM_CCR_360_FBCONFIG_M_NP_32 (0x0080)
  142. #define CCM_CCR_360_FBCONFIG_M_NP_8 (0x00A0)
  143. #define CCM_CCR_360_FBCONFIG_M_NP_16 (0x00C0)
  144. #define CCM_CCR_360_FBCONFIG_M_P_8 (0x00E0)
  145. #define CCM_CCR_360_PLLMULT2_12X (0x0000)
  146. #define CCM_CCR_360_PLLMULT2_6X (0x0001)
  147. #define CCM_CCR_360_PLLMULT2_16X (0x0002)
  148. #define CCM_CCR_360_PLLMULT2_8X (0x0003)
  149. #define CCM_CCR_360_PLLMULT3_20X (0x0000)
  150. #define CCM_CCR_360_PLLMULT3_10X (0x0001)
  151. #define CCM_CCR_360_PLLMULT3_24X (0x0002)
  152. #define CCM_CCR_360_PLLMULT3_18X (0x0003)
  153. #define CCM_CCR_360_PLLMULT3_12X (0x0004)
  154. #define CCM_CCR_360_PLLMULT3_6X (0x0005)
  155. #define CCM_CCR_360_PLLMULT3_16X (0x0006)
  156. #define CCM_CCR_360_PLLMULT3_8X (0x0007)
  157. /* Bit definitions and macros for CCR_256 */
  158. #define CCM_CCR_256_PLLMULT3(x) (((x)&0x0007)) /* 3-Bit PLL clock mode */
  159. #define CCM_CCR_256_OSCMODE (0x0008) /* Oscillator clock mode */
  160. #define CCM_CCR_256_PLLMODE (0x0010) /* PLL Mode */
  161. #define CCM_CCR_256_FBCONFIG(x) (((x)&0x0007)<<5) /* Flexbus/PCI port size configuration */
  162. #define CCM_CCR_256_FBCONFIG_MASK (0x00E0)
  163. #define CCM_CCR_256_FBCONFIG_NM_32 (0x0000)
  164. #define CCM_CCR_256_FBCONFIG_NM_8 (0x0020)
  165. #define CCM_CCR_256_FBCONFIG_NM_16 (0x0040)
  166. #define CCM_CCR_256_FBCONFIG_M_32 (0x0080)
  167. #define CCM_CCR_256_FBCONFIG_M_8 (0x00A0)
  168. #define CCM_CCR_256_FBCONFIG_M_16 (0x00C0)
  169. #define CCM_CCR_256_PLLMULT3_MASK (0x0007)
  170. #define CCM_CCR_256_PLLMULT3_20X (0x0000)
  171. #define CCM_CCR_256_PLLMULT3_10X (0x0001)
  172. #define CCM_CCR_256_PLLMULT3_24X (0x0002)
  173. #define CCM_CCR_256_PLLMULT3_18X (0x0003)
  174. #define CCM_CCR_256_PLLMULT3_12X (0x0004)
  175. #define CCM_CCR_256_PLLMULT3_6X (0x0005)
  176. #define CCM_CCR_256_PLLMULT3_16X (0x0006)
  177. #define CCM_CCR_256_PLLMULT3_8X (0x0007)
  178. /* Bit definitions and macros for RCON_360 */
  179. #define CCM_RCON_360_PLLMULT(x) (((x)&0x0003)) /* PLL clock mode */
  180. #define CCM_RCON_360_PCISLEW (0x0004) /* PCI pad slew rate mode */
  181. #define CCM_RCON_360_PCIMODE (0x0008) /* PCI host/agent mode */
  182. #define CCM_RCON_360_PLLMODE (0x0010) /* PLL Mode */
  183. #define CCM_RCON_360_FBCONFIG(x) (((x)&0x0007)<<5) /* Flexbus/PCI port size configuration */
  184. /* Bit definitions and macros for RCON_256 */
  185. #define CCM_RCON_256_PLLMULT(x) (((x)&0x0007)) /* PLL clock mode */
  186. #define CCM_RCON_256_OSCMODE (0x0008) /* Oscillator clock mode */
  187. #define CCM_RCON_256_PLLMODE (0x0010) /* PLL Mode */
  188. #define CCM_RCON_256_FBCONFIG(x) (((x)&0x0007)<<5) /* Flexbus/PCI port size configuration */
  189. /* Bit definitions and macros for CIR */
  190. #define CCM_CIR_PRN(x) (((x)&0x003F)) /* Part revision number */
  191. #define CCM_CIR_PIN(x) (((x)&0x03FF)<<6) /* Part identification number */
  192. #define CCM_CIR_PIN_MASK (0xFFC0)
  193. #define CCM_CIR_PRN_MASK (0x003F)
  194. #define CCM_CIR_PIN_MCF54450 (0x4F<<6)
  195. #define CCM_CIR_PIN_MCF54451 (0x4D<<6)
  196. #define CCM_CIR_PIN_MCF54452 (0x4B<<6)
  197. #define CCM_CIR_PIN_MCF54453 (0x49<<6)
  198. #define CCM_CIR_PIN_MCF54454 (0x4A<<6)
  199. #define CCM_CIR_PIN_MCF54455 (0x48<<6)
  200. /* Bit definitions and macros for MISCCR */
  201. #define CCM_MISCCR_USBSRC (0x0001) /* USB clock source */
  202. #define CCM_MISCCR_USBOC (0x0002) /* USB VBUS over-current sense polarity */
  203. #define CCM_MISCCR_USBPUE (0x0004) /* USB transceiver pull-up enable */
  204. #define CCM_MISCCR_SSISRC (0x0010) /* SSI clock source */
  205. #define CCM_MISCCR_TIMDMA (0x0020) /* Timer DMA mux selection */
  206. #define CCM_MISCCR_SSIPUS (0x0040) /* SSI RXD/TXD pull select */
  207. #define CCM_MISCCR_SSIPUE (0x0080) /* SSI RXD/TXD pull enable */
  208. #define CCM_MISCCR_BMT(x) (((x)&0x0007)<<8) /* Bus monitor timing field */
  209. #define CCM_MISCCR_BME (0x0800) /* Bus monitor external enable bit */
  210. #define CCM_MISCCR_LIMP (0x1000) /* Limp mode enable */
  211. #define CCM_MISCCR_BMT_65536 (0)
  212. #define CCM_MISCCR_BMT_32768 (1)
  213. #define CCM_MISCCR_BMT_16384 (2)
  214. #define CCM_MISCCR_BMT_8192 (3)
  215. #define CCM_MISCCR_BMT_4096 (4)
  216. #define CCM_MISCCR_BMT_2048 (5)
  217. #define CCM_MISCCR_BMT_1024 (6)
  218. #define CCM_MISCCR_BMT_512 (7)
  219. #define CCM_MISCCR_SSIPUS_UP (1)
  220. #define CCM_MISCCR_SSIPUS_DOWN (0)
  221. #define CCM_MISCCR_TIMDMA_TIM (1)
  222. #define CCM_MISCCR_TIMDMA_SSI (0)
  223. #define CCM_MISCCR_SSISRC_CLKIN (0)
  224. #define CCM_MISCCR_SSISRC_PLL (1)
  225. #define CCM_MISCCR_USBOC_ACTHI (0)
  226. #define CCM_MISCCR_USBOV_ACTLO (1)
  227. #define CCM_MISCCR_USBSRC_CLKIN (0)
  228. #define CCM_MISCCR_USBSRC_PLL (1)
  229. /* Bit definitions and macros for CDR */
  230. #define CCM_CDR_SSIDIV(x) (((x)&0x00FF)) /* SSI oversampling clock divider */
  231. #define CCM_CDR_LPDIV(x) (((x)&0x000F)<<8) /* Low power clock divider */
  232. /* Bit definitions and macros for UOCSR */
  233. #define CCM_UOCSR_XPDE (0x0001) /* On-chip transceiver pull-down enable */
  234. #define CCM_UOCSR_UOMIE (0x0002) /* USB OTG misc interrupt enable */
  235. #define CCM_UOCSR_WKUP (0x0004) /* USB OTG controller wake-up event */
  236. #define CCM_UOCSR_PWRFLT (0x0008) /* VBUS power fault */
  237. #define CCM_UOCSR_SEND (0x0010) /* Session end */
  238. #define CCM_UOCSR_VVLD (0x0020) /* VBUS valid indicator */
  239. #define CCM_UOCSR_BVLD (0x0040) /* B-peripheral valid indicator */
  240. #define CCM_UOCSR_AVLD (0x0080) /* A-peripheral valid indicator */
  241. #define CCM_UOCSR_DPPU (0x0100) /* D+ pull-up for FS enabled (read-only) */
  242. #define CCM_UOCSR_DCR_VBUS (0x0200) /* VBUS discharge resistor enabled (read-only) */
  243. #define CCM_UOCSR_CRG_VBUS (0x0400) /* VBUS charge resistor enabled (read-only) */
  244. #define CCM_UOCSR_DMPD (0x1000) /* D- 15Kohm pull-down (read-only) */
  245. #define CCM_UOCSR_DPPD (0x2000) /* D+ 15Kohm pull-down (read-only) */
  246. /*********************************************************************
  247. * General Purpose I/O Module (GPIO)
  248. *********************************************************************/
  249. /* Bit definitions and macros for PAR_FEC */
  250. #define GPIO_PAR_FEC_FEC0(x) (((x)&0x07))
  251. #define GPIO_PAR_FEC_FEC1(x) (((x)&0x07)<<4)
  252. #define GPIO_PAR_FEC_FEC1_UNMASK (0x8F)
  253. #define GPIO_PAR_FEC_FEC1_MII (0x70)
  254. #define GPIO_PAR_FEC_FEC1_RMII_GPIO (0x30)
  255. #define GPIO_PAR_FEC_FEC1_RMII_ATA (0x20)
  256. #define GPIO_PAR_FEC_FEC1_ATA (0x10)
  257. #define GPIO_PAR_FEC_FEC1_GPIO (0x00)
  258. #define GPIO_PAR_FEC_FEC0_UNMASK (0xF8)
  259. #define GPIO_PAR_FEC_FEC0_MII (0x07)
  260. #define GPIO_PAR_FEC_FEC0_RMII_GPIO (0x03)
  261. #define GPIO_PAR_FEC_FEC0_RMII_ULPI (0x02)
  262. #define GPIO_PAR_FEC_FEC0_ULPI (0x01)
  263. #define GPIO_PAR_FEC_FEC0_GPIO (0x00)
  264. /* Bit definitions and macros for PAR_DMA */
  265. #define GPIO_PAR_DMA_DREQ0 (0x01)
  266. #define GPIO_PAR_DMA_DACK0(x) (((x)&0x03)<<2)
  267. #define GPIO_PAR_DMA_DREQ1(x) (((x)&0x03)<<4)
  268. #define GPIO_PAR_DMA_DACK1(x) (((x)&0x03)<<6)
  269. #define GPIO_PAR_DMA_DACK1_UNMASK (0x3F)
  270. #define GPIO_PAR_DMA_DACK1_DACK1 (0xC0)
  271. #define GPIO_PAR_DMA_DACK1_ULPI_DIR (0x40)
  272. #define GPIO_PAR_DMA_DACK1_GPIO (0x00)
  273. #define GPIO_PAR_DMA_DREQ1_UNMASK (0xCF)
  274. #define GPIO_PAR_DMA_DREQ1_DREQ1 (0x30)
  275. #define GPIO_PAR_DMA_DREQ1_USB_CLKIN (0x10)
  276. #define GPIO_PAR_DMA_DREQ1_GPIO (0x00)
  277. #define GPIO_PAR_DMA_DACK0_UNMASK (0xF3)
  278. #define GPIO_PAR_DMA_DACK0_DACK1 (0x0C)
  279. #define GPIO_PAR_DMA_DACK0_PCS3 (0x08)
  280. #define GPIO_PAR_DMA_DACK0_ULPI_DIR (0x04)
  281. #define GPIO_PAR_DMA_DACK0_GPIO (0x00)
  282. #define GPIO_PAR_DMA_DREQ0_DREQ0 (0x01)
  283. #define GPIO_PAR_DMA_DREQ0_GPIO (0x00)
  284. /* Bit definitions and macros for PAR_FBCTL */
  285. #define GPIO_PAR_FBCTL_TS(x) (((x)&0x03)<<3)
  286. #define GPIO_PAR_FBCTL_RW (0x20)
  287. #define GPIO_PAR_FBCTL_TA (0x40)
  288. #define GPIO_PAR_FBCTL_OE (0x80)
  289. #define GPIO_PAR_FBCTL_OE_OE (0x80)
  290. #define GPIO_PAR_FBCTL_OE_GPIO (0x00)
  291. #define GPIO_PAR_FBCTL_TA_TA (0x40)
  292. #define GPIO_PAR_FBCTL_TA_GPIO (0x00)
  293. #define GPIO_PAR_FBCTL_RW_RW (0x20)
  294. #define GPIO_PAR_FBCTL_RW_GPIO (0x00)
  295. #define GPIO_PAR_FBCTL_TS_UNMASK (0xE7)
  296. #define GPIO_PAR_FBCTL_TS_TS (0x18)
  297. #define GPIO_PAR_FBCTL_TS_ALE (0x10)
  298. #define GPIO_PAR_FBCTL_TS_TBST (0x08)
  299. #define GPIO_PAR_FBCTL_TS_GPIO (0x80)
  300. /* Bit definitions and macros for PAR_DSPI */
  301. #define GPIO_PAR_DSPI_SCK (0x01)
  302. #define GPIO_PAR_DSPI_SOUT (0x02)
  303. #define GPIO_PAR_DSPI_SIN (0x04)
  304. #define GPIO_PAR_DSPI_PCS0 (0x08)
  305. #define GPIO_PAR_DSPI_PCS1 (0x10)
  306. #define GPIO_PAR_DSPI_PCS2 (0x20)
  307. #define GPIO_PAR_DSPI_PCS5 (0x40)
  308. #define GPIO_PAR_DSPI_PCS5_PCS5 (0x40)
  309. #define GPIO_PAR_DSPI_PCS5_GPIO (0x00)
  310. #define GPIO_PAR_DSPI_PCS2_PCS2 (0x20)
  311. #define GPIO_PAR_DSPI_PCS2_GPIO (0x00)
  312. #define GPIO_PAR_DSPI_PCS1_PCS1 (0x10)
  313. #define GPIO_PAR_DSPI_PCS1_GPIO (0x00)
  314. #define GPIO_PAR_DSPI_PCS0_PCS0 (0x08)
  315. #define GPIO_PAR_DSPI_PCS0_GPIO (0x00)
  316. #define GPIO_PAR_DSPI_SIN_SIN (0x04)
  317. #define GPIO_PAR_DSPI_SIN_GPIO (0x00)
  318. #define GPIO_PAR_DSPI_SOUT_SOUT (0x02)
  319. #define GPIO_PAR_DSPI_SOUT_GPIO (0x00)
  320. #define GPIO_PAR_DSPI_SCK_SCK (0x01)
  321. #define GPIO_PAR_DSPI_SCK_GPIO (0x00)
  322. /* Bit definitions and macros for PAR_BE */
  323. #define GPIO_PAR_BE_BS0 (0x01)
  324. #define GPIO_PAR_BE_BS1 (0x04)
  325. #define GPIO_PAR_BE_BS2(x) (((x)&0x03)<<4)
  326. #define GPIO_PAR_BE_BS3(x) (((x)&0x03)<<6)
  327. #define GPIO_PAR_BE_BE3_UNMASK (0x3F)
  328. #define GPIO_PAR_BE_BE3_BE3 (0xC0)
  329. #define GPIO_PAR_BE_BE3_TSIZ1 (0x80)
  330. #define GPIO_PAR_BE_BE3_GPIO (0x00)
  331. #define GPIO_PAR_BE_BE2_UNMASK (0xCF)
  332. #define GPIO_PAR_BE_BE2_BE2 (0x30)
  333. #define GPIO_PAR_BE_BE2_TSIZ0 (0x20)
  334. #define GPIO_PAR_BE_BE2_GPIO (0x00)
  335. #define GPIO_PAR_BE_BE1_BE1 (0x04)
  336. #define GPIO_PAR_BE_BE1_GPIO (0x00)
  337. #define GPIO_PAR_BE_BE0_BE0 (0x01)
  338. #define GPIO_PAR_BE_BE0_GPIO (0x00)
  339. /* Bit definitions and macros for PAR_CS */
  340. #define GPIO_PAR_CS_CS1 (0x02)
  341. #define GPIO_PAR_CS_CS2 (0x04)
  342. #define GPIO_PAR_CS_CS3 (0x08)
  343. #define GPIO_PAR_CS_CS3_CS3 (0x08)
  344. #define GPIO_PAR_CS_CS3_GPIO (0x00)
  345. #define GPIO_PAR_CS_CS2_CS2 (0x04)
  346. #define GPIO_PAR_CS_CS2_GPIO (0x00)
  347. #define GPIO_PAR_CS_CS1_CS1 (0x02)
  348. #define GPIO_PAR_CS_CS1_GPIO (0x00)
  349. /* Bit definitions and macros for PAR_TIMER */
  350. #define GPIO_PAR_TIMER_T0IN(x) (((x)&0x03))
  351. #define GPIO_PAR_TIMER_T1IN(x) (((x)&0x03)<<2)
  352. #define GPIO_PAR_TIMER_T2IN(x) (((x)&0x03)<<4)
  353. #define GPIO_PAR_TIMER_T3IN(x) (((x)&0x03)<<6)
  354. #define GPIO_PAR_TIMER_T3IN_UNMASK (0x3F)
  355. #define GPIO_PAR_TIMER_T3IN_T3IN (0xC0)
  356. #define GPIO_PAR_TIMER_T3IN_T3OUT (0x80)
  357. #define GPIO_PAR_TIMER_T3IN_U2RXD (0x40)
  358. #define GPIO_PAR_TIMER_T3IN_GPIO (0x00)
  359. #define GPIO_PAR_TIMER_T2IN_UNMASK (0xCF)
  360. #define GPIO_PAR_TIMER_T2IN_T2IN (0x30)
  361. #define GPIO_PAR_TIMER_T2IN_T2OUT (0x20)
  362. #define GPIO_PAR_TIMER_T2IN_U2TXD (0x10)
  363. #define GPIO_PAR_TIMER_T2IN_GPIO (0x00)
  364. #define GPIO_PAR_TIMER_T1IN_UNMASK (0xF3)
  365. #define GPIO_PAR_TIMER_T1IN_T1IN (0x0C)
  366. #define GPIO_PAR_TIMER_T1IN_T1OUT (0x08)
  367. #define GPIO_PAR_TIMER_T1IN_U2CTS (0x04)
  368. #define GPIO_PAR_TIMER_T1IN_GPIO (0x00)
  369. #define GPIO_PAR_TIMER_T0IN_UNMASK (0xFC)
  370. #define GPIO_PAR_TIMER_T0IN_T0IN (0x03)
  371. #define GPIO_PAR_TIMER_T0IN_T0OUT (0x02)
  372. #define GPIO_PAR_TIMER_T0IN_U2RTS (0x01)
  373. #define GPIO_PAR_TIMER_T0IN_GPIO (0x00)
  374. /* Bit definitions and macros for PAR_USB */
  375. #define GPIO_PAR_USB_VBUSOC(x) (((x)&0x03))
  376. #define GPIO_PAR_USB_VBUSEN(x) (((x)&0x03)<<2)
  377. #define GPIO_PAR_USB_VBUSEN_UNMASK (0xF3)
  378. #define GPIO_PAR_USB_VBUSEN_VBUSEN (0x0C)
  379. #define GPIO_PAR_USB_VBUSEN_USBPULLUP (0x08)
  380. #define GPIO_PAR_USB_VBUSEN_ULPI_NXT (0x04)
  381. #define GPIO_PAR_USB_VBUSEN_GPIO (0x00)
  382. #define GPIO_PAR_USB_VBUSOC_UNMASK (0xFC)
  383. #define GPIO_PAR_USB_VBUSOC_VBUSOC (0x03)
  384. #define GPIO_PAR_USB_VBUSOC_ULPI_STP (0x01)
  385. #define GPIO_PAR_USB_VBUSOC_GPIO (0x00)
  386. /* Bit definitions and macros for PAR_UART */
  387. #define GPIO_PAR_UART_U0TXD (0x01)
  388. #define GPIO_PAR_UART_U0RXD (0x02)
  389. #define GPIO_PAR_UART_U0RTS (0x04)
  390. #define GPIO_PAR_UART_U0CTS (0x08)
  391. #define GPIO_PAR_UART_U1TXD (0x10)
  392. #define GPIO_PAR_UART_U1RXD (0x20)
  393. #define GPIO_PAR_UART_U1RTS (0x40)
  394. #define GPIO_PAR_UART_U1CTS (0x80)
  395. #define GPIO_PAR_UART_U1CTS_U1CTS (0x80)
  396. #define GPIO_PAR_UART_U1CTS_GPIO (0x00)
  397. #define GPIO_PAR_UART_U1RTS_U1RTS (0x40)
  398. #define GPIO_PAR_UART_U1RTS_GPIO (0x00)
  399. #define GPIO_PAR_UART_U1RXD_U1RXD (0x20)
  400. #define GPIO_PAR_UART_U1RXD_GPIO (0x00)
  401. #define GPIO_PAR_UART_U1TXD_U1TXD (0x10)
  402. #define GPIO_PAR_UART_U1TXD_GPIO (0x00)
  403. #define GPIO_PAR_UART_U0CTS_U0CTS (0x08)
  404. #define GPIO_PAR_UART_U0CTS_GPIO (0x00)
  405. #define GPIO_PAR_UART_U0RTS_U0RTS (0x04)
  406. #define GPIO_PAR_UART_U0RTS_GPIO (0x00)
  407. #define GPIO_PAR_UART_U0RXD_U0RXD (0x02)
  408. #define GPIO_PAR_UART_U0RXD_GPIO (0x00)
  409. #define GPIO_PAR_UART_U0TXD_U0TXD (0x01)
  410. #define GPIO_PAR_UART_U0TXD_GPIO (0x00)
  411. /* Bit definitions and macros for PAR_FECI2C */
  412. #define GPIO_PAR_FECI2C_SDA(x) (((x)&0x0003))
  413. #define GPIO_PAR_FECI2C_SCL(x) (((x)&0x0003)<<2)
  414. #define GPIO_PAR_FECI2C_MDIO0 (0x0010)
  415. #define GPIO_PAR_FECI2C_MDC0 (0x0040)
  416. #define GPIO_PAR_FECI2C_MDIO1(x) (((x)&0x0003)<<8)
  417. #define GPIO_PAR_FECI2C_MDC1(x) (((x)&0x0003)<<10)
  418. #define GPIO_PAR_FECI2C_MDC1_UNMASK (0xF3FF)
  419. #define GPIO_PAR_FECI2C_MDC1_MDC1 (0x0C00)
  420. #define GPIO_PAR_FECI2C_MDC1_ATA_DIOR (0x0800)
  421. #define GPIO_PAR_FECI2C_MDC1_GPIO (0x0000)
  422. #define GPIO_PAR_FECI2C_MDIO1_UNMASK (0xFCFF)
  423. #define GPIO_PAR_FECI2C_MDIO1_MDIO1 (0x0300)
  424. #define GPIO_PAR_FECI2C_MDIO1_ATA_DIOW (0x0200)
  425. #define GPIO_PAR_FECI2C_MDIO1_GPIO (0x0000)
  426. #define GPIO_PAR_FECI2C_MDC0_MDC0 (0x0040)
  427. #define GPIO_PAR_FECI2C_MDC0_GPIO (0x0000)
  428. #define GPIO_PAR_FECI2C_MDIO0_MDIO0 (0x0010)
  429. #define GPIO_PAR_FECI2C_MDIO0_GPIO (0x0000)
  430. #define GPIO_PAR_FECI2C_SCL_UNMASK (0xFFF3)
  431. #define GPIO_PAR_FECI2C_SCL_SCL (0x000C)
  432. #define GPIO_PAR_FECI2C_SCL_U2TXD (0x0004)
  433. #define GPIO_PAR_FECI2C_SCL_GPIO (0x0000)
  434. #define GPIO_PAR_FECI2C_SDA_UNMASK (0xFFFC)
  435. #define GPIO_PAR_FECI2C_SDA_SDA (0x0003)
  436. #define GPIO_PAR_FECI2C_SDA_U2RXD (0x0001)
  437. #define GPIO_PAR_FECI2C_SDA_GPIO (0x0000)
  438. /* Bit definitions and macros for PAR_SSI */
  439. #define GPIO_PAR_SSI_MCLK (0x0001)
  440. #define GPIO_PAR_SSI_STXD(x) (((x)&0x0003)<<2)
  441. #define GPIO_PAR_SSI_SRXD(x) (((x)&0x0003)<<4)
  442. #define GPIO_PAR_SSI_FS(x) (((x)&0x0003)<<6)
  443. #define GPIO_PAR_SSI_BCLK(x) (((x)&0x0003)<<8)
  444. #define GPIO_PAR_SSI_BCLK_UNMASK (0xFCFF)
  445. #define GPIO_PAR_SSI_BCLK_BCLK (0x0300)
  446. #define GPIO_PAR_SSI_BCLK_U1CTS (0x0200)
  447. #define GPIO_PAR_SSI_BCLK_GPIO (0x0000)
  448. #define GPIO_PAR_SSI_FS_UNMASK (0xFF3F)
  449. #define GPIO_PAR_SSI_FS_FS (0x00C0)
  450. #define GPIO_PAR_SSI_FS_U1RTS (0x0080)
  451. #define GPIO_PAR_SSI_FS_GPIO (0x0000)
  452. #define GPIO_PAR_SSI_SRXD_UNMASK (0xFFCF)
  453. #define GPIO_PAR_SSI_SRXD_SRXD (0x0030)
  454. #define GPIO_PAR_SSI_SRXD_U1RXD (0x0020)
  455. #define GPIO_PAR_SSI_SRXD_GPIO (0x0000)
  456. #define GPIO_PAR_SSI_STXD_UNMASK (0xFFF3)
  457. #define GPIO_PAR_SSI_STXD_STXD (0x000C)
  458. #define GPIO_PAR_SSI_STXD_U1TXD (0x0008)
  459. #define GPIO_PAR_SSI_STXD_GPIO (0x0000)
  460. #define GPIO_PAR_SSI_MCLK_MCLK (0x0001)
  461. #define GPIO_PAR_SSI_MCLK_GPIO (0x0000)
  462. /* Bit definitions and macros for PAR_ATA */
  463. #define GPIO_PAR_ATA_IORDY (0x0001)
  464. #define GPIO_PAR_ATA_DMARQ (0x0002)
  465. #define GPIO_PAR_ATA_RESET (0x0004)
  466. #define GPIO_PAR_ATA_DA0 (0x0020)
  467. #define GPIO_PAR_ATA_DA1 (0x0040)
  468. #define GPIO_PAR_ATA_DA2 (0x0080)
  469. #define GPIO_PAR_ATA_CS0 (0x0100)
  470. #define GPIO_PAR_ATA_CS1 (0x0200)
  471. #define GPIO_PAR_ATA_BUFEN (0x0400)
  472. #define GPIO_PAR_ATA_BUFEN_BUFEN (0x0400)
  473. #define GPIO_PAR_ATA_BUFEN_GPIO (0x0000)
  474. #define GPIO_PAR_ATA_CS1_CS1 (0x0200)
  475. #define GPIO_PAR_ATA_CS1_GPIO (0x0000)
  476. #define GPIO_PAR_ATA_CS0_CS0 (0x0100)
  477. #define GPIO_PAR_ATA_CS0_GPIO (0x0000)
  478. #define GPIO_PAR_ATA_DA2_DA2 (0x0080)
  479. #define GPIO_PAR_ATA_DA2_GPIO (0x0000)
  480. #define GPIO_PAR_ATA_DA1_DA1 (0x0040)
  481. #define GPIO_PAR_ATA_DA1_GPIO (0x0000)
  482. #define GPIO_PAR_ATA_DA0_DA0 (0x0020)
  483. #define GPIO_PAR_ATA_DA0_GPIO (0x0000)
  484. #define GPIO_PAR_ATA_RESET_RESET (0x0004)
  485. #define GPIO_PAR_ATA_RESET_GPIO (0x0000)
  486. #define GPIO_PAR_ATA_DMARQ_DMARQ (0x0002)
  487. #define GPIO_PAR_ATA_DMARQ_GPIO (0x0000)
  488. #define GPIO_PAR_ATA_IORDY_IORDY (0x0001)
  489. #define GPIO_PAR_ATA_IORDY_GPIO (0x0000)
  490. /* Bit definitions and macros for PAR_IRQ */
  491. #define GPIO_PAR_IRQ_IRQ1 (0x02)
  492. #define GPIO_PAR_IRQ_IRQ4 (0x10)
  493. #define GPIO_PAR_IRQ_IRQ4_IRQ4 (0x10)
  494. #define GPIO_PAR_IRQ_IRQ4_GPIO (0x00)
  495. #define GPIO_PAR_IRQ_IRQ1_IRQ1 (0x02)
  496. #define GPIO_PAR_IRQ_IRQ1_GPIO (0x00)
  497. /* Bit definitions and macros for PAR_PCI */
  498. #define GPIO_PAR_PCI_REQ0 (0x0001)
  499. #define GPIO_PAR_PCI_REQ1 (0x0004)
  500. #define GPIO_PAR_PCI_REQ2 (0x0010)
  501. #define GPIO_PAR_PCI_REQ3(x) (((x)&0x0003)<<6)
  502. #define GPIO_PAR_PCI_GNT0 (0x0100)
  503. #define GPIO_PAR_PCI_GNT1 (0x0400)
  504. #define GPIO_PAR_PCI_GNT2 (0x1000)
  505. #define GPIO_PAR_PCI_GNT3(x) (((x)&0x0003)<<14)
  506. #define GPIO_PAR_PCI_GNT3_UNMASK (0x3FFF)
  507. #define GPIO_PAR_PCI_GNT3_GNT3 (0xC000)
  508. #define GPIO_PAR_PCI_GNT3_ATA_DMACK (0x8000)
  509. #define GPIO_PAR_PCI_GNT3_GPIO (0x0000)
  510. #define GPIO_PAR_PCI_GNT2_GNT2 (0x1000)
  511. #define GPIO_PAR_PCI_GNT2_GPIO (0x0000)
  512. #define GPIO_PAR_PCI_GNT1_GNT1 (0x0400)
  513. #define GPIO_PAR_PCI_GNT1_GPIO (0x0000)
  514. #define GPIO_PAR_PCI_GNT0_GNT0 (0x0100)
  515. #define GPIO_PAR_PCI_GNT0_GPIO (0x0000)
  516. #define GPIO_PAR_PCI_REQ3_UNMASK (0xFF3F)
  517. #define GPIO_PAR_PCI_REQ3_REQ3 (0x00C0)
  518. #define GPIO_PAR_PCI_REQ3_ATA_INTRQ (0x0080)
  519. #define GPIO_PAR_PCI_REQ3_GPIO (0x0000)
  520. #define GPIO_PAR_PCI_REQ2_REQ2 (0x0010)
  521. #define GPIO_PAR_PCI_REQ2_GPIO (0x0000)
  522. #define GPIO_PAR_PCI_REQ1_REQ1 (0x0040)
  523. #define GPIO_PAR_PCI_REQ1_GPIO (0x0000)
  524. #define GPIO_PAR_PCI_REQ0_REQ0 (0x0001)
  525. #define GPIO_PAR_PCI_REQ0_GPIO (0x0000)
  526. /* Bit definitions and macros for MSCR_SDRAM */
  527. #define GPIO_MSCR_SDRAM_SDCTL(x) (((x)&0x03))
  528. #define GPIO_MSCR_SDRAM_SDCLK(x) (((x)&0x03)<<2)
  529. #define GPIO_MSCR_SDRAM_SDDQS(x) (((x)&0x03)<<4)
  530. #define GPIO_MSCR_SDRAM_SDDATA(x) (((x)&0x03)<<6)
  531. #define GPIO_MSCR_SDRAM_SDDATA_UNMASK (0x3F)
  532. #define GPIO_MSCR_SDRAM_SDDATA_DDR1 (0xC0)
  533. #define GPIO_MSCR_SDRAM_SDDATA_DDR2 (0x80)
  534. #define GPIO_MSCR_SDRAM_SDDATA_FS_LPDDR (0x40)
  535. #define GPIO_MSCR_SDRAM_SDDATA_HS_LPDDR (0x00)
  536. #define GPIO_MSCR_SDRAM_SDDQS_UNMASK (0xCF)
  537. #define GPIO_MSCR_SDRAM_SDDQS_DDR1 (0x30)
  538. #define GPIO_MSCR_SDRAM_SDDQS_DDR2 (0x20)
  539. #define GPIO_MSCR_SDRAM_SDDQS_FS_LPDDR (0x10)
  540. #define GPIO_MSCR_SDRAM_SDDQS_HS_LPDDR (0x00)
  541. #define GPIO_MSCR_SDRAM_SDCLK_UNMASK (0xF3)
  542. #define GPIO_MSCR_SDRAM_SDCLK_DDR1 (0x0C)
  543. #define GPIO_MSCR_SDRAM_SDCLK_DDR2 (0x08)
  544. #define GPIO_MSCR_SDRAM_SDCLK_FS_LPDDR (0x04)
  545. #define GPIO_MSCR_SDRAM_SDCLK_HS_LPDDR (0x00)
  546. #define GPIO_MSCR_SDRAM_SDCTL_UNMASK (0xFC)
  547. #define GPIO_MSCR_SDRAM_SDCTL_DDR1 (0x03)
  548. #define GPIO_MSCR_SDRAM_SDCTL_DDR2 (0x02)
  549. #define GPIO_MSCR_SDRAM_SDCTL_FS_LPDDR (0x01)
  550. #define GPIO_MSCR_SDRAM_SDCTL_HS_LPDDR (0x00)
  551. /* Bit definitions and macros for MSCR_PCI */
  552. #define GPIO_MSCR_PCI_PCI (0x01)
  553. #define GPIO_MSCR_PCI_PCI_HI_66MHZ (0x01)
  554. #define GPIO_MSCR_PCI_PCI_LO_33MHZ (0x00)
  555. /* Bit definitions and macros for DSCR_I2C */
  556. #define GPIO_DSCR_I2C_I2C(x) (((x)&0x03))
  557. #define GPIO_DSCR_I2C_I2C_LOAD_50PF (0x03)
  558. #define GPIO_DSCR_I2C_I2C_LOAD_30PF (0x02)
  559. #define GPIO_DSCR_I2C_I2C_LOAD_20PF (0x01)
  560. #define GPIO_DSCR_I2C_I2C_LOAD_10PF (0x00)
  561. /* Bit definitions and macros for DSCR_FLEXBUS */
  562. #define GPIO_DSCR_FLEXBUS_FBADL(x) (((x)&0x03))
  563. #define GPIO_DSCR_FLEXBUS_FBADH(x) (((x)&0x03)<<2)
  564. #define GPIO_DSCR_FLEXBUS_FBCTL(x) (((x)&0x03)<<4)
  565. #define GPIO_DSCR_FLEXBUS_FBCLK(x) (((x)&0x03)<<6)
  566. #define GPIO_DSCR_FLEXBUS_FBCLK_LOAD_50PF (0xC0)
  567. #define GPIO_DSCR_FLEXBUS_FBCLK_LOAD_30PF (0x80)
  568. #define GPIO_DSCR_FLEXBUS_FBCLK_LOAD_20PF (0x40)
  569. #define GPIO_DSCR_FLEXBUS_FBCLK_LOAD_10PF (0x00)
  570. #define GPIO_DSCR_FLEXBUS_FBCTL_LOAD_50PF (0x30)
  571. #define GPIO_DSCR_FLEXBUS_FBCTL_LOAD_30PF (0x20)
  572. #define GPIO_DSCR_FLEXBUS_FBCTL_LOAD_20PF (0x10)
  573. #define GPIO_DSCR_FLEXBUS_FBCTL_LOAD_10PF (0x00)
  574. #define GPIO_DSCR_FLEXBUS_FBADH_LOAD_50PF (0x0C)
  575. #define GPIO_DSCR_FLEXBUS_FBADH_LOAD_30PF (0x08)
  576. #define GPIO_DSCR_FLEXBUS_FBADH_LOAD_20PF (0x04)
  577. #define GPIO_DSCR_FLEXBUS_FBADH_LOAD_10PF (0x00)
  578. #define GPIO_DSCR_FLEXBUS_FBADL_LOAD_50PF (0x03)
  579. #define GPIO_DSCR_FLEXBUS_FBADL_LOAD_30PF (0x02)
  580. #define GPIO_DSCR_FLEXBUS_FBADL_LOAD_20PF (0x01)
  581. #define GPIO_DSCR_FLEXBUS_FBADL_LOAD_10PF (0x00)
  582. /* Bit definitions and macros for DSCR_FEC */
  583. #define GPIO_DSCR_FEC_FEC0(x) (((x)&0x03))
  584. #define GPIO_DSCR_FEC_FEC1(x) (((x)&0x03)<<2)
  585. #define GPIO_DSCR_FEC_FEC1_LOAD_50PF (0x0C)
  586. #define GPIO_DSCR_FEC_FEC1_LOAD_30PF (0x08)
  587. #define GPIO_DSCR_FEC_FEC1_LOAD_20PF (0x04)
  588. #define GPIO_DSCR_FEC_FEC1_LOAD_10PF (0x00)
  589. #define GPIO_DSCR_FEC_FEC0_LOAD_50PF (0x03)
  590. #define GPIO_DSCR_FEC_FEC0_LOAD_30PF (0x02)
  591. #define GPIO_DSCR_FEC_FEC0_LOAD_20PF (0x01)
  592. #define GPIO_DSCR_FEC_FEC0_LOAD_10PF (0x00)
  593. /* Bit definitions and macros for DSCR_UART */
  594. #define GPIO_DSCR_UART_UART0(x) (((x)&0x03))
  595. #define GPIO_DSCR_UART_UART1(x) (((x)&0x03)<<2)
  596. #define GPIO_DSCR_UART_UART1_LOAD_50PF (0x0C)
  597. #define GPIO_DSCR_UART_UART1_LOAD_30PF (0x08)
  598. #define GPIO_DSCR_UART_UART1_LOAD_20PF (0x04)
  599. #define GPIO_DSCR_UART_UART1_LOAD_10PF (0x00)
  600. #define GPIO_DSCR_UART_UART0_LOAD_50PF (0x03)
  601. #define GPIO_DSCR_UART_UART0_LOAD_30PF (0x02)
  602. #define GPIO_DSCR_UART_UART0_LOAD_20PF (0x01)
  603. #define GPIO_DSCR_UART_UART0_LOAD_10PF (0x00)
  604. /* Bit definitions and macros for DSCR_DSPI */
  605. #define GPIO_DSCR_DSPI_DSPI(x) (((x)&0x03))
  606. #define GPIO_DSCR_DSPI_DSPI_LOAD_50PF (0x03)
  607. #define GPIO_DSCR_DSPI_DSPI_LOAD_30PF (0x02)
  608. #define GPIO_DSCR_DSPI_DSPI_LOAD_20PF (0x01)
  609. #define GPIO_DSCR_DSPI_DSPI_LOAD_10PF (0x00)
  610. /* Bit definitions and macros for DSCR_TIMER */
  611. #define GPIO_DSCR_TIMER_TIMER(x) (((x)&0x03))
  612. #define GPIO_DSCR_TIMER_TIMER_LOAD_50PF (0x03)
  613. #define GPIO_DSCR_TIMER_TIMER_LOAD_30PF (0x02)
  614. #define GPIO_DSCR_TIMER_TIMER_LOAD_20PF (0x01)
  615. #define GPIO_DSCR_TIMER_TIMER_LOAD_10PF (0x00)
  616. /* Bit definitions and macros for DSCR_SSI */
  617. #define GPIO_DSCR_SSI_SSI(x) (((x)&0x03))
  618. #define GPIO_DSCR_SSI_SSI_LOAD_50PF (0x03)
  619. #define GPIO_DSCR_SSI_SSI_LOAD_30PF (0x02)
  620. #define GPIO_DSCR_SSI_SSI_LOAD_20PF (0x01)
  621. #define GPIO_DSCR_SSI_SSI_LOAD_10PF (0x00)
  622. /* Bit definitions and macros for DSCR_DMA */
  623. #define GPIO_DSCR_DMA_DMA(x) (((x)&0x03))
  624. #define GPIO_DSCR_DMA_DMA_LOAD_50PF (0x03)
  625. #define GPIO_DSCR_DMA_DMA_LOAD_30PF (0x02)
  626. #define GPIO_DSCR_DMA_DMA_LOAD_20PF (0x01)
  627. #define GPIO_DSCR_DMA_DMA_LOAD_10PF (0x00)
  628. /* Bit definitions and macros for DSCR_DEBUG */
  629. #define GPIO_DSCR_DEBUG_DEBUG(x) (((x)&0x03))
  630. #define GPIO_DSCR_DEBUG_DEBUG_LOAD_50PF (0x03)
  631. #define GPIO_DSCR_DEBUG_DEBUG_LOAD_30PF (0x02)
  632. #define GPIO_DSCR_DEBUG_DEBUG_LOAD_20PF (0x01)
  633. #define GPIO_DSCR_DEBUG_DEBUG_LOAD_10PF (0x00)
  634. /* Bit definitions and macros for DSCR_RESET */
  635. #define GPIO_DSCR_RESET_RESET(x) (((x)&0x03))
  636. #define GPIO_DSCR_RESET_RESET_LOAD_50PF (0x03)
  637. #define GPIO_DSCR_RESET_RESET_LOAD_30PF (0x02)
  638. #define GPIO_DSCR_RESET_RESET_LOAD_20PF (0x01)
  639. #define GPIO_DSCR_RESET_RESET_LOAD_10PF (0x00)
  640. /* Bit definitions and macros for DSCR_IRQ */
  641. #define GPIO_DSCR_IRQ_IRQ(x) (((x)&0x03))
  642. #define GPIO_DSCR_IRQ_IRQ_LOAD_50PF (0x03)
  643. #define GPIO_DSCR_IRQ_IRQ_LOAD_30PF (0x02)
  644. #define GPIO_DSCR_IRQ_IRQ_LOAD_20PF (0x01)
  645. #define GPIO_DSCR_IRQ_IRQ_LOAD_10PF (0x00)
  646. /* Bit definitions and macros for DSCR_USB */
  647. #define GPIO_DSCR_USB_USB(x) (((x)&0x03))
  648. #define GPIO_DSCR_USB_USB_LOAD_50PF (0x03)
  649. #define GPIO_DSCR_USB_USB_LOAD_30PF (0x02)
  650. #define GPIO_DSCR_USB_USB_LOAD_20PF (0x01)
  651. #define GPIO_DSCR_USB_USB_LOAD_10PF (0x00)
  652. /* Bit definitions and macros for DSCR_ATA */
  653. #define GPIO_DSCR_ATA_ATA(x) (((x)&0x03))
  654. #define GPIO_DSCR_ATA_ATA_LOAD_50PF (0x03)
  655. #define GPIO_DSCR_ATA_ATA_LOAD_30PF (0x02)
  656. #define GPIO_DSCR_ATA_ATA_LOAD_20PF (0x01)
  657. #define GPIO_DSCR_ATA_ATA_LOAD_10PF (0x00)
  658. /*********************************************************************
  659. * SDRAM Controller (SDRAMC)
  660. *********************************************************************/
  661. /* Bit definitions and macros for SDMR */
  662. #define SDRAMC_SDMR_DDR2_AD(x) (((x)&0x00003FFF)) /* Address for DDR2 */
  663. #define SDRAMC_SDMR_CMD (0x00010000) /* Command */
  664. #define SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18) /* Address */
  665. #define SDRAMC_SDMR_BK(x) (((x)&0x00000003)<<30) /* Bank Address */
  666. #define SDRAMC_SDMR_BK_LMR (0x00000000)
  667. #define SDRAMC_SDMR_BK_LEMR (0x40000000)
  668. /* Bit definitions and macros for SDCR */
  669. #define SDRAMC_SDCR_DPD (0x00000001) /* Deep Power-Down Mode */
  670. #define SDRAMC_SDCR_IPALL (0x00000002) /* Initiate Precharge All */
  671. #define SDRAMC_SDCR_IREF (0x00000004) /* Initiate Refresh */
  672. #define SDRAMC_SDCR_DQS_OE(x) (((x)&0x00000003)<<10) /* DQS Output Enable */
  673. #define SDRAMC_SDCR_MEM_PS (0x00002000) /* Data Port Size */
  674. #define SDRAMC_SDCR_REF_CNT(x) (((x)&0x0000003F)<<16) /* Periodic Refresh Counter */
  675. #define SDRAMC_SDCR_OE_RULE (0x00400000) /* Drive Rule Selection */
  676. #define SDRAMC_SDCR_ADDR_MUX(x) (((x)&0x00000003)<<24) /* Internal Address Mux Select */
  677. #define SDRAMC_SDCR_DDR2_MODE (0x08000000) /* DDR2 Mode Select */
  678. #define SDRAMC_SDCR_REF_EN (0x10000000) /* Refresh Enable */
  679. #define SDRAMC_SDCR_DDR_MODE (0x20000000) /* DDR Mode Select */
  680. #define SDRAMC_SDCR_CKE (0x40000000) /* Clock Enable */
  681. #define SDRAMC_SDCR_MODE_EN (0x80000000) /* SDRAM Mode Register Programming Enable */
  682. #define SDRAMC_SDCR_DQS_OE_BOTH (0x00000C000)
  683. /* Bit definitions and macros for SDCFG1 */
  684. #define SDRAMC_SDCFG1_WT_LAT(x) (((x)&0x00000007)<<4) /* Write Latency */
  685. #define SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8) /* Refresh to active delay */
  686. #define SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12) /* Precharge to active delay */
  687. #define SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16) /* Active to read/write delay */
  688. #define SDRAMC_SDCFG1_RD_LAT(x) (((x)&0x0000000F)<<20) /* Read CAS Latency */
  689. #define SDRAMC_SDCFG1_SWT2RWP(x) (((x)&0x00000007)<<24) /* Single write to read/write/precharge delay */
  690. #define SDRAMC_SDCFG1_SRD2RWP(x) (((x)&0x0000000F)<<28) /* Single read to read/write/precharge delay */
  691. /* Bit definitions and macros for SDCFG2 */
  692. #define SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16) /* Burst Length */
  693. #define SDRAMC_SDCFG2_BRD2W(x) (((x)&0x0000000F)<<20) /* Burst read to write delay */
  694. #define SDRAMC_SDCFG2_BWT2RWP(x) (((x)&0x0000000F)<<24) /* Burst write to read/write/precharge delay */
  695. #define SDRAMC_SDCFG2_BRD2RP(x) (((x)&0x0000000F)<<28) /* Burst read to read/precharge delay */
  696. /* Bit definitions and macros for SDCS group */
  697. #define SDRAMC_SDCS_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
  698. #define SDRAMC_SDCS_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
  699. #define SDRAMC_SDCS_BA(x) ((x)&0xFFF00000)
  700. #define SDRAMC_SDCS_CSSZ_DISABLE (0x00000000)
  701. #define SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
  702. #define SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
  703. #define SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
  704. #define SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
  705. #define SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
  706. #define SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
  707. #define SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
  708. #define SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
  709. #define SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
  710. #define SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
  711. #define SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
  712. #define SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
  713. #define SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
  714. /*********************************************************************
  715. * Phase Locked Loop (PLL)
  716. *********************************************************************/
  717. /* Bit definitions and macros for PCR */
  718. #define PLL_PCR_OUTDIV1(x) (((x)&0x0000000F)) /* Output divider for CPU clock frequency */
  719. #define PLL_PCR_OUTDIV2(x) (((x)&0x0000000F)<<4) /* Output divider for internal bus clock frequency */
  720. #define PLL_PCR_OUTDIV3(x) (((x)&0x0000000F)<<8) /* Output divider for Flexbus clock frequency */
  721. #define PLL_PCR_OUTDIV4(x) (((x)&0x0000000F)<<12) /* Output divider for PCI clock frequency */
  722. #define PLL_PCR_OUTDIV5(x) (((x)&0x0000000F)<<16) /* Output divider for USB clock frequency */
  723. #define PLL_PCR_PFDR(x) (((x)&0x000000FF)<<24) /* Feedback divider for VCO frequency */
  724. #define PLL_PCR_PFDR_MASK (0x000F0000)
  725. #define PLL_PCR_OUTDIV5_MASK (0x000F0000)
  726. #define PLL_PCR_OUTDIV4_MASK (0x0000F000)
  727. #define PLL_PCR_OUTDIV3_MASK (0x00000F00)
  728. #define PLL_PCR_OUTDIV2_MASK (0x000000F0)
  729. #define PLL_PCR_OUTDIV1_MASK (0x0000000F)
  730. /* Bit definitions and macros for PSR */
  731. #define PLL_PSR_LOCKS (0x00000001) /* PLL lost lock - sticky */
  732. #define PLL_PSR_LOCK (0x00000002) /* PLL lock status */
  733. #define PLL_PSR_LOLIRQ (0x00000004) /* PLL loss-of-lock interrupt enable */
  734. #define PLL_PSR_LOLRE (0x00000008) /* PLL loss-of-lock reset enable */
  735. /*********************************************************************
  736. * PCI
  737. *********************************************************************/
  738. /* Bit definitions and macros for SCR */
  739. #define PCI_SCR_PE (0x80000000) /* Parity Error detected */
  740. #define PCI_SCR_SE (0x40000000) /* System error signalled */
  741. #define PCI_SCR_MA (0x20000000) /* Master aboart received */
  742. #define PCI_SCR_TR (0x10000000) /* Target abort received */
  743. #define PCI_SCR_TS (0x08000000) /* Target abort signalled */
  744. #define PCI_SCR_DT (0x06000000) /* PCI_DEVSEL timing */
  745. #define PCI_SCR_DP (0x01000000) /* Master data parity err */
  746. #define PCI_SCR_FC (0x00800000) /* Fast back-to-back */
  747. #define PCI_SCR_R (0x00400000) /* Reserved */
  748. #define PCI_SCR_66M (0x00200000) /* 66Mhz */
  749. #define PCI_SCR_C (0x00100000) /* Capabilities list */
  750. #define PCI_SCR_F (0x00000200) /* Fast back-to-back enable */
  751. #define PCI_SCR_S (0x00000100) /* SERR enable */
  752. #define PCI_SCR_ST (0x00000080) /* Addr and Data stepping */
  753. #define PCI_SCR_PER (0x00000040) /* Parity error response */
  754. #define PCI_SCR_V (0x00000020) /* VGA palette snoop enable */
  755. #define PCI_SCR_MW (0x00000010) /* Memory write and invalidate enable */
  756. #define PCI_SCR_SP (0x00000008) /* Special cycle monitor or ignore */
  757. #define PCI_SCR_B (0x00000004) /* Bus master enable */
  758. #define PCI_SCR_M (0x00000002) /* Memory access control */
  759. #define PCI_SCR_IO (0x00000001) /* I/O access control */
  760. #define PCI_CR1_BIST(x) ((x & 0xFF) << 24) /* Built in self test */
  761. #define PCI_CR1_HDR(x) ((x & 0xFF) << 16) /* Header type */
  762. #define PCI_CR1_LTMR(x) ((x & 0xF8) << 8) /* Latency timer */
  763. #define PCI_CR1_CLS(x) (x & 0x0F) /* Cache line size */
  764. #define PCI_BAR_BAR0(x) (x & 0xFFFC0000)
  765. #define PCI_BAR_BAR1(x) (x & 0xFFF00000)
  766. #define PCI_BAR_BAR2(x) (x & 0xFFC00000)
  767. #define PCI_BAR_BAR3(x) (x & 0xFF000000)
  768. #define PCI_BAR_BAR4(x) (x & 0xF8000000)
  769. #define PCI_BAR_BAR5(x) (x & 0xE0000000)
  770. #define PCI_BAR_PREF (0x00000004) /* Prefetchable access */
  771. #define PCI_BAR_RANGE (0x00000002) /* Fixed to 00 */
  772. #define PCI_BAR_IO_M (0x00000001) /* IO / memory space */
  773. #define PCI_CR2_MAXLAT(x) ((x & 0xFF) << 24) /* Maximum latency */
  774. #define PCI_CR2_MINGNT(x) ((x & 0xFF) << 16) /* Minimum grant */
  775. #define PCI_CR2_INTPIN(x) ((x & 0xFF) << 8) /* Interrupt Pin */
  776. #define PCI_CR2_INTLIN(x) (x & 0xFF) /* Interrupt Line */
  777. #define PCI_GSCR_DRD (0x80000000) /* Delayed read discarded */
  778. #define PCI_GSCR_PE (0x20000000) /* PCI_PERR detected */
  779. #define PCI_GSCR_SE (0x10000000) /* SERR detected */
  780. #define PCI_GSCR_ER (0x08000000) /* Error response detected */
  781. #define PCI_GSCR_DRDE (0x00008000) /* Delayed read discarded enable */
  782. #define PCI_GSCR_PEE (0x00002000) /* PERR detected interrupt enable */
  783. #define PCI_GSCR_SEE (0x00001000) /* SERR detected interrupt enable */
  784. #define PCI_GSCR_PR (0x00000001) /* PCI reset */
  785. #define PCI_TCR1_LD (0x01000000) /* Latency rule disable */
  786. #define PCI_TCR1_PID (0x00020000) /* Prefetch invalidate and disable */
  787. #define PCI_TCR1_P (0x00010000) /* Prefetch reads */
  788. #define PCI_TCR1_WCD (0x00000100) /* Write combine disable */
  789. #define PCI_TCR2_B5E (0x00002000) /* */
  790. #define PCI_TCR2_B4E (0x00001000) /* */
  791. #define PCI_TCR2_B3E (0x00000800) /* */
  792. #define PCI_TCR2_B2E (0x00000400) /* */
  793. #define PCI_TCR2_B1E (0x00000200) /* */
  794. #define PCI_TCR2_B0E (0x00000100) /* */
  795. #define PCI_TCR2_CR (0x00000001) /* */
  796. #define PCI_TBATR_BAT(x) ((x & 0xFFF) << 20)
  797. #define PCI_TBATR_EN (0x00000001) /* Enable */
  798. #define PCI_IWCR_W0C_IO (0x08000000) /* Windows Maps to PCI I/O */
  799. #define PCI_IWCR_W0C_PRC_RDMUL (0x04000000) /* PCI Memory Read multiple */
  800. #define PCI_IWCR_W0C_PRC_RDLN (0x02000000) /* PCI Memory Read line */
  801. #define PCI_IWCR_W0C_PRC_RD (0x00000000) /* PCI Memory Read */
  802. #define PCI_IWCR_W0C_EN (0x01000000) /* Enable - Register initialize */
  803. #define PCI_IWCR_W1C_IO (0x00080000) /* Windows Maps to PCI I/O */
  804. #define PCI_IWCR_W1C_PRC_RDMUL (0x00040000) /* PCI Memory Read multiple */
  805. #define PCI_IWCR_W1C_PRC_RDLN (0x00020000) /* PCI Memory Read line */
  806. #define PCI_IWCR_W1C_PRC_RD (0x00000000) /* PCI Memory Read */
  807. #define PCI_IWCR_W1C_EN (0x00010000) /* Enable - Register initialize */
  808. #define PCI_IWCR_W2C_IO (0x00000800) /* Windows Maps to PCI I/O */
  809. #define PCI_IWCR_W2C_PRC_RDMUL (0x00000400) /* PCI Memory Read multiple */
  810. #define PCI_IWCR_W2C_PRC_RDLN (0x00000200) /* PCI Memory Read line */
  811. #define PCI_IWCR_W2C_PRC_RD (0x00000000) /* PCI Memory Read */
  812. #define PCI_IWCR_W2C_EN (0x00000100) /* Enable - Register initialize */
  813. #define PCI_ICR_REE (0x04000000) /* Retry error enable */
  814. #define PCI_ICR_IAE (0x02000000) /* Initiator abort enable */
  815. #define PCI_ICR_TAE (0x01000000) /* Target abort enable */
  816. #define PCI_ICR_MAXRETRY(x) ((x) & 0x000000FF)
  817. /********************************************************************/
  818. #endif /* __MCF5445X__ */