SA-1100.h 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * FILE SA-1100.h
  4. *
  5. * Version 1.2
  6. * Author Copyright (c) Marc A. Viredaz, 1998
  7. * DEC Western Research Laboratory, Palo Alto, CA
  8. * Date January 1998 (April 1997)
  9. * System StrongARM SA-1100
  10. * Language C or ARM Assembly
  11. * Purpose Definition of constants related to the StrongARM
  12. * SA-1100 microprocessor (Advanced RISC Machine (ARM)
  13. * architecture version 4). This file is based on the
  14. * StrongARM SA-1100 data sheet version 2.2.
  15. *
  16. */
  17. /* Be sure that virtual mapping is defined right */
  18. #ifndef __ASM_ARCH_HARDWARE_H
  19. #error You must include hardware.h not SA-1100.h
  20. #endif
  21. #include "bitfield.h"
  22. /*
  23. * SA1100 CS line to physical address
  24. */
  25. #define SA1100_CS0_PHYS 0x00000000
  26. #define SA1100_CS1_PHYS 0x08000000
  27. #define SA1100_CS2_PHYS 0x10000000
  28. #define SA1100_CS3_PHYS 0x18000000
  29. #define SA1100_CS4_PHYS 0x40000000
  30. #define SA1100_CS5_PHYS 0x48000000
  31. /*
  32. * Personal Computer Memory Card International Association (PCMCIA) sockets
  33. */
  34. #define PCMCIAPrtSp 0x04000000 /* PCMCIA Partition Space [byte] */
  35. #define PCMCIASp (4*PCMCIAPrtSp) /* PCMCIA Space [byte] */
  36. #define PCMCIAIOSp PCMCIAPrtSp /* PCMCIA I/O Space [byte] */
  37. #define PCMCIAAttrSp PCMCIAPrtSp /* PCMCIA Attribute Space [byte] */
  38. #define PCMCIAMemSp PCMCIAPrtSp /* PCMCIA Memory Space [byte] */
  39. #define PCMCIA0Sp PCMCIASp /* PCMCIA 0 Space [byte] */
  40. #define PCMCIA0IOSp PCMCIAIOSp /* PCMCIA 0 I/O Space [byte] */
  41. #define PCMCIA0AttrSp PCMCIAAttrSp /* PCMCIA 0 Attribute Space [byte] */
  42. #define PCMCIA0MemSp PCMCIAMemSp /* PCMCIA 0 Memory Space [byte] */
  43. #define PCMCIA1Sp PCMCIASp /* PCMCIA 1 Space [byte] */
  44. #define PCMCIA1IOSp PCMCIAIOSp /* PCMCIA 1 I/O Space [byte] */
  45. #define PCMCIA1AttrSp PCMCIAAttrSp /* PCMCIA 1 Attribute Space [byte] */
  46. #define PCMCIA1MemSp PCMCIAMemSp /* PCMCIA 1 Memory Space [byte] */
  47. #define _PCMCIA(Nb) /* PCMCIA [0..1] */ \
  48. (0x20000000 + (Nb)*PCMCIASp)
  49. #define _PCMCIAIO(Nb) _PCMCIA (Nb) /* PCMCIA I/O [0..1] */
  50. #define _PCMCIAAttr(Nb) /* PCMCIA Attribute [0..1] */ \
  51. (_PCMCIA (Nb) + 2*PCMCIAPrtSp)
  52. #define _PCMCIAMem(Nb) /* PCMCIA Memory [0..1] */ \
  53. (_PCMCIA (Nb) + 3*PCMCIAPrtSp)
  54. #define _PCMCIA0 _PCMCIA (0) /* PCMCIA 0 */
  55. #define _PCMCIA0IO _PCMCIAIO (0) /* PCMCIA 0 I/O */
  56. #define _PCMCIA0Attr _PCMCIAAttr (0) /* PCMCIA 0 Attribute */
  57. #define _PCMCIA0Mem _PCMCIAMem (0) /* PCMCIA 0 Memory */
  58. #define _PCMCIA1 _PCMCIA (1) /* PCMCIA 1 */
  59. #define _PCMCIA1IO _PCMCIAIO (1) /* PCMCIA 1 I/O */
  60. #define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
  61. #define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */
  62. /*
  63. * Universal Serial Bus (USB) Device Controller (UDC) control registers
  64. *
  65. * Registers
  66. * Ser0UDCCR Serial port 0 Universal Serial Bus (USB) Device
  67. * Controller (UDC) Control Register (read/write).
  68. * Ser0UDCAR Serial port 0 Universal Serial Bus (USB) Device
  69. * Controller (UDC) Address Register (read/write).
  70. * Ser0UDCOMP Serial port 0 Universal Serial Bus (USB) Device
  71. * Controller (UDC) Output Maximum Packet size register
  72. * (read/write).
  73. * Ser0UDCIMP Serial port 0 Universal Serial Bus (USB) Device
  74. * Controller (UDC) Input Maximum Packet size register
  75. * (read/write).
  76. * Ser0UDCCS0 Serial port 0 Universal Serial Bus (USB) Device
  77. * Controller (UDC) Control/Status register end-point 0
  78. * (read/write).
  79. * Ser0UDCCS1 Serial port 0 Universal Serial Bus (USB) Device
  80. * Controller (UDC) Control/Status register end-point 1
  81. * (output, read/write).
  82. * Ser0UDCCS2 Serial port 0 Universal Serial Bus (USB) Device
  83. * Controller (UDC) Control/Status register end-point 2
  84. * (input, read/write).
  85. * Ser0UDCD0 Serial port 0 Universal Serial Bus (USB) Device
  86. * Controller (UDC) Data register end-point 0
  87. * (read/write).
  88. * Ser0UDCWC Serial port 0 Universal Serial Bus (USB) Device
  89. * Controller (UDC) Write Count register end-point 0
  90. * (read).
  91. * Ser0UDCDR Serial port 0 Universal Serial Bus (USB) Device
  92. * Controller (UDC) Data Register (read/write).
  93. * Ser0UDCSR Serial port 0 Universal Serial Bus (USB) Device
  94. * Controller (UDC) Status Register (read/write).
  95. */
  96. #define Ser0UDCCR __REG(0x80000000) /* Ser. port 0 UDC Control Reg. */
  97. #define Ser0UDCAR __REG(0x80000004) /* Ser. port 0 UDC Address Reg. */
  98. #define Ser0UDCOMP __REG(0x80000008) /* Ser. port 0 UDC Output Maximum Packet size reg. */
  99. #define Ser0UDCIMP __REG(0x8000000C) /* Ser. port 0 UDC Input Maximum Packet size reg. */
  100. #define Ser0UDCCS0 __REG(0x80000010) /* Ser. port 0 UDC Control/Status reg. end-point 0 */
  101. #define Ser0UDCCS1 __REG(0x80000014) /* Ser. port 0 UDC Control/Status reg. end-point 1 (output) */
  102. #define Ser0UDCCS2 __REG(0x80000018) /* Ser. port 0 UDC Control/Status reg. end-point 2 (input) */
  103. #define Ser0UDCD0 __REG(0x8000001C) /* Ser. port 0 UDC Data reg. end-point 0 */
  104. #define Ser0UDCWC __REG(0x80000020) /* Ser. port 0 UDC Write Count reg. end-point 0 */
  105. #define Ser0UDCDR __REG(0x80000028) /* Ser. port 0 UDC Data Reg. */
  106. #define Ser0UDCSR __REG(0x80000030) /* Ser. port 0 UDC Status Reg. */
  107. #define UDCCR_UDD 0x00000001 /* UDC Disable */
  108. #define UDCCR_UDA 0x00000002 /* UDC Active (read) */
  109. #define UDCCR_RESIM 0x00000004 /* Resume Interrupt Mask, per errata */
  110. #define UDCCR_EIM 0x00000008 /* End-point 0 Interrupt Mask */
  111. /* (disable) */
  112. #define UDCCR_RIM 0x00000010 /* Receive Interrupt Mask */
  113. /* (disable) */
  114. #define UDCCR_TIM 0x00000020 /* Transmit Interrupt Mask */
  115. /* (disable) */
  116. #define UDCCR_SRM 0x00000040 /* Suspend/Resume interrupt Mask */
  117. /* (disable) */
  118. #define UDCCR_SUSIM UDCCR_SRM /* Per errata, SRM just masks suspend */
  119. #define UDCCR_REM 0x00000080 /* REset interrupt Mask (disable) */
  120. #define UDCAR_ADD Fld (7, 0) /* function ADDress */
  121. #define UDCOMP_OUTMAXP Fld (8, 0) /* OUTput MAXimum Packet size - 1 */
  122. /* [byte] */
  123. #define UDCOMP_OutMaxPkt(Size) /* Output Maximum Packet size */ \
  124. /* [1..256 byte] */ \
  125. (((Size) - 1) << FShft (UDCOMP_OUTMAXP))
  126. #define UDCIMP_INMAXP Fld (8, 0) /* INput MAXimum Packet size - 1 */
  127. /* [byte] */
  128. #define UDCIMP_InMaxPkt(Size) /* Input Maximum Packet size */ \
  129. /* [1..256 byte] */ \
  130. (((Size) - 1) << FShft (UDCIMP_INMAXP))
  131. #define UDCCS0_OPR 0x00000001 /* Output Packet Ready (read) */
  132. #define UDCCS0_IPR 0x00000002 /* Input Packet Ready */
  133. #define UDCCS0_SST 0x00000004 /* Sent STall */
  134. #define UDCCS0_FST 0x00000008 /* Force STall */
  135. #define UDCCS0_DE 0x00000010 /* Data End */
  136. #define UDCCS0_SE 0x00000020 /* Setup End (read) */
  137. #define UDCCS0_SO 0x00000040 /* Serviced Output packet ready */
  138. /* (write) */
  139. #define UDCCS0_SSE 0x00000080 /* Serviced Setup End (write) */
  140. #define UDCCS1_RFS 0x00000001 /* Receive FIFO 12-bytes or more */
  141. /* Service request (read) */
  142. #define UDCCS1_RPC 0x00000002 /* Receive Packet Complete */
  143. #define UDCCS1_RPE 0x00000004 /* Receive Packet Error (read) */
  144. #define UDCCS1_SST 0x00000008 /* Sent STall */
  145. #define UDCCS1_FST 0x00000010 /* Force STall */
  146. #define UDCCS1_RNE 0x00000020 /* Receive FIFO Not Empty (read) */
  147. #define UDCCS2_TFS 0x00000001 /* Transmit FIFO 8-bytes or less */
  148. /* Service request (read) */
  149. #define UDCCS2_TPC 0x00000002 /* Transmit Packet Complete */
  150. #define UDCCS2_TPE 0x00000004 /* Transmit Packet Error (read) */
  151. #define UDCCS2_TUR 0x00000008 /* Transmit FIFO Under-Run */
  152. #define UDCCS2_SST 0x00000010 /* Sent STall */
  153. #define UDCCS2_FST 0x00000020 /* Force STall */
  154. #define UDCD0_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
  155. #define UDCWC_WC Fld (4, 0) /* Write Count */
  156. #define UDCDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
  157. #define UDCSR_EIR 0x00000001 /* End-point 0 Interrupt Request */
  158. #define UDCSR_RIR 0x00000002 /* Receive Interrupt Request */
  159. #define UDCSR_TIR 0x00000004 /* Transmit Interrupt Request */
  160. #define UDCSR_SUSIR 0x00000008 /* SUSpend Interrupt Request */
  161. #define UDCSR_RESIR 0x00000010 /* RESume Interrupt Request */
  162. #define UDCSR_RSTIR 0x00000020 /* ReSeT Interrupt Request */
  163. /*
  164. * Universal Asynchronous Receiver/Transmitter (UART) control registers
  165. *
  166. * Registers
  167. * Ser1UTCR0 Serial port 1 Universal Asynchronous
  168. * Receiver/Transmitter (UART) Control Register 0
  169. * (read/write).
  170. * Ser1UTCR1 Serial port 1 Universal Asynchronous
  171. * Receiver/Transmitter (UART) Control Register 1
  172. * (read/write).
  173. * Ser1UTCR2 Serial port 1 Universal Asynchronous
  174. * Receiver/Transmitter (UART) Control Register 2
  175. * (read/write).
  176. * Ser1UTCR3 Serial port 1 Universal Asynchronous
  177. * Receiver/Transmitter (UART) Control Register 3
  178. * (read/write).
  179. * Ser1UTDR Serial port 1 Universal Asynchronous
  180. * Receiver/Transmitter (UART) Data Register
  181. * (read/write).
  182. * Ser1UTSR0 Serial port 1 Universal Asynchronous
  183. * Receiver/Transmitter (UART) Status Register 0
  184. * (read/write).
  185. * Ser1UTSR1 Serial port 1 Universal Asynchronous
  186. * Receiver/Transmitter (UART) Status Register 1 (read).
  187. *
  188. * Ser2UTCR0 Serial port 2 Universal Asynchronous
  189. * Receiver/Transmitter (UART) Control Register 0
  190. * (read/write).
  191. * Ser2UTCR1 Serial port 2 Universal Asynchronous
  192. * Receiver/Transmitter (UART) Control Register 1
  193. * (read/write).
  194. * Ser2UTCR2 Serial port 2 Universal Asynchronous
  195. * Receiver/Transmitter (UART) Control Register 2
  196. * (read/write).
  197. * Ser2UTCR3 Serial port 2 Universal Asynchronous
  198. * Receiver/Transmitter (UART) Control Register 3
  199. * (read/write).
  200. * Ser2UTCR4 Serial port 2 Universal Asynchronous
  201. * Receiver/Transmitter (UART) Control Register 4
  202. * (read/write).
  203. * Ser2UTDR Serial port 2 Universal Asynchronous
  204. * Receiver/Transmitter (UART) Data Register
  205. * (read/write).
  206. * Ser2UTSR0 Serial port 2 Universal Asynchronous
  207. * Receiver/Transmitter (UART) Status Register 0
  208. * (read/write).
  209. * Ser2UTSR1 Serial port 2 Universal Asynchronous
  210. * Receiver/Transmitter (UART) Status Register 1 (read).
  211. *
  212. * Ser3UTCR0 Serial port 3 Universal Asynchronous
  213. * Receiver/Transmitter (UART) Control Register 0
  214. * (read/write).
  215. * Ser3UTCR1 Serial port 3 Universal Asynchronous
  216. * Receiver/Transmitter (UART) Control Register 1
  217. * (read/write).
  218. * Ser3UTCR2 Serial port 3 Universal Asynchronous
  219. * Receiver/Transmitter (UART) Control Register 2
  220. * (read/write).
  221. * Ser3UTCR3 Serial port 3 Universal Asynchronous
  222. * Receiver/Transmitter (UART) Control Register 3
  223. * (read/write).
  224. * Ser3UTDR Serial port 3 Universal Asynchronous
  225. * Receiver/Transmitter (UART) Data Register
  226. * (read/write).
  227. * Ser3UTSR0 Serial port 3 Universal Asynchronous
  228. * Receiver/Transmitter (UART) Status Register 0
  229. * (read/write).
  230. * Ser3UTSR1 Serial port 3 Universal Asynchronous
  231. * Receiver/Transmitter (UART) Status Register 1 (read).
  232. *
  233. * Clocks
  234. * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
  235. * or 3.5795 MHz).
  236. * fua, Tua Frequency, period of the UART communication.
  237. */
  238. #define _UTCR0(Nb) __REG(0x80010000 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 0 [1..3] */
  239. #define _UTCR1(Nb) __REG(0x80010004 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 1 [1..3] */
  240. #define _UTCR2(Nb) __REG(0x80010008 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 2 [1..3] */
  241. #define _UTCR3(Nb) __REG(0x8001000C + ((Nb) - 1)*0x00020000) /* UART Control Reg. 3 [1..3] */
  242. #define _UTCR4(Nb) __REG(0x80010010 + ((Nb) - 1)*0x00020000) /* UART Control Reg. 4 [2] */
  243. #define _UTDR(Nb) __REG(0x80010014 + ((Nb) - 1)*0x00020000) /* UART Data Reg. [1..3] */
  244. #define _UTSR0(Nb) __REG(0x8001001C + ((Nb) - 1)*0x00020000) /* UART Status Reg. 0 [1..3] */
  245. #define _UTSR1(Nb) __REG(0x80010020 + ((Nb) - 1)*0x00020000) /* UART Status Reg. 1 [1..3] */
  246. #define Ser1UTCR0 _UTCR0 (1) /* Ser. port 1 UART Control Reg. 0 */
  247. #define Ser1UTCR1 _UTCR1 (1) /* Ser. port 1 UART Control Reg. 1 */
  248. #define Ser1UTCR2 _UTCR2 (1) /* Ser. port 1 UART Control Reg. 2 */
  249. #define Ser1UTCR3 _UTCR3 (1) /* Ser. port 1 UART Control Reg. 3 */
  250. #define Ser1UTDR _UTDR (1) /* Ser. port 1 UART Data Reg. */
  251. #define Ser1UTSR0 _UTSR0 (1) /* Ser. port 1 UART Status Reg. 0 */
  252. #define Ser1UTSR1 _UTSR1 (1) /* Ser. port 1 UART Status Reg. 1 */
  253. #define Ser2UTCR0 _UTCR0 (2) /* Ser. port 2 UART Control Reg. 0 */
  254. #define Ser2UTCR1 _UTCR1 (2) /* Ser. port 2 UART Control Reg. 1 */
  255. #define Ser2UTCR2 _UTCR2 (2) /* Ser. port 2 UART Control Reg. 2 */
  256. #define Ser2UTCR3 _UTCR3 (2) /* Ser. port 2 UART Control Reg. 3 */
  257. #define Ser2UTCR4 _UTCR4 (2) /* Ser. port 2 UART Control Reg. 4 */
  258. #define Ser2UTDR _UTDR (2) /* Ser. port 2 UART Data Reg. */
  259. #define Ser2UTSR0 _UTSR0 (2) /* Ser. port 2 UART Status Reg. 0 */
  260. #define Ser2UTSR1 _UTSR1 (2) /* Ser. port 2 UART Status Reg. 1 */
  261. #define Ser3UTCR0 _UTCR0 (3) /* Ser. port 3 UART Control Reg. 0 */
  262. #define Ser3UTCR1 _UTCR1 (3) /* Ser. port 3 UART Control Reg. 1 */
  263. #define Ser3UTCR2 _UTCR2 (3) /* Ser. port 3 UART Control Reg. 2 */
  264. #define Ser3UTCR3 _UTCR3 (3) /* Ser. port 3 UART Control Reg. 3 */
  265. #define Ser3UTDR _UTDR (3) /* Ser. port 3 UART Data Reg. */
  266. #define Ser3UTSR0 _UTSR0 (3) /* Ser. port 3 UART Status Reg. 0 */
  267. #define Ser3UTSR1 _UTSR1 (3) /* Ser. port 3 UART Status Reg. 1 */
  268. /* Those are still used in some places */
  269. #define _Ser1UTCR0 __PREG(Ser1UTCR0)
  270. #define _Ser2UTCR0 __PREG(Ser2UTCR0)
  271. #define _Ser3UTCR0 __PREG(Ser3UTCR0)
  272. /* Register offsets */
  273. #define UTCR0 0x00
  274. #define UTCR1 0x04
  275. #define UTCR2 0x08
  276. #define UTCR3 0x0c
  277. #define UTDR 0x14
  278. #define UTSR0 0x1c
  279. #define UTSR1 0x20
  280. #define UTCR0_PE 0x00000001 /* Parity Enable */
  281. #define UTCR0_OES 0x00000002 /* Odd/Even parity Select */
  282. #define UTCR0_OddPar (UTCR0_OES*0) /* Odd Parity */
  283. #define UTCR0_EvenPar (UTCR0_OES*1) /* Even Parity */
  284. #define UTCR0_SBS 0x00000004 /* Stop Bit Select */
  285. #define UTCR0_1StpBit (UTCR0_SBS*0) /* 1 Stop Bit per frame */
  286. #define UTCR0_2StpBit (UTCR0_SBS*1) /* 2 Stop Bits per frame */
  287. #define UTCR0_DSS 0x00000008 /* Data Size Select */
  288. #define UTCR0_7BitData (UTCR0_DSS*0) /* 7-Bit Data */
  289. #define UTCR0_8BitData (UTCR0_DSS*1) /* 8-Bit Data */
  290. #define UTCR0_SCE 0x00000010 /* Sample Clock Enable */
  291. /* (ser. port 1: GPIO [18], */
  292. /* ser. port 3: GPIO [20]) */
  293. #define UTCR0_RCE 0x00000020 /* Receive Clock Edge select */
  294. #define UTCR0_RcRsEdg (UTCR0_RCE*0) /* Receive clock Rising-Edge */
  295. #define UTCR0_RcFlEdg (UTCR0_RCE*1) /* Receive clock Falling-Edge */
  296. #define UTCR0_TCE 0x00000040 /* Transmit Clock Edge select */
  297. #define UTCR0_TrRsEdg (UTCR0_TCE*0) /* Transmit clock Rising-Edge */
  298. #define UTCR0_TrFlEdg (UTCR0_TCE*1) /* Transmit clock Falling-Edge */
  299. #define UTCR0_Ser2IrDA /* Ser. port 2 IrDA settings */ \
  300. (UTCR0_1StpBit + UTCR0_8BitData)
  301. #define UTCR1_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
  302. #define UTCR2_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
  303. /* fua = fxtl/(16*(BRD[11:0] + 1)) */
  304. /* Tua = 16*(BRD [11:0] + 1)*Txtl */
  305. #define UTCR1_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
  306. (((Div) - 16)/16 >> FSize (UTCR2_BRD) << \
  307. FShft (UTCR1_BRD))
  308. #define UTCR2_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
  309. (((Div) - 16)/16 & FAlnMsk (UTCR2_BRD) << \
  310. FShft (UTCR2_BRD))
  311. /* fua = fxtl/(16*Floor (Div/16)) */
  312. /* Tua = 16*Floor (Div/16)*Txtl */
  313. #define UTCR1_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
  314. (((Div) - 1)/16 >> FSize (UTCR2_BRD) << \
  315. FShft (UTCR1_BRD))
  316. #define UTCR2_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
  317. (((Div) - 1)/16 & FAlnMsk (UTCR2_BRD) << \
  318. FShft (UTCR2_BRD))
  319. /* fua = fxtl/(16*Ceil (Div/16)) */
  320. /* Tua = 16*Ceil (Div/16)*Txtl */
  321. #define UTCR3_RXE 0x00000001 /* Receive Enable */
  322. #define UTCR3_TXE 0x00000002 /* Transmit Enable */
  323. #define UTCR3_BRK 0x00000004 /* BReaK mode */
  324. #define UTCR3_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
  325. /* more Interrupt Enable */
  326. #define UTCR3_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
  327. /* Interrupt Enable */
  328. #define UTCR3_LBM 0x00000020 /* Look-Back Mode */
  329. #define UTCR3_Ser2IrDA /* Ser. port 2 IrDA settings (RIE, */ \
  330. /* TIE, LBM can be set or cleared) */ \
  331. (UTCR3_RXE + UTCR3_TXE)
  332. #define UTCR4_HSE 0x00000001 /* Hewlett-Packard Serial InfraRed */
  333. /* (HP-SIR) modulation Enable */
  334. #define UTCR4_NRZ (UTCR4_HSE*0) /* Non-Return to Zero modulation */
  335. #define UTCR4_HPSIR (UTCR4_HSE*1) /* HP-SIR modulation */
  336. #define UTCR4_LPM 0x00000002 /* Low-Power Mode */
  337. #define UTCR4_Z3_16Bit (UTCR4_LPM*0) /* Zero pulse = 3/16 Bit time */
  338. #define UTCR4_Z1_6us (UTCR4_LPM*1) /* Zero pulse = 1.6 us */
  339. #define UTDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
  340. #if 0 /* Hidden receive FIFO bits */
  341. #define UTDR_PRE 0x00000100 /* receive PaRity Error (read) */
  342. #define UTDR_FRE 0x00000200 /* receive FRaming Error (read) */
  343. #define UTDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
  344. #endif /* 0 */
  345. #define UTSR0_TFS 0x00000001 /* Transmit FIFO 1/2-full or less */
  346. /* Service request (read) */
  347. #define UTSR0_RFS 0x00000002 /* Receive FIFO 1/3-to-2/3-full or */
  348. /* more Service request (read) */
  349. #define UTSR0_RID 0x00000004 /* Receiver IDle */
  350. #define UTSR0_RBB 0x00000008 /* Receive Beginning of Break */
  351. #define UTSR0_REB 0x00000010 /* Receive End of Break */
  352. #define UTSR0_EIF 0x00000020 /* Error In FIFO (read) */
  353. #define UTSR1_TBY 0x00000001 /* Transmitter BusY (read) */
  354. #define UTSR1_RNE 0x00000002 /* Receive FIFO Not Empty (read) */
  355. #define UTSR1_TNF 0x00000004 /* Transmit FIFO Not Full (read) */
  356. #define UTSR1_PRE 0x00000008 /* receive PaRity Error (read) */
  357. #define UTSR1_FRE 0x00000010 /* receive FRaming Error (read) */
  358. #define UTSR1_ROR 0x00000020 /* Receive FIFO Over-Run (read) */
  359. /*
  360. * Synchronous Data Link Controller (SDLC) control registers
  361. *
  362. * Registers
  363. * Ser1SDCR0 Serial port 1 Synchronous Data Link Controller (SDLC)
  364. * Control Register 0 (read/write).
  365. * Ser1SDCR1 Serial port 1 Synchronous Data Link Controller (SDLC)
  366. * Control Register 1 (read/write).
  367. * Ser1SDCR2 Serial port 1 Synchronous Data Link Controller (SDLC)
  368. * Control Register 2 (read/write).
  369. * Ser1SDCR3 Serial port 1 Synchronous Data Link Controller (SDLC)
  370. * Control Register 3 (read/write).
  371. * Ser1SDCR4 Serial port 1 Synchronous Data Link Controller (SDLC)
  372. * Control Register 4 (read/write).
  373. * Ser1SDDR Serial port 1 Synchronous Data Link Controller (SDLC)
  374. * Data Register (read/write).
  375. * Ser1SDSR0 Serial port 1 Synchronous Data Link Controller (SDLC)
  376. * Status Register 0 (read/write).
  377. * Ser1SDSR1 Serial port 1 Synchronous Data Link Controller (SDLC)
  378. * Status Register 1 (read/write).
  379. *
  380. * Clocks
  381. * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
  382. * or 3.5795 MHz).
  383. * fsd, Tsd Frequency, period of the SDLC communication.
  384. */
  385. #define Ser1SDCR0 __REG(0x80020060) /* Ser. port 1 SDLC Control Reg. 0 */
  386. #define Ser1SDCR1 __REG(0x80020064) /* Ser. port 1 SDLC Control Reg. 1 */
  387. #define Ser1SDCR2 __REG(0x80020068) /* Ser. port 1 SDLC Control Reg. 2 */
  388. #define Ser1SDCR3 __REG(0x8002006C) /* Ser. port 1 SDLC Control Reg. 3 */
  389. #define Ser1SDCR4 __REG(0x80020070) /* Ser. port 1 SDLC Control Reg. 4 */
  390. #define Ser1SDDR __REG(0x80020078) /* Ser. port 1 SDLC Data Reg. */
  391. #define Ser1SDSR0 __REG(0x80020080) /* Ser. port 1 SDLC Status Reg. 0 */
  392. #define Ser1SDSR1 __REG(0x80020084) /* Ser. port 1 SDLC Status Reg. 1 */
  393. #define SDCR0_SUS 0x00000001 /* SDLC/UART Select */
  394. #define SDCR0_SDLC (SDCR0_SUS*0) /* SDLC mode (TXD1 & RXD1) */
  395. #define SDCR0_UART (SDCR0_SUS*1) /* UART mode (TXD1 & RXD1) */
  396. #define SDCR0_SDF 0x00000002 /* Single/Double start Flag select */
  397. #define SDCR0_SglFlg (SDCR0_SDF*0) /* Single start Flag */
  398. #define SDCR0_DblFlg (SDCR0_SDF*1) /* Double start Flag */
  399. #define SDCR0_LBM 0x00000004 /* Look-Back Mode */
  400. #define SDCR0_BMS 0x00000008 /* Bit Modulation Select */
  401. #define SDCR0_FM0 (SDCR0_BMS*0) /* Freq. Modulation zero (0) */
  402. #define SDCR0_NRZ (SDCR0_BMS*1) /* Non-Return to Zero modulation */
  403. #define SDCR0_SCE 0x00000010 /* Sample Clock Enable (GPIO [16]) */
  404. #define SDCR0_SCD 0x00000020 /* Sample Clock Direction select */
  405. /* (GPIO [16]) */
  406. #define SDCR0_SClkIn (SDCR0_SCD*0) /* Sample Clock Input */
  407. #define SDCR0_SClkOut (SDCR0_SCD*1) /* Sample Clock Output */
  408. #define SDCR0_RCE 0x00000040 /* Receive Clock Edge select */
  409. #define SDCR0_RcRsEdg (SDCR0_RCE*0) /* Receive clock Rising-Edge */
  410. #define SDCR0_RcFlEdg (SDCR0_RCE*1) /* Receive clock Falling-Edge */
  411. #define SDCR0_TCE 0x00000080 /* Transmit Clock Edge select */
  412. #define SDCR0_TrRsEdg (SDCR0_TCE*0) /* Transmit clock Rising-Edge */
  413. #define SDCR0_TrFlEdg (SDCR0_TCE*1) /* Transmit clock Falling-Edge */
  414. #define SDCR1_AAF 0x00000001 /* Abort After Frame enable */
  415. /* (GPIO [17]) */
  416. #define SDCR1_TXE 0x00000002 /* Transmit Enable */
  417. #define SDCR1_RXE 0x00000004 /* Receive Enable */
  418. #define SDCR1_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
  419. /* more Interrupt Enable */
  420. #define SDCR1_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
  421. /* Interrupt Enable */
  422. #define SDCR1_AME 0x00000020 /* Address Match Enable */
  423. #define SDCR1_TUS 0x00000040 /* Transmit FIFO Under-run Select */
  424. #define SDCR1_EFrmURn (SDCR1_TUS*0) /* End Frame on Under-Run */
  425. #define SDCR1_AbortURn (SDCR1_TUS*1) /* Abort on Under-Run */
  426. #define SDCR1_RAE 0x00000080 /* Receive Abort interrupt Enable */
  427. #define SDCR2_AMV Fld (8, 0) /* Address Match Value */
  428. #define SDCR3_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
  429. #define SDCR4_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
  430. /* fsd = fxtl/(16*(BRD[11:0] + 1)) */
  431. /* Tsd = 16*(BRD[11:0] + 1)*Txtl */
  432. #define SDCR3_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
  433. (((Div) - 16)/16 >> FSize (SDCR4_BRD) << \
  434. FShft (SDCR3_BRD))
  435. #define SDCR4_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
  436. (((Div) - 16)/16 & FAlnMsk (SDCR4_BRD) << \
  437. FShft (SDCR4_BRD))
  438. /* fsd = fxtl/(16*Floor (Div/16)) */
  439. /* Tsd = 16*Floor (Div/16)*Txtl */
  440. #define SDCR3_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
  441. (((Div) - 1)/16 >> FSize (SDCR4_BRD) << \
  442. FShft (SDCR3_BRD))
  443. #define SDCR4_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
  444. (((Div) - 1)/16 & FAlnMsk (SDCR4_BRD) << \
  445. FShft (SDCR4_BRD))
  446. /* fsd = fxtl/(16*Ceil (Div/16)) */
  447. /* Tsd = 16*Ceil (Div/16)*Txtl */
  448. #define SDDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
  449. #if 0 /* Hidden receive FIFO bits */
  450. #define SDDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
  451. #define SDDR_CRE 0x00000200 /* receive CRC Error (read) */
  452. #define SDDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
  453. #endif /* 0 */
  454. #define SDSR0_EIF 0x00000001 /* Error In FIFO (read) */
  455. #define SDSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
  456. #define SDSR0_RAB 0x00000004 /* Receive ABort */
  457. #define SDSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
  458. /* Service request (read) */
  459. #define SDSR0_RFS 0x00000010 /* Receive FIFO 1/3-to-2/3-full or */
  460. /* more Service request (read) */
  461. #define SDSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
  462. #define SDSR1_TBY 0x00000002 /* Transmitter BusY (read) */
  463. #define SDSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
  464. #define SDSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
  465. #define SDSR1_RTD 0x00000010 /* Receive Transition Detected */
  466. #define SDSR1_EOF 0x00000020 /* receive End-Of-Frame (read) */
  467. #define SDSR1_CRE 0x00000040 /* receive CRC Error (read) */
  468. #define SDSR1_ROR 0x00000080 /* Receive FIFO Over-Run (read) */
  469. /*
  470. * High-Speed Serial to Parallel controller (HSSP) control registers
  471. *
  472. * Registers
  473. * Ser2HSCR0 Serial port 2 High-Speed Serial to Parallel
  474. * controller (HSSP) Control Register 0 (read/write).
  475. * Ser2HSCR1 Serial port 2 High-Speed Serial to Parallel
  476. * controller (HSSP) Control Register 1 (read/write).
  477. * Ser2HSDR Serial port 2 High-Speed Serial to Parallel
  478. * controller (HSSP) Data Register (read/write).
  479. * Ser2HSSR0 Serial port 2 High-Speed Serial to Parallel
  480. * controller (HSSP) Status Register 0 (read/write).
  481. * Ser2HSSR1 Serial port 2 High-Speed Serial to Parallel
  482. * controller (HSSP) Status Register 1 (read).
  483. * Ser2HSCR2 Serial port 2 High-Speed Serial to Parallel
  484. * controller (HSSP) Control Register 2 (read/write).
  485. * [The HSCR2 register is only implemented in
  486. * versions 2.0 (rev. = 8) and higher of the StrongARM
  487. * SA-1100.]
  488. */
  489. #define Ser2HSCR0 __REG(0x80040060) /* Ser. port 2 HSSP Control Reg. 0 */
  490. #define Ser2HSCR1 __REG(0x80040064) /* Ser. port 2 HSSP Control Reg. 1 */
  491. #define Ser2HSDR __REG(0x8004006C) /* Ser. port 2 HSSP Data Reg. */
  492. #define Ser2HSSR0 __REG(0x80040074) /* Ser. port 2 HSSP Status Reg. 0 */
  493. #define Ser2HSSR1 __REG(0x80040078) /* Ser. port 2 HSSP Status Reg. 1 */
  494. #define Ser2HSCR2 __REG(0x90060028) /* Ser. port 2 HSSP Control Reg. 2 */
  495. #define HSCR0_ITR 0x00000001 /* IrDA Transmission Rate */
  496. #define HSCR0_UART (HSCR0_ITR*0) /* UART mode (115.2 kb/s if IrDA) */
  497. #define HSCR0_HSSP (HSCR0_ITR*1) /* HSSP mode (4 Mb/s) */
  498. #define HSCR0_LBM 0x00000002 /* Look-Back Mode */
  499. #define HSCR0_TUS 0x00000004 /* Transmit FIFO Under-run Select */
  500. #define HSCR0_EFrmURn (HSCR0_TUS*0) /* End Frame on Under-Run */
  501. #define HSCR0_AbortURn (HSCR0_TUS*1) /* Abort on Under-Run */
  502. #define HSCR0_TXE 0x00000008 /* Transmit Enable */
  503. #define HSCR0_RXE 0x00000010 /* Receive Enable */
  504. #define HSCR0_RIE 0x00000020 /* Receive FIFO 2/5-to-3/5-full or */
  505. /* more Interrupt Enable */
  506. #define HSCR0_TIE 0x00000040 /* Transmit FIFO 1/2-full or less */
  507. /* Interrupt Enable */
  508. #define HSCR0_AME 0x00000080 /* Address Match Enable */
  509. #define HSCR1_AMV Fld (8, 0) /* Address Match Value */
  510. #define HSDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
  511. #if 0 /* Hidden receive FIFO bits */
  512. #define HSDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
  513. #define HSDR_CRE 0x00000200 /* receive CRC Error (read) */
  514. #define HSDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
  515. #endif /* 0 */
  516. #define HSSR0_EIF 0x00000001 /* Error In FIFO (read) */
  517. #define HSSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
  518. #define HSSR0_RAB 0x00000004 /* Receive ABort */
  519. #define HSSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
  520. /* Service request (read) */
  521. #define HSSR0_RFS 0x00000010 /* Receive FIFO 2/5-to-3/5-full or */
  522. /* more Service request (read) */
  523. #define HSSR0_FRE 0x00000020 /* receive FRaming Error */
  524. #define HSSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
  525. #define HSSR1_TBY 0x00000002 /* Transmitter BusY (read) */
  526. #define HSSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
  527. #define HSSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
  528. #define HSSR1_EOF 0x00000010 /* receive End-Of-Frame (read) */
  529. #define HSSR1_CRE 0x00000020 /* receive CRC Error (read) */
  530. #define HSSR1_ROR 0x00000040 /* Receive FIFO Over-Run (read) */
  531. #define HSCR2_TXP 0x00040000 /* Transmit data Polarity (TXD_2) */
  532. #define HSCR2_TrDataL (HSCR2_TXP*0) /* Transmit Data active Low */
  533. /* (inverted) */
  534. #define HSCR2_TrDataH (HSCR2_TXP*1) /* Transmit Data active High */
  535. /* (non-inverted) */
  536. #define HSCR2_RXP 0x00080000 /* Receive data Polarity (RXD_2) */
  537. #define HSCR2_RcDataL (HSCR2_RXP*0) /* Receive Data active Low */
  538. /* (inverted) */
  539. #define HSCR2_RcDataH (HSCR2_RXP*1) /* Receive Data active High */
  540. /* (non-inverted) */
  541. /*
  542. * Multi-media Communications Port (MCP) control registers
  543. *
  544. * Registers
  545. * Ser4MCCR0 Serial port 4 Multi-media Communications Port (MCP)
  546. * Control Register 0 (read/write).
  547. * Ser4MCDR0 Serial port 4 Multi-media Communications Port (MCP)
  548. * Data Register 0 (audio, read/write).
  549. * Ser4MCDR1 Serial port 4 Multi-media Communications Port (MCP)
  550. * Data Register 1 (telecom, read/write).
  551. * Ser4MCDR2 Serial port 4 Multi-media Communications Port (MCP)
  552. * Data Register 2 (CODEC registers, read/write).
  553. * Ser4MCSR Serial port 4 Multi-media Communications Port (MCP)
  554. * Status Register (read/write).
  555. * Ser4MCCR1 Serial port 4 Multi-media Communications Port (MCP)
  556. * Control Register 1 (read/write).
  557. * [The MCCR1 register is only implemented in
  558. * versions 2.0 (rev. = 8) and higher of the StrongARM
  559. * SA-1100.]
  560. *
  561. * Clocks
  562. * fmc, Tmc Frequency, period of the MCP communication (10 MHz,
  563. * 12 MHz, or GPIO [21]).
  564. * faud, Taud Frequency, period of the audio sampling.
  565. * ftcm, Ttcm Frequency, period of the telecom sampling.
  566. */
  567. #define Ser4MCCR0 __REG(0x80060000) /* Ser. port 4 MCP Control Reg. 0 */
  568. #define Ser4MCDR0 __REG(0x80060008) /* Ser. port 4 MCP Data Reg. 0 (audio) */
  569. #define Ser4MCDR1 __REG(0x8006000C) /* Ser. port 4 MCP Data Reg. 1 (telecom) */
  570. #define Ser4MCDR2 __REG(0x80060010) /* Ser. port 4 MCP Data Reg. 2 (CODEC reg.) */
  571. #define Ser4MCSR __REG(0x80060018) /* Ser. port 4 MCP Status Reg. */
  572. #define Ser4MCCR1 __REG(0x90060030) /* Ser. port 4 MCP Control Reg. 1 */
  573. #define MCCR0_ASD Fld (7, 0) /* Audio Sampling rate Divisor/32 */
  574. /* [6..127] */
  575. /* faud = fmc/(32*ASD) */
  576. /* Taud = 32*ASD*Tmc */
  577. #define MCCR0_AudSmpDiv(Div) /* Audio Sampling rate Divisor */ \
  578. /* [192..4064] */ \
  579. ((Div)/32 << FShft (MCCR0_ASD))
  580. /* faud = fmc/(32*Floor (Div/32)) */
  581. /* Taud = 32*Floor (Div/32)*Tmc */
  582. #define MCCR0_CeilAudSmpDiv(Div) /* Ceil. of AudSmpDiv [192..4064] */ \
  583. (((Div) + 31)/32 << FShft (MCCR0_ASD))
  584. /* faud = fmc/(32*Ceil (Div/32)) */
  585. /* Taud = 32*Ceil (Div/32)*Tmc */
  586. #define MCCR0_TSD Fld (7, 8) /* Telecom Sampling rate */
  587. /* Divisor/32 [16..127] */
  588. /* ftcm = fmc/(32*TSD) */
  589. /* Ttcm = 32*TSD*Tmc */
  590. #define MCCR0_TcmSmpDiv(Div) /* Telecom Sampling rate Divisor */ \
  591. /* [512..4064] */ \
  592. ((Div)/32 << FShft (MCCR0_TSD))
  593. /* ftcm = fmc/(32*Floor (Div/32)) */
  594. /* Ttcm = 32*Floor (Div/32)*Tmc */
  595. #define MCCR0_CeilTcmSmpDiv(Div) /* Ceil. of TcmSmpDiv [512..4064] */ \
  596. (((Div) + 31)/32 << FShft (MCCR0_TSD))
  597. /* ftcm = fmc/(32*Ceil (Div/32)) */
  598. /* Ttcm = 32*Ceil (Div/32)*Tmc */
  599. #define MCCR0_MCE 0x00010000 /* MCP Enable */
  600. #define MCCR0_ECS 0x00020000 /* External Clock Select */
  601. #define MCCR0_IntClk (MCCR0_ECS*0) /* Internal Clock (10 or 12 MHz) */
  602. #define MCCR0_ExtClk (MCCR0_ECS*1) /* External Clock (GPIO [21]) */
  603. #define MCCR0_ADM 0x00040000 /* A/D (audio/telecom) data */
  604. /* sampling/storing Mode */
  605. #define MCCR0_VldBit (MCCR0_ADM*0) /* Valid Bit storing mode */
  606. #define MCCR0_SmpCnt (MCCR0_ADM*1) /* Sampling Counter storing mode */
  607. #define MCCR0_TTE 0x00080000 /* Telecom Transmit FIFO 1/2-full */
  608. /* or less interrupt Enable */
  609. #define MCCR0_TRE 0x00100000 /* Telecom Receive FIFO 1/2-full */
  610. /* or more interrupt Enable */
  611. #define MCCR0_ATE 0x00200000 /* Audio Transmit FIFO 1/2-full */
  612. /* or less interrupt Enable */
  613. #define MCCR0_ARE 0x00400000 /* Audio Receive FIFO 1/2-full or */
  614. /* more interrupt Enable */
  615. #define MCCR0_LBM 0x00800000 /* Look-Back Mode */
  616. #define MCCR0_ECP Fld (2, 24) /* External Clock Prescaler - 1 */
  617. #define MCCR0_ExtClkDiv(Div) /* External Clock Divisor [1..4] */ \
  618. (((Div) - 1) << FShft (MCCR0_ECP))
  619. #define MCDR0_DATA Fld (12, 4) /* receive/transmit audio DATA */
  620. /* FIFOs */
  621. #define MCDR1_DATA Fld (14, 2) /* receive/transmit telecom DATA */
  622. /* FIFOs */
  623. /* receive/transmit CODEC reg. */
  624. /* FIFOs: */
  625. #define MCDR2_DATA Fld (16, 0) /* reg. DATA */
  626. #define MCDR2_RW 0x00010000 /* reg. Read/Write (transmit) */
  627. #define MCDR2_Rd (MCDR2_RW*0) /* reg. Read */
  628. #define MCDR2_Wr (MCDR2_RW*1) /* reg. Write */
  629. #define MCDR2_ADD Fld (4, 17) /* reg. ADDress */
  630. #define MCSR_ATS 0x00000001 /* Audio Transmit FIFO 1/2-full */
  631. /* or less Service request (read) */
  632. #define MCSR_ARS 0x00000002 /* Audio Receive FIFO 1/2-full or */
  633. /* more Service request (read) */
  634. #define MCSR_TTS 0x00000004 /* Telecom Transmit FIFO 1/2-full */
  635. /* or less Service request (read) */
  636. #define MCSR_TRS 0x00000008 /* Telecom Receive FIFO 1/2-full */
  637. /* or more Service request (read) */
  638. #define MCSR_ATU 0x00000010 /* Audio Transmit FIFO Under-run */
  639. #define MCSR_ARO 0x00000020 /* Audio Receive FIFO Over-run */
  640. #define MCSR_TTU 0x00000040 /* Telecom Transmit FIFO Under-run */
  641. #define MCSR_TRO 0x00000080 /* Telecom Receive FIFO Over-run */
  642. #define MCSR_ANF 0x00000100 /* Audio transmit FIFO Not Full */
  643. /* (read) */
  644. #define MCSR_ANE 0x00000200 /* Audio receive FIFO Not Empty */
  645. /* (read) */
  646. #define MCSR_TNF 0x00000400 /* Telecom transmit FIFO Not Full */
  647. /* (read) */
  648. #define MCSR_TNE 0x00000800 /* Telecom receive FIFO Not Empty */
  649. /* (read) */
  650. #define MCSR_CWC 0x00001000 /* CODEC register Write Completed */
  651. /* (read) */
  652. #define MCSR_CRC 0x00002000 /* CODEC register Read Completed */
  653. /* (read) */
  654. #define MCSR_ACE 0x00004000 /* Audio CODEC Enabled (read) */
  655. #define MCSR_TCE 0x00008000 /* Telecom CODEC Enabled (read) */
  656. #define MCCR1_CFS 0x00100000 /* Clock Freq. Select */
  657. #define MCCR1_F12MHz (MCCR1_CFS*0) /* Freq. (fmc) = ~ 12 MHz */
  658. /* (11.981 MHz) */
  659. #define MCCR1_F10MHz (MCCR1_CFS*1) /* Freq. (fmc) = ~ 10 MHz */
  660. /* (9.585 MHz) */
  661. /*
  662. * Synchronous Serial Port (SSP) control registers
  663. *
  664. * Registers
  665. * Ser4SSCR0 Serial port 4 Synchronous Serial Port (SSP) Control
  666. * Register 0 (read/write).
  667. * Ser4SSCR1 Serial port 4 Synchronous Serial Port (SSP) Control
  668. * Register 1 (read/write).
  669. * [Bits SPO and SP are only implemented in versions 2.0
  670. * (rev. = 8) and higher of the StrongARM SA-1100.]
  671. * Ser4SSDR Serial port 4 Synchronous Serial Port (SSP) Data
  672. * Register (read/write).
  673. * Ser4SSSR Serial port 4 Synchronous Serial Port (SSP) Status
  674. * Register (read/write).
  675. *
  676. * Clocks
  677. * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
  678. * or 3.5795 MHz).
  679. * fss, Tss Frequency, period of the SSP communication.
  680. */
  681. #define Ser4SSCR0 __REG(0x80070060) /* Ser. port 4 SSP Control Reg. 0 */
  682. #define Ser4SSCR1 __REG(0x80070064) /* Ser. port 4 SSP Control Reg. 1 */
  683. #define Ser4SSDR __REG(0x8007006C) /* Ser. port 4 SSP Data Reg. */
  684. #define Ser4SSSR __REG(0x80070074) /* Ser. port 4 SSP Status Reg. */
  685. #define SSCR0_DSS Fld (4, 0) /* Data Size - 1 Select [3..15] */
  686. #define SSCR0_DataSize(Size) /* Data Size Select [4..16] */ \
  687. (((Size) - 1) << FShft (SSCR0_DSS))
  688. #define SSCR0_FRF Fld (2, 4) /* FRame Format */
  689. #define SSCR0_Motorola /* Motorola Serial Peripheral */ \
  690. /* Interface (SPI) format */ \
  691. (0 << FShft (SSCR0_FRF))
  692. #define SSCR0_TI /* Texas Instruments Synchronous */ \
  693. /* Serial format */ \
  694. (1 << FShft (SSCR0_FRF))
  695. #define SSCR0_National /* National Microwire format */ \
  696. (2 << FShft (SSCR0_FRF))
  697. #define SSCR0_SSE 0x00000080 /* SSP Enable */
  698. #define SSCR0_SCR Fld (8, 8) /* Serial Clock Rate divisor/2 - 1 */
  699. /* fss = fxtl/(2*(SCR + 1)) */
  700. /* Tss = 2*(SCR + 1)*Txtl */
  701. #define SSCR0_SerClkDiv(Div) /* Serial Clock Divisor [2..512] */ \
  702. (((Div) - 2)/2 << FShft (SSCR0_SCR))
  703. /* fss = fxtl/(2*Floor (Div/2)) */
  704. /* Tss = 2*Floor (Div/2)*Txtl */
  705. #define SSCR0_CeilSerClkDiv(Div) /* Ceil. of SerClkDiv [2..512] */ \
  706. (((Div) - 1)/2 << FShft (SSCR0_SCR))
  707. /* fss = fxtl/(2*Ceil (Div/2)) */
  708. /* Tss = 2*Ceil (Div/2)*Txtl */
  709. #define SSCR1_RIE 0x00000001 /* Receive FIFO 1/2-full or more */
  710. /* Interrupt Enable */
  711. #define SSCR1_TIE 0x00000002 /* Transmit FIFO 1/2-full or less */
  712. /* Interrupt Enable */
  713. #define SSCR1_LBM 0x00000004 /* Look-Back Mode */
  714. #define SSCR1_SPO 0x00000008 /* Sample clock (SCLK) POlarity */
  715. #define SSCR1_SClkIactL (SSCR1_SPO*0) /* Sample Clock Inactive Low */
  716. #define SSCR1_SClkIactH (SSCR1_SPO*1) /* Sample Clock Inactive High */
  717. #define SSCR1_SP 0x00000010 /* Sample clock (SCLK) Phase */
  718. #define SSCR1_SClk1P (SSCR1_SP*0) /* Sample Clock active 1 Period */
  719. /* after frame (SFRM, 1st edge) */
  720. #define SSCR1_SClk1_2P (SSCR1_SP*1) /* Sample Clock active 1/2 Period */
  721. /* after frame (SFRM, 1st edge) */
  722. #define SSCR1_ECS 0x00000020 /* External Clock Select */
  723. #define SSCR1_IntClk (SSCR1_ECS*0) /* Internal Clock */
  724. #define SSCR1_ExtClk (SSCR1_ECS*1) /* External Clock (GPIO [19]) */
  725. #define SSDR_DATA Fld (16, 0) /* receive/transmit DATA FIFOs */
  726. #define SSSR_TNF 0x00000002 /* Transmit FIFO Not Full (read) */
  727. #define SSSR_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
  728. #define SSSR_BSY 0x00000008 /* SSP BuSY (read) */
  729. #define SSSR_TFS 0x00000010 /* Transmit FIFO 1/2-full or less */
  730. /* Service request (read) */
  731. #define SSSR_RFS 0x00000020 /* Receive FIFO 1/2-full or more */
  732. /* Service request (read) */
  733. #define SSSR_ROR 0x00000040 /* Receive FIFO Over-Run */
  734. /*
  735. * Operating System (OS) timer control registers
  736. *
  737. * Registers
  738. * OSMR0 Operating System (OS) timer Match Register 0
  739. * (read/write).
  740. * OSMR1 Operating System (OS) timer Match Register 1
  741. * (read/write).
  742. * OSMR2 Operating System (OS) timer Match Register 2
  743. * (read/write).
  744. * OSMR3 Operating System (OS) timer Match Register 3
  745. * (read/write).
  746. * OSCR Operating System (OS) timer Counter Register
  747. * (read/write).
  748. * OSSR Operating System (OS) timer Status Register
  749. * (read/write).
  750. * OWER Operating System (OS) timer Watch-dog Enable Register
  751. * (read/write).
  752. * OIER Operating System (OS) timer Interrupt Enable Register
  753. * (read/write).
  754. */
  755. #define OSMR0 io_p2v(0x90000000) /* OS timer Match Reg. 0 */
  756. #define OSMR1 io_p2v(0x90000004) /* OS timer Match Reg. 1 */
  757. #define OSMR2 io_p2v(0x90000008) /* OS timer Match Reg. 2 */
  758. #define OSMR3 io_p2v(0x9000000c) /* OS timer Match Reg. 3 */
  759. #define OSCR io_p2v(0x90000010) /* OS timer Counter Reg. */
  760. #define OSSR io_p2v(0x90000014) /* OS timer Status Reg. */
  761. #define OWER io_p2v(0x90000018) /* OS timer Watch-dog Enable Reg. */
  762. #define OIER io_p2v(0x9000001C) /* OS timer Interrupt Enable Reg. */
  763. #define OSSR_M(Nb) /* Match detected [0..3] */ \
  764. (0x00000001 << (Nb))
  765. #define OSSR_M0 OSSR_M (0) /* Match detected 0 */
  766. #define OSSR_M1 OSSR_M (1) /* Match detected 1 */
  767. #define OSSR_M2 OSSR_M (2) /* Match detected 2 */
  768. #define OSSR_M3 OSSR_M (3) /* Match detected 3 */
  769. #define OWER_WME 0x00000001 /* Watch-dog Match Enable */
  770. /* (set only) */
  771. #define OIER_E(Nb) /* match interrupt Enable [0..3] */ \
  772. (0x00000001 << (Nb))
  773. #define OIER_E0 OIER_E (0) /* match interrupt Enable 0 */
  774. #define OIER_E1 OIER_E (1) /* match interrupt Enable 1 */
  775. #define OIER_E2 OIER_E (2) /* match interrupt Enable 2 */
  776. #define OIER_E3 OIER_E (3) /* match interrupt Enable 3 */
  777. /*
  778. * Power Manager (PM) control registers
  779. *
  780. * Registers
  781. * PMCR Power Manager (PM) Control Register (read/write).
  782. * PSSR Power Manager (PM) Sleep Status Register (read/write).
  783. * PSPR Power Manager (PM) Scratch-Pad Register (read/write).
  784. * PWER Power Manager (PM) Wake-up Enable Register
  785. * (read/write).
  786. * PCFR Power Manager (PM) general ConFiguration Register
  787. * (read/write).
  788. * PPCR Power Manager (PM) Phase-Locked Loop (PLL)
  789. * Configuration Register (read/write).
  790. * PGSR Power Manager (PM) General-Purpose Input/Output (GPIO)
  791. * Sleep state Register (read/write, see GPIO pins).
  792. * POSR Power Manager (PM) Oscillator Status Register (read).
  793. *
  794. * Clocks
  795. * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
  796. * or 3.5795 MHz).
  797. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  798. */
  799. #define PMCR __REG(0x90020000) /* PM Control Reg. */
  800. #define PSSR __REG(0x90020004) /* PM Sleep Status Reg. */
  801. #define PSPR __REG(0x90020008) /* PM Scratch-Pad Reg. */
  802. #define PWER __REG(0x9002000C) /* PM Wake-up Enable Reg. */
  803. #define PCFR __REG(0x90020010) /* PM general ConFiguration Reg. */
  804. #define PPCR __REG(0x90020014) /* PM PLL Configuration Reg. */
  805. #define PGSR __REG(0x90020018) /* PM GPIO Sleep state Reg. */
  806. #define POSR __REG(0x9002001C) /* PM Oscillator Status Reg. */
  807. #define PMCR_SF 0x00000001 /* Sleep Force (set only) */
  808. #define PSSR_SS 0x00000001 /* Software Sleep */
  809. #define PSSR_BFS 0x00000002 /* Battery Fault Status */
  810. /* (BATT_FAULT) */
  811. #define PSSR_VFS 0x00000004 /* Vdd Fault Status (VDD_FAULT) */
  812. #define PSSR_DH 0x00000008 /* DRAM control Hold */
  813. #define PSSR_PH 0x00000010 /* Peripheral control Hold */
  814. #define PWER_GPIO(Nb) GPIO_GPIO (Nb) /* GPIO [0..27] wake-up enable */
  815. #define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
  816. #define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
  817. #define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
  818. #define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
  819. #define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
  820. #define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
  821. #define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
  822. #define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
  823. #define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
  824. #define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
  825. #define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
  826. #define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
  827. #define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
  828. #define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
  829. #define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
  830. #define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
  831. #define PWER_GPIO16 PWER_GPIO (16) /* GPIO [16] wake-up enable */
  832. #define PWER_GPIO17 PWER_GPIO (17) /* GPIO [17] wake-up enable */
  833. #define PWER_GPIO18 PWER_GPIO (18) /* GPIO [18] wake-up enable */
  834. #define PWER_GPIO19 PWER_GPIO (19) /* GPIO [19] wake-up enable */
  835. #define PWER_GPIO20 PWER_GPIO (20) /* GPIO [20] wake-up enable */
  836. #define PWER_GPIO21 PWER_GPIO (21) /* GPIO [21] wake-up enable */
  837. #define PWER_GPIO22 PWER_GPIO (22) /* GPIO [22] wake-up enable */
  838. #define PWER_GPIO23 PWER_GPIO (23) /* GPIO [23] wake-up enable */
  839. #define PWER_GPIO24 PWER_GPIO (24) /* GPIO [24] wake-up enable */
  840. #define PWER_GPIO25 PWER_GPIO (25) /* GPIO [25] wake-up enable */
  841. #define PWER_GPIO26 PWER_GPIO (26) /* GPIO [26] wake-up enable */
  842. #define PWER_GPIO27 PWER_GPIO (27) /* GPIO [27] wake-up enable */
  843. #define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
  844. #define PCFR_OPDE 0x00000001 /* Oscillator Power-Down Enable */
  845. #define PCFR_ClkRun (PCFR_OPDE*0) /* Clock Running in sleep mode */
  846. #define PCFR_ClkStp (PCFR_OPDE*1) /* Clock Stopped in sleep mode */
  847. #define PCFR_FP 0x00000002 /* Float PCMCIA pins */
  848. #define PCFR_PCMCIANeg (PCFR_FP*0) /* PCMCIA pins Negated (1) */
  849. #define PCFR_PCMCIAFlt (PCFR_FP*1) /* PCMCIA pins Floating */
  850. #define PCFR_FS 0x00000004 /* Float Static memory pins */
  851. #define PCFR_StMemNeg (PCFR_FS*0) /* Static Memory pins Negated (1) */
  852. #define PCFR_StMemFlt (PCFR_FS*1) /* Static Memory pins Floating */
  853. #define PCFR_FO 0x00000008 /* Force RTC oscillator */
  854. /* (32.768 kHz) enable On */
  855. #define PPCR_CCF Fld (5, 0) /* CPU core Clock (CCLK) Freq. */
  856. #define PPCR_Fx16 /* Freq. x 16 (fcpu = 16*fxtl) */ \
  857. (0x00 << FShft (PPCR_CCF))
  858. #define PPCR_Fx20 /* Freq. x 20 (fcpu = 20*fxtl) */ \
  859. (0x01 << FShft (PPCR_CCF))
  860. #define PPCR_Fx24 /* Freq. x 24 (fcpu = 24*fxtl) */ \
  861. (0x02 << FShft (PPCR_CCF))
  862. #define PPCR_Fx28 /* Freq. x 28 (fcpu = 28*fxtl) */ \
  863. (0x03 << FShft (PPCR_CCF))
  864. #define PPCR_Fx32 /* Freq. x 32 (fcpu = 32*fxtl) */ \
  865. (0x04 << FShft (PPCR_CCF))
  866. #define PPCR_Fx36 /* Freq. x 36 (fcpu = 36*fxtl) */ \
  867. (0x05 << FShft (PPCR_CCF))
  868. #define PPCR_Fx40 /* Freq. x 40 (fcpu = 40*fxtl) */ \
  869. (0x06 << FShft (PPCR_CCF))
  870. #define PPCR_Fx44 /* Freq. x 44 (fcpu = 44*fxtl) */ \
  871. (0x07 << FShft (PPCR_CCF))
  872. #define PPCR_Fx48 /* Freq. x 48 (fcpu = 48*fxtl) */ \
  873. (0x08 << FShft (PPCR_CCF))
  874. #define PPCR_Fx52 /* Freq. x 52 (fcpu = 52*fxtl) */ \
  875. (0x09 << FShft (PPCR_CCF))
  876. #define PPCR_Fx56 /* Freq. x 56 (fcpu = 56*fxtl) */ \
  877. (0x0A << FShft (PPCR_CCF))
  878. #define PPCR_Fx60 /* Freq. x 60 (fcpu = 60*fxtl) */ \
  879. (0x0B << FShft (PPCR_CCF))
  880. #define PPCR_Fx64 /* Freq. x 64 (fcpu = 64*fxtl) */ \
  881. (0x0C << FShft (PPCR_CCF))
  882. #define PPCR_Fx68 /* Freq. x 68 (fcpu = 68*fxtl) */ \
  883. (0x0D << FShft (PPCR_CCF))
  884. #define PPCR_Fx72 /* Freq. x 72 (fcpu = 72*fxtl) */ \
  885. (0x0E << FShft (PPCR_CCF))
  886. #define PPCR_Fx76 /* Freq. x 76 (fcpu = 76*fxtl) */ \
  887. (0x0F << FShft (PPCR_CCF))
  888. /* 3.6864 MHz crystal (fxtl): */
  889. #define PPCR_F59_0MHz PPCR_Fx16 /* Freq. (fcpu) = 59.0 MHz */
  890. #define PPCR_F73_7MHz PPCR_Fx20 /* Freq. (fcpu) = 73.7 MHz */
  891. #define PPCR_F88_5MHz PPCR_Fx24 /* Freq. (fcpu) = 88.5 MHz */
  892. #define PPCR_F103_2MHz PPCR_Fx28 /* Freq. (fcpu) = 103.2 MHz */
  893. #define PPCR_F118_0MHz PPCR_Fx32 /* Freq. (fcpu) = 118.0 MHz */
  894. #define PPCR_F132_7MHz PPCR_Fx36 /* Freq. (fcpu) = 132.7 MHz */
  895. #define PPCR_F147_5MHz PPCR_Fx40 /* Freq. (fcpu) = 147.5 MHz */
  896. #define PPCR_F162_2MHz PPCR_Fx44 /* Freq. (fcpu) = 162.2 MHz */
  897. #define PPCR_F176_9MHz PPCR_Fx48 /* Freq. (fcpu) = 176.9 MHz */
  898. #define PPCR_F191_7MHz PPCR_Fx52 /* Freq. (fcpu) = 191.7 MHz */
  899. #define PPCR_F206_4MHz PPCR_Fx56 /* Freq. (fcpu) = 206.4 MHz */
  900. #define PPCR_F221_2MHz PPCR_Fx60 /* Freq. (fcpu) = 221.2 MHz */
  901. #define PPCR_F239_6MHz PPCR_Fx64 /* Freq. (fcpu) = 239.6 MHz */
  902. #define PPCR_F250_7MHz PPCR_Fx68 /* Freq. (fcpu) = 250.7 MHz */
  903. #define PPCR_F265_4MHz PPCR_Fx72 /* Freq. (fcpu) = 265.4 MHz */
  904. #define PPCR_F280_2MHz PPCR_Fx76 /* Freq. (fcpu) = 280.2 MHz */
  905. /* 3.5795 MHz crystal (fxtl): */
  906. #define PPCR_F57_3MHz PPCR_Fx16 /* Freq. (fcpu) = 57.3 MHz */
  907. #define PPCR_F71_6MHz PPCR_Fx20 /* Freq. (fcpu) = 71.6 MHz */
  908. #define PPCR_F85_9MHz PPCR_Fx24 /* Freq. (fcpu) = 85.9 MHz */
  909. #define PPCR_F100_2MHz PPCR_Fx28 /* Freq. (fcpu) = 100.2 MHz */
  910. #define PPCR_F114_5MHz PPCR_Fx32 /* Freq. (fcpu) = 114.5 MHz */
  911. #define PPCR_F128_9MHz PPCR_Fx36 /* Freq. (fcpu) = 128.9 MHz */
  912. #define PPCR_F143_2MHz PPCR_Fx40 /* Freq. (fcpu) = 143.2 MHz */
  913. #define PPCR_F157_5MHz PPCR_Fx44 /* Freq. (fcpu) = 157.5 MHz */
  914. #define PPCR_F171_8MHz PPCR_Fx48 /* Freq. (fcpu) = 171.8 MHz */
  915. #define PPCR_F186_1MHz PPCR_Fx52 /* Freq. (fcpu) = 186.1 MHz */
  916. #define PPCR_F200_5MHz PPCR_Fx56 /* Freq. (fcpu) = 200.5 MHz */
  917. #define PPCR_F214_8MHz PPCR_Fx60 /* Freq. (fcpu) = 214.8 MHz */
  918. #define PPCR_F229_1MHz PPCR_Fx64 /* Freq. (fcpu) = 229.1 MHz */
  919. #define PPCR_F243_4MHz PPCR_Fx68 /* Freq. (fcpu) = 243.4 MHz */
  920. #define PPCR_F257_7MHz PPCR_Fx72 /* Freq. (fcpu) = 257.7 MHz */
  921. #define PPCR_F272_0MHz PPCR_Fx76 /* Freq. (fcpu) = 272.0 MHz */
  922. #define POSR_OOK 0x00000001 /* RTC Oscillator (32.768 kHz) OK */
  923. /*
  924. * Reset Controller (RC) control registers
  925. *
  926. * Registers
  927. * RSRR Reset Controller (RC) Software Reset Register
  928. * (read/write).
  929. * RCSR Reset Controller (RC) Status Register (read/write).
  930. */
  931. #define RSRR __REG(0x90030000) /* RC Software Reset Reg. */
  932. #define RCSR __REG(0x90030004) /* RC Status Reg. */
  933. #define RSRR_SWR 0x00000001 /* SoftWare Reset (set only) */
  934. #define RCSR_HWR 0x00000001 /* HardWare Reset */
  935. #define RCSR_SWR 0x00000002 /* SoftWare Reset */
  936. #define RCSR_WDR 0x00000004 /* Watch-Dog Reset */
  937. #define RCSR_SMR 0x00000008 /* Sleep-Mode Reset */
  938. /*
  939. * Test unit control registers
  940. *
  941. * Registers
  942. * TUCR Test Unit Control Register (read/write).
  943. */
  944. #define TUCR __REG(0x90030008) /* Test Unit Control Reg. */
  945. #define TUCR_TIC 0x00000040 /* TIC mode */
  946. #define TUCR_TTST 0x00000080 /* Trim TeST mode */
  947. #define TUCR_RCRC 0x00000100 /* Richard's Cyclic Redundancy */
  948. /* Check */
  949. #define TUCR_PMD 0x00000200 /* Power Management Disable */
  950. #define TUCR_MR 0x00000400 /* Memory Request mode */
  951. #define TUCR_NoMB (TUCR_MR*0) /* No Memory Bus request & grant */
  952. #define TUCR_MBGPIO (TUCR_MR*1) /* Memory Bus request (MBREQ) & */
  953. /* grant (MBGNT) on GPIO [22:21] */
  954. #define TUCR_CTB Fld (3, 20) /* Clock Test Bits */
  955. #define TUCR_FDC 0x00800000 /* RTC Force Delete Count */
  956. #define TUCR_FMC 0x01000000 /* Force Michelle's Control mode */
  957. #define TUCR_TMC 0x02000000 /* RTC Trimmer Multiplexer Control */
  958. #define TUCR_DPS 0x04000000 /* Disallow Pad Sleep */
  959. #define TUCR_TSEL Fld (3, 29) /* clock Test SELect on GPIO [27] */
  960. #define TUCR_32_768kHz /* 32.768 kHz osc. on GPIO [27] */ \
  961. (0 << FShft (TUCR_TSEL))
  962. #define TUCR_3_6864MHz /* 3.6864 MHz osc. on GPIO [27] */ \
  963. (1 << FShft (TUCR_TSEL))
  964. #define TUCR_VDD /* VDD ring osc./16 on GPIO [27] */ \
  965. (2 << FShft (TUCR_TSEL))
  966. #define TUCR_96MHzPLL /* 96 MHz PLL/4 on GPIO [27] */ \
  967. (3 << FShft (TUCR_TSEL))
  968. #define TUCR_Clock /* internal (fcpu/2) & 32.768 kHz */ \
  969. /* Clocks on GPIO [26:27] */ \
  970. (4 << FShft (TUCR_TSEL))
  971. #define TUCR_3_6864MHzA /* 3.6864 MHz osc. on GPIO [27] */ \
  972. /* (Alternative) */ \
  973. (5 << FShft (TUCR_TSEL))
  974. #define TUCR_MainPLL /* Main PLL/16 on GPIO [27] */ \
  975. (6 << FShft (TUCR_TSEL))
  976. #define TUCR_VDDL /* VDDL ring osc./4 on GPIO [27] */ \
  977. (7 << FShft (TUCR_TSEL))
  978. /*
  979. * General-Purpose Input/Output (GPIO) control registers
  980. *
  981. * Registers
  982. * GPLR General-Purpose Input/Output (GPIO) Pin Level
  983. * Register (read).
  984. * GPDR General-Purpose Input/Output (GPIO) Pin Direction
  985. * Register (read/write).
  986. * GPSR General-Purpose Input/Output (GPIO) Pin output Set
  987. * Register (write).
  988. * GPCR General-Purpose Input/Output (GPIO) Pin output Clear
  989. * Register (write).
  990. * GRER General-Purpose Input/Output (GPIO) Rising-Edge
  991. * detect Register (read/write).
  992. * GFER General-Purpose Input/Output (GPIO) Falling-Edge
  993. * detect Register (read/write).
  994. * GEDR General-Purpose Input/Output (GPIO) Edge Detect
  995. * status Register (read/write).
  996. * GAFR General-Purpose Input/Output (GPIO) Alternate
  997. * Function Register (read/write).
  998. *
  999. * Clock
  1000. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  1001. */
  1002. #define GPLR __REG(0x90040000) /* GPIO Pin Level Reg. */
  1003. #define GPDR __REG(0x90040004) /* GPIO Pin Direction Reg. */
  1004. #define GPSR __REG(0x90040008) /* GPIO Pin output Set Reg. */
  1005. #define GPCR __REG(0x9004000C) /* GPIO Pin output Clear Reg. */
  1006. #define GRER __REG(0x90040010) /* GPIO Rising-Edge detect Reg. */
  1007. #define GFER __REG(0x90040014) /* GPIO Falling-Edge detect Reg. */
  1008. #define GEDR __REG(0x90040018) /* GPIO Edge Detect status Reg. */
  1009. #define GAFR __REG(0x9004001C) /* GPIO Alternate Function Reg. */
  1010. #define GPIO_MIN (0)
  1011. #define GPIO_MAX (27)
  1012. #define GPIO_GPIO(Nb) /* GPIO [0..27] */ \
  1013. (0x00000001 << (Nb))
  1014. #define GPIO_GPIO0 GPIO_GPIO (0) /* GPIO [0] */
  1015. #define GPIO_GPIO1 GPIO_GPIO (1) /* GPIO [1] */
  1016. #define GPIO_GPIO2 GPIO_GPIO (2) /* GPIO [2] */
  1017. #define GPIO_GPIO3 GPIO_GPIO (3) /* GPIO [3] */
  1018. #define GPIO_GPIO4 GPIO_GPIO (4) /* GPIO [4] */
  1019. #define GPIO_GPIO5 GPIO_GPIO (5) /* GPIO [5] */
  1020. #define GPIO_GPIO6 GPIO_GPIO (6) /* GPIO [6] */
  1021. #define GPIO_GPIO7 GPIO_GPIO (7) /* GPIO [7] */
  1022. #define GPIO_GPIO8 GPIO_GPIO (8) /* GPIO [8] */
  1023. #define GPIO_GPIO9 GPIO_GPIO (9) /* GPIO [9] */
  1024. #define GPIO_GPIO10 GPIO_GPIO (10) /* GPIO [10] */
  1025. #define GPIO_GPIO11 GPIO_GPIO (11) /* GPIO [11] */
  1026. #define GPIO_GPIO12 GPIO_GPIO (12) /* GPIO [12] */
  1027. #define GPIO_GPIO13 GPIO_GPIO (13) /* GPIO [13] */
  1028. #define GPIO_GPIO14 GPIO_GPIO (14) /* GPIO [14] */
  1029. #define GPIO_GPIO15 GPIO_GPIO (15) /* GPIO [15] */
  1030. #define GPIO_GPIO16 GPIO_GPIO (16) /* GPIO [16] */
  1031. #define GPIO_GPIO17 GPIO_GPIO (17) /* GPIO [17] */
  1032. #define GPIO_GPIO18 GPIO_GPIO (18) /* GPIO [18] */
  1033. #define GPIO_GPIO19 GPIO_GPIO (19) /* GPIO [19] */
  1034. #define GPIO_GPIO20 GPIO_GPIO (20) /* GPIO [20] */
  1035. #define GPIO_GPIO21 GPIO_GPIO (21) /* GPIO [21] */
  1036. #define GPIO_GPIO22 GPIO_GPIO (22) /* GPIO [22] */
  1037. #define GPIO_GPIO23 GPIO_GPIO (23) /* GPIO [23] */
  1038. #define GPIO_GPIO24 GPIO_GPIO (24) /* GPIO [24] */
  1039. #define GPIO_GPIO25 GPIO_GPIO (25) /* GPIO [25] */
  1040. #define GPIO_GPIO26 GPIO_GPIO (26) /* GPIO [26] */
  1041. #define GPIO_GPIO27 GPIO_GPIO (27) /* GPIO [27] */
  1042. #define GPIO_LDD(Nb) /* LCD Data [8..15] (O) */ \
  1043. GPIO_GPIO ((Nb) - 6)
  1044. #define GPIO_LDD8 GPIO_LDD (8) /* LCD Data [8] (O) */
  1045. #define GPIO_LDD9 GPIO_LDD (9) /* LCD Data [9] (O) */
  1046. #define GPIO_LDD10 GPIO_LDD (10) /* LCD Data [10] (O) */
  1047. #define GPIO_LDD11 GPIO_LDD (11) /* LCD Data [11] (O) */
  1048. #define GPIO_LDD12 GPIO_LDD (12) /* LCD Data [12] (O) */
  1049. #define GPIO_LDD13 GPIO_LDD (13) /* LCD Data [13] (O) */
  1050. #define GPIO_LDD14 GPIO_LDD (14) /* LCD Data [14] (O) */
  1051. #define GPIO_LDD15 GPIO_LDD (15) /* LCD Data [15] (O) */
  1052. /* ser. port 4: */
  1053. #define GPIO_SSP_TXD GPIO_GPIO (10) /* SSP Transmit Data (O) */
  1054. #define GPIO_SSP_RXD GPIO_GPIO (11) /* SSP Receive Data (I) */
  1055. #define GPIO_SSP_SCLK GPIO_GPIO (12) /* SSP Sample CLocK (O) */
  1056. #define GPIO_SSP_SFRM GPIO_GPIO (13) /* SSP Sample FRaMe (O) */
  1057. /* ser. port 1: */
  1058. #define GPIO_UART_TXD GPIO_GPIO (14) /* UART Transmit Data (O) */
  1059. #define GPIO_UART_RXD GPIO_GPIO (15) /* UART Receive Data (I) */
  1060. #define GPIO_SDLC_SCLK GPIO_GPIO (16) /* SDLC Sample CLocK (I/O) */
  1061. #define GPIO_SDLC_AAF GPIO_GPIO (17) /* SDLC Abort After Frame (O) */
  1062. #define GPIO_UART_SCLK1 GPIO_GPIO (18) /* UART Sample CLocK 1 (I) */
  1063. /* ser. port 4: */
  1064. #define GPIO_SSP_CLK GPIO_GPIO (19) /* SSP external CLocK (I) */
  1065. /* ser. port 3: */
  1066. #define GPIO_UART_SCLK3 GPIO_GPIO (20) /* UART Sample CLocK 3 (I) */
  1067. /* ser. port 4: */
  1068. #define GPIO_MCP_CLK GPIO_GPIO (21) /* MCP CLocK (I) */
  1069. /* test controller: */
  1070. #define GPIO_TIC_ACK GPIO_GPIO (21) /* TIC ACKnowledge (O) */
  1071. #define GPIO_MBGNT GPIO_GPIO (21) /* Memory Bus GraNT (O) */
  1072. #define GPIO_TREQA GPIO_GPIO (22) /* TIC REQuest A (I) */
  1073. #define GPIO_MBREQ GPIO_GPIO (22) /* Memory Bus REQuest (I) */
  1074. #define GPIO_TREQB GPIO_GPIO (23) /* TIC REQuest B (I) */
  1075. #define GPIO_1Hz GPIO_GPIO (25) /* 1 Hz clock (O) */
  1076. #define GPIO_RCLK GPIO_GPIO (26) /* internal (R) CLocK (O, fcpu/2) */
  1077. #define GPIO_32_768kHz GPIO_GPIO (27) /* 32.768 kHz clock (O, RTC) */
  1078. #define GPDR_In 0 /* Input */
  1079. #define GPDR_Out 1 /* Output */
  1080. /*
  1081. * Interrupt Controller (IC) control registers
  1082. *
  1083. * Registers
  1084. * ICIP Interrupt Controller (IC) Interrupt ReQuest (IRQ)
  1085. * Pending register (read).
  1086. * ICMR Interrupt Controller (IC) Mask Register (read/write).
  1087. * ICLR Interrupt Controller (IC) Level Register (read/write).
  1088. * ICCR Interrupt Controller (IC) Control Register
  1089. * (read/write).
  1090. * [The ICCR register is only implemented in versions 2.0
  1091. * (rev. = 8) and higher of the StrongARM SA-1100.]
  1092. * ICFP Interrupt Controller (IC) Fast Interrupt reQuest
  1093. * (FIQ) Pending register (read).
  1094. * ICPR Interrupt Controller (IC) Pending Register (read).
  1095. * [The ICPR register is active low (inverted) in
  1096. * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
  1097. * StrongARM SA-1100, it is active high (non-inverted) in
  1098. * versions 2.0 (rev. = 8) and higher.]
  1099. */
  1100. #define ICIP __REG(0x90050000) /* IC IRQ Pending reg. */
  1101. #define ICMR __REG(0x90050004) /* IC Mask Reg. */
  1102. #define ICLR __REG(0x90050008) /* IC Level Reg. */
  1103. #define ICCR __REG(0x9005000C) /* IC Control Reg. */
  1104. #define ICFP __REG(0x90050010) /* IC FIQ Pending reg. */
  1105. #define ICPR __REG(0x90050020) /* IC Pending Reg. */
  1106. #define IC_GPIO(Nb) /* GPIO [0..10] */ \
  1107. (0x00000001 << (Nb))
  1108. #define IC_GPIO0 IC_GPIO (0) /* GPIO [0] */
  1109. #define IC_GPIO1 IC_GPIO (1) /* GPIO [1] */
  1110. #define IC_GPIO2 IC_GPIO (2) /* GPIO [2] */
  1111. #define IC_GPIO3 IC_GPIO (3) /* GPIO [3] */
  1112. #define IC_GPIO4 IC_GPIO (4) /* GPIO [4] */
  1113. #define IC_GPIO5 IC_GPIO (5) /* GPIO [5] */
  1114. #define IC_GPIO6 IC_GPIO (6) /* GPIO [6] */
  1115. #define IC_GPIO7 IC_GPIO (7) /* GPIO [7] */
  1116. #define IC_GPIO8 IC_GPIO (8) /* GPIO [8] */
  1117. #define IC_GPIO9 IC_GPIO (9) /* GPIO [9] */
  1118. #define IC_GPIO10 IC_GPIO (10) /* GPIO [10] */
  1119. #define IC_GPIO11_27 0x00000800 /* GPIO [11:27] (ORed) */
  1120. #define IC_LCD 0x00001000 /* LCD controller */
  1121. #define IC_Ser0UDC 0x00002000 /* Ser. port 0 UDC */
  1122. #define IC_Ser1SDLC 0x00004000 /* Ser. port 1 SDLC */
  1123. #define IC_Ser1UART 0x00008000 /* Ser. port 1 UART */
  1124. #define IC_Ser2ICP 0x00010000 /* Ser. port 2 ICP */
  1125. #define IC_Ser3UART 0x00020000 /* Ser. port 3 UART */
  1126. #define IC_Ser4MCP 0x00040000 /* Ser. port 4 MCP */
  1127. #define IC_Ser4SSP 0x00080000 /* Ser. port 4 SSP */
  1128. #define IC_DMA(Nb) /* DMA controller channel [0..5] */ \
  1129. (0x00100000 << (Nb))
  1130. #define IC_DMA0 IC_DMA (0) /* DMA controller channel 0 */
  1131. #define IC_DMA1 IC_DMA (1) /* DMA controller channel 1 */
  1132. #define IC_DMA2 IC_DMA (2) /* DMA controller channel 2 */
  1133. #define IC_DMA3 IC_DMA (3) /* DMA controller channel 3 */
  1134. #define IC_DMA4 IC_DMA (4) /* DMA controller channel 4 */
  1135. #define IC_DMA5 IC_DMA (5) /* DMA controller channel 5 */
  1136. #define IC_OST(Nb) /* OS Timer match [0..3] */ \
  1137. (0x04000000 << (Nb))
  1138. #define IC_OST0 IC_OST (0) /* OS Timer match 0 */
  1139. #define IC_OST1 IC_OST (1) /* OS Timer match 1 */
  1140. #define IC_OST2 IC_OST (2) /* OS Timer match 2 */
  1141. #define IC_OST3 IC_OST (3) /* OS Timer match 3 */
  1142. #define IC_RTC1Hz 0x40000000 /* RTC 1 Hz clock */
  1143. #define IC_RTCAlrm 0x80000000 /* RTC Alarm */
  1144. #define ICLR_IRQ 0 /* Interrupt ReQuest */
  1145. #define ICLR_FIQ 1 /* Fast Interrupt reQuest */
  1146. #define ICCR_DIM 0x00000001 /* Disable Idle-mode interrupt */
  1147. /* Mask */
  1148. #define ICCR_IdleAllInt (ICCR_DIM*0) /* Idle-mode All Interrupt enable */
  1149. /* (ICMR ignored) */
  1150. #define ICCR_IdleMskInt (ICCR_DIM*1) /* Idle-mode non-Masked Interrupt */
  1151. /* enable (ICMR used) */
  1152. /*
  1153. * Peripheral Pin Controller (PPC) control registers
  1154. *
  1155. * Registers
  1156. * PPDR Peripheral Pin Controller (PPC) Pin Direction
  1157. * Register (read/write).
  1158. * PPSR Peripheral Pin Controller (PPC) Pin State Register
  1159. * (read/write).
  1160. * PPAR Peripheral Pin Controller (PPC) Pin Assignment
  1161. * Register (read/write).
  1162. * PSDR Peripheral Pin Controller (PPC) Sleep-mode pin
  1163. * Direction Register (read/write).
  1164. * PPFR Peripheral Pin Controller (PPC) Pin Flag Register
  1165. * (read).
  1166. */
  1167. #define PPDR __REG(0x90060000) /* PPC Pin Direction Reg. */
  1168. #define PPSR __REG(0x90060004) /* PPC Pin State Reg. */
  1169. #define PPAR __REG(0x90060008) /* PPC Pin Assignment Reg. */
  1170. #define PSDR __REG(0x9006000C) /* PPC Sleep-mode pin Direction Reg. */
  1171. #define PPFR __REG(0x90060010) /* PPC Pin Flag Reg. */
  1172. #define PPC_LDD(Nb) /* LCD Data [0..7] */ \
  1173. (0x00000001 << (Nb))
  1174. #define PPC_LDD0 PPC_LDD (0) /* LCD Data [0] */
  1175. #define PPC_LDD1 PPC_LDD (1) /* LCD Data [1] */
  1176. #define PPC_LDD2 PPC_LDD (2) /* LCD Data [2] */
  1177. #define PPC_LDD3 PPC_LDD (3) /* LCD Data [3] */
  1178. #define PPC_LDD4 PPC_LDD (4) /* LCD Data [4] */
  1179. #define PPC_LDD5 PPC_LDD (5) /* LCD Data [5] */
  1180. #define PPC_LDD6 PPC_LDD (6) /* LCD Data [6] */
  1181. #define PPC_LDD7 PPC_LDD (7) /* LCD Data [7] */
  1182. #define PPC_L_PCLK 0x00000100 /* LCD Pixel CLocK */
  1183. #define PPC_L_LCLK 0x00000200 /* LCD Line CLocK */
  1184. #define PPC_L_FCLK 0x00000400 /* LCD Frame CLocK */
  1185. #define PPC_L_BIAS 0x00000800 /* LCD AC BIAS */
  1186. /* ser. port 1: */
  1187. #define PPC_TXD1 0x00001000 /* SDLC/UART Transmit Data 1 */
  1188. #define PPC_RXD1 0x00002000 /* SDLC/UART Receive Data 1 */
  1189. /* ser. port 2: */
  1190. #define PPC_TXD2 0x00004000 /* IPC Transmit Data 2 */
  1191. #define PPC_RXD2 0x00008000 /* IPC Receive Data 2 */
  1192. /* ser. port 3: */
  1193. #define PPC_TXD3 0x00010000 /* UART Transmit Data 3 */
  1194. #define PPC_RXD3 0x00020000 /* UART Receive Data 3 */
  1195. /* ser. port 4: */
  1196. #define PPC_TXD4 0x00040000 /* MCP/SSP Transmit Data 4 */
  1197. #define PPC_RXD4 0x00080000 /* MCP/SSP Receive Data 4 */
  1198. #define PPC_SCLK 0x00100000 /* MCP/SSP Sample CLocK */
  1199. #define PPC_SFRM 0x00200000 /* MCP/SSP Sample FRaMe */
  1200. #define PPDR_In 0 /* Input */
  1201. #define PPDR_Out 1 /* Output */
  1202. /* ser. port 1: */
  1203. #define PPAR_UPR 0x00001000 /* UART Pin Reassignment */
  1204. #define PPAR_UARTTR (PPAR_UPR*0) /* UART on TXD_1 & RXD_1 */
  1205. #define PPAR_UARTGPIO (PPAR_UPR*1) /* UART on GPIO [14:15] */
  1206. /* ser. port 4: */
  1207. #define PPAR_SPR 0x00040000 /* SSP Pin Reassignment */
  1208. #define PPAR_SSPTRSS (PPAR_SPR*0) /* SSP on TXD_C, RXD_C, SCLK_C, */
  1209. /* & SFRM_C */
  1210. #define PPAR_SSPGPIO (PPAR_SPR*1) /* SSP on GPIO [10:13] */
  1211. #define PSDR_OutL 0 /* Output Low in sleep mode */
  1212. #define PSDR_Flt 1 /* Floating (input) in sleep mode */
  1213. #define PPFR_LCD 0x00000001 /* LCD controller */
  1214. #define PPFR_SP1TX 0x00001000 /* Ser. Port 1 SDLC/UART Transmit */
  1215. #define PPFR_SP1RX 0x00002000 /* Ser. Port 1 SDLC/UART Receive */
  1216. #define PPFR_SP2TX 0x00004000 /* Ser. Port 2 ICP Transmit */
  1217. #define PPFR_SP2RX 0x00008000 /* Ser. Port 2 ICP Receive */
  1218. #define PPFR_SP3TX 0x00010000 /* Ser. Port 3 UART Transmit */
  1219. #define PPFR_SP3RX 0x00020000 /* Ser. Port 3 UART Receive */
  1220. #define PPFR_SP4 0x00040000 /* Ser. Port 4 MCP/SSP */
  1221. #define PPFR_PerEn 0 /* Peripheral Enabled */
  1222. #define PPFR_PPCEn 1 /* PPC Enabled */
  1223. /*
  1224. * Dynamic Random-Access Memory (DRAM) control registers
  1225. *
  1226. * Registers
  1227. * MDCNFG Memory system: Dynamic Random-Access Memory (DRAM)
  1228. * CoNFiGuration register (read/write).
  1229. * MDCAS0 Memory system: Dynamic Random-Access Memory (DRAM)
  1230. * Column Address Strobe (CAS) shift register 0
  1231. * (read/write).
  1232. * MDCAS1 Memory system: Dynamic Random-Access Memory (DRAM)
  1233. * Column Address Strobe (CAS) shift register 1
  1234. * (read/write).
  1235. * MDCAS2 Memory system: Dynamic Random-Access Memory (DRAM)
  1236. * Column Address Strobe (CAS) shift register 2
  1237. * (read/write).
  1238. *
  1239. * Clocks
  1240. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  1241. * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
  1242. * fcas, Tcas Frequency, period of the DRAM CAS shift registers.
  1243. */
  1244. #define MDCNFG __REG(0xA0000000) /* DRAM CoNFiGuration reg. */
  1245. #define MDCAS0 __REG(0xA0000004) /* DRAM CAS shift reg. 0 */
  1246. #define MDCAS1 __REG(0xA0000008) /* DRAM CAS shift reg. 1 */
  1247. #define MDCAS2 __REG(0xA000000c) /* DRAM CAS shift reg. 2 */
  1248. /* SA1100 MDCNFG values */
  1249. #define MDCNFG_DE(Nb) /* DRAM Enable bank [0..3] */ \
  1250. (0x00000001 << (Nb))
  1251. #define MDCNFG_DE0 MDCNFG_DE (0) /* DRAM Enable bank 0 */
  1252. #define MDCNFG_DE1 MDCNFG_DE (1) /* DRAM Enable bank 1 */
  1253. #define MDCNFG_DE2 MDCNFG_DE (2) /* DRAM Enable bank 2 */
  1254. #define MDCNFG_DE3 MDCNFG_DE (3) /* DRAM Enable bank 3 */
  1255. #define MDCNFG_DRAC Fld (2, 4) /* DRAM Row Address Count - 9 */
  1256. #define MDCNFG_RowAdd(Add) /* Row Address count [9..12] */ \
  1257. (((Add) - 9) << FShft (MDCNFG_DRAC))
  1258. #define MDCNFG_CDB2 0x00000040 /* shift reg. Clock Divide By 2 */
  1259. /* (fcas = fcpu/2) */
  1260. #define MDCNFG_TRP Fld (4, 7) /* Time RAS Pre-charge - 1 [Tmem] */
  1261. #define MDCNFG_PrChrg(Tcpu) /* Pre-Charge time [2..32 Tcpu] */ \
  1262. (((Tcpu) - 2)/2 << FShft (MDCNFG_TRP))
  1263. #define MDCNFG_CeilPrChrg(Tcpu) /* Ceil. of PrChrg [2..32 Tcpu] */ \
  1264. (((Tcpu) - 1)/2 << FShft (MDCNFG_TRP))
  1265. #define MDCNFG_TRASR Fld (4, 11) /* Time RAS Refresh - 1 [Tmem] */
  1266. #define MDCNFG_Ref(Tcpu) /* Refresh time [2..32 Tcpu] */ \
  1267. (((Tcpu) - 2)/2 << FShft (MDCNFG_TRASR))
  1268. #define MDCNFG_CeilRef(Tcpu) /* Ceil. of Ref [2..32 Tcpu] */ \
  1269. (((Tcpu) - 1)/2 << FShft (MDCNFG_TRASR))
  1270. #define MDCNFG_TDL Fld (2, 15) /* Time Data Latch [Tcpu] */
  1271. #define MDCNFG_DataLtch(Tcpu) /* Data Latch delay [0..3 Tcpu] */ \
  1272. ((Tcpu) << FShft (MDCNFG_TDL))
  1273. #define MDCNFG_DRI Fld (15, 17) /* min. DRAM Refresh Interval/4 */
  1274. /* [Tmem] */
  1275. #define MDCNFG_RefInt(Tcpu) /* min. Refresh Interval */ \
  1276. /* [0..262136 Tcpu] */ \
  1277. ((Tcpu)/8 << FShft (MDCNFG_DRI))
  1278. /* SA1110 MDCNFG values */
  1279. #define MDCNFG_SA1110_DE0 0x00000001 /* DRAM Enable bank 0 */
  1280. #define MDCNFG_SA1110_DE1 0x00000002 /* DRAM Enable bank 1 */
  1281. #define MDCNFG_SA1110_DTIM0 0x00000004 /* DRAM timing type 0/1 */
  1282. #define MDCNFG_SA1110_DWID0 0x00000008 /* DRAM bus width 0/1 */
  1283. #define MDCNFG_SA1110_DRAC0 Fld(3, 4) /* DRAM row addr bit count */
  1284. /* bank 0/1 */
  1285. #define MDCNFG_SA1110_CDB20 0x00000080 /* Mem Clock divide by 2 0/1 */
  1286. #define MDCNFG_SA1110_TRP0 Fld(3, 8) /* RAS precharge 0/1 */
  1287. #define MDCNFG_SA1110_TDL0 Fld(2, 12) /* Data input latch after CAS*/
  1288. /* deassertion 0/1 */
  1289. #define MDCNFG_SA1110_TWR0 Fld(2, 14) /* SDRAM write recovery 0/1 */
  1290. #define MDCNFG_SA1110_DE2 0x00010000 /* DRAM Enable bank 0 */
  1291. #define MDCNFG_SA1110_DE3 0x00020000 /* DRAM Enable bank 1 */
  1292. #define MDCNFG_SA1110_DTIM2 0x00040000 /* DRAM timing type 0/1 */
  1293. #define MDCNFG_SA1110_DWID2 0x00080000 /* DRAM bus width 0/1 */
  1294. #define MDCNFG_SA1110_DRAC2 Fld(3, 20) /* DRAM row addr bit count */
  1295. /* bank 0/1 */
  1296. #define MDCNFG_SA1110_CDB22 0x00800000 /* Mem Clock divide by 2 0/1 */
  1297. #define MDCNFG_SA1110_TRP2 Fld(3, 24) /* RAS precharge 0/1 */
  1298. #define MDCNFG_SA1110_TDL2 Fld(2, 28) /* Data input latch after CAS*/
  1299. /* deassertion 0/1 */
  1300. #define MDCNFG_SA1110_TWR2 Fld(2, 30) /* SDRAM write recovery 0/1 */
  1301. /*
  1302. * Static memory control registers
  1303. *
  1304. * Registers
  1305. * MSC0 Memory system: Static memory Control register 0
  1306. * (read/write).
  1307. * MSC1 Memory system: Static memory Control register 1
  1308. * (read/write).
  1309. *
  1310. * Clocks
  1311. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  1312. * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
  1313. */
  1314. #define MSC0 __REG(0xa0000010) /* Static memory Control reg. 0 */
  1315. #define MSC1 __REG(0xa0000014) /* Static memory Control reg. 1 */
  1316. #define MSC2 __REG(0xa000002c) /* Static memory Control reg. 2, not contiguous */
  1317. #define MSC_Bnk(Nb) /* static memory Bank [0..3] */ \
  1318. Fld (16, ((Nb) Modulo 2)*16)
  1319. #define MSC0_Bnk0 MSC_Bnk (0) /* static memory Bank 0 */
  1320. #define MSC0_Bnk1 MSC_Bnk (1) /* static memory Bank 1 */
  1321. #define MSC1_Bnk2 MSC_Bnk (2) /* static memory Bank 2 */
  1322. #define MSC1_Bnk3 MSC_Bnk (3) /* static memory Bank 3 */
  1323. #define MSC_RT Fld (2, 0) /* ROM/static memory Type */
  1324. #define MSC_NonBrst /* Non-Burst static memory */ \
  1325. (0 << FShft (MSC_RT))
  1326. #define MSC_SRAM /* 32-bit byte-writable SRAM */ \
  1327. (1 << FShft (MSC_RT))
  1328. #define MSC_Brst4 /* Burst-of-4 static memory */ \
  1329. (2 << FShft (MSC_RT))
  1330. #define MSC_Brst8 /* Burst-of-8 static memory */ \
  1331. (3 << FShft (MSC_RT))
  1332. #define MSC_RBW 0x0004 /* ROM/static memory Bus Width */
  1333. #define MSC_32BitStMem (MSC_RBW*0) /* 32-Bit Static Memory */
  1334. #define MSC_16BitStMem (MSC_RBW*1) /* 16-Bit Static Memory */
  1335. #define MSC_RDF Fld (5, 3) /* ROM/static memory read Delay */
  1336. /* First access - 1(.5) [Tmem] */
  1337. #define MSC_1stRdAcc(Tcpu) /* 1st Read Access time (burst */ \
  1338. /* static memory) [3..65 Tcpu] */ \
  1339. ((((Tcpu) - 3)/2) << FShft (MSC_RDF))
  1340. #define MSC_Ceil1stRdAcc(Tcpu) /* Ceil. of 1stRdAcc [3..65 Tcpu] */ \
  1341. ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
  1342. #define MSC_RdAcc(Tcpu) /* Read Access time (non-burst */ \
  1343. /* static memory) [2..64 Tcpu] */ \
  1344. ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
  1345. #define MSC_CeilRdAcc(Tcpu) /* Ceil. of RdAcc [2..64 Tcpu] */ \
  1346. ((((Tcpu) - 1)/2) << FShft (MSC_RDF))
  1347. #define MSC_RDN Fld (5, 8) /* ROM/static memory read Delay */
  1348. /* Next access - 1 [Tmem] */
  1349. #define MSC_NxtRdAcc(Tcpu) /* Next Read Access time (burst */ \
  1350. /* static memory) [2..64 Tcpu] */ \
  1351. ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
  1352. #define MSC_CeilNxtRdAcc(Tcpu) /* Ceil. of NxtRdAcc [2..64 Tcpu] */ \
  1353. ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
  1354. #define MSC_WrAcc(Tcpu) /* Write Access time (non-burst */ \
  1355. /* static memory) [2..64 Tcpu] */ \
  1356. ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
  1357. #define MSC_CeilWrAcc(Tcpu) /* Ceil. of WrAcc [2..64 Tcpu] */ \
  1358. ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
  1359. #define MSC_RRR Fld (3, 13) /* ROM/static memory RecoveRy */
  1360. /* time/2 [Tmem] */
  1361. #define MSC_Rec(Tcpu) /* Recovery time [0..28 Tcpu] */ \
  1362. (((Tcpu)/4) << FShft (MSC_RRR))
  1363. #define MSC_CeilRec(Tcpu) /* Ceil. of Rec [0..28 Tcpu] */ \
  1364. ((((Tcpu) + 3)/4) << FShft (MSC_RRR))
  1365. /*
  1366. * Personal Computer Memory Card International Association (PCMCIA) control
  1367. * register
  1368. *
  1369. * Register
  1370. * MECR Memory system: Expansion memory bus (PCMCIA)
  1371. * Configuration Register (read/write).
  1372. *
  1373. * Clocks
  1374. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  1375. * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
  1376. * fbclk, Tbclk Frequency, period of the PCMCIA clock (BCLK).
  1377. */
  1378. /* Memory system: */
  1379. #define MECR __REG(0xA0000018) /* Expansion memory bus (PCMCIA) Configuration Reg. */
  1380. #define MECR_PCMCIA(Nb) /* PCMCIA [0..1] */ \
  1381. Fld (15, (Nb)*16)
  1382. #define MECR_PCMCIA0 MECR_PCMCIA (0) /* PCMCIA 0 */
  1383. #define MECR_PCMCIA1 MECR_PCMCIA (1) /* PCMCIA 1 */
  1384. #define MECR_BSIO Fld (5, 0) /* BCLK Select I/O - 1 [Tmem] */
  1385. #define MECR_IOClk(Tcpu) /* I/O Clock [2..64 Tcpu] */ \
  1386. ((((Tcpu) - 2)/2) << FShft (MECR_BSIO))
  1387. #define MECR_CeilIOClk(Tcpu) /* Ceil. of IOClk [2..64 Tcpu] */ \
  1388. ((((Tcpu) - 1)/2) << FShft (MECR_BSIO))
  1389. #define MECR_BSA Fld (5, 5) /* BCLK Select Attribute - 1 */
  1390. /* [Tmem] */
  1391. #define MECR_AttrClk(Tcpu) /* Attribute Clock [2..64 Tcpu] */ \
  1392. ((((Tcpu) - 2)/2) << FShft (MECR_BSA))
  1393. #define MECR_CeilAttrClk(Tcpu) /* Ceil. of AttrClk [2..64 Tcpu] */ \
  1394. ((((Tcpu) - 1)/2) << FShft (MECR_BSA))
  1395. #define MECR_BSM Fld (5, 10) /* BCLK Select Memory - 1 [Tmem] */
  1396. #define MECR_MemClk(Tcpu) /* Memory Clock [2..64 Tcpu] */ \
  1397. ((((Tcpu) - 2)/2) << FShft (MECR_BSM))
  1398. #define MECR_CeilMemClk(Tcpu) /* Ceil. of MemClk [2..64 Tcpu] */ \
  1399. ((((Tcpu) - 1)/2) << FShft (MECR_BSM))
  1400. /*
  1401. * On SA1110 only
  1402. */
  1403. #define MDREFR __REG(0xA000001C)
  1404. #define MDREFR_TRASR Fld (4, 0)
  1405. #define MDREFR_DRI Fld (12, 4)
  1406. #define MDREFR_E0PIN (1 << 16)
  1407. #define MDREFR_K0RUN (1 << 17)
  1408. #define MDREFR_K0DB2 (1 << 18)
  1409. #define MDREFR_E1PIN (1 << 20)
  1410. #define MDREFR_K1RUN (1 << 21)
  1411. #define MDREFR_K1DB2 (1 << 22)
  1412. #define MDREFR_K2RUN (1 << 25)
  1413. #define MDREFR_K2DB2 (1 << 26)
  1414. #define MDREFR_EAPD (1 << 28)
  1415. #define MDREFR_KAPD (1 << 29)
  1416. #define MDREFR_SLFRSH (1 << 31)
  1417. /*
  1418. * Direct Memory Access (DMA) control registers
  1419. */
  1420. #define DMA_SIZE (6 * 0x20)
  1421. #define DMA_PHYS 0xb0000000
  1422. /*
  1423. * Liquid Crystal Display (LCD) control registers
  1424. *
  1425. * Registers
  1426. * LCCR0 Liquid Crystal Display (LCD) Control Register 0
  1427. * (read/write).
  1428. * [Bits LDM, BAM, and ERM are only implemented in
  1429. * versions 2.0 (rev. = 8) and higher of the StrongARM
  1430. * SA-1100.]
  1431. * LCSR Liquid Crystal Display (LCD) Status Register
  1432. * (read/write).
  1433. * [Bit LDD can be only read in versions 1.0 (rev. = 1)
  1434. * and 1.1 (rev. = 2) of the StrongARM SA-1100, it can be
  1435. * read and written (cleared) in versions 2.0 (rev. = 8)
  1436. * and higher.]
  1437. * DBAR1 Liquid Crystal Display (LCD) Direct Memory Access
  1438. * (DMA) Base Address Register channel 1 (read/write).
  1439. * DCAR1 Liquid Crystal Display (LCD) Direct Memory Access
  1440. * (DMA) Current Address Register channel 1 (read).
  1441. * DBAR2 Liquid Crystal Display (LCD) Direct Memory Access
  1442. * (DMA) Base Address Register channel 2 (read/write).
  1443. * DCAR2 Liquid Crystal Display (LCD) Direct Memory Access
  1444. * (DMA) Current Address Register channel 2 (read).
  1445. * LCCR1 Liquid Crystal Display (LCD) Control Register 1
  1446. * (read/write).
  1447. * [The LCCR1 register can be only written in
  1448. * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
  1449. * StrongARM SA-1100, it can be written and read in
  1450. * versions 2.0 (rev. = 8) and higher.]
  1451. * LCCR2 Liquid Crystal Display (LCD) Control Register 2
  1452. * (read/write).
  1453. * [The LCCR1 register can be only written in
  1454. * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
  1455. * StrongARM SA-1100, it can be written and read in
  1456. * versions 2.0 (rev. = 8) and higher.]
  1457. * LCCR3 Liquid Crystal Display (LCD) Control Register 3
  1458. * (read/write).
  1459. * [The LCCR1 register can be only written in
  1460. * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
  1461. * StrongARM SA-1100, it can be written and read in
  1462. * versions 2.0 (rev. = 8) and higher. Bit PCP is only
  1463. * implemented in versions 2.0 (rev. = 8) and higher of
  1464. * the StrongARM SA-1100.]
  1465. *
  1466. * Clocks
  1467. * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
  1468. * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
  1469. * fpix, Tpix Frequency, period of the pixel clock.
  1470. * fln, Tln Frequency, period of the line clock.
  1471. * fac, Tac Frequency, period of the AC bias clock.
  1472. */
  1473. #define LCD_PEntrySp 2 /* LCD Palette Entry Space [byte] */
  1474. #define LCD_4BitPSp /* LCD 4-Bit pixel Palette Space */ \
  1475. /* [byte] */ \
  1476. (16*LCD_PEntrySp)
  1477. #define LCD_8BitPSp /* LCD 8-Bit pixel Palette Space */ \
  1478. /* [byte] */ \
  1479. (256*LCD_PEntrySp)
  1480. #define LCD_12_16BitPSp /* LCD 12/16-Bit pixel */ \
  1481. /* dummy-Palette Space [byte] */ \
  1482. (16*LCD_PEntrySp)
  1483. #define LCD_PGrey Fld (4, 0) /* LCD Palette entry Grey value */
  1484. #define LCD_PBlue Fld (4, 0) /* LCD Palette entry Blue value */
  1485. #define LCD_PGreen Fld (4, 4) /* LCD Palette entry Green value */
  1486. #define LCD_PRed Fld (4, 8) /* LCD Palette entry Red value */
  1487. #define LCD_PBS Fld (2, 12) /* LCD Pixel Bit Size */
  1488. #define LCD_4Bit /* LCD 4-Bit pixel mode */ \
  1489. (0 << FShft (LCD_PBS))
  1490. #define LCD_8Bit /* LCD 8-Bit pixel mode */ \
  1491. (1 << FShft (LCD_PBS))
  1492. #define LCD_12_16Bit /* LCD 12/16-Bit pixel mode */ \
  1493. (2 << FShft (LCD_PBS))
  1494. #define LCD_Int0_0 0x0 /* LCD Intensity = 0.0% = 0 */
  1495. #define LCD_Int11_1 0x1 /* LCD Intensity = 11.1% = 1/9 */
  1496. #define LCD_Int20_0 0x2 /* LCD Intensity = 20.0% = 1/5 */
  1497. #define LCD_Int26_7 0x3 /* LCD Intensity = 26.7% = 4/15 */
  1498. #define LCD_Int33_3 0x4 /* LCD Intensity = 33.3% = 3/9 */
  1499. #define LCD_Int40_0 0x5 /* LCD Intensity = 40.0% = 2/5 */
  1500. #define LCD_Int44_4 0x6 /* LCD Intensity = 44.4% = 4/9 */
  1501. #define LCD_Int50_0 0x7 /* LCD Intensity = 50.0% = 1/2 */
  1502. #define LCD_Int55_6 0x8 /* LCD Intensity = 55.6% = 5/9 */
  1503. #define LCD_Int60_0 0x9 /* LCD Intensity = 60.0% = 3/5 */
  1504. #define LCD_Int66_7 0xA /* LCD Intensity = 66.7% = 6/9 */
  1505. #define LCD_Int73_3 0xB /* LCD Intensity = 73.3% = 11/15 */
  1506. #define LCD_Int80_0 0xC /* LCD Intensity = 80.0% = 4/5 */
  1507. #define LCD_Int88_9 0xD /* LCD Intensity = 88.9% = 8/9 */
  1508. #define LCD_Int100_0 0xE /* LCD Intensity = 100.0% = 1 */
  1509. #define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */
  1510. /* (Alternative) */
  1511. #define LCCR0_LEN 0x00000001 /* LCD ENable */
  1512. #define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */
  1513. #define LCCR0_Color (LCCR0_CMS*0) /* Color display */
  1514. #define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */
  1515. #define LCCR0_SDS 0x00000004 /* Single/Dual panel display */
  1516. /* Select */
  1517. #define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */
  1518. #define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */
  1519. #define LCCR0_LDM 0x00000008 /* LCD Disable done (LDD) */
  1520. /* interrupt Mask (disable) */
  1521. #define LCCR0_BAM 0x00000010 /* Base Address update (BAU) */
  1522. /* interrupt Mask (disable) */
  1523. #define LCCR0_ERM 0x00000020 /* LCD ERror (BER, IOL, IUL, IOU, */
  1524. /* IUU, OOL, OUL, OOU, and OUU) */
  1525. /* interrupt Mask (disable) */
  1526. #define LCCR0_PAS 0x00000080 /* Passive/Active display Select */
  1527. #define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */
  1528. #define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */
  1529. #define LCCR0_BLE 0x00000100 /* Big/Little Endian select */
  1530. #define LCCR0_LtlEnd (LCCR0_BLE*0) /* Little Endian frame buffer */
  1531. #define LCCR0_BigEnd (LCCR0_BLE*1) /* Big Endian frame buffer */
  1532. #define LCCR0_DPD 0x00000200 /* Double Pixel Data (monochrome */
  1533. /* display mode) */
  1534. #define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome */
  1535. /* display */
  1536. #define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome */
  1537. /* display */
  1538. #define LCCR0_PDD Fld (8, 12) /* Palette DMA request Delay */
  1539. /* [Tmem] */
  1540. #define LCCR0_DMADel(Tcpu) /* palette DMA request Delay */ \
  1541. /* [0..510 Tcpu] */ \
  1542. ((Tcpu)/2 << FShft (LCCR0_PDD))
  1543. #define LCSR_LDD 0x00000001 /* LCD Disable Done */
  1544. #define LCSR_BAU 0x00000002 /* Base Address Update (read) */
  1545. #define LCSR_BER 0x00000004 /* Bus ERror */
  1546. #define LCSR_ABC 0x00000008 /* AC Bias clock Count */
  1547. #define LCSR_IOL 0x00000010 /* Input FIFO Over-run Lower */
  1548. /* panel */
  1549. #define LCSR_IUL 0x00000020 /* Input FIFO Under-run Lower */
  1550. /* panel */
  1551. #define LCSR_IOU 0x00000040 /* Input FIFO Over-run Upper */
  1552. /* panel */
  1553. #define LCSR_IUU 0x00000080 /* Input FIFO Under-run Upper */
  1554. /* panel */
  1555. #define LCSR_OOL 0x00000100 /* Output FIFO Over-run Lower */
  1556. /* panel */
  1557. #define LCSR_OUL 0x00000200 /* Output FIFO Under-run Lower */
  1558. /* panel */
  1559. #define LCSR_OOU 0x00000400 /* Output FIFO Over-run Upper */
  1560. /* panel */
  1561. #define LCSR_OUU 0x00000800 /* Output FIFO Under-run Upper */
  1562. /* panel */
  1563. #define LCCR1_PPL Fld (6, 4) /* Pixels Per Line/16 - 1 */
  1564. #define LCCR1_DisWdth(Pixel) /* Display Width [16..1024 pix.] */ \
  1565. (((Pixel) - 16)/16 << FShft (LCCR1_PPL))
  1566. #define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */
  1567. /* pulse Width - 1 [Tpix] (L_LCLK) */
  1568. #define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \
  1569. /* pulse Width [1..64 Tpix] */ \
  1570. (((Tpix) - 1) << FShft (LCCR1_HSW))
  1571. #define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */
  1572. /* count - 1 [Tpix] */
  1573. #define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \
  1574. /* [1..256 Tpix] */ \
  1575. (((Tpix) - 1) << FShft (LCCR1_ELW))
  1576. #define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */
  1577. /* Wait count - 1 [Tpix] */
  1578. #define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \
  1579. /* [1..256 Tpix] */ \
  1580. (((Tpix) - 1) << FShft (LCCR1_BLW))
  1581. #define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */
  1582. #define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \
  1583. (((Line) - 1) << FShft (LCCR2_LPP))
  1584. #define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */
  1585. /* Width - 1 [Tln] (L_FCLK) */
  1586. #define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \
  1587. /* Width [1..64 Tln] */ \
  1588. (((Tln) - 1) << FShft (LCCR2_VSW))
  1589. #define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */
  1590. /* count [Tln] */
  1591. #define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \
  1592. /* [0..255 Tln] */ \
  1593. ((Tln) << FShft (LCCR2_EFW))
  1594. #define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */
  1595. /* Wait count [Tln] */
  1596. #define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \
  1597. /* [0..255 Tln] */ \
  1598. ((Tln) << FShft (LCCR2_BFW))
  1599. #define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor/2 - 2 */
  1600. /* [1..255] (L_PCLK) */
  1601. /* fpix = fcpu/(2*(PCD + 2)) */
  1602. /* Tpix = 2*(PCD + 2)*Tcpu */
  1603. #define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor [6..514] */ \
  1604. (((Div) - 4)/2 << FShft (LCCR3_PCD))
  1605. /* fpix = fcpu/(2*Floor (Div/2)) */
  1606. /* Tpix = 2*Floor (Div/2)*Tcpu */
  1607. #define LCCR3_CeilPixClkDiv(Div) /* Ceil. of PixClkDiv [6..514] */ \
  1608. (((Div) - 3)/2 << FShft (LCCR3_PCD))
  1609. /* fpix = fcpu/(2*Ceil (Div/2)) */
  1610. /* Tpix = 2*Ceil (Div/2)*Tcpu */
  1611. #define LCCR3_ACB Fld (8, 8) /* AC Bias clock half period - 1 */
  1612. /* [Tln] (L_BIAS) */
  1613. #define LCCR3_ACBsDiv(Div) /* AC Bias clock Divisor [2..512] */ \
  1614. (((Div) - 2)/2 << FShft (LCCR3_ACB))
  1615. /* fac = fln/(2*Floor (Div/2)) */
  1616. /* Tac = 2*Floor (Div/2)*Tln */
  1617. #define LCCR3_CeilACBsDiv(Div) /* Ceil. of ACBsDiv [2..512] */ \
  1618. (((Div) - 1)/2 << FShft (LCCR3_ACB))
  1619. /* fac = fln/(2*Ceil (Div/2)) */
  1620. /* Tac = 2*Ceil (Div/2)*Tln */
  1621. #define LCCR3_API Fld (4, 16) /* AC bias Pin transitions per */
  1622. /* Interrupt */
  1623. #define LCCR3_ACBsCntOff /* AC Bias clock transition Count */ \
  1624. /* Off */ \
  1625. (0 << FShft (LCCR3_API))
  1626. #define LCCR3_ACBsCnt(Trans) /* AC Bias clock transition Count */ \
  1627. /* [1..15] */ \
  1628. ((Trans) << FShft (LCCR3_API))
  1629. #define LCCR3_VSP 0x00100000 /* Vertical Synchronization pulse */
  1630. /* Polarity (L_FCLK) */
  1631. #define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */
  1632. /* active High */
  1633. #define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */
  1634. /* active Low */
  1635. #define LCCR3_HSP 0x00200000 /* Horizontal Synchronization */
  1636. /* pulse Polarity (L_LCLK) */
  1637. #define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */
  1638. /* pulse active High */
  1639. #define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */
  1640. /* pulse active Low */
  1641. #define LCCR3_PCP 0x00400000 /* Pixel Clock Polarity (L_PCLK) */
  1642. #define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */
  1643. #define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */
  1644. #define LCCR3_OEP 0x00800000 /* Output Enable Polarity (L_BIAS, */
  1645. /* active display mode) */
  1646. #define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */
  1647. #define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */