m5329.h 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397
  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. * FlexBus Chip Selects (FBCS)
  172. *********************************************************************/
  173. /* Bit definitions and macros for FBCS_CSAR */
  174. #define CSAR_BA(x) (((x)&0xFFFF)<<16)
  175. /* Bit definitions and macros for FBCS_CSMR */
  176. #define CSMR_BAM(x) (((x)&0xFFFF)<<16)
  177. #define CSMR_BAM_4G (0xFFFF0000)
  178. #define CSMR_BAM_2G (0x7FFF0000)
  179. #define CSMR_BAM_1G (0x3FFF0000)
  180. #define CSMR_BAM_1024M (0x3FFF0000)
  181. #define CSMR_BAM_512M (0x1FFF0000)
  182. #define CSMR_BAM_256M (0x0FFF0000)
  183. #define CSMR_BAM_128M (0x07FF0000)
  184. #define CSMR_BAM_64M (0x03FF0000)
  185. #define CSMR_BAM_32M (0x01FF0000)
  186. #define CSMR_BAM_16M (0x00FF0000)
  187. #define CSMR_BAM_8M (0x007F0000)
  188. #define CSMR_BAM_4M (0x003F0000)
  189. #define CSMR_BAM_2M (0x001F0000)
  190. #define CSMR_BAM_1M (0x000F0000)
  191. #define CSMR_BAM_1024K (0x000F0000)
  192. #define CSMR_BAM_512K (0x00070000)
  193. #define CSMR_BAM_256K (0x00030000)
  194. #define CSMR_BAM_128K (0x00010000)
  195. #define CSMR_BAM_64K (0x00000000)
  196. #define CSMR_WP (0x00000100)
  197. #define CSMR_V (0x00000001)
  198. /* Bit definitions and macros for FBCS_CSCR */
  199. #define CSCR_SWS(x) (((x)&0x3F)<<26)
  200. #define CSCR_ASET(x) (((x)&0x03)<<20)
  201. #define CSCR_SWSEN (0x00800000)
  202. #define CSCR_ASET_4CLK (0x00300000)
  203. #define CSCR_ASET_3CLK (0x00200000)
  204. #define CSCR_ASET_2CLK (0x00100000)
  205. #define CSCR_ASET_1CLK (0x00000000)
  206. #define CSCR_RDAH(x) (((x)&0x03)<<18)
  207. #define CSCR_RDAH_4CYC (0x000C0000)
  208. #define CSCR_RDAH_3CYC (0x00080000)
  209. #define CSCR_RDAH_2CYC (0x00040000)
  210. #define CSCR_RDAH_1CYC (0x00000000)
  211. #define CSCR_WRAH(x) (((x)&0x03)<<16)
  212. #define CSCR_WDAH_4CYC (0x00003000)
  213. #define CSCR_WDAH_3CYC (0x00002000)
  214. #define CSCR_WDAH_2CYC (0x00001000)
  215. #define CSCR_WDAH_1CYC (0x00000000)
  216. #define CSCR_WS(x) (((x)&0x3F)<<10)
  217. #define CSCR_SBM (0x00000200)
  218. #define CSCR_AA (0x00000100)
  219. #define CSCR_PS_MASK (0x000000C0)
  220. #define CSCR_PS_32 (0x00000000)
  221. #define CSCR_PS_16 (0x00000080)
  222. #define CSCR_PS_8 (0x00000040)
  223. #define CSCR_BEM (0x00000020)
  224. #define CSCR_BSTR (0x00000010)
  225. #define CSCR_BSTW (0x00000008)
  226. /*********************************************************************
  227. * Reset Controller Module (RCM)
  228. *********************************************************************/
  229. /* Bit definitions and macros for RCR */
  230. #define RCM_RCR_FRCRSTOUT (0x40)
  231. #define RCM_RCR_SOFTRST (0x80)
  232. /* Bit definitions and macros for RSR */
  233. #define RCM_RSR_LOL (0x01)
  234. #define RCM_RSR_WDR_CORE (0x02)
  235. #define RCM_RSR_EXT (0x04)
  236. #define RCM_RSR_POR (0x08)
  237. #define RCM_RSR_SOFT (0x20)
  238. /*********************************************************************
  239. * FlexCAN Module (CAN)
  240. *********************************************************************/
  241. /* Bit definitions and macros for CAN_CANMCR */
  242. #define CANMCR_MDIS (0x80000000)
  243. #define CANMCR_FRZ (0x40000000)
  244. #define CANMCR_HALT (0x10000000)
  245. #define CANMCR_NORDY (0x08000000)
  246. #define CANMCR_SOFTRST (0x02000000)
  247. #define CANMCR_FRZACK (0x01000000)
  248. #define CANMCR_SUPV (0x00800000)
  249. #define CANMCR_LPMACK (0x00100000)
  250. #define CANMCR_MAXMB(x) (((x)&0x0F))
  251. /* Bit definitions and macros for CAN_CANCTRL */
  252. #define CANCTRL_PRESDIV(x) (((x)&0xFF)<<24)
  253. #define CANCTRL_RJW(x) (((x)&0x03)<<22)
  254. #define CANCTRL_PSEG1(x) (((x)&0x07)<<19)
  255. #define CANCTRL_PSEG2(x) (((x)&0x07)<<16)
  256. #define CANCTRL_BOFFMSK (0x00008000)
  257. #define CANCTRL_ERRMSK (0x00004000)
  258. #define CANCTRL_CLKSRC (0x00002000)
  259. #define CANCTRL_LPB (0x00001000)
  260. #define CANCTRL_SMP (0x00000080)
  261. #define CANCTRL_BOFFREC (0x00000040)
  262. #define CANCTRL_TSYNC (0x00000020)
  263. #define CANCTRL_LBUF (0x00000010)
  264. #define CANCTRL_LOM (0x00000008)
  265. #define CANCTRL_PROPSEG(x) (((x)&0x07))
  266. /* Bit definitions and macros for CAN_TIMER */
  267. #define TIMER_TIMER(x) ((x)&0xFFFF)
  268. /* Bit definitions and macros for CAN_RXGMASK */
  269. #define RXGMASK_MI(x) ((x)&0x1FFFFFFF)
  270. /* Bit definitions and macros for CAN_ERRCNT */
  271. #define ERRCNT_TXECTR(x) (((x)&0xFF))
  272. #define ERRCNT_RXECTR(x) (((x)&0xFF)<<8)
  273. /* Bit definitions and macros for CAN_ERRSTAT */
  274. #define ERRSTAT_BITERR1 (0x00008000)
  275. #define ERRSTAT_BITERR0 (0x00004000)
  276. #define ERRSTAT_ACKERR (0x00002000)
  277. #define ERRSTAT_CRCERR (0x00001000)
  278. #define ERRSTAT_FRMERR (0x00000800)
  279. #define ERRSTAT_STFERR (0x00000400)
  280. #define ERRSTAT_TXWRN (0x00000200)
  281. #define ERRSTAT_RXWRN (0x00000100)
  282. #define ERRSTAT_IDLE (0x00000080)
  283. #define ERRSTAT_TXRX (0x00000040)
  284. #define ERRSTAT_FLT_BUSOFF (0x00000020)
  285. #define ERRSTAT_FLT_PASSIVE (0x00000010)
  286. #define ERRSTAT_FLT_ACTIVE (0x00000000)
  287. #define ERRSTAT_BOFFINT (0x00000004)
  288. #define ERRSTAT_ERRINT (0x00000002)
  289. #define ERRSTAT_WAKINT (0x00000001)
  290. /* Bit definitions and macros for CAN_IMASK */
  291. #define IMASK_BUF15M (0x00008000)
  292. #define IMASK_BUF14M (0x00004000)
  293. #define IMASK_BUF13M (0x00002000)
  294. #define IMASK_BUF12M (0x00001000)
  295. #define IMASK_BUF11M (0x00000800)
  296. #define IMASK_BUF10M (0x00000400)
  297. #define IMASK_BUF9M (0x00000200)
  298. #define IMASK_BUF8M (0x00000100)
  299. #define IMASK_BUF7M (0x00000080)
  300. #define IMASK_BUF6M (0x00000040)
  301. #define IMASK_BUF5M (0x00000020)
  302. #define IMASK_BUF4M (0x00000010)
  303. #define IMASK_BUF3M (0x00000008)
  304. #define IMASK_BUF2M (0x00000004)
  305. #define IMASK_BUF1M (0x00000002)
  306. #define IMASK_BUF0M (0x00000001)
  307. /* Bit definitions and macros for CAN_IFLAG */
  308. #define IFLAG_BUF15I (0x00008000)
  309. #define IFLAG_BUF14I (0x00004000)
  310. #define IFLAG_BUF13I (0x00002000)
  311. #define IFLAG_BUF12I (0x00001000)
  312. #define IFLAG_BUF11I (0x00000800)
  313. #define IFLAG_BUF10I (0x00000400)
  314. #define IFLAG_BUF9I (0x00000200)
  315. #define IFLAG_BUF8I (0x00000100)
  316. #define IFLAG_BUF7I (0x00000080)
  317. #define IFLAG_BUF6I (0x00000040)
  318. #define IFLAG_BUF5I (0x00000020)
  319. #define IFLAG_BUF4I (0x00000010)
  320. #define IFLAG_BUF3I (0x00000008)
  321. #define IFLAG_BUF2I (0x00000004)
  322. #define IFLAG_BUF1I (0x00000002)
  323. #define IFLAG_BUF0I (0x00000001)
  324. /*********************************************************************
  325. * Interrupt Controller (INTC)
  326. *********************************************************************/
  327. #define INTC0_EPORT INTC_IPRL_INT1
  328. #define INT0_LO_RSVD0 (0)
  329. #define INT0_LO_EPORT1 (1)
  330. #define INT0_LO_EPORT2 (2)
  331. #define INT0_LO_EPORT3 (3)
  332. #define INT0_LO_EPORT4 (4)
  333. #define INT0_LO_EPORT5 (5)
  334. #define INT0_LO_EPORT6 (6)
  335. #define INT0_LO_EPORT7 (7)
  336. #define INT0_LO_EDMA_00 (8)
  337. #define INT0_LO_EDMA_01 (9)
  338. #define INT0_LO_EDMA_02 (10)
  339. #define INT0_LO_EDMA_03 (11)
  340. #define INT0_LO_EDMA_04 (12)
  341. #define INT0_LO_EDMA_05 (13)
  342. #define INT0_LO_EDMA_06 (14)
  343. #define INT0_LO_EDMA_07 (15)
  344. #define INT0_LO_EDMA_08 (16)
  345. #define INT0_LO_EDMA_09 (17)
  346. #define INT0_LO_EDMA_10 (18)
  347. #define INT0_LO_EDMA_11 (19)
  348. #define INT0_LO_EDMA_12 (20)
  349. #define INT0_LO_EDMA_13 (21)
  350. #define INT0_LO_EDMA_14 (22)
  351. #define INT0_LO_EDMA_15 (23)
  352. #define INT0_LO_EDMA_ERR (24)
  353. #define INT0_LO_SCM (25)
  354. #define INT0_LO_UART0 (26)
  355. #define INT0_LO_UART1 (27)
  356. #define INT0_LO_UART2 (28)
  357. #define INT0_LO_RSVD1 (29)
  358. #define INT0_LO_I2C (30)
  359. #define INT0_LO_QSPI (31)
  360. #define INT0_HI_DTMR0 (32)
  361. #define INT0_HI_DTMR1 (33)
  362. #define INT0_HI_DTMR2 (34)
  363. #define INT0_HI_DTMR3 (35)
  364. #define INT0_HI_FEC_TXF (36)
  365. #define INT0_HI_FEC_TXB (37)
  366. #define INT0_HI_FEC_UN (38)
  367. #define INT0_HI_FEC_RL (39)
  368. #define INT0_HI_FEC_RXF (40)
  369. #define INT0_HI_FEC_RXB (41)
  370. #define INT0_HI_FEC_MII (42)
  371. #define INT0_HI_FEC_LC (43)
  372. #define INT0_HI_FEC_HBERR (44)
  373. #define INT0_HI_FEC_GRA (45)
  374. #define INT0_HI_FEC_EBERR (46)
  375. #define INT0_HI_FEC_BABT (47)
  376. #define INT0_HI_FEC_BABR (48)
  377. /* 49 - 61 Reserved */
  378. #define INT0_HI_SCM (62)
  379. /* Bit definitions and macros for INTC_IPRH */
  380. #define INTC_IPRH_INT63 (0x80000000)
  381. #define INTC_IPRH_INT62 (0x40000000)
  382. #define INTC_IPRH_INT61 (0x20000000)
  383. #define INTC_IPRH_INT60 (0x10000000)
  384. #define INTC_IPRH_INT59 (0x08000000)
  385. #define INTC_IPRH_INT58 (0x04000000)
  386. #define INTC_IPRH_INT57 (0x02000000)
  387. #define INTC_IPRH_INT56 (0x01000000)
  388. #define INTC_IPRH_INT55 (0x00800000)
  389. #define INTC_IPRH_INT54 (0x00400000)
  390. #define INTC_IPRH_INT53 (0x00200000)
  391. #define INTC_IPRH_INT52 (0x00100000)
  392. #define INTC_IPRH_INT51 (0x00080000)
  393. #define INTC_IPRH_INT50 (0x00040000)
  394. #define INTC_IPRH_INT49 (0x00020000)
  395. #define INTC_IPRH_INT48 (0x00010000)
  396. #define INTC_IPRH_INT47 (0x00008000)
  397. #define INTC_IPRH_INT46 (0x00004000)
  398. #define INTC_IPRH_INT45 (0x00002000)
  399. #define INTC_IPRH_INT44 (0x00001000)
  400. #define INTC_IPRH_INT43 (0x00000800)
  401. #define INTC_IPRH_INT42 (0x00000400)
  402. #define INTC_IPRH_INT41 (0x00000200)
  403. #define INTC_IPRH_INT40 (0x00000100)
  404. #define INTC_IPRH_INT39 (0x00000080)
  405. #define INTC_IPRH_INT38 (0x00000040)
  406. #define INTC_IPRH_INT37 (0x00000020)
  407. #define INTC_IPRH_INT36 (0x00000010)
  408. #define INTC_IPRH_INT35 (0x00000008)
  409. #define INTC_IPRH_INT34 (0x00000004)
  410. #define INTC_IPRH_INT33 (0x00000002)
  411. #define INTC_IPRH_INT32 (0x00000001)
  412. /* Bit definitions and macros for INTC_IPRL */
  413. #define INTC_IPRL_INT31 (0x80000000)
  414. #define INTC_IPRL_INT30 (0x40000000)
  415. #define INTC_IPRL_INT29 (0x20000000)
  416. #define INTC_IPRL_INT28 (0x10000000)
  417. #define INTC_IPRL_INT27 (0x08000000)
  418. #define INTC_IPRL_INT26 (0x04000000)
  419. #define INTC_IPRL_INT25 (0x02000000)
  420. #define INTC_IPRL_INT24 (0x01000000)
  421. #define INTC_IPRL_INT23 (0x00800000)
  422. #define INTC_IPRL_INT22 (0x00400000)
  423. #define INTC_IPRL_INT21 (0x00200000)
  424. #define INTC_IPRL_INT20 (0x00100000)
  425. #define INTC_IPRL_INT19 (0x00080000)
  426. #define INTC_IPRL_INT18 (0x00040000)
  427. #define INTC_IPRL_INT17 (0x00020000)
  428. #define INTC_IPRL_INT16 (0x00010000)
  429. #define INTC_IPRL_INT15 (0x00008000)
  430. #define INTC_IPRL_INT14 (0x00004000)
  431. #define INTC_IPRL_INT13 (0x00002000)
  432. #define INTC_IPRL_INT12 (0x00001000)
  433. #define INTC_IPRL_INT11 (0x00000800)
  434. #define INTC_IPRL_INT10 (0x00000400)
  435. #define INTC_IPRL_INT9 (0x00000200)
  436. #define INTC_IPRL_INT8 (0x00000100)
  437. #define INTC_IPRL_INT7 (0x00000080)
  438. #define INTC_IPRL_INT6 (0x00000040)
  439. #define INTC_IPRL_INT5 (0x00000020)
  440. #define INTC_IPRL_INT4 (0x00000010)
  441. #define INTC_IPRL_INT3 (0x00000008)
  442. #define INTC_IPRL_INT2 (0x00000004)
  443. #define INTC_IPRL_INT1 (0x00000002)
  444. #define INTC_IPRL_INT0 (0x00000001)
  445. /* Bit definitions and macros for INTC_ICONFIG */
  446. #define INTC_ICFG_ELVLPRI7 (0x8000)
  447. #define INTC_ICFG_ELVLPRI6 (0x4000)
  448. #define INTC_ICFG_ELVLPRI5 (0x2000)
  449. #define INTC_ICFG_ELVLPRI4 (0x1000)
  450. #define INTC_ICFG_ELVLPRI3 (0x0800)
  451. #define INTC_ICFG_ELVLPRI2 (0x0400)
  452. #define INTC_ICFG_ELVLPRI1 (0x0200)
  453. #define INTC_ICFG_EMASK (0x0020)
  454. /* Bit definitions and macros for INTC_SIMR */
  455. #define INTC_SIMR_SALL (0x40)
  456. #define INTC_SIMR_SIMR(x) ((x)&0x3F)
  457. /* Bit definitions and macros for INTC_CIMR */
  458. #define INTC_CIMR_CALL (0x40)
  459. #define INTC_CIMR_CIMR(x) ((x)&0x3F)
  460. /* Bit definitions and macros for INTC_CLMASK */
  461. #define INTC_CLMASK_CLMASK(x) ((x)&0x0F)
  462. /* Bit definitions and macros for INTC_SLMASK */
  463. #define INTC_SLMASK_SLMASK(x) ((x)&0x0F)
  464. /* Bit definitions and macros for INTC_ICR */
  465. #define INTC_ICR_IL(x) ((x)&0x07)
  466. /*********************************************************************
  467. * Queued Serial Peripheral Interface (QSPI)
  468. *********************************************************************/
  469. /* Bit definitions and macros for QSPI_QMR */
  470. #define QSPI_QMR_MSTR (0x8000)
  471. #define QSPI_QMR_DOHIE (0x4000)
  472. #define QSPI_QMR_BITS(x) (((x)&0x000F)<<10)
  473. #define QSPI_QMR_CPOL (0x0200)
  474. #define QSPI_QMR_CPHA (0x0100)
  475. #define QSPI_QMR_BAUD(x) ((x)&0x00FF)
  476. /* Bit definitions and macros for QSPI_QDLYR */
  477. #define QSPI_QDLYR_SPE (0x8000)
  478. #define QSPI_QDLYR_QCD(x) (((x)&0x007F)<<8)
  479. #define QSPI_QDLYR_DTL(x) ((x)&0x00FF)
  480. /* Bit definitions and macros for QSPI_QWR */
  481. #define QSPI_QWR_NEWQP(x) ((x)&0x000F)
  482. #define QSPI_QWR_ENDQP(x) (((x)&0x000F)<<8)
  483. #define QSPI_QWR_CSIV (0x1000)
  484. #define QSPI_QWR_WRTO (0x2000)
  485. #define QSPI_QWR_WREN (0x4000)
  486. #define QSPI_QWR_HALT (0x8000)
  487. /* Bit definitions and macros for QSPI_QIR */
  488. #define QSPI_QIR_WCEFB (0x8000)
  489. #define QSPI_QIR_ABRTB (0x4000)
  490. #define QSPI_QIR_ABRTL (0x1000)
  491. #define QSPI_QIR_WCEFE (0x0800)
  492. #define QSPI_QIR_ABRTE (0x0400)
  493. #define QSPI_QIR_SPIFE (0x0100)
  494. #define QSPI_QIR_WCEF (0x0008)
  495. #define QSPI_QIR_ABRT (0x0004)
  496. #define QSPI_QIR_SPIF (0x0001)
  497. /* Bit definitions and macros for QSPI_QAR */
  498. #define QSPI_QAR_ADDR(x) ((x)&0x003F)
  499. #define QSPI_QAR_TRANS (0x0000)
  500. #define QSPI_QAR_RECV (0x0010)
  501. #define QSPI_QAR_CMD (0x0020)
  502. /* Bit definitions and macros for QSPI_QDR */
  503. #define QSPI_QDR_CONT (0x8000)
  504. #define QSPI_QDR_BITSE (0x4000)
  505. #define QSPI_QDR_DT (0x2000)
  506. #define QSPI_QDR_DSCK (0x1000)
  507. #define QSPI_QDR_QSPI_CS3 (0x0800)
  508. #define QSPI_QDR_QSPI_CS2 (0x0400)
  509. #define QSPI_QDR_QSPI_CS1 (0x0200)
  510. #define QSPI_QDR_QSPI_CS0 (0x0100)
  511. /*********************************************************************
  512. * Pulse Width Modulation (PWM)
  513. *********************************************************************/
  514. /* Bit definitions and macros for PWM_E */
  515. #define PWM_EN_PWME7 (0x80)
  516. #define PWM_EN_PWME5 (0x20)
  517. #define PWM_EN_PWME3 (0x08)
  518. #define PWM_EN_PWME1 (0x02)
  519. /* Bit definitions and macros for PWM_POL */
  520. #define PWM_POL_PPOL7 (0x80)
  521. #define PWM_POL_PPOL5 (0x20)
  522. #define PWM_POL_PPOL3 (0x08)
  523. #define PWM_POL_PPOL1 (0x02)
  524. /* Bit definitions and macros for PWM_CLK */
  525. #define PWM_CLK_PCLK7 (0x80)
  526. #define PWM_CLK_PCLK5 (0x20)
  527. #define PWM_CLK_PCLK3 (0x08)
  528. #define PWM_CLK_PCLK1 (0x02)
  529. /* Bit definitions and macros for PWM_PRCLK */
  530. #define PWM_PRCLK_PCKB(x) (((x)&0x07)<<4)
  531. #define PWM_PRCLK_PCKA(x) ((x)&0x07)
  532. /* Bit definitions and macros for PWM_CAE */
  533. #define PWM_CAE_CAE7 (0x80)
  534. #define PWM_CAE_CAE5 (0x20)
  535. #define PWM_CAE_CAE3 (0x08)
  536. #define PWM_CAE_CAE1 (0x02)
  537. /* Bit definitions and macros for PWM_CTL */
  538. #define PWM_CTL_CON67 (0x80)
  539. #define PWM_CTL_CON45 (0x40)
  540. #define PWM_CTL_CON23 (0x20)
  541. #define PWM_CTL_CON01 (0x10)
  542. #define PWM_CTL_PSWAR (0x08)
  543. #define PWM_CTL_PFRZ (0x04)
  544. /* Bit definitions and macros for PWM_SDN */
  545. #define PWM_SDN_IF (0x80)
  546. #define PWM_SDN_IE (0x40)
  547. #define PWM_SDN_RESTART (0x20)
  548. #define PWM_SDN_LVL (0x10)
  549. #define PWM_SDN_PWM7IN (0x04)
  550. #define PWM_SDN_PWM7IL (0x02)
  551. #define PWM_SDN_SDNEN (0x01)
  552. /*********************************************************************
  553. * Watchdog Timer Modules (WTM)
  554. *********************************************************************/
  555. /* Bit definitions and macros for WTM_WCR */
  556. #define WTM_WCR_WAIT (0x0008)
  557. #define WTM_WCR_DOZE (0x0004)
  558. #define WTM_WCR_HALTED (0x0002)
  559. #define WTM_WCR_EN (0x0001)
  560. /*********************************************************************
  561. * Chip Configuration Module (CCM)
  562. *********************************************************************/
  563. /* Bit definitions and macros for CCM_CCR */
  564. #define CCM_CCR_CSC(x) (((x)&0x0003)<<8|0x0001)
  565. #define CCM_CCR_LIMP (0x0041)
  566. #define CCM_CCR_LOAD (0x0021)
  567. #define CCM_CCR_BOOTPS(x) (((x)&0x0003)<<3|0x0001)
  568. #define CCM_CCR_OSC_MODE (0x0005)
  569. #define CCM_CCR_PLL_MODE (0x0003)
  570. #define CCM_CCR_RESERVED (0x0001)
  571. /* Bit definitions and macros for CCM_RCON */
  572. #define CCM_RCON_CSC(x) (((x)&0x0003)<<8|0x0001)
  573. #define CCM_RCON_LIMP (0x0041)
  574. #define CCM_RCON_LOAD (0x0021)
  575. #define CCM_RCON_BOOTPS(x) (((x)&0x0003)<<3|0x0001)
  576. #define CCM_RCON_OSC_MODE (0x0005)
  577. #define CCM_RCON_PLL_MODE (0x0003)
  578. #define CCM_RCON_RESERVED (0x0001)
  579. /* Bit definitions and macros for CCM_CIR */
  580. #define CCM_CIR_PIN(x) (((x)&0x03FF)<<6)
  581. #define CCM_CIR_PRN(x) ((x)&0x003F)
  582. /* Bit definitions and macros for CCM_MISCCR */
  583. #define CCM_MISCCR_PLL_LOCK (0x2000)
  584. #define CCM_MISCCR_LIMP (0x1000)
  585. #define CCM_MISCCR_LCD_CHEN (0x0100)
  586. #define CCM_MISCCR_SSI_PUE (0x0080)
  587. #define CCM_MISCCR_SSI_PUS (0x0040)
  588. #define CCM_MISCCR_TIM_DMA (0x0020)
  589. #define CCM_MISCCR_SSI_SRC (0x0010)
  590. #define CCM_MISCCR_USBDIV (0x0002)
  591. #define CCM_MISCCR_USBSRC (0x0001)
  592. /* Bit definitions and macros for CCM_CDR */
  593. #define CCM_CDR_LPDIV(x) (((x)&0x000F)<<8)
  594. #define CCM_CDR_SSIDIV(x) ((x)&0x000F)
  595. /* Bit definitions and macros for CCM_UHCSR */
  596. #define CCM_UHCSR_PORTIND(x) (((x)&0x0003)<<14)
  597. #define CCM_UHCSR_WKUP (0x0004)
  598. #define CCM_UHCSR_UHMIE (0x0002)
  599. #define CCM_UHCSR_XPDE (0x0001)
  600. /* Bit definitions and macros for CCM_UOCSR */
  601. #define CCM_UOCSR_PORTIND(x) (((x)&0x0003)<<14)
  602. #define CCM_UOCSR_DPPD (0x2000)
  603. #define CCM_UOCSR_DMPD (0x1000)
  604. #define CCM_UOCSR_DRV_VBUS (0x0800)
  605. #define CCM_UOCSR_CRG_VBUS (0x0400)
  606. #define CCM_UOCSR_DCR_VBUS (0x0200)
  607. #define CCM_UOCSR_DPPU (0x0100)
  608. #define CCM_UOCSR_AVLD (0x0080)
  609. #define CCM_UOCSR_BVLD (0x0040)
  610. #define CCM_UOCSR_VVLD (0x0020)
  611. #define CCM_UOCSR_SEND (0x0010)
  612. #define CCM_UOCSR_PWRFLT (0x0008)
  613. #define CCM_UOCSR_WKUP (0x0004)
  614. #define CCM_UOCSR_UOMIE (0x0002)
  615. #define CCM_UOCSR_XPDE (0x0001)
  616. /* not done yet */
  617. /*********************************************************************
  618. * General Purpose I/O (GPIO)
  619. *********************************************************************/
  620. /* Bit definitions and macros for GPIO_PODR_FECH_L */
  621. #define GPIO_PODR_FECH_L7 (0x80)
  622. #define GPIO_PODR_FECH_L6 (0x40)
  623. #define GPIO_PODR_FECH_L5 (0x20)
  624. #define GPIO_PODR_FECH_L4 (0x10)
  625. #define GPIO_PODR_FECH_L3 (0x08)
  626. #define GPIO_PODR_FECH_L2 (0x04)
  627. #define GPIO_PODR_FECH_L1 (0x02)
  628. #define GPIO_PODR_FECH_L0 (0x01)
  629. /* Bit definitions and macros for GPIO_PODR_SSI */
  630. #define GPIO_PODR_SSI_4 (0x10)
  631. #define GPIO_PODR_SSI_3 (0x08)
  632. #define GPIO_PODR_SSI_2 (0x04)
  633. #define GPIO_PODR_SSI_1 (0x02)
  634. #define GPIO_PODR_SSI_0 (0x01)
  635. /* Bit definitions and macros for GPIO_PODR_BUSCTL */
  636. #define GPIO_PODR_BUSCTL_3 (0x08)
  637. #define GPIO_PODR_BUSCTL_2 (0x04)
  638. #define GPIO_PODR_BUSCTL_1 (0x02)
  639. #define GPIO_PODR_BUSCTL_0 (0x01)
  640. /* Bit definitions and macros for GPIO_PODR_BE */
  641. #define GPIO_PODR_BE_3 (0x08)
  642. #define GPIO_PODR_BE_2 (0x04)
  643. #define GPIO_PODR_BE_1 (0x02)
  644. #define GPIO_PODR_BE_0 (0x01)
  645. /* Bit definitions and macros for GPIO_PODR_CS */
  646. #define GPIO_PODR_CS_5 (0x20)
  647. #define GPIO_PODR_CS_4 (0x10)
  648. #define GPIO_PODR_CS_3 (0x08)
  649. #define GPIO_PODR_CS_2 (0x04)
  650. #define GPIO_PODR_CS_1 (0x02)
  651. /* Bit definitions and macros for GPIO_PODR_PWM */
  652. #define GPIO_PODR_PWM_5 (0x20)
  653. #define GPIO_PODR_PWM_4 (0x10)
  654. #define GPIO_PODR_PWM_3 (0x08)
  655. #define GPIO_PODR_PWM_2 (0x04)
  656. /* Bit definitions and macros for GPIO_PODR_FECI2C */
  657. #define GPIO_PODR_FECI2C_3 (0x08)
  658. #define GPIO_PODR_FECI2C_2 (0x04)
  659. #define GPIO_PODR_FECI2C_1 (0x02)
  660. #define GPIO_PODR_FECI2C_0 (0x01)
  661. /* Bit definitions and macros for GPIO_PODR_UART */
  662. #define GPIO_PODR_UART_7 (0x80)
  663. #define GPIO_PODR_UART_6 (0x40)
  664. #define GPIO_PODR_UART_5 (0x20)
  665. #define GPIO_PODR_UART_4 (0x10)
  666. #define GPIO_PODR_UART_3 (0x08)
  667. #define GPIO_PODR_UART_2 (0x04)
  668. #define GPIO_PODR_UART_1 (0x02)
  669. #define GPIO_PODR_UART_0 (0x01)
  670. /* Bit definitions and macros for GPIO_PODR_QSPI */
  671. #define GPIO_PODR_QSPI_5 (0x20)
  672. #define GPIO_PODR_QSPI_4 (0x10)
  673. #define GPIO_PODR_QSPI_3 (0x08)
  674. #define GPIO_PODR_QSPI_2 (0x04)
  675. #define GPIO_PODR_QSPI_1 (0x02)
  676. #define GPIO_PODR_QSPI_0 (0x01)
  677. /* Bit definitions and macros for GPIO_PODR_TIMER */
  678. #define GPIO_PODR_TIMER_3 (0x08)
  679. #define GPIO_PODR_TIMER_2 (0x04)
  680. #define GPIO_PODR_TIMER_1 (0x02)
  681. #define GPIO_PODR_TIMER_0 (0x01)
  682. /* Bit definitions and macros for GPIO_PODR_LCDDATAH */
  683. #define GPIO_PODR_LCDDATAH_1 (0x02)
  684. #define GPIO_PODR_LCDDATAH_0 (0x01)
  685. /* Bit definitions and macros for GPIO_PODR_LCDDATAM */
  686. #define GPIO_PODR_LCDDATAM_7 (0x80)
  687. #define GPIO_PODR_LCDDATAM_6 (0x40)
  688. #define GPIO_PODR_LCDDATAM_5 (0x20)
  689. #define GPIO_PODR_LCDDATAM_4 (0x10)
  690. #define GPIO_PODR_LCDDATAM_3 (0x08)
  691. #define GPIO_PODR_LCDDATAM_2 (0x04)
  692. #define GPIO_PODR_LCDDATAM_1 (0x02)
  693. #define GPIO_PODR_LCDDATAM_0 (0x01)
  694. /* Bit definitions and macros for GPIO_PODR_LCDDATAL */
  695. #define GPIO_PODR_LCDDATAL_7 (0x80)
  696. #define GPIO_PODR_LCDDATAL_6 (0x40)
  697. #define GPIO_PODR_LCDDATAL_5 (0x20)
  698. #define GPIO_PODR_LCDDATAL_4 (0x10)
  699. #define GPIO_PODR_LCDDATAL_3 (0x08)
  700. #define GPIO_PODR_LCDDATAL_2 (0x04)
  701. #define GPIO_PODR_LCDDATAL_1 (0x02)
  702. #define GPIO_PODR_LCDDATAL_0 (0x01)
  703. /* Bit definitions and macros for GPIO_PODR_LCDCTLH */
  704. #define GPIO_PODR_LCDCTLH_0 (0x01)
  705. /* Bit definitions and macros for GPIO_PODR_LCDCTLL */
  706. #define GPIO_PODR_LCDCTLL_7 (0x80)
  707. #define GPIO_PODR_LCDCTLL_6 (0x40)
  708. #define GPIO_PODR_LCDCTLL_5 (0x20)
  709. #define GPIO_PODR_LCDCTLL_4 (0x10)
  710. #define GPIO_PODR_LCDCTLL_3 (0x08)
  711. #define GPIO_PODR_LCDCTLL_2 (0x04)
  712. #define GPIO_PODR_LCDCTLL_1 (0x02)
  713. #define GPIO_PODR_LCDCTLL_0 (0x01)
  714. /* Bit definitions and macros for GPIO_PDDR_FECH */
  715. #define GPIO_PDDR_FECH_L7 (0x80)
  716. #define GPIO_PDDR_FECH_L6 (0x40)
  717. #define GPIO_PDDR_FECH_L5 (0x20)
  718. #define GPIO_PDDR_FECH_L4 (0x10)
  719. #define GPIO_PDDR_FECH_L3 (0x08)
  720. #define GPIO_PDDR_FECH_L2 (0x04)
  721. #define GPIO_PDDR_FECH_L1 (0x02)
  722. #define GPIO_PDDR_FECH_L0 (0x01)
  723. /* Bit definitions and macros for GPIO_PDDR_SSI */
  724. #define GPIO_PDDR_SSI_4 (0x10)
  725. #define GPIO_PDDR_SSI_3 (0x08)
  726. #define GPIO_PDDR_SSI_2 (0x04)
  727. #define GPIO_PDDR_SSI_1 (0x02)
  728. #define GPIO_PDDR_SSI_0 (0x01)
  729. /* Bit definitions and macros for GPIO_PDDR_BUSCTL */
  730. #define GPIO_PDDR_BUSCTL_3 (0x08)
  731. #define GPIO_PDDR_BUSCTL_2 (0x04)
  732. #define GPIO_PDDR_BUSCTL_1 (0x02)
  733. #define GPIO_PDDR_BUSCTL_0 (0x01)
  734. /* Bit definitions and macros for GPIO_PDDR_BE */
  735. #define GPIO_PDDR_BE_3 (0x08)
  736. #define GPIO_PDDR_BE_2 (0x04)
  737. #define GPIO_PDDR_BE_1 (0x02)
  738. #define GPIO_PDDR_BE_0 (0x01)
  739. /* Bit definitions and macros for GPIO_PDDR_CS */
  740. #define GPIO_PDDR_CS_1 (0x02)
  741. #define GPIO_PDDR_CS_2 (0x04)
  742. #define GPIO_PDDR_CS_3 (0x08)
  743. #define GPIO_PDDR_CS_4 (0x10)
  744. #define GPIO_PDDR_CS_5 (0x20)
  745. /* Bit definitions and macros for GPIO_PDDR_PWM */
  746. #define GPIO_PDDR_PWM_2 (0x04)
  747. #define GPIO_PDDR_PWM_3 (0x08)
  748. #define GPIO_PDDR_PWM_4 (0x10)
  749. #define GPIO_PDDR_PWM_5 (0x20)
  750. /* Bit definitions and macros for GPIO_PDDR_FECI2C */
  751. #define GPIO_PDDR_FECI2C_0 (0x01)
  752. #define GPIO_PDDR_FECI2C_1 (0x02)
  753. #define GPIO_PDDR_FECI2C_2 (0x04)
  754. #define GPIO_PDDR_FECI2C_3 (0x08)
  755. /* Bit definitions and macros for GPIO_PDDR_UART */
  756. #define GPIO_PDDR_UART_0 (0x01)
  757. #define GPIO_PDDR_UART_1 (0x02)
  758. #define GPIO_PDDR_UART_2 (0x04)
  759. #define GPIO_PDDR_UART_3 (0x08)
  760. #define GPIO_PDDR_UART_4 (0x10)
  761. #define GPIO_PDDR_UART_5 (0x20)
  762. #define GPIO_PDDR_UART_6 (0x40)
  763. #define GPIO_PDDR_UART_7 (0x80)
  764. /* Bit definitions and macros for GPIO_PDDR_QSPI */
  765. #define GPIO_PDDR_QSPI_0 (0x01)
  766. #define GPIO_PDDR_QSPI_1 (0x02)
  767. #define GPIO_PDDR_QSPI_2 (0x04)
  768. #define GPIO_PDDR_QSPI_3 (0x08)
  769. #define GPIO_PDDR_QSPI_4 (0x10)
  770. #define GPIO_PDDR_QSPI_5 (0x20)
  771. /* Bit definitions and macros for GPIO_PDDR_TIMER */
  772. #define GPIO_PDDR_TIMER_0 (0x01)
  773. #define GPIO_PDDR_TIMER_1 (0x02)
  774. #define GPIO_PDDR_TIMER_2 (0x04)
  775. #define GPIO_PDDR_TIMER_3 (0x08)
  776. /* Bit definitions and macros for GPIO_PDDR_LCDDATAH */
  777. #define GPIO_PDDR_LCDDATAH_0 (0x01)
  778. #define GPIO_PDDR_LCDDATAH_1 (0x02)
  779. /* Bit definitions and macros for GPIO_PDDR_LCDDATAM */
  780. #define GPIO_PDDR_LCDDATAM_0 (0x01)
  781. #define GPIO_PDDR_LCDDATAM_1 (0x02)
  782. #define GPIO_PDDR_LCDDATAM_2 (0x04)
  783. #define GPIO_PDDR_LCDDATAM_3 (0x08)
  784. #define GPIO_PDDR_LCDDATAM_4 (0x10)
  785. #define GPIO_PDDR_LCDDATAM_5 (0x20)
  786. #define GPIO_PDDR_LCDDATAM_6 (0x40)
  787. #define GPIO_PDDR_LCDDATAM_7 (0x80)
  788. /* Bit definitions and macros for GPIO_PDDR_LCDDATAL */
  789. #define GPIO_PDDR_LCDDATAL_0 (0x01)
  790. #define GPIO_PDDR_LCDDATAL_1 (0x02)
  791. #define GPIO_PDDR_LCDDATAL_2 (0x04)
  792. #define GPIO_PDDR_LCDDATAL_3 (0x08)
  793. #define GPIO_PDDR_LCDDATAL_4 (0x10)
  794. #define GPIO_PDDR_LCDDATAL_5 (0x20)
  795. #define GPIO_PDDR_LCDDATAL_6 (0x40)
  796. #define GPIO_PDDR_LCDDATAL_7 (0x80)
  797. /* Bit definitions and macros for GPIO_PDDR_LCDCTLH */
  798. #define GPIO_PDDR_LCDCTLH_0 (0x01)
  799. /* Bit definitions and macros for GPIO_PDDR_LCDCTLL */
  800. #define GPIO_PDDR_LCDCTLL_0 (0x01)
  801. #define GPIO_PDDR_LCDCTLL_1 (0x02)
  802. #define GPIO_PDDR_LCDCTLL_2 (0x04)
  803. #define GPIO_PDDR_LCDCTLL_3 (0x08)
  804. #define GPIO_PDDR_LCDCTLL_4 (0x10)
  805. #define GPIO_PDDR_LCDCTLL_5 (0x20)
  806. #define GPIO_PDDR_LCDCTLL_6 (0x40)
  807. #define GPIO_PDDR_LCDCTLL_7 (0x80)
  808. /* Bit definitions and macros for GPIO_PPDSDR_FECH */
  809. #define GPIO_PPDSDR_FECH_L0 (0x01)
  810. #define GPIO_PPDSDR_FECH_L1 (0x02)
  811. #define GPIO_PPDSDR_FECH_L2 (0x04)
  812. #define GPIO_PPDSDR_FECH_L3 (0x08)
  813. #define GPIO_PPDSDR_FECH_L4 (0x10)
  814. #define GPIO_PPDSDR_FECH_L5 (0x20)
  815. #define GPIO_PPDSDR_FECH_L6 (0x40)
  816. #define GPIO_PPDSDR_FECH_L7 (0x80)
  817. /* Bit definitions and macros for GPIO_PPDSDR_SSI */
  818. #define GPIO_PPDSDR_SSI_0 (0x01)
  819. #define GPIO_PPDSDR_SSI_1 (0x02)
  820. #define GPIO_PPDSDR_SSI_2 (0x04)
  821. #define GPIO_PPDSDR_SSI_3 (0x08)
  822. #define GPIO_PPDSDR_SSI_4 (0x10)
  823. /* Bit definitions and macros for GPIO_PPDSDR_BUSCTL */
  824. #define GPIO_PPDSDR_BUSCTL_0 (0x01)
  825. #define GPIO_PPDSDR_BUSCTL_1 (0x02)
  826. #define GPIO_PPDSDR_BUSCTL_2 (0x04)
  827. #define GPIO_PPDSDR_BUSCTL_3 (0x08)
  828. /* Bit definitions and macros for GPIO_PPDSDR_BE */
  829. #define GPIO_PPDSDR_BE_0 (0x01)
  830. #define GPIO_PPDSDR_BE_1 (0x02)
  831. #define GPIO_PPDSDR_BE_2 (0x04)
  832. #define GPIO_PPDSDR_BE_3 (0x08)
  833. /* Bit definitions and macros for GPIO_PPDSDR_CS */
  834. #define GPIO_PPDSDR_CS_1 (0x02)
  835. #define GPIO_PPDSDR_CS_2 (0x04)
  836. #define GPIO_PPDSDR_CS_3 (0x08)
  837. #define GPIO_PPDSDR_CS_4 (0x10)
  838. #define GPIO_PPDSDR_CS_5 (0x20)
  839. /* Bit definitions and macros for GPIO_PPDSDR_PWM */
  840. #define GPIO_PPDSDR_PWM_2 (0x04)
  841. #define GPIO_PPDSDR_PWM_3 (0x08)
  842. #define GPIO_PPDSDR_PWM_4 (0x10)
  843. #define GPIO_PPDSDR_PWM_5 (0x20)
  844. /* Bit definitions and macros for GPIO_PPDSDR_FECI2C */
  845. #define GPIO_PPDSDR_FECI2C_0 (0x01)
  846. #define GPIO_PPDSDR_FECI2C_1 (0x02)
  847. #define GPIO_PPDSDR_FECI2C_2 (0x04)
  848. #define GPIO_PPDSDR_FECI2C_3 (0x08)
  849. /* Bit definitions and macros for GPIO_PPDSDR_UART */
  850. #define GPIO_PPDSDR_UART_0 (0x01)
  851. #define GPIO_PPDSDR_UART_1 (0x02)
  852. #define GPIO_PPDSDR_UART_2 (0x04)
  853. #define GPIO_PPDSDR_UART_3 (0x08)
  854. #define GPIO_PPDSDR_UART_4 (0x10)
  855. #define GPIO_PPDSDR_UART_5 (0x20)
  856. #define GPIO_PPDSDR_UART_6 (0x40)
  857. #define GPIO_PPDSDR_UART_7 (0x80)
  858. /* Bit definitions and macros for GPIO_PPDSDR_QSPI */
  859. #define GPIO_PPDSDR_QSPI_0 (0x01)
  860. #define GPIO_PPDSDR_QSPI_1 (0x02)
  861. #define GPIO_PPDSDR_QSPI_2 (0x04)
  862. #define GPIO_PPDSDR_QSPI_3 (0x08)
  863. #define GPIO_PPDSDR_QSPI_4 (0x10)
  864. #define GPIO_PPDSDR_QSPI_5 (0x20)
  865. /* Bit definitions and macros for GPIO_PPDSDR_TIMER */
  866. #define GPIO_PPDSDR_TIMER_0 (0x01)
  867. #define GPIO_PPDSDR_TIMER_1 (0x02)
  868. #define GPIO_PPDSDR_TIMER_2 (0x04)
  869. #define GPIO_PPDSDR_TIMER_3 (0x08)
  870. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAH */
  871. #define GPIO_PPDSDR_LCDDATAH_0 (0x01)
  872. #define GPIO_PPDSDR_LCDDATAH_1 (0x02)
  873. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAM */
  874. #define GPIO_PPDSDR_LCDDATAM_0 (0x01)
  875. #define GPIO_PPDSDR_LCDDATAM_1 (0x02)
  876. #define GPIO_PPDSDR_LCDDATAM_2 (0x04)
  877. #define GPIO_PPDSDR_LCDDATAM_3 (0x08)
  878. #define GPIO_PPDSDR_LCDDATAM_4 (0x10)
  879. #define GPIO_PPDSDR_LCDDATAM_5 (0x20)
  880. #define GPIO_PPDSDR_LCDDATAM_6 (0x40)
  881. #define GPIO_PPDSDR_LCDDATAM_7 (0x80)
  882. /* Bit definitions and macros for GPIO_PPDSDR_LCDDATAL */
  883. #define GPIO_PPDSDR_LCDDATAL_0 (0x01)
  884. #define GPIO_PPDSDR_LCDDATAL_1 (0x02)
  885. #define GPIO_PPDSDR_LCDDATAL_2 (0x04)
  886. #define GPIO_PPDSDR_LCDDATAL_3 (0x08)
  887. #define GPIO_PPDSDR_LCDDATAL_4 (0x10)
  888. #define GPIO_PPDSDR_LCDDATAL_5 (0x20)
  889. #define GPIO_PPDSDR_LCDDATAL_6 (0x40)
  890. #define GPIO_PPDSDR_LCDDATAL_7 (0x80)
  891. /* Bit definitions and macros for GPIO_PPDSDR_LCDCTLH */
  892. #define GPIO_PPDSDR_LCDCTLH_0 (0x01)
  893. /* Bit definitions and macros for GPIO_PPDSDR_LCDCTLL */
  894. #define GPIO_PPDSDR_LCDCTLL_0 (0x01)
  895. #define GPIO_PPDSDR_LCDCTLL_1 (0x02)
  896. #define GPIO_PPDSDR_LCDCTLL_2 (0x04)
  897. #define GPIO_PPDSDR_LCDCTLL_3 (0x08)
  898. #define GPIO_PPDSDR_LCDCTLL_4 (0x10)
  899. #define GPIO_PPDSDR_LCDCTLL_5 (0x20)
  900. #define GPIO_PPDSDR_LCDCTLL_6 (0x40)
  901. #define GPIO_PPDSDR_LCDCTLL_7 (0x80)
  902. /* Bit definitions and macros for GPIO_PCLRR_FECH */
  903. #define GPIO_PCLRR_FECH_L0 (0x01)
  904. #define GPIO_PCLRR_FECH_L1 (0x02)
  905. #define GPIO_PCLRR_FECH_L2 (0x04)
  906. #define GPIO_PCLRR_FECH_L3 (0x08)
  907. #define GPIO_PCLRR_FECH_L4 (0x10)
  908. #define GPIO_PCLRR_FECH_L5 (0x20)
  909. #define GPIO_PCLRR_FECH_L6 (0x40)
  910. #define GPIO_PCLRR_FECH_L7 (0x80)
  911. /* Bit definitions and macros for GPIO_PCLRR_SSI */
  912. #define GPIO_PCLRR_SSI_0 (0x01)
  913. #define GPIO_PCLRR_SSI_1 (0x02)
  914. #define GPIO_PCLRR_SSI_2 (0x04)
  915. #define GPIO_PCLRR_SSI_3 (0x08)
  916. #define GPIO_PCLRR_SSI_4 (0x10)
  917. /* Bit definitions and macros for GPIO_PCLRR_BUSCTL */
  918. #define GPIO_PCLRR_BUSCTL_L0 (0x01)
  919. #define GPIO_PCLRR_BUSCTL_L1 (0x02)
  920. #define GPIO_PCLRR_BUSCTL_L2 (0x04)
  921. #define GPIO_PCLRR_BUSCTL_L3 (0x08)
  922. /* Bit definitions and macros for GPIO_PCLRR_BE */
  923. #define GPIO_PCLRR_BE_0 (0x01)
  924. #define GPIO_PCLRR_BE_1 (0x02)
  925. #define GPIO_PCLRR_BE_2 (0x04)
  926. #define GPIO_PCLRR_BE_3 (0x08)
  927. /* Bit definitions and macros for GPIO_PCLRR_CS */
  928. #define GPIO_PCLRR_CS_1 (0x02)
  929. #define GPIO_PCLRR_CS_2 (0x04)
  930. #define GPIO_PCLRR_CS_3 (0x08)
  931. #define GPIO_PCLRR_CS_4 (0x10)
  932. #define GPIO_PCLRR_CS_5 (0x20)
  933. /* Bit definitions and macros for GPIO_PCLRR_PWM */
  934. #define GPIO_PCLRR_PWM_2 (0x04)
  935. #define GPIO_PCLRR_PWM_3 (0x08)
  936. #define GPIO_PCLRR_PWM_4 (0x10)
  937. #define GPIO_PCLRR_PWM_5 (0x20)
  938. /* Bit definitions and macros for GPIO_PCLRR_FECI2C */
  939. #define GPIO_PCLRR_FECI2C_0 (0x01)
  940. #define GPIO_PCLRR_FECI2C_1 (0x02)
  941. #define GPIO_PCLRR_FECI2C_2 (0x04)
  942. #define GPIO_PCLRR_FECI2C_3 (0x08)
  943. /* Bit definitions and macros for GPIO_PCLRR_UART */
  944. #define GPIO_PCLRR_UART0 (0x01)
  945. #define GPIO_PCLRR_UART1 (0x02)
  946. #define GPIO_PCLRR_UART2 (0x04)
  947. #define GPIO_PCLRR_UART3 (0x08)
  948. #define GPIO_PCLRR_UART4 (0x10)
  949. #define GPIO_PCLRR_UART5 (0x20)
  950. #define GPIO_PCLRR_UART6 (0x40)
  951. #define GPIO_PCLRR_UART7 (0x80)
  952. /* Bit definitions and macros for GPIO_PCLRR_QSPI */
  953. #define GPIO_PCLRR_QSPI0 (0x01)
  954. #define GPIO_PCLRR_QSPI1 (0x02)
  955. #define GPIO_PCLRR_QSPI2 (0x04)
  956. #define GPIO_PCLRR_QSPI3 (0x08)
  957. #define GPIO_PCLRR_QSPI4 (0x10)
  958. #define GPIO_PCLRR_QSPI5 (0x20)
  959. /* Bit definitions and macros for GPIO_PCLRR_TIMER */
  960. #define GPIO_PCLRR_TIMER0 (0x01)
  961. #define GPIO_PCLRR_TIMER1 (0x02)
  962. #define GPIO_PCLRR_TIMER2 (0x04)
  963. #define GPIO_PCLRR_TIMER3 (0x08)
  964. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAH */
  965. #define GPIO_PCLRR_LCDDATAH0 (0x01)
  966. #define GPIO_PCLRR_LCDDATAH1 (0x02)
  967. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAM */
  968. #define GPIO_PCLRR_LCDDATAM0 (0x01)
  969. #define GPIO_PCLRR_LCDDATAM1 (0x02)
  970. #define GPIO_PCLRR_LCDDATAM2 (0x04)
  971. #define GPIO_PCLRR_LCDDATAM3 (0x08)
  972. #define GPIO_PCLRR_LCDDATAM4 (0x10)
  973. #define GPIO_PCLRR_LCDDATAM5 (0x20)
  974. #define GPIO_PCLRR_LCDDATAM6 (0x40)
  975. #define GPIO_PCLRR_LCDDATAM7 (0x80)
  976. /* Bit definitions and macros for GPIO_PCLRR_LCDDATAL */
  977. #define GPIO_PCLRR_LCDDATAL0 (0x01)
  978. #define GPIO_PCLRR_LCDDATAL1 (0x02)
  979. #define GPIO_PCLRR_LCDDATAL2 (0x04)
  980. #define GPIO_PCLRR_LCDDATAL3 (0x08)
  981. #define GPIO_PCLRR_LCDDATAL4 (0x10)
  982. #define GPIO_PCLRR_LCDDATAL5 (0x20)
  983. #define GPIO_PCLRR_LCDDATAL6 (0x40)
  984. #define GPIO_PCLRR_LCDDATAL7 (0x80)
  985. /* Bit definitions and macros for GPIO_PCLRR_LCDCTLH */
  986. #define GPIO_PCLRR_LCDCTLH_PCLRR_LCDCTLH0 (0x01)
  987. /* Bit definitions and macros for GPIO_PCLRR_LCDCTLL */
  988. #define GPIO_PCLRR_LCDCTLL0 (0x01)
  989. #define GPIO_PCLRR_LCDCTLL1 (0x02)
  990. #define GPIO_PCLRR_LCDCTLL2 (0x04)
  991. #define GPIO_PCLRR_LCDCTLL3 (0x08)
  992. #define GPIO_PCLRR_LCDCTLL4 (0x10)
  993. #define GPIO_PCLRR_LCDCTLL5 (0x20)
  994. #define GPIO_PCLRR_LCDCTLL6 (0x40)
  995. #define GPIO_PCLRR_LCDCTLL7 (0x80)
  996. /* Bit definitions and macros for GPIO_PAR_FEC */
  997. #ifdef CONFIG_M5329
  998. #define GPIO_PAR_FEC_MII(x) (((x)&0x03)<<0)
  999. #define GPIO_PAR_FEC_7W(x) (((x)&0x03)<<2)
  1000. #define GPIO_PAR_FEC_7W_GPIO (0x00)
  1001. #define GPIO_PAR_FEC_7W_URTS1 (0x04)
  1002. #define GPIO_PAR_FEC_7W_FEC (0x0C)
  1003. #define GPIO_PAR_FEC_MII_GPIO (0x00)
  1004. #define GPIO_PAR_FEC_MII_UART (0x01)
  1005. #define GPIO_PAR_FEC_MII_FEC (0x03)
  1006. #else
  1007. #define GPIO_PAR_FEC_7W_FEC (0x08)
  1008. #define GPIO_PAR_FEC_MII_FEC (0x02)
  1009. #endif
  1010. /* Bit definitions and macros for GPIO_PAR_PWM */
  1011. #define GPIO_PAR_PWM1(x) (((x)&0x03)<<0)
  1012. #define GPIO_PAR_PWM3(x) (((x)&0x03)<<2)
  1013. #define GPIO_PAR_PWM5 (0x10)
  1014. #define GPIO_PAR_PWM7 (0x20)
  1015. /* Bit definitions and macros for GPIO_PAR_BUSCTL */
  1016. #define GPIO_PAR_BUSCTL_TS(x) (((x)&0x03)<<3)
  1017. #define GPIO_PAR_BUSCTL_RWB (0x20)
  1018. #define GPIO_PAR_BUSCTL_TA (0x40)
  1019. #define GPIO_PAR_BUSCTL_OE (0x80)
  1020. #define GPIO_PAR_BUSCTL_OE_GPIO (0x00)
  1021. #define GPIO_PAR_BUSCTL_OE_OE (0x80)
  1022. #define GPIO_PAR_BUSCTL_TA_GPIO (0x00)
  1023. #define GPIO_PAR_BUSCTL_TA_TA (0x40)
  1024. #define GPIO_PAR_BUSCTL_RWB_GPIO (0x00)
  1025. #define GPIO_PAR_BUSCTL_RWB_RWB (0x20)
  1026. #define GPIO_PAR_BUSCTL_TS_GPIO (0x00)
  1027. #define GPIO_PAR_BUSCTL_TS_DACK0 (0x10)
  1028. #define GPIO_PAR_BUSCTL_TS_TS (0x18)
  1029. /* Bit definitions and macros for GPIO_PAR_FECI2C */
  1030. #define GPIO_PAR_FECI2C_SDA(x) (((x)&0x03)<<0)
  1031. #define GPIO_PAR_FECI2C_SCL(x) (((x)&0x03)<<2)
  1032. #define GPIO_PAR_FECI2C_MDIO(x) (((x)&0x03)<<4)
  1033. #define GPIO_PAR_FECI2C_MDC(x) (((x)&0x03)<<6)
  1034. #define GPIO_PAR_FECI2C_MDC_GPIO (0x00)
  1035. #define GPIO_PAR_FECI2C_MDC_UTXD2 (0x40)
  1036. #define GPIO_PAR_FECI2C_MDC_SCL (0x80)
  1037. #define GPIO_PAR_FECI2C_MDC_EMDC (0xC0)
  1038. #define GPIO_PAR_FECI2C_MDIO_GPIO (0x00)
  1039. #define GPIO_PAR_FECI2C_MDIO_URXD2 (0x10)
  1040. #define GPIO_PAR_FECI2C_MDIO_SDA (0x20)
  1041. #define GPIO_PAR_FECI2C_MDIO_EMDIO (0x30)
  1042. #define GPIO_PAR_FECI2C_SCL_GPIO (0x00)
  1043. #define GPIO_PAR_FECI2C_SCL_UTXD2 (0x04)
  1044. #define GPIO_PAR_FECI2C_SCL_SCL (0x0C)
  1045. #define GPIO_PAR_FECI2C_SDA_GPIO (0x00)
  1046. #define GPIO_PAR_FECI2C_SDA_URXD2 (0x02)
  1047. #define GPIO_PAR_FECI2C_SDA_SDA (0x03)
  1048. /* Bit definitions and macros for GPIO_PAR_BE */
  1049. #define GPIO_PAR_BE0 (0x01)
  1050. #define GPIO_PAR_BE1 (0x02)
  1051. #define GPIO_PAR_BE2 (0x04)
  1052. #define GPIO_PAR_BE3 (0x08)
  1053. /* Bit definitions and macros for GPIO_PAR_CS */
  1054. #define GPIO_PAR_CS1 (0x02)
  1055. #define GPIO_PAR_CS2 (0x04)
  1056. #define GPIO_PAR_CS3 (0x08)
  1057. #define GPIO_PAR_CS4 (0x10)
  1058. #define GPIO_PAR_CS5 (0x20)
  1059. #define GPIO_PAR_CS1_GPIO (0x00)
  1060. #define GPIO_PAR_CS1_SDCS1 (0x01)
  1061. #define GPIO_PAR_CS1_CS1 (0x03)
  1062. /* Bit definitions and macros for GPIO_PAR_SSI */
  1063. #define GPIO_PAR_SSI_MCLK (0x0080)
  1064. #define GPIO_PAR_SSI_TXD(x) (((x)&0x0003)<<8)
  1065. #define GPIO_PAR_SSI_RXD(x) (((x)&0x0003)<<10)
  1066. #define GPIO_PAR_SSI_FS(x) (((x)&0x0003)<<12)
  1067. #define GPIO_PAR_SSI_BCLK(x) (((x)&0x0003)<<14)
  1068. /* Bit definitions and macros for GPIO_PAR_UART */
  1069. #define GPIO_PAR_UART_TXD0 (0x0001)
  1070. #define GPIO_PAR_UART_RXD0 (0x0002)
  1071. #define GPIO_PAR_UART_RTS0 (0x0004)
  1072. #define GPIO_PAR_UART_CTS0 (0x0008)
  1073. #define GPIO_PAR_UART_TXD1(x) (((x)&0x0003)<<4)
  1074. #define GPIO_PAR_UART_RXD1(x) (((x)&0x0003)<<6)
  1075. #define GPIO_PAR_UART_RTS1(x) (((x)&0x0003)<<8)
  1076. #define GPIO_PAR_UART_CTS1(x) (((x)&0x0003)<<10)
  1077. #define GPIO_PAR_UART_CTS1_GPIO (0x0000)
  1078. #define GPIO_PAR_UART_CTS1_SSI_BCLK (0x0800)
  1079. #define GPIO_PAR_UART_CTS1_ULPI_D7 (0x0400)
  1080. #define GPIO_PAR_UART_CTS1_UCTS1 (0x0C00)
  1081. #define GPIO_PAR_UART_RTS1_GPIO (0x0000)
  1082. #define GPIO_PAR_UART_RTS1_SSI_FS (0x0200)
  1083. #define GPIO_PAR_UART_RTS1_ULPI_D6 (0x0100)
  1084. #define GPIO_PAR_UART_RTS1_URTS1 (0x0300)
  1085. #define GPIO_PAR_UART_RXD1_GPIO (0x0000)
  1086. #define GPIO_PAR_UART_RXD1_SSI_RXD (0x0080)
  1087. #define GPIO_PAR_UART_RXD1_ULPI_D5 (0x0040)
  1088. #define GPIO_PAR_UART_RXD1_URXD1 (0x00C0)
  1089. #define GPIO_PAR_UART_TXD1_GPIO (0x0000)
  1090. #define GPIO_PAR_UART_TXD1_SSI_TXD (0x0020)
  1091. #define GPIO_PAR_UART_TXD1_ULPI_D4 (0x0010)
  1092. #define GPIO_PAR_UART_TXD1_UTXD1 (0x0030)
  1093. /* Bit definitions and macros for GPIO_PAR_QSPI */
  1094. #define GPIO_PAR_QSPI_SCK(x) (((x)&0x0003)<<4)
  1095. #define GPIO_PAR_QSPI_DOUT(x) (((x)&0x0003)<<6)
  1096. #define GPIO_PAR_QSPI_DIN(x) (((x)&0x0003)<<8)
  1097. #define GPIO_PAR_QSPI_PCS0(x) (((x)&0x0003)<<10)
  1098. #define GPIO_PAR_QSPI_PCS1(x) (((x)&0x0003)<<12)
  1099. #define GPIO_PAR_QSPI_PCS2(x) (((x)&0x0003)<<14)
  1100. /* Bit definitions and macros for GPIO_PAR_TIMER */
  1101. #define GPIO_PAR_TIN0(x) (((x)&0x03)<<0)
  1102. #define GPIO_PAR_TIN1(x) (((x)&0x03)<<2)
  1103. #define GPIO_PAR_TIN2(x) (((x)&0x03)<<4)
  1104. #define GPIO_PAR_TIN3(x) (((x)&0x03)<<6)
  1105. #define GPIO_PAR_TIN3_GPIO (0x00)
  1106. #define GPIO_PAR_TIN3_TOUT3 (0x80)
  1107. #define GPIO_PAR_TIN3_URXD2 (0x40)
  1108. #define GPIO_PAR_TIN3_TIN3 (0xC0)
  1109. #define GPIO_PAR_TIN2_GPIO (0x00)
  1110. #define GPIO_PAR_TIN2_TOUT2 (0x20)
  1111. #define GPIO_PAR_TIN2_UTXD2 (0x10)
  1112. #define GPIO_PAR_TIN2_TIN2 (0x30)
  1113. #define GPIO_PAR_TIN1_GPIO (0x00)
  1114. #define GPIO_PAR_TIN1_TOUT1 (0x08)
  1115. #define GPIO_PAR_TIN1_DACK1 (0x04)
  1116. #define GPIO_PAR_TIN1_TIN1 (0x0C)
  1117. #define GPIO_PAR_TIN0_GPIO (0x00)
  1118. #define GPIO_PAR_TIN0_TOUT0 (0x02)
  1119. #define GPIO_PAR_TIN0_DREQ0 (0x01)
  1120. #define GPIO_PAR_TIN0_TIN0 (0x03)
  1121. /* Bit definitions and macros for GPIO_PAR_LCDDATA */
  1122. #define GPIO_PAR_LCDDATA_LD7_0(x) ((x)&0x03)
  1123. #define GPIO_PAR_LCDDATA_LD15_8(x) (((x)&0x03)<<2)
  1124. #define GPIO_PAR_LCDDATA_LD16(x) (((x)&0x03)<<4)
  1125. #define GPIO_PAR_LCDDATA_LD17(x) (((x)&0x03)<<6)
  1126. /* Bit definitions and macros for GPIO_PAR_LCDCTL */
  1127. #define GPIO_PAR_LCDCTL_CLS (0x0001)
  1128. #define GPIO_PAR_LCDCTL_PS (0x0002)
  1129. #define GPIO_PAR_LCDCTL_REV (0x0004)
  1130. #define GPIO_PAR_LCDCTL_SPL_SPR (0x0008)
  1131. #define GPIO_PAR_LCDCTL_CONTRAST (0x0010)
  1132. #define GPIO_PAR_LCDCTL_LSCLK (0x0020)
  1133. #define GPIO_PAR_LCDCTL_LP_HSYNC (0x0040)
  1134. #define GPIO_PAR_LCDCTL_FLM_VSYNC (0x0080)
  1135. #define GPIO_PAR_LCDCTL_ACD_OE (0x0100)
  1136. /* Bit definitions and macros for GPIO_PAR_IRQ */
  1137. #define GPIO_PAR_IRQ1(x) (((x)&0x0003)<<4)
  1138. #define GPIO_PAR_IRQ2(x) (((x)&0x0003)<<6)
  1139. #define GPIO_PAR_IRQ4(x) (((x)&0x0003)<<8)
  1140. #define GPIO_PAR_IRQ5(x) (((x)&0x0003)<<10)
  1141. #define GPIO_PAR_IRQ6(x) (((x)&0x0003)<<12)
  1142. /* Bit definitions and macros for GPIO_MSCR_FLEXBUS */
  1143. #define GPIO_MSCR_FLEXBUS_ADDRCTL(x) ((x)&0x03)
  1144. #define GPIO_MSCR_FLEXBUS_DLOWER(x) (((x)&0x03)<<2)
  1145. #define GPIO_MSCR_FLEXBUS_DUPPER(x) (((x)&0x03)<<4)
  1146. /* Bit definitions and macros for GPIO_MSCR_SDRAM */
  1147. #define GPIO_MSCR_SDRAM_SDRAM(x) ((x)&0x03)
  1148. #define GPIO_MSCR_SDRAM_SDCLK(x) (((x)&0x03)<<2)
  1149. #define GPIO_MSCR_SDRAM_SDCLKB(x) (((x)&0x03)<<4)
  1150. /* Bit definitions and macros for GPIO_DSCR_I2C */
  1151. #define GPIO_DSCR_I2C_DSE(x) ((x)&0x03)
  1152. /* Bit definitions and macros for GPIO_DSCR_PWM */
  1153. #define GPIO_DSCR_PWM_DSE(x) ((x)&0x03)
  1154. /* Bit definitions and macros for GPIO_DSCR_FEC */
  1155. #define GPIO_DSCR_FEC_DSE(x) ((x)&0x03)
  1156. /* Bit definitions and macros for GPIO_DSCR_UART */
  1157. #define GPIO_DSCR_UART0_DSE(x) ((x)&0x03)
  1158. #define GPIO_DSCR_UART1_DSE(x) (((x)&0x03)<<2)
  1159. /* Bit definitions and macros for GPIO_DSCR_QSPI */
  1160. #define GPIO_DSCR_QSPI_DSE(x) ((x)&0x03)
  1161. /* Bit definitions and macros for GPIO_DSCR_TIMER */
  1162. #define GPIO_DSCR_TIMER_DSE(x) ((x)&0x03)
  1163. /* Bit definitions and macros for GPIO_DSCR_SSI */
  1164. #define GPIO_DSCR_SSI_DSE(x) ((x)&0x03)
  1165. /* Bit definitions and macros for GPIO_DSCR_LCD */
  1166. #define GPIO_DSCR_LCD_DSE(x) ((x)&0x03)
  1167. /* Bit definitions and macros for GPIO_DSCR_DEBUG */
  1168. #define GPIO_DSCR_DEBUG_DSE(x) ((x)&0x03)
  1169. /* Bit definitions and macros for GPIO_DSCR_CLKRST */
  1170. #define GPIO_DSCR_CLKRST_DSE(x) ((x)&0x03)
  1171. /* Bit definitions and macros for GPIO_DSCR_IRQ */
  1172. #define GPIO_DSCR_IRQ_DSE(x) ((x)&0x03)
  1173. /*********************************************************************
  1174. * SDRAM Controller (SDRAMC)
  1175. *********************************************************************/
  1176. /* Bit definitions and macros for SDRAMC_SDMR */
  1177. #define SDRAMC_SDMR_BNKAD_LEMR (0x40000000)
  1178. #define SDRAMC_SDMR_BNKAD_LMR (0x00000000)
  1179. #define SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18)
  1180. #define SDRAMC_SDMR_CMD (0x00010000)
  1181. /* Bit definitions and macros for SDRAMC_SDCR */
  1182. #define SDRAMC_SDCR_MODE_EN (0x80000000)
  1183. #define SDRAMC_SDCR_CKE (0x40000000)
  1184. #define SDRAMC_SDCR_DDR (0x20000000)
  1185. #define SDRAMC_SDCR_REF (0x10000000)
  1186. #define SDRAMC_SDCR_MUX(x) (((x)&0x00000003)<<24)
  1187. #define SDRAMC_SDCR_OE_RULE (0x00400000)
  1188. #define SDRAMC_SDCR_RCNT(x) (((x)&0x0000003F)<<16)
  1189. #define SDRAMC_SDCR_PS_32 (0x00000000)
  1190. #define SDRAMC_SDCR_PS_16 (0x00002000)
  1191. #define SDRAMC_SDCR_DQS_OE(x) (((x)&0x0000000F)<<8)
  1192. #define SDRAMC_SDCR_IREF (0x00000004)
  1193. #define SDRAMC_SDCR_IPALL (0x00000002)
  1194. /* Bit definitions and macros for SDRAMC_SDCFG1 */
  1195. #define SDRAMC_SDCFG1_SRD2RW(x) (((x)&0x0000000F)<<28)
  1196. #define SDRAMC_SDCFG1_SWT2RD(x) (((x)&0x00000007)<<24)
  1197. #define SDRAMC_SDCFG1_RDLAT(x) (((x)&0x0000000F)<<20)
  1198. #define SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16)
  1199. #define SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12)
  1200. #define SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8)
  1201. #define SDRAMC_SDCFG1_WTLAT(x) (((x)&0x00000007)<<4)
  1202. /* Bit definitions and macros for SDRAMC_SDCFG2 */
  1203. #define SDRAMC_SDCFG2_BRD2PRE(x) (((x)&0x0000000F)<<28)
  1204. #define SDRAMC_SDCFG2_BWT2RW(x) (((x)&0x0000000F)<<24)
  1205. #define SDRAMC_SDCFG2_BRD2WT(x) (((x)&0x0000000F)<<20)
  1206. #define SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16)
  1207. /* Bit definitions and macros for SDRAMC_SDDS */
  1208. #define SDRAMC_SDDS_SB_E(x) (((x)&0x00000003)<<8)
  1209. #define SDRAMC_SDDS_SB_C(x) (((x)&0x00000003)<<6)
  1210. #define SDRAMC_SDDS_SB_A(x) (((x)&0x00000003)<<4)
  1211. #define SDRAMC_SDDS_SB_S(x) (((x)&0x00000003)<<2)
  1212. #define SDRAMC_SDDS_SB_D(x) ((x)&0x00000003)
  1213. /* Bit definitions and macros for SDRAMC_SDCS */
  1214. #define SDRAMC_SDCS_BASE(x) (((x)&0x00000FFF)<<20)
  1215. #define SDRAMC_SDCS_CSSZ(x) ((x)&0x0000001F)
  1216. #define SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
  1217. #define SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
  1218. #define SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
  1219. #define SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
  1220. #define SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
  1221. #define SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
  1222. #define SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
  1223. #define SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
  1224. #define SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
  1225. #define SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
  1226. #define SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
  1227. #define SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
  1228. #define SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
  1229. #define SDRAMC_SDCS_CSSZ_DIABLE (0x00000000)
  1230. /*********************************************************************
  1231. * Phase Locked Loop (PLL)
  1232. *********************************************************************/
  1233. /* Bit definitions and macros for PLL_PODR */
  1234. #define PLL_PODR_CPUDIV(x) (((x)&0x0F)<<4)
  1235. #define PLL_PODR_BUSDIV(x) ((x)&0x0F)
  1236. /* Bit definitions and macros for PLL_PLLCR */
  1237. #define PLL_PLLCR_DITHEN (0x80)
  1238. #define PLL_PLLCR_DITHDEV(x) ((x)&0x07)
  1239. #endif /* mcf5329_h */