SA-1100.h 96 KB

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