m5329.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. /*
  2. * mcf5329.h -- Definitions for Freescale Coldfire 5329
  3. *
  4. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef mcf5329_h
  26. #define mcf5329_h
  27. /****************************************************************************/
  28. /*********************************************************************
  29. * System Control Module (SCM)
  30. *********************************************************************/
  31. /* Bit definitions and macros for SCM_MPR */
  32. #define SCM_MPR_MPROT0(x) (((x)&0x0F)<<28)
  33. #define SCM_MPR_MPROT1(x) (((x)&0x0F)<<24)
  34. #define SCM_MPR_MPROT2(x) (((x)&0x0F)<<20)
  35. #define SCM_MPR_MPROT4(x) (((x)&0x0F)<<12)
  36. #define SCM_MPR_MPROT5(x) (((x)&0x0F)<<8)
  37. #define SCM_MPR_MPROT6(x) (((x)&0x0F)<<4)
  38. #define MPROT_MTR 4
  39. #define MPROT_MTW 2
  40. #define MPROT_MPL 1
  41. /* Bit definitions and macros for SCM_BMT */
  42. #define BMT_BME (0x08)
  43. #define BMT_8 (0x07)
  44. #define BMT_16 (0x06)
  45. #define BMT_32 (0x05)
  46. #define BMT_64 (0x04)
  47. #define BMT_128 (0x03)
  48. #define BMT_256 (0x02)
  49. #define BMT_512 (0x01)
  50. #define BMT_1024 (0x00)
  51. /* Bit definitions and macros for SCM_PACRA */
  52. #define SCM_PACRA_PACR0(x) (((x)&0x0F)<<28)
  53. #define SCM_PACRA_PACR1(x) (((x)&0x0F)<<24)
  54. #define SCM_PACRA_PACR2(x) (((x)&0x0F)<<20)
  55. #define PACR_SP 4
  56. #define PACR_WP 2
  57. #define PACR_TP 1
  58. /* Bit definitions and macros for SCM_PACRB */
  59. #define SCM_PACRB_PACR8(x) (((x)&0x0F)<<28)
  60. #define SCM_PACRB_PACR12(x) (((x)&0x0F)<<12)
  61. /* Bit definitions and macros for SCM_PACRC */
  62. #define SCM_PACRC_PACR16(x) (((x)&0x0F)<<28)
  63. #define SCM_PACRC_PACR17(x) (((x)&0x0F)<<24)
  64. #define SCM_PACRC_PACR18(x) (((x)&0x0F)<<20)
  65. #define SCM_PACRC_PACR19(x) (((x)&0x0F)<<16)
  66. #define SCM_PACRC_PACR21(x) (((x)&0x0F)<<8)
  67. #define SCM_PACRC_PACR22(x) (((x)&0x0F)<<4)
  68. #define SCM_PACRC_PACR23(x) (((x)&0x0F)<<0)
  69. /* Bit definitions and macros for SCM_PACRD */
  70. #define SCM_PACRD_PACR24(x) (((x)&0x0F)<<28)
  71. #define SCM_PACRD_PACR25(x) (((x)&0x0F)<<24)
  72. #define SCM_PACRD_PACR26(x) (((x)&0x0F)<<20)
  73. #define SCM_PACRD_PACR28(x) (((x)&0x0F)<<12)
  74. #define SCM_PACRD_PACR29(x) (((x)&0x0F)<<8)
  75. #define SCM_PACRD_PACR30(x) (((x)&0x0F)<<4)
  76. #define SCM_PACRD_PACR31(x) (((x)&0x0F)<<0)
  77. /* Bit definitions and macros for SCM_PACRE */
  78. #define SCM_PACRE_PACR32(x) (((x)&0x0F)<<28)
  79. #define SCM_PACRE_PACR33(x) (((x)&0x0F)<<24)
  80. #define SCM_PACRE_PACR34(x) (((x)&0x0F)<<20)
  81. #define SCM_PACRE_PACR35(x) (((x)&0x0F)<<16)
  82. #define SCM_PACRE_PACR36(x) (((x)&0x0F)<<12)
  83. #define SCM_PACRE_PACR37(x) (((x)&0x0F)<<8)
  84. #define SCM_PACRE_PACR38(x) (((x)&0x0F)<<4)
  85. /* Bit definitions and macros for SCM_PACRF */
  86. #define SCM_PACRF_PACR40(x) (((x)&0x0F)<<28)
  87. #define SCM_PACRF_PACR41(x) (((x)&0x0F)<<24)
  88. #define SCM_PACRF_PACR42(x) (((x)&0x0F)<<20)
  89. #define SCM_PACRF_PACR43(x) (((x)&0x0F)<<16)
  90. #define SCM_PACRF_PACR44(x) (((x)&0x0F)<<12)
  91. #define SCM_PACRF_PACR45(x) (((x)&0x0F)<<8)
  92. #define SCM_PACRF_PACR46(x) (((x)&0x0F)<<4)
  93. #define SCM_PACRF_PACR47(x) (((x)&0x0F)<<0)
  94. /* Bit definitions and macros for SCM_PACRG */
  95. #define SCM_PACRG_PACR48(x) (((x)&0x0F)<<28)
  96. /* Bit definitions and macros for SCM_PACRH */
  97. #define SCM_PACRH_PACR56(x) (((x)&0x0F)<<28)
  98. #define SCM_PACRH_PACR57(x) (((x)&0x0F)<<24)
  99. #define SCM_PACRH_PACR58(x) (((x)&0x0F)<<20)
  100. /* PACRn Assignments */
  101. #define PACR0(x) SCM_PACRA_PACR0(x)
  102. #define PACR1(x) SCM_PACRA_PACR1(x)
  103. #define PACR2(x) SCM_PACRA_PACR2(x)
  104. #define PACR8(x) SCM_PACRB_PACR8(x)
  105. #define PACR12(x) SCM_PACRB_PACR12(x)
  106. #define PACR16(x) SCM_PACRC_PACR16(x)
  107. #define PACR17(x) SCM_PACRC_PACR17(x)
  108. #define PACR18(x) SCM_PACRC_PACR18(x)
  109. #define PACR19(x) SCM_PACRC_PACR19(x)
  110. #define PACR21(x) SCM_PACRC_PACR21(x)
  111. #define PACR22(x) SCM_PACRC_PACR22(x)
  112. #define PACR23(x) SCM_PACRC_PACR23(x)
  113. #define PACR24(x) SCM_PACRD_PACR24(x)
  114. #define PACR25(x) SCM_PACRD_PACR25(x)
  115. #define PACR26(x) SCM_PACRD_PACR26(x)
  116. #define PACR28(x) SCM_PACRD_PACR28(x)
  117. #define PACR29(x) SCM_PACRD_PACR29(x)
  118. #define PACR30(x) SCM_PACRD_PACR30(x)
  119. #define PACR31(x) SCM_PACRD_PACR31(x)
  120. #define PACR32(x) SCM_PACRE_PACR32(x)
  121. #define PACR33(x) SCM_PACRE_PACR33(x)
  122. #define PACR34(x) SCM_PACRE_PACR34(x)
  123. #define PACR35(x) SCM_PACRE_PACR35(x)
  124. #define PACR36(x) SCM_PACRE_PACR36(x)
  125. #define PACR37(x) SCM_PACRE_PACR37(x)
  126. #define PACR38(x) SCM_PACRE_PACR38(x)
  127. #define PACR40(x) SCM_PACRF_PACR40(x)
  128. #define PACR41(x) SCM_PACRF_PACR41(x)
  129. #define PACR42(x) SCM_PACRF_PACR42(x)
  130. #define PACR43(x) SCM_PACRF_PACR43(x)
  131. #define PACR44(x) SCM_PACRF_PACR44(x)
  132. #define PACR45(x) SCM_PACRF_PACR45(x)
  133. #define PACR46(x) SCM_PACRF_PACR46(x)
  134. #define PACR47(x) SCM_PACRF_PACR47(x)
  135. #define PACR48(x) SCM_PACRG_PACR48(x)
  136. #define PACR56(x) SCM_PACRH_PACR56(x)
  137. #define PACR57(x) SCM_PACRH_PACR57(x)
  138. #define PACR58(x) SCM_PACRH_PACR58(x)
  139. /* Bit definitions and macros for SCM_CWCR */
  140. #define CWCR_RO (0x8000)
  141. #define CWCR_CWR_WH (0x0100)
  142. #define CWCR_CWE (0x0080)
  143. #define CWRI_WINDOW (0x0060)
  144. #define CWRI_RESET (0x0040)
  145. #define CWRI_INT_RESET (0x0020)
  146. #define CWRI_INT (0x0000)
  147. #define CWCR_CWT(x) (((x)&0x001F))
  148. /* Bit definitions and macros for SCM_ISR */
  149. #define SCMISR_CFEI (0x02)
  150. #define SCMISR_CWIC (0x01)
  151. /* Bit definitions and macros for SCM_BCR */
  152. #define BCR_GBR (0x00000200)
  153. #define BCR_GBW (0x00000100)
  154. #define BCR_S7 (0x00000080)
  155. #define BCR_S6 (0x00000040)
  156. #define BCR_S4 (0x00000010)
  157. #define BCR_S1 (0x00000002)
  158. /* Bit definitions and macros for SCM_CFIER */
  159. #define CFIER_ECFEI (0x01)
  160. /* Bit definitions and macros for SCM_CFLOC */
  161. #define CFLOC_LOC (0x80)
  162. /* Bit definitions and macros for SCM_CFATR */
  163. #define CFATR_WRITE (0x80)
  164. #define CFATR_SZ32 (0x20)
  165. #define CFATR_SZ16 (0x10)
  166. #define CFATR_SZ08 (0x00)
  167. #define CFATR_CACHE (0x08)
  168. #define CFATR_MODE (0x02)
  169. #define CFATR_TYPE (0x01)
  170. /*********************************************************************
  171. * Reset Controller Module (RCM)
  172. *********************************************************************/
  173. /* Bit definitions and macros for RCR */
  174. #define RCM_RCR_FRCRSTOUT (0x40)
  175. #define RCM_RCR_SOFTRST (0x80)
  176. /* Bit definitions and macros for RSR */
  177. #define RCM_RSR_LOL (0x01)
  178. #define RCM_RSR_WDR_CORE (0x02)
  179. #define RCM_RSR_EXT (0x04)
  180. #define RCM_RSR_POR (0x08)
  181. #define RCM_RSR_SOFT (0x20)
  182. /*********************************************************************
  183. * Interrupt Controller (INTC)
  184. *********************************************************************/
  185. #define INTC0_EPORT INTC_IPRL_INT1
  186. #define INT0_LO_RSVD0 (0)
  187. #define INT0_LO_EPORT1 (1)
  188. #define INT0_LO_EPORT2 (2)
  189. #define INT0_LO_EPORT3 (3)
  190. #define INT0_LO_EPORT4 (4)
  191. #define INT0_LO_EPORT5 (5)
  192. #define INT0_LO_EPORT6 (6)
  193. #define INT0_LO_EPORT7 (7)
  194. #define INT0_LO_EDMA_00 (8)
  195. #define INT0_LO_EDMA_01 (9)
  196. #define INT0_LO_EDMA_02 (10)
  197. #define INT0_LO_EDMA_03 (11)
  198. #define INT0_LO_EDMA_04 (12)
  199. #define INT0_LO_EDMA_05 (13)
  200. #define INT0_LO_EDMA_06 (14)
  201. #define INT0_LO_EDMA_07 (15)
  202. #define INT0_LO_EDMA_08 (16)
  203. #define INT0_LO_EDMA_09 (17)
  204. #define INT0_LO_EDMA_10 (18)
  205. #define INT0_LO_EDMA_11 (19)
  206. #define INT0_LO_EDMA_12 (20)
  207. #define INT0_LO_EDMA_13 (21)
  208. #define INT0_LO_EDMA_14 (22)
  209. #define INT0_LO_EDMA_15 (23)
  210. #define INT0_LO_EDMA_ERR (24)
  211. #define INT0_LO_SCM (25)
  212. #define INT0_LO_UART0 (26)
  213. #define INT0_LO_UART1 (27)
  214. #define INT0_LO_UART2 (28)
  215. #define INT0_LO_RSVD1 (29)
  216. #define INT0_LO_I2C (30)
  217. #define INT0_LO_QSPI (31)
  218. #define INT0_HI_DTMR0 (32)
  219. #define INT0_HI_DTMR1 (33)
  220. #define INT0_HI_DTMR2 (34)
  221. #define INT0_HI_DTMR3 (35)
  222. #define INT0_HI_FEC_TXF (36)
  223. #define INT0_HI_FEC_TXB (37)
  224. #define INT0_HI_FEC_UN (38)
  225. #define INT0_HI_FEC_RL (39)
  226. #define INT0_HI_FEC_RXF (40)
  227. #define INT0_HI_FEC_RXB (41)
  228. #define INT0_HI_FEC_MII (42)
  229. #define INT0_HI_FEC_LC (43)
  230. #define INT0_HI_FEC_HBERR (44)
  231. #define INT0_HI_FEC_GRA (45)
  232. #define INT0_HI_FEC_EBERR (46)
  233. #define INT0_HI_FEC_BABT (47)
  234. #define INT0_HI_FEC_BABR (48)
  235. /* 49 - 61 Reserved */
  236. #define INT0_HI_SCM (62)
  237. /*********************************************************************
  238. * Watchdog Timer Modules (WTM)
  239. *********************************************************************/
  240. /* Bit definitions and macros for WTM_WCR */
  241. #define WTM_WCR_WAIT (0x0008)
  242. #define WTM_WCR_DOZE (0x0004)
  243. #define WTM_WCR_HALTED (0x0002)
  244. #define WTM_WCR_EN (0x0001)
  245. /*********************************************************************
  246. * Chip Configuration Module (CCM)
  247. *********************************************************************/
  248. /* Bit definitions and macros for CCM_CCR */
  249. #define CCM_CCR_CSC(x) (((x)&0x0003)<<8|0x0001)
  250. #define CCM_CCR_LIMP (0x0041)
  251. #define CCM_CCR_LOAD (0x0021)
  252. #define CCM_CCR_BOOTPS(x) (((x)&0x0003)<<3|0x0001)
  253. #define CCM_CCR_OSC_MODE (0x0005)
  254. #define CCM_CCR_PLL_MODE (0x0003)
  255. #define CCM_CCR_RESERVED (0x0001)
  256. /* Bit definitions and macros for CCM_RCON */
  257. #define CCM_RCON_CSC(x) (((x)&0x0003)<<8|0x0001)
  258. #define CCM_RCON_LIMP (0x0041)
  259. #define CCM_RCON_LOAD (0x0021)
  260. #define CCM_RCON_BOOTPS(x) (((x)&0x0003)<<3|0x0001)
  261. #define CCM_RCON_OSC_MODE (0x0005)
  262. #define CCM_RCON_PLL_MODE (0x0003)
  263. #define CCM_RCON_RESERVED (0x0001)
  264. /* Bit definitions and macros for CCM_CIR */
  265. #define CCM_CIR_PIN(x) (((x)&0x03FF)<<6)
  266. #define CCM_CIR_PRN(x) ((x)&0x003F)
  267. /* Bit definitions and macros for CCM_MISCCR */
  268. #define CCM_MISCCR_PLL_LOCK (0x2000)
  269. #define CCM_MISCCR_LIMP (0x1000)
  270. #define CCM_MISCCR_LCD_CHEN (0x0100)
  271. #define CCM_MISCCR_SSI_PUE (0x0080)
  272. #define CCM_MISCCR_SSI_PUS (0x0040)
  273. #define CCM_MISCCR_TIM_DMA (0x0020)
  274. #define CCM_MISCCR_SSI_SRC (0x0010)
  275. #define CCM_MISCCR_USBDIV (0x0002)
  276. #define CCM_MISCCR_USBSRC (0x0001)
  277. /* Bit definitions and macros for CCM_CDR */
  278. #define CCM_CDR_LPDIV(x) (((x)&0x000F)<<8)
  279. #define CCM_CDR_SSIDIV(x) ((x)&0x000F)
  280. /* Bit definitions and macros for CCM_UHCSR */
  281. #define CCM_UHCSR_PORTIND(x) (((x)&0x0003)<<14)
  282. #define CCM_UHCSR_WKUP (0x0004)
  283. #define CCM_UHCSR_UHMIE (0x0002)
  284. #define CCM_UHCSR_XPDE (0x0001)
  285. /* Bit definitions and macros for CCM_UOCSR */
  286. #define CCM_UOCSR_PORTIND(x) (((x)&0x0003)<<14)
  287. #define CCM_UOCSR_DPPD (0x2000)
  288. #define CCM_UOCSR_DMPD (0x1000)
  289. #define CCM_UOCSR_DRV_VBUS (0x0800)
  290. #define CCM_UOCSR_CRG_VBUS (0x0400)
  291. #define CCM_UOCSR_DCR_VBUS (0x0200)
  292. #define CCM_UOCSR_DPPU (0x0100)
  293. #define CCM_UOCSR_AVLD (0x0080)
  294. #define CCM_UOCSR_BVLD (0x0040)
  295. #define CCM_UOCSR_VVLD (0x0020)
  296. #define CCM_UOCSR_SEND (0x0010)
  297. #define CCM_UOCSR_PWRFLT (0x0008)
  298. #define CCM_UOCSR_WKUP (0x0004)
  299. #define CCM_UOCSR_UOMIE (0x0002)
  300. #define CCM_UOCSR_XPDE (0x0001)
  301. /* not done yet */
  302. /*********************************************************************
  303. * General Purpose I/O (GPIO)
  304. *********************************************************************/
  305. /* Bit definitions and macros for GPIO_PODR_FECH_L */
  306. #define GPIO_PODR_FECH_L7 (0x80)
  307. #define GPIO_PODR_FECH_L6 (0x40)
  308. #define GPIO_PODR_FECH_L5 (0x20)
  309. #define GPIO_PODR_FECH_L4 (0x10)
  310. #define GPIO_PODR_FECH_L3 (0x08)
  311. #define GPIO_PODR_FECH_L2 (0x04)
  312. #define GPIO_PODR_FECH_L1 (0x02)
  313. #define GPIO_PODR_FECH_L0 (0x01)
  314. /* Bit definitions and macros for GPIO_PODR_SSI */
  315. #define GPIO_PODR_SSI_4 (0x10)
  316. #define GPIO_PODR_SSI_3 (0x08)
  317. #define GPIO_PODR_SSI_2 (0x04)
  318. #define GPIO_PODR_SSI_1 (0x02)
  319. #define GPIO_PODR_SSI_0 (0x01)
  320. /* Bit definitions and macros for GPIO_PODR_BUSCTL */
  321. #define GPIO_PODR_BUSCTL_3 (0x08)
  322. #define GPIO_PODR_BUSCTL_2 (0x04)
  323. #define GPIO_PODR_BUSCTL_1 (0x02)
  324. #define GPIO_PODR_BUSCTL_0 (0x01)
  325. /* Bit definitions and macros for GPIO_PODR_BE */
  326. #define GPIO_PODR_BE_3 (0x08)
  327. #define GPIO_PODR_BE_2 (0x04)
  328. #define GPIO_PODR_BE_1 (0x02)
  329. #define GPIO_PODR_BE_0 (0x01)
  330. /* Bit definitions and macros for GPIO_PODR_CS */
  331. #define GPIO_PODR_CS_5 (0x20)
  332. #define GPIO_PODR_CS_4 (0x10)
  333. #define GPIO_PODR_CS_3 (0x08)
  334. #define GPIO_PODR_CS_2 (0x04)
  335. #define GPIO_PODR_CS_1 (0x02)
  336. /* Bit definitions and macros for GPIO_PODR_PWM */
  337. #define GPIO_PODR_PWM_5 (0x20)
  338. #define GPIO_PODR_PWM_4 (0x10)
  339. #define GPIO_PODR_PWM_3 (0x08)
  340. #define GPIO_PODR_PWM_2 (0x04)
  341. /* Bit definitions and macros for GPIO_PODR_FECI2C */
  342. #define GPIO_PODR_FECI2C_3 (0x08)
  343. #define GPIO_PODR_FECI2C_2 (0x04)
  344. #define GPIO_PODR_FECI2C_1 (0x02)
  345. #define GPIO_PODR_FECI2C_0 (0x01)
  346. /* Bit definitions and macros for GPIO_PODR_UART */
  347. #define GPIO_PODR_UART_7 (0x80)
  348. #define GPIO_PODR_UART_6 (0x40)
  349. #define GPIO_PODR_UART_5 (0x20)
  350. #define GPIO_PODR_UART_4 (0x10)
  351. #define GPIO_PODR_UART_3 (0x08)
  352. #define GPIO_PODR_UART_2 (0x04)
  353. #define GPIO_PODR_UART_1 (0x02)
  354. #define GPIO_PODR_UART_0 (0x01)
  355. /* Bit definitions and macros for GPIO_PODR_QSPI */
  356. #define GPIO_PODR_QSPI_5 (0x20)
  357. #define GPIO_PODR_QSPI_4 (0x10)
  358. #define GPIO_PODR_QSPI_3 (0x08)
  359. #define GPIO_PODR_QSPI_2 (0x04)
  360. #define GPIO_PODR_QSPI_1 (0x02)
  361. #define GPIO_PODR_QSPI_0 (0x01)
  362. /* Bit definitions and macros for GPIO_PODR_TIMER */
  363. #define GPIO_PODR_TIMER_3 (0x08)
  364. #define GPIO_PODR_TIMER_2 (0x04)
  365. #define GPIO_PODR_TIMER_1 (0x02)
  366. #define GPIO_PODR_TIMER_0 (0x01)
  367. /* Bit definitions and macros for GPIO_PODR_LCDDATAH */
  368. #define GPIO_PODR_LCDDATAH_1 (0x02)
  369. #define GPIO_PODR_LCDDATAH_0 (0x01)
  370. /* Bit definitions and macros for GPIO_PODR_LCDDATAM */
  371. #define GPIO_PODR_LCDDATAM_7 (0x80)
  372. #define GPIO_PODR_LCDDATAM_6 (0x40)
  373. #define GPIO_PODR_LCDDATAM_5 (0x20)
  374. #define GPIO_PODR_LCDDATAM_4 (0x10)
  375. #define GPIO_PODR_LCDDATAM_3 (0x08)
  376. #define GPIO_PODR_LCDDATAM_2 (0x04)
  377. #define GPIO_PODR_LCDDATAM_1 (0x02)
  378. #define GPIO_PODR_LCDDATAM_0 (0x01)
  379. /* Bit definitions and macros for GPIO_PODR_LCDDATAL */
  380. #define GPIO_PODR_LCDDATAL_7 (0x80)
  381. #define GPIO_PODR_LCDDATAL_6 (0x40)
  382. #define GPIO_PODR_LCDDATAL_5 (0x20)
  383. #define GPIO_PODR_LCDDATAL_4 (0x10)
  384. #define GPIO_PODR_LCDDATAL_3 (0x08)
  385. #define GPIO_PODR_LCDDATAL_2 (0x04)
  386. #define GPIO_PODR_LCDDATAL_1 (0x02)
  387. #define GPIO_PODR_LCDDATAL_0 (0x01)
  388. /* Bit definitions and macros for GPIO_PODR_LCDCTLH */
  389. #define GPIO_PODR_LCDCTLH_0 (0x01)
  390. /* Bit definitions and macros for GPIO_PODR_LCDCTLL */
  391. #define GPIO_PODR_LCDCTLL_7 (0x80)
  392. #define GPIO_PODR_LCDCTLL_6 (0x40)
  393. #define GPIO_PODR_LCDCTLL_5 (0x20)
  394. #define GPIO_PODR_LCDCTLL_4 (0x10)
  395. #define GPIO_PODR_LCDCTLL_3 (0x08)
  396. #define GPIO_PODR_LCDCTLL_2 (0x04)
  397. #define GPIO_PODR_LCDCTLL_1 (0x02)
  398. #define GPIO_PODR_LCDCTLL_0 (0x01)
  399. /* Bit definitions and macros for GPIO_PDDR_FECH */
  400. #define GPIO_PDDR_FECH_L7 (0x80)
  401. #define GPIO_PDDR_FECH_L6 (0x40)
  402. #define GPIO_PDDR_FECH_L5 (0x20)
  403. #define GPIO_PDDR_FECH_L4 (0x10)
  404. #define GPIO_PDDR_FECH_L3 (0x08)
  405. #define GPIO_PDDR_FECH_L2 (0x04)
  406. #define GPIO_PDDR_FECH_L1 (0x02)
  407. #define GPIO_PDDR_FECH_L0 (0x01)
  408. /* Bit definitions and macros for GPIO_PDDR_SSI */
  409. #define GPIO_PDDR_SSI_4 (0x10)
  410. #define GPIO_PDDR_SSI_3 (0x08)
  411. #define GPIO_PDDR_SSI_2 (0x04)
  412. #define GPIO_PDDR_SSI_1 (0x02)
  413. #define GPIO_PDDR_SSI_0 (0x01)
  414. /* Bit definitions and macros for GPIO_PDDR_BUSCTL */
  415. #define GPIO_PDDR_BUSCTL_3 (0x08)
  416. #define GPIO_PDDR_BUSCTL_2 (0x04)
  417. #define GPIO_PDDR_BUSCTL_1 (0x02)
  418. #define GPIO_PDDR_BUSCTL_0 (0x01)
  419. /* Bit definitions and macros for GPIO_PDDR_BE */
  420. #define GPIO_PDDR_BE_3 (0x08)
  421. #define GPIO_PDDR_BE_2 (0x04)
  422. #define GPIO_PDDR_BE_1 (0x02)
  423. #define GPIO_PDDR_BE_0 (0x01)
  424. /* Bit definitions and macros for GPIO_PDDR_CS */
  425. #define GPIO_PDDR_CS_1 (0x02)
  426. #define GPIO_PDDR_CS_2 (0x04)
  427. #define GPIO_PDDR_CS_3 (0x08)
  428. #define GPIO_PDDR_CS_4 (0x10)
  429. #define GPIO_PDDR_CS_5 (0x20)
  430. /* Bit definitions and macros for GPIO_PDDR_PWM */
  431. #define GPIO_PDDR_PWM_2 (0x04)
  432. #define GPIO_PDDR_PWM_3 (0x08)
  433. #define GPIO_PDDR_PWM_4 (0x10)
  434. #define GPIO_PDDR_PWM_5 (0x20)
  435. /* Bit definitions and macros for GPIO_PDDR_FECI2C */
  436. #define GPIO_PDDR_FECI2C_0 (0x01)
  437. #define GPIO_PDDR_FECI2C_1 (0x02)
  438. #define GPIO_PDDR_FECI2C_2 (0x04)
  439. #define GPIO_PDDR_FECI2C_3 (0x08)
  440. /* Bit definitions and macros for GPIO_PDDR_UART */
  441. #define GPIO_PDDR_UART_0 (0x01)
  442. #define GPIO_PDDR_UART_1 (0x02)
  443. #define GPIO_PDDR_UART_2 (0x04)
  444. #define GPIO_PDDR_UART_3 (0x08)
  445. #define GPIO_PDDR_UART_4 (0x10)
  446. #define GPIO_PDDR_UART_5 (0x20)
  447. #define GPIO_PDDR_UART_6 (0x40)
  448. #define GPIO_PDDR_UART_7 (0x80)
  449. /* Bit definitions and macros for GPIO_PDDR_QSPI */
  450. #define GPIO_PDDR_QSPI_0 (0x01)
  451. #define GPIO_PDDR_QSPI_1 (0x02)
  452. #define GPIO_PDDR_QSPI_2 (0x04)
  453. #define GPIO_PDDR_QSPI_3 (0x08)
  454. #define GPIO_PDDR_QSPI_4 (0x10)
  455. #define GPIO_PDDR_QSPI_5 (0x20)
  456. /* Bit definitions and macros for GPIO_PDDR_TIMER */
  457. #define GPIO_PDDR_TIMER_0 (0x01)
  458. #define GPIO_PDDR_TIMER_1 (0x02)
  459. #define GPIO_PDDR_TIMER_2 (0x04)
  460. #define GPIO_PDDR_TIMER_3 (0x08)
  461. /* Bit definitions and macros for GPIO_PDDR_LCDDATAH */
  462. #define GPIO_PDDR_LCDDATAH_0 (0x01)
  463. #define GPIO_PDDR_LCDDATAH_1 (0x02)
  464. /* Bit definitions and macros for GPIO_PDDR_LCDDATAM */
  465. #define GPIO_PDDR_LCDDATAM_0 (0x01)
  466. #define GPIO_PDDR_LCDDATAM_1 (0x02)
  467. #define GPIO_PDDR_LCDDATAM_2 (0x04)
  468. #define GPIO_PDDR_LCDDATAM_3 (0x08)
  469. #define GPIO_PDDR_LCDDATAM_4 (0x10)
  470. #define GPIO_PDDR_LCDDATAM_5 (0x20)
  471. #define GPIO_PDDR_LCDDATAM_6 (0x40)
  472. #define GPIO_PDDR_LCDDATAM_7 (0x80)
  473. /* Bit definitions and macros for GPIO_PDDR_LCDDATAL */
  474. #define GPIO_PDDR_LCDDATAL_0 (0x01)
  475. #define GPIO_PDDR_LCDDATAL_1 (0x02)
  476. #define GPIO_PDDR_LCDDATAL_2 (0x04)
  477. #define GPIO_PDDR_LCDDATAL_3 (0x08)
  478. #define GPIO_PDDR_LCDDATAL_4 (0x10)
  479. #define GPIO_PDDR_LCDDATAL_5 (0x20)
  480. #define GPIO_PDDR_LCDDATAL_6 (0x40)
  481. #define GPIO_PDDR_LCDDATAL_7 (0x80)
  482. /* Bit definitions and macros for GPIO_PDDR_LCDCTLH */
  483. #define GPIO_PDDR_LCDCTLH_0 (0x01)
  484. /* Bit definitions and macros for GPIO_PDDR_LCDCTLL */
  485. #define GPIO_PDDR_LCDCTLL_0 (0x01)
  486. #define GPIO_PDDR_LCDCTLL_1 (0x02)
  487. #define GPIO_PDDR_LCDCTLL_2 (0x04)
  488. #define GPIO_PDDR_LCDCTLL_3 (0x08)
  489. #define GPIO_PDDR_LCDCTLL_4 (0x10)
  490. #define GPIO_PDDR_LCDCTLL_5 (0x20)
  491. #define GPIO_PDDR_LCDCTLL_6 (0x40)
  492. #define GPIO_PDDR_LCDCTLL_7 (0x80)
  493. /* Bit definitions and macros for GPIO_PPDSDR_FECH */
  494. #define GPIO_PPDSDR_FECH_L0 (0x01)
  495. #define GPIO_PPDSDR_FECH_L1 (0x02)
  496. #define GPIO_PPDSDR_FECH_L2 (0x04)
  497. #define GPIO_PPDSDR_FECH_L3 (0x08)
  498. #define GPIO_PPDSDR_FECH_L4 (0x10)
  499. #define GPIO_PPDSDR_FECH_L5 (0x20)
  500. #define GPIO_PPDSDR_FECH_L6 (0x40)
  501. #define GPIO_PPDSDR_FECH_L7 (0x80)
  502. /* Bit definitions and macros for GPIO_PPDSDR_SSI */
  503. #define GPIO_PPDSDR_SSI_0 (0x01)
  504. #define GPIO_PPDSDR_SSI_1 (0x02)
  505. #define GPIO_PPDSDR_SSI_2 (0x04)
  506. #define GPIO_PPDSDR_SSI_3 (0x08)
  507. #define GPIO_PPDSDR_SSI_4 (0x10)
  508. /* Bit definitions and macros for GPIO_PPDSDR_BUSCTL */
  509. #define GPIO_PPDSDR_BUSCTL_0 (0x01)
  510. #define GPIO_PPDSDR_BUSCTL_1 (0x02)
  511. #define GPIO_PPDSDR_BUSCTL_2 (0x04)
  512. #define GPIO_PPDSDR_BUSCTL_3 (0x08)
  513. /* Bit definitions and macros for GPIO_PPDSDR_BE */
  514. #define GPIO_PPDSDR_BE_0 (0x01)
  515. #define GPIO_PPDSDR_BE_1 (0x02)
  516. #define GPIO_PPDSDR_BE_2 (0x04)
  517. #define GPIO_PPDSDR_BE_3 (0x08)
  518. /* Bit definitions and macros for GPIO_PPDSDR_CS */
  519. #define GPIO_PPDSDR_CS_1 (0x02)
  520. #define GPIO_PPDSDR_CS_2 (0x04)
  521. #define GPIO_PPDSDR_CS_3 (0x08)
  522. #define GPIO_PPDSDR_CS_4 (0x10)
  523. #define GPIO_PPDSDR_CS_5 (0x20)
  524. /* Bit definitions and macros for GPIO_PPDSDR_PWM */
  525. #define GPIO_PPDSDR_PWM_2 (0x04)
  526. #define GPIO_PPDSDR_PWM_3 (0x08)
  527. #define GPIO_PPDSDR_PWM_4 (0x10)
  528. #define GPIO_PPDSDR_PWM_5 (0x20)
  529. /* Bit definitions and macros for GPIO_PPDSDR_FECI2C */
  530. #define GPIO_PPDSDR_FECI2C_0 (0x01)
  531. #define GPIO_PPDSDR_FECI2C_1 (0x02)
  532. #define GPIO_PPDSDR_FECI2C_2 (0x04)
  533. #define GPIO_PPDSDR_FECI2C_3 (0x08)
  534. /* Bit definitions and macros for GPIO_PPDSDR_UART */
  535. #define GPIO_PPDSDR_UART_0 (0x01)
  536. #define GPIO_PPDSDR_UART_1 (0x02)
  537. #define GPIO_PPDSDR_UART_2 (0x04)
  538. #define GPIO_PPDSDR_UART_3 (0x08)
  539. #define GPIO_PPDSDR_UART_4 (0x10)
  540. #define GPIO_PPDSDR_UART_5 (0x20)
  541. #define GPIO_PPDSDR_UART_6 (0x40)
  542. #define GPIO_PPDSDR_UART_7 (0x80)
  543. /* Bit definitions and macros for GPIO_PPDSDR_QSPI */
  544. #define GPIO_PPDSDR_QSPI_0 (0x01)
  545. #define GPIO_PPDSDR_QSPI_1 (0x02)
  546. #define GPIO_PPDSDR_QSPI_2 (0x04)
  547. #define GPIO_PPDSDR_QSPI_3 (0x08)
  548. #define GPIO_PPDSDR_QSPI_4 (0x10)
  549. #define GPIO_PPDSDR_QSPI_5 (0x20)
  550. /* Bit definitions and macros for GPIO_PPDSDR_TIMER */
  551. #define GPIO_PPDSDR_TIMER_0 (0x01)
  552. #define GPIO_PPDSDR_TIMER_1 (0x02)
  553. #define GPIO_PPDSDR_TIMER_2 (0x04)
  554. #define GPIO_PPDSDR_TIMER_3 (0x08)
  555. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAH */
  556. #define GPIO_PPDSDR_LCDDATAH_0 (0x01)
  557. #define GPIO_PPDSDR_LCDDATAH_1 (0x02)
  558. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAM */
  559. #define GPIO_PPDSDR_LCDDATAM_0 (0x01)
  560. #define GPIO_PPDSDR_LCDDATAM_1 (0x02)
  561. #define GPIO_PPDSDR_LCDDATAM_2 (0x04)
  562. #define GPIO_PPDSDR_LCDDATAM_3 (0x08)
  563. #define GPIO_PPDSDR_LCDDATAM_4 (0x10)
  564. #define GPIO_PPDSDR_LCDDATAM_5 (0x20)
  565. #define GPIO_PPDSDR_LCDDATAM_6 (0x40)
  566. #define GPIO_PPDSDR_LCDDATAM_7 (0x80)
  567. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAL */
  568. #define GPIO_PPDSDR_LCDDATAL_0 (0x01)
  569. #define GPIO_PPDSDR_LCDDATAL_1 (0x02)
  570. #define GPIO_PPDSDR_LCDDATAL_2 (0x04)
  571. #define GPIO_PPDSDR_LCDDATAL_3 (0x08)
  572. #define GPIO_PPDSDR_LCDDATAL_4 (0x10)
  573. #define GPIO_PPDSDR_LCDDATAL_5 (0x20)
  574. #define GPIO_PPDSDR_LCDDATAL_6 (0x40)
  575. #define GPIO_PPDSDR_LCDDATAL_7 (0x80)
  576. /* Bit definitions and macros for GPIO_PPDSDR_LCDCTLH */
  577. #define GPIO_PPDSDR_LCDCTLH_0 (0x01)
  578. /* Bit definitions and macros for GPIO_PPDSDR_LCDCTLL */
  579. #define GPIO_PPDSDR_LCDCTLL_0 (0x01)
  580. #define GPIO_PPDSDR_LCDCTLL_1 (0x02)
  581. #define GPIO_PPDSDR_LCDCTLL_2 (0x04)
  582. #define GPIO_PPDSDR_LCDCTLL_3 (0x08)
  583. #define GPIO_PPDSDR_LCDCTLL_4 (0x10)
  584. #define GPIO_PPDSDR_LCDCTLL_5 (0x20)
  585. #define GPIO_PPDSDR_LCDCTLL_6 (0x40)
  586. #define GPIO_PPDSDR_LCDCTLL_7 (0x80)
  587. /* Bit definitions and macros for GPIO_PCLRR_FECH */
  588. #define GPIO_PCLRR_FECH_L0 (0x01)
  589. #define GPIO_PCLRR_FECH_L1 (0x02)
  590. #define GPIO_PCLRR_FECH_L2 (0x04)
  591. #define GPIO_PCLRR_FECH_L3 (0x08)
  592. #define GPIO_PCLRR_FECH_L4 (0x10)
  593. #define GPIO_PCLRR_FECH_L5 (0x20)
  594. #define GPIO_PCLRR_FECH_L6 (0x40)
  595. #define GPIO_PCLRR_FECH_L7 (0x80)
  596. /* Bit definitions and macros for GPIO_PCLRR_SSI */
  597. #define GPIO_PCLRR_SSI_0 (0x01)
  598. #define GPIO_PCLRR_SSI_1 (0x02)
  599. #define GPIO_PCLRR_SSI_2 (0x04)
  600. #define GPIO_PCLRR_SSI_3 (0x08)
  601. #define GPIO_PCLRR_SSI_4 (0x10)
  602. /* Bit definitions and macros for GPIO_PCLRR_BUSCTL */
  603. #define GPIO_PCLRR_BUSCTL_L0 (0x01)
  604. #define GPIO_PCLRR_BUSCTL_L1 (0x02)
  605. #define GPIO_PCLRR_BUSCTL_L2 (0x04)
  606. #define GPIO_PCLRR_BUSCTL_L3 (0x08)
  607. /* Bit definitions and macros for GPIO_PCLRR_BE */
  608. #define GPIO_PCLRR_BE_0 (0x01)
  609. #define GPIO_PCLRR_BE_1 (0x02)
  610. #define GPIO_PCLRR_BE_2 (0x04)
  611. #define GPIO_PCLRR_BE_3 (0x08)
  612. /* Bit definitions and macros for GPIO_PCLRR_CS */
  613. #define GPIO_PCLRR_CS_1 (0x02)
  614. #define GPIO_PCLRR_CS_2 (0x04)
  615. #define GPIO_PCLRR_CS_3 (0x08)
  616. #define GPIO_PCLRR_CS_4 (0x10)
  617. #define GPIO_PCLRR_CS_5 (0x20)
  618. /* Bit definitions and macros for GPIO_PCLRR_PWM */
  619. #define GPIO_PCLRR_PWM_2 (0x04)
  620. #define GPIO_PCLRR_PWM_3 (0x08)
  621. #define GPIO_PCLRR_PWM_4 (0x10)
  622. #define GPIO_PCLRR_PWM_5 (0x20)
  623. /* Bit definitions and macros for GPIO_PCLRR_FECI2C */
  624. #define GPIO_PCLRR_FECI2C_0 (0x01)
  625. #define GPIO_PCLRR_FECI2C_1 (0x02)
  626. #define GPIO_PCLRR_FECI2C_2 (0x04)
  627. #define GPIO_PCLRR_FECI2C_3 (0x08)
  628. /* Bit definitions and macros for GPIO_PCLRR_UART */
  629. #define GPIO_PCLRR_UART0 (0x01)
  630. #define GPIO_PCLRR_UART1 (0x02)
  631. #define GPIO_PCLRR_UART2 (0x04)
  632. #define GPIO_PCLRR_UART3 (0x08)
  633. #define GPIO_PCLRR_UART4 (0x10)
  634. #define GPIO_PCLRR_UART5 (0x20)
  635. #define GPIO_PCLRR_UART6 (0x40)
  636. #define GPIO_PCLRR_UART7 (0x80)
  637. /* Bit definitions and macros for GPIO_PCLRR_QSPI */
  638. #define GPIO_PCLRR_QSPI0 (0x01)
  639. #define GPIO_PCLRR_QSPI1 (0x02)
  640. #define GPIO_PCLRR_QSPI2 (0x04)
  641. #define GPIO_PCLRR_QSPI3 (0x08)
  642. #define GPIO_PCLRR_QSPI4 (0x10)
  643. #define GPIO_PCLRR_QSPI5 (0x20)
  644. /* Bit definitions and macros for GPIO_PCLRR_TIMER */
  645. #define GPIO_PCLRR_TIMER0 (0x01)
  646. #define GPIO_PCLRR_TIMER1 (0x02)
  647. #define GPIO_PCLRR_TIMER2 (0x04)
  648. #define GPIO_PCLRR_TIMER3 (0x08)
  649. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAH */
  650. #define GPIO_PCLRR_LCDDATAH0 (0x01)
  651. #define GPIO_PCLRR_LCDDATAH1 (0x02)
  652. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAM */
  653. #define GPIO_PCLRR_LCDDATAM0 (0x01)
  654. #define GPIO_PCLRR_LCDDATAM1 (0x02)
  655. #define GPIO_PCLRR_LCDDATAM2 (0x04)
  656. #define GPIO_PCLRR_LCDDATAM3 (0x08)
  657. #define GPIO_PCLRR_LCDDATAM4 (0x10)
  658. #define GPIO_PCLRR_LCDDATAM5 (0x20)
  659. #define GPIO_PCLRR_LCDDATAM6 (0x40)
  660. #define GPIO_PCLRR_LCDDATAM7 (0x80)
  661. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAL */
  662. #define GPIO_PCLRR_LCDDATAL0 (0x01)
  663. #define GPIO_PCLRR_LCDDATAL1 (0x02)
  664. #define GPIO_PCLRR_LCDDATAL2 (0x04)
  665. #define GPIO_PCLRR_LCDDATAL3 (0x08)
  666. #define GPIO_PCLRR_LCDDATAL4 (0x10)
  667. #define GPIO_PCLRR_LCDDATAL5 (0x20)
  668. #define GPIO_PCLRR_LCDDATAL6 (0x40)
  669. #define GPIO_PCLRR_LCDDATAL7 (0x80)
  670. /* Bit definitions and macros for GPIO_PCLRR_LCDCTLH */
  671. #define GPIO_PCLRR_LCDCTLH_PCLRR_LCDCTLH0 (0x01)
  672. /* Bit definitions and macros for GPIO_PCLRR_LCDCTLL */
  673. #define GPIO_PCLRR_LCDCTLL0 (0x01)
  674. #define GPIO_PCLRR_LCDCTLL1 (0x02)
  675. #define GPIO_PCLRR_LCDCTLL2 (0x04)
  676. #define GPIO_PCLRR_LCDCTLL3 (0x08)
  677. #define GPIO_PCLRR_LCDCTLL4 (0x10)
  678. #define GPIO_PCLRR_LCDCTLL5 (0x20)
  679. #define GPIO_PCLRR_LCDCTLL6 (0x40)
  680. #define GPIO_PCLRR_LCDCTLL7 (0x80)
  681. /* Bit definitions and macros for GPIO_PAR_FEC */
  682. #ifdef CONFIG_M5329
  683. #define GPIO_PAR_FEC_MII(x) (((x)&0x03)<<0)
  684. #define GPIO_PAR_FEC_7W(x) (((x)&0x03)<<2)
  685. #define GPIO_PAR_FEC_7W_GPIO (0x00)
  686. #define GPIO_PAR_FEC_7W_URTS1 (0x04)
  687. #define GPIO_PAR_FEC_7W_FEC (0x0C)
  688. #define GPIO_PAR_FEC_MII_GPIO (0x00)
  689. #define GPIO_PAR_FEC_MII_UART (0x01)
  690. #define GPIO_PAR_FEC_MII_FEC (0x03)
  691. #else
  692. #define GPIO_PAR_FEC_7W_FEC (0x08)
  693. #define GPIO_PAR_FEC_MII_FEC (0x02)
  694. #endif
  695. /* Bit definitions and macros for GPIO_PAR_PWM */
  696. #define GPIO_PAR_PWM1(x) (((x)&0x03)<<0)
  697. #define GPIO_PAR_PWM3(x) (((x)&0x03)<<2)
  698. #define GPIO_PAR_PWM5 (0x10)
  699. #define GPIO_PAR_PWM7 (0x20)
  700. /* Bit definitions and macros for GPIO_PAR_BUSCTL */
  701. #define GPIO_PAR_BUSCTL_TS(x) (((x)&0x03)<<3)
  702. #define GPIO_PAR_BUSCTL_RWB (0x20)
  703. #define GPIO_PAR_BUSCTL_TA (0x40)
  704. #define GPIO_PAR_BUSCTL_OE (0x80)
  705. #define GPIO_PAR_BUSCTL_OE_GPIO (0x00)
  706. #define GPIO_PAR_BUSCTL_OE_OE (0x80)
  707. #define GPIO_PAR_BUSCTL_TA_GPIO (0x00)
  708. #define GPIO_PAR_BUSCTL_TA_TA (0x40)
  709. #define GPIO_PAR_BUSCTL_RWB_GPIO (0x00)
  710. #define GPIO_PAR_BUSCTL_RWB_RWB (0x20)
  711. #define GPIO_PAR_BUSCTL_TS_GPIO (0x00)
  712. #define GPIO_PAR_BUSCTL_TS_DACK0 (0x10)
  713. #define GPIO_PAR_BUSCTL_TS_TS (0x18)
  714. /* Bit definitions and macros for GPIO_PAR_FECI2C */
  715. #define GPIO_PAR_FECI2C_SDA(x) (((x)&0x03)<<0)
  716. #define GPIO_PAR_FECI2C_SCL(x) (((x)&0x03)<<2)
  717. #define GPIO_PAR_FECI2C_MDIO(x) (((x)&0x03)<<4)
  718. #define GPIO_PAR_FECI2C_MDC(x) (((x)&0x03)<<6)
  719. #define GPIO_PAR_FECI2C_MDC_GPIO (0x00)
  720. #define GPIO_PAR_FECI2C_MDC_UTXD2 (0x40)
  721. #define GPIO_PAR_FECI2C_MDC_SCL (0x80)
  722. #define GPIO_PAR_FECI2C_MDC_EMDC (0xC0)
  723. #define GPIO_PAR_FECI2C_MDIO_GPIO (0x00)
  724. #define GPIO_PAR_FECI2C_MDIO_URXD2 (0x10)
  725. #define GPIO_PAR_FECI2C_MDIO_SDA (0x20)
  726. #define GPIO_PAR_FECI2C_MDIO_EMDIO (0x30)
  727. #define GPIO_PAR_FECI2C_SCL_GPIO (0x00)
  728. #define GPIO_PAR_FECI2C_SCL_UTXD2 (0x04)
  729. #define GPIO_PAR_FECI2C_SCL_SCL (0x0C)
  730. #define GPIO_PAR_FECI2C_SDA_GPIO (0x00)
  731. #define GPIO_PAR_FECI2C_SDA_URXD2 (0x02)
  732. #define GPIO_PAR_FECI2C_SDA_SDA (0x03)
  733. /* Bit definitions and macros for GPIO_PAR_BE */
  734. #define GPIO_PAR_BE0 (0x01)
  735. #define GPIO_PAR_BE1 (0x02)
  736. #define GPIO_PAR_BE2 (0x04)
  737. #define GPIO_PAR_BE3 (0x08)
  738. /* Bit definitions and macros for GPIO_PAR_CS */
  739. #define GPIO_PAR_CS1 (0x02)
  740. #define GPIO_PAR_CS2 (0x04)
  741. #define GPIO_PAR_CS3 (0x08)
  742. #define GPIO_PAR_CS4 (0x10)
  743. #define GPIO_PAR_CS5 (0x20)
  744. #define GPIO_PAR_CS1_GPIO (0x00)
  745. #define GPIO_PAR_CS1_SDCS1 (0x01)
  746. #define GPIO_PAR_CS1_CS1 (0x03)
  747. /* Bit definitions and macros for GPIO_PAR_SSI */
  748. #define GPIO_PAR_SSI_MCLK (0x0080)
  749. #define GPIO_PAR_SSI_TXD(x) (((x)&0x0003)<<8)
  750. #define GPIO_PAR_SSI_RXD(x) (((x)&0x0003)<<10)
  751. #define GPIO_PAR_SSI_FS(x) (((x)&0x0003)<<12)
  752. #define GPIO_PAR_SSI_BCLK(x) (((x)&0x0003)<<14)
  753. /* Bit definitions and macros for GPIO_PAR_UART */
  754. #define GPIO_PAR_UART_TXD0 (0x0001)
  755. #define GPIO_PAR_UART_RXD0 (0x0002)
  756. #define GPIO_PAR_UART_RTS0 (0x0004)
  757. #define GPIO_PAR_UART_CTS0 (0x0008)
  758. #define GPIO_PAR_UART_TXD1(x) (((x)&0x0003)<<4)
  759. #define GPIO_PAR_UART_RXD1(x) (((x)&0x0003)<<6)
  760. #define GPIO_PAR_UART_RTS1(x) (((x)&0x0003)<<8)
  761. #define GPIO_PAR_UART_CTS1(x) (((x)&0x0003)<<10)
  762. #define GPIO_PAR_UART_CTS1_GPIO (0x0000)
  763. #define GPIO_PAR_UART_CTS1_SSI_BCLK (0x0800)
  764. #define GPIO_PAR_UART_CTS1_ULPI_D7 (0x0400)
  765. #define GPIO_PAR_UART_CTS1_UCTS1 (0x0C00)
  766. #define GPIO_PAR_UART_RTS1_GPIO (0x0000)
  767. #define GPIO_PAR_UART_RTS1_SSI_FS (0x0200)
  768. #define GPIO_PAR_UART_RTS1_ULPI_D6 (0x0100)
  769. #define GPIO_PAR_UART_RTS1_URTS1 (0x0300)
  770. #define GPIO_PAR_UART_RXD1_GPIO (0x0000)
  771. #define GPIO_PAR_UART_RXD1_SSI_RXD (0x0080)
  772. #define GPIO_PAR_UART_RXD1_ULPI_D5 (0x0040)
  773. #define GPIO_PAR_UART_RXD1_URXD1 (0x00C0)
  774. #define GPIO_PAR_UART_TXD1_GPIO (0x0000)
  775. #define GPIO_PAR_UART_TXD1_SSI_TXD (0x0020)
  776. #define GPIO_PAR_UART_TXD1_ULPI_D4 (0x0010)
  777. #define GPIO_PAR_UART_TXD1_UTXD1 (0x0030)
  778. /* Bit definitions and macros for GPIO_PAR_QSPI */
  779. #define GPIO_PAR_QSPI_SCK(x) (((x)&0x0003)<<4)
  780. #define GPIO_PAR_QSPI_DOUT(x) (((x)&0x0003)<<6)
  781. #define GPIO_PAR_QSPI_DIN(x) (((x)&0x0003)<<8)
  782. #define GPIO_PAR_QSPI_PCS0(x) (((x)&0x0003)<<10)
  783. #define GPIO_PAR_QSPI_PCS1(x) (((x)&0x0003)<<12)
  784. #define GPIO_PAR_QSPI_PCS2(x) (((x)&0x0003)<<14)
  785. /* Bit definitions and macros for GPIO_PAR_TIMER */
  786. #define GPIO_PAR_TIN0(x) (((x)&0x03)<<0)
  787. #define GPIO_PAR_TIN1(x) (((x)&0x03)<<2)
  788. #define GPIO_PAR_TIN2(x) (((x)&0x03)<<4)
  789. #define GPIO_PAR_TIN3(x) (((x)&0x03)<<6)
  790. #define GPIO_PAR_TIN3_GPIO (0x00)
  791. #define GPIO_PAR_TIN3_TOUT3 (0x80)
  792. #define GPIO_PAR_TIN3_URXD2 (0x40)
  793. #define GPIO_PAR_TIN3_TIN3 (0xC0)
  794. #define GPIO_PAR_TIN2_GPIO (0x00)
  795. #define GPIO_PAR_TIN2_TOUT2 (0x20)
  796. #define GPIO_PAR_TIN2_UTXD2 (0x10)
  797. #define GPIO_PAR_TIN2_TIN2 (0x30)
  798. #define GPIO_PAR_TIN1_GPIO (0x00)
  799. #define GPIO_PAR_TIN1_TOUT1 (0x08)
  800. #define GPIO_PAR_TIN1_DACK1 (0x04)
  801. #define GPIO_PAR_TIN1_TIN1 (0x0C)
  802. #define GPIO_PAR_TIN0_GPIO (0x00)
  803. #define GPIO_PAR_TIN0_TOUT0 (0x02)
  804. #define GPIO_PAR_TIN0_DREQ0 (0x01)
  805. #define GPIO_PAR_TIN0_TIN0 (0x03)
  806. /* Bit definitions and macros for GPIO_PAR_LCDDATA */
  807. #define GPIO_PAR_LCDDATA_LD7_0(x) ((x)&0x03)
  808. #define GPIO_PAR_LCDDATA_LD15_8(x) (((x)&0x03)<<2)
  809. #define GPIO_PAR_LCDDATA_LD16(x) (((x)&0x03)<<4)
  810. #define GPIO_PAR_LCDDATA_LD17(x) (((x)&0x03)<<6)
  811. /* Bit definitions and macros for GPIO_PAR_LCDCTL */
  812. #define GPIO_PAR_LCDCTL_CLS (0x0001)
  813. #define GPIO_PAR_LCDCTL_PS (0x0002)
  814. #define GPIO_PAR_LCDCTL_REV (0x0004)
  815. #define GPIO_PAR_LCDCTL_SPL_SPR (0x0008)
  816. #define GPIO_PAR_LCDCTL_CONTRAST (0x0010)
  817. #define GPIO_PAR_LCDCTL_LSCLK (0x0020)
  818. #define GPIO_PAR_LCDCTL_LP_HSYNC (0x0040)
  819. #define GPIO_PAR_LCDCTL_FLM_VSYNC (0x0080)
  820. #define GPIO_PAR_LCDCTL_ACD_OE (0x0100)
  821. /* Bit definitions and macros for GPIO_PAR_IRQ */
  822. #define GPIO_PAR_IRQ1(x) (((x)&0x0003)<<4)
  823. #define GPIO_PAR_IRQ2(x) (((x)&0x0003)<<6)
  824. #define GPIO_PAR_IRQ4(x) (((x)&0x0003)<<8)
  825. #define GPIO_PAR_IRQ5(x) (((x)&0x0003)<<10)
  826. #define GPIO_PAR_IRQ6(x) (((x)&0x0003)<<12)
  827. /* Bit definitions and macros for GPIO_MSCR_FLEXBUS */
  828. #define GPIO_MSCR_FLEXBUS_ADDRCTL(x) ((x)&0x03)
  829. #define GPIO_MSCR_FLEXBUS_DLOWER(x) (((x)&0x03)<<2)
  830. #define GPIO_MSCR_FLEXBUS_DUPPER(x) (((x)&0x03)<<4)
  831. /* Bit definitions and macros for GPIO_MSCR_SDRAM */
  832. #define GPIO_MSCR_SDRAM_SDRAM(x) ((x)&0x03)
  833. #define GPIO_MSCR_SDRAM_SDCLK(x) (((x)&0x03)<<2)
  834. #define GPIO_MSCR_SDRAM_SDCLKB(x) (((x)&0x03)<<4)
  835. /* Bit definitions and macros for GPIO_DSCR_I2C */
  836. #define GPIO_DSCR_I2C_DSE(x) ((x)&0x03)
  837. /* Bit definitions and macros for GPIO_DSCR_PWM */
  838. #define GPIO_DSCR_PWM_DSE(x) ((x)&0x03)
  839. /* Bit definitions and macros for GPIO_DSCR_FEC */
  840. #define GPIO_DSCR_FEC_DSE(x) ((x)&0x03)
  841. /* Bit definitions and macros for GPIO_DSCR_UART */
  842. #define GPIO_DSCR_UART0_DSE(x) ((x)&0x03)
  843. #define GPIO_DSCR_UART1_DSE(x) (((x)&0x03)<<2)
  844. /* Bit definitions and macros for GPIO_DSCR_QSPI */
  845. #define GPIO_DSCR_QSPI_DSE(x) ((x)&0x03)
  846. /* Bit definitions and macros for GPIO_DSCR_TIMER */
  847. #define GPIO_DSCR_TIMER_DSE(x) ((x)&0x03)
  848. /* Bit definitions and macros for GPIO_DSCR_SSI */
  849. #define GPIO_DSCR_SSI_DSE(x) ((x)&0x03)
  850. /* Bit definitions and macros for GPIO_DSCR_LCD */
  851. #define GPIO_DSCR_LCD_DSE(x) ((x)&0x03)
  852. /* Bit definitions and macros for GPIO_DSCR_DEBUG */
  853. #define GPIO_DSCR_DEBUG_DSE(x) ((x)&0x03)
  854. /* Bit definitions and macros for GPIO_DSCR_CLKRST */
  855. #define GPIO_DSCR_CLKRST_DSE(x) ((x)&0x03)
  856. /* Bit definitions and macros for GPIO_DSCR_IRQ */
  857. #define GPIO_DSCR_IRQ_DSE(x) ((x)&0x03)
  858. /*********************************************************************
  859. * SDRAM Controller (SDRAMC)
  860. *********************************************************************/
  861. /* Bit definitions and macros for SDRAMC_SDMR */
  862. #define SDRAMC_SDMR_BNKAD_LEMR (0x40000000)
  863. #define SDRAMC_SDMR_BNKAD_LMR (0x00000000)
  864. #define SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18)
  865. #define SDRAMC_SDMR_CMD (0x00010000)
  866. /* Bit definitions and macros for SDRAMC_SDCR */
  867. #define SDRAMC_SDCR_MODE_EN (0x80000000)
  868. #define SDRAMC_SDCR_CKE (0x40000000)
  869. #define SDRAMC_SDCR_DDR (0x20000000)
  870. #define SDRAMC_SDCR_REF (0x10000000)
  871. #define SDRAMC_SDCR_MUX(x) (((x)&0x00000003)<<24)
  872. #define SDRAMC_SDCR_OE_RULE (0x00400000)
  873. #define SDRAMC_SDCR_RCNT(x) (((x)&0x0000003F)<<16)
  874. #define SDRAMC_SDCR_PS_32 (0x00000000)
  875. #define SDRAMC_SDCR_PS_16 (0x00002000)
  876. #define SDRAMC_SDCR_DQS_OE(x) (((x)&0x0000000F)<<8)
  877. #define SDRAMC_SDCR_IREF (0x00000004)
  878. #define SDRAMC_SDCR_IPALL (0x00000002)
  879. /* Bit definitions and macros for SDRAMC_SDCFG1 */
  880. #define SDRAMC_SDCFG1_SRD2RW(x) (((x)&0x0000000F)<<28)
  881. #define SDRAMC_SDCFG1_SWT2RD(x) (((x)&0x00000007)<<24)
  882. #define SDRAMC_SDCFG1_RDLAT(x) (((x)&0x0000000F)<<20)
  883. #define SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16)
  884. #define SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12)
  885. #define SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8)
  886. #define SDRAMC_SDCFG1_WTLAT(x) (((x)&0x00000007)<<4)
  887. /* Bit definitions and macros for SDRAMC_SDCFG2 */
  888. #define SDRAMC_SDCFG2_BRD2PRE(x) (((x)&0x0000000F)<<28)
  889. #define SDRAMC_SDCFG2_BWT2RW(x) (((x)&0x0000000F)<<24)
  890. #define SDRAMC_SDCFG2_BRD2WT(x) (((x)&0x0000000F)<<20)
  891. #define SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16)
  892. /* Bit definitions and macros for SDRAMC_SDDS */
  893. #define SDRAMC_SDDS_SB_E(x) (((x)&0x00000003)<<8)
  894. #define SDRAMC_SDDS_SB_C(x) (((x)&0x00000003)<<6)
  895. #define SDRAMC_SDDS_SB_A(x) (((x)&0x00000003)<<4)
  896. #define SDRAMC_SDDS_SB_S(x) (((x)&0x00000003)<<2)
  897. #define SDRAMC_SDDS_SB_D(x) ((x)&0x00000003)
  898. /* Bit definitions and macros for SDRAMC_SDCS */
  899. #define SDRAMC_SDCS_BASE(x) (((x)&0x00000FFF)<<20)
  900. #define SDRAMC_SDCS_CSSZ(x) ((x)&0x0000001F)
  901. #define SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
  902. #define SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
  903. #define SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
  904. #define SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
  905. #define SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
  906. #define SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
  907. #define SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
  908. #define SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
  909. #define SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
  910. #define SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
  911. #define SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
  912. #define SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
  913. #define SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
  914. #define SDRAMC_SDCS_CSSZ_DIABLE (0x00000000)
  915. /*********************************************************************
  916. * Phase Locked Loop (PLL)
  917. *********************************************************************/
  918. /* Bit definitions and macros for PLL_PODR */
  919. #define PLL_PODR_CPUDIV(x) (((x)&0x0F)<<4)
  920. #define PLL_PODR_BUSDIV(x) ((x)&0x0F)
  921. /* Bit definitions and macros for PLL_PLLCR */
  922. #define PLL_PLLCR_DITHEN (0x80)
  923. #define PLL_PLLCR_DITHDEV(x) ((x)&0x07)
  924. #endif /* mcf5329_h */