m5329.h 35 KB

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