m5329.h 35 KB

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