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