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 #if 0           	        	/* Hidden receive FIFO bits        */
379 #define UTDR_PRE	0x00000100	/*  receive PaRity Error (read)    */
380 #define UTDR_FRE	0x00000200	/*  receive FRaming Error (read)   */
381 #define UTDR_ROR	0x00000400	/*  Receive FIFO Over-Run (read)   */
382 #endif /* 0 */
383 
384 #define UTSR0_TFS	0x00000001	/* Transmit FIFO 1/2-full or less  */
385                 	        	/* Service request (read)          */
386 #define UTSR0_RFS	0x00000002	/* Receive FIFO 1/3-to-2/3-full or */
387                 	        	/* more Service request (read)     */
388 #define UTSR0_RID	0x00000004	/* Receiver IDle                   */
389 #define UTSR0_RBB	0x00000008	/* Receive Beginning of Break      */
390 #define UTSR0_REB	0x00000010	/* Receive End of Break            */
391 #define UTSR0_EIF	0x00000020	/* Error In FIFO (read)            */
392 
393 #define UTSR1_TBY	0x00000001	/* Transmitter BusY (read)         */
394 #define UTSR1_RNE	0x00000002	/* Receive FIFO Not Empty (read)   */
395 #define UTSR1_TNF	0x00000004	/* Transmit FIFO Not Full (read)   */
396 #define UTSR1_PRE	0x00000008	/* receive PaRity Error (read)     */
397 #define UTSR1_FRE	0x00000010	/* receive FRaming Error (read)    */
398 #define UTSR1_ROR	0x00000020	/* Receive FIFO Over-Run (read)    */
399 
400 
401 /*
402  * Synchronous Data Link Controller (SDLC) control registers
403  *
404  * Registers
405  *    Ser1SDCR0 	Serial port 1 Synchronous Data Link Controller (SDLC)
406  *              	Control Register 0 (read/write).
407  *    Ser1SDCR1 	Serial port 1 Synchronous Data Link Controller (SDLC)
408  *              	Control Register 1 (read/write).
409  *    Ser1SDCR2 	Serial port 1 Synchronous Data Link Controller (SDLC)
410  *              	Control Register 2 (read/write).
411  *    Ser1SDCR3 	Serial port 1 Synchronous Data Link Controller (SDLC)
412  *              	Control Register 3 (read/write).
413  *    Ser1SDCR4 	Serial port 1 Synchronous Data Link Controller (SDLC)
414  *              	Control Register 4 (read/write).
415  *    Ser1SDDR  	Serial port 1 Synchronous Data Link Controller (SDLC)
416  *              	Data Register (read/write).
417  *    Ser1SDSR0 	Serial port 1 Synchronous Data Link Controller (SDLC)
418  *              	Status Register 0 (read/write).
419  *    Ser1SDSR1 	Serial port 1 Synchronous Data Link Controller (SDLC)
420  *              	Status Register 1 (read/write).
421  *
422  * Clocks
423  *    fxtl, Txtl	Frequency, period of the system crystal (3.6864 MHz
424  *              	or 3.5795 MHz).
425  *    fsd, Tsd  	Frequency, period of the SDLC communication.
426  */
427 
428 #define Ser1SDCR0	__REG(0x80020060)  /* Ser. port 1 SDLC Control Reg. 0 */
429 #define Ser1SDCR1	__REG(0x80020064)  /* Ser. port 1 SDLC Control Reg. 1 */
430 #define Ser1SDCR2	__REG(0x80020068)  /* Ser. port 1 SDLC Control Reg. 2 */
431 #define Ser1SDCR3	__REG(0x8002006C)  /* Ser. port 1 SDLC Control Reg. 3 */
432 #define Ser1SDCR4	__REG(0x80020070)  /* Ser. port 1 SDLC Control Reg. 4 */
433 #define Ser1SDDR	__REG(0x80020078)  /* Ser. port 1 SDLC Data Reg.      */
434 #define Ser1SDSR0	__REG(0x80020080)  /* Ser. port 1 SDLC Status Reg. 0  */
435 #define Ser1SDSR1	__REG(0x80020084)  /* Ser. port 1 SDLC Status Reg. 1  */
436 
437 #define SDCR0_SUS	0x00000001	/* SDLC/UART Select                */
438 #define SDCR0_SDLC	(SDCR0_SUS*0)	/*  SDLC mode (TXD1 & RXD1)        */
439 #define SDCR0_UART	(SDCR0_SUS*1)	/*  UART mode (TXD1 & RXD1)        */
440 #define SDCR0_SDF	0x00000002	/* Single/Double start Flag select */
441 #define SDCR0_SglFlg	(SDCR0_SDF*0)	/*  Single start Flag              */
442 #define SDCR0_DblFlg	(SDCR0_SDF*1)	/*  Double start Flag              */
443 #define SDCR0_LBM	0x00000004	/* Look-Back Mode                  */
444 #define SDCR0_BMS	0x00000008	/* Bit Modulation Select           */
445 #define SDCR0_FM0	(SDCR0_BMS*0)	/*  Freq. Modulation zero (0)      */
446 #define SDCR0_NRZ	(SDCR0_BMS*1)	/*  Non-Return to Zero modulation  */
447 #define SDCR0_SCE	0x00000010	/* Sample Clock Enable (GPIO [16]) */
448 #define SDCR0_SCD	0x00000020	/* Sample Clock Direction select   */
449                 	        	/* (GPIO [16])                     */
450 #define SDCR0_SClkIn	(SDCR0_SCD*0)	/*  Sample Clock Input             */
451 #define SDCR0_SClkOut	(SDCR0_SCD*1)	/*  Sample Clock Output            */
452 #define SDCR0_RCE	0x00000040	/* Receive Clock Edge select       */
453 #define SDCR0_RcRsEdg	(SDCR0_RCE*0)	/*  Receive clock Rising-Edge      */
454 #define SDCR0_RcFlEdg	(SDCR0_RCE*1)	/*  Receive clock Falling-Edge     */
455 #define SDCR0_TCE	0x00000080	/* Transmit Clock Edge select      */
456 #define SDCR0_TrRsEdg	(SDCR0_TCE*0)	/*  Transmit clock Rising-Edge     */
457 #define SDCR0_TrFlEdg	(SDCR0_TCE*1)	/*  Transmit clock Falling-Edge    */
458 
459 #define SDCR1_AAF	0x00000001	/* Abort After Frame enable        */
460                 	        	/* (GPIO [17])                     */
461 #define SDCR1_TXE	0x00000002	/* Transmit Enable                 */
462 #define SDCR1_RXE	0x00000004	/* Receive Enable                  */
463 #define SDCR1_RIE	0x00000008	/* Receive FIFO 1/3-to-2/3-full or */
464                 	        	/* more Interrupt Enable           */
465 #define SDCR1_TIE	0x00000010	/* Transmit FIFO 1/2-full or less  */
466                 	        	/* Interrupt Enable                */
467 #define SDCR1_AME	0x00000020	/* Address Match Enable            */
468 #define SDCR1_TUS	0x00000040	/* Transmit FIFO Under-run Select  */
469 #define SDCR1_EFrmURn	(SDCR1_TUS*0)	/*  End Frame on Under-Run         */
470 #define SDCR1_AbortURn	(SDCR1_TUS*1)	/*  Abort on Under-Run             */
471 #define SDCR1_RAE	0x00000080	/* Receive Abort interrupt Enable  */
472 
473 #define SDCR2_AMV	Fld (8, 0)	/* Address Match Value             */
474 
475 #define SDCR3_BRD	Fld (4, 0)	/* Baud Rate Divisor/16 - 1 [11:8] */
476 #define SDCR4_BRD	Fld (8, 0)	/* Baud Rate Divisor/16 - 1  [7:0] */
477                 	        	/* fsd = fxtl/(16*(BRD[11:0] + 1)) */
478                 	        	/* Tsd = 16*(BRD[11:0] + 1)*Txtl   */
479 #define SDCR3_BdRtDiv(Div)      	/*  Baud Rate Divisor [16..65536]  */ \
480                 	(((Div) - 16)/16 >> FSize (SDCR4_BRD) << \
481                 	 FShft (SDCR3_BRD))
482 #define SDCR4_BdRtDiv(Div)      	/*  Baud Rate Divisor [16..65536]  */ \
483                 	(((Div) - 16)/16 & FAlnMsk (SDCR4_BRD) << \
484                 	 FShft (SDCR4_BRD))
485                 	        	/*  fsd = fxtl/(16*Floor (Div/16)) */
486                 	        	/*  Tsd = 16*Floor (Div/16)*Txtl   */
487 #define SDCR3_CeilBdRtDiv(Div)  	/*  Ceil. of BdRtDiv [16..65536]   */ \
488                 	(((Div) - 1)/16 >> FSize (SDCR4_BRD) << \
489                 	 FShft (SDCR3_BRD))
490 #define SDCR4_CeilBdRtDiv(Div)  	/*  Ceil. of BdRtDiv [16..65536]   */ \
491                 	(((Div) - 1)/16 & FAlnMsk (SDCR4_BRD) << \
492                 	 FShft (SDCR4_BRD))
493                 	        	/*  fsd = fxtl/(16*Ceil (Div/16))  */
494                 	        	/*  Tsd = 16*Ceil (Div/16)*Txtl    */
495 
496 #define SDDR_DATA	Fld (8, 0)	/* receive/transmit DATA FIFOs     */
497 #if 0           	        	/* Hidden receive FIFO bits        */
498 #define SDDR_EOF	0x00000100	/*  receive End-Of-Frame (read)    */
499 #define SDDR_CRE	0x00000200	/*  receive CRC Error (read)       */
500 #define SDDR_ROR	0x00000400	/*  Receive FIFO Over-Run (read)   */
501 #endif /* 0 */
502 
503 #define SDSR0_EIF	0x00000001	/* Error In FIFO (read)            */
504 #define SDSR0_TUR	0x00000002	/* Transmit FIFO Under-Run         */
505 #define SDSR0_RAB	0x00000004	/* Receive ABort                   */
506 #define SDSR0_TFS	0x00000008	/* Transmit FIFO 1/2-full or less  */
507                 	        	/* Service request (read)          */
508 #define SDSR0_RFS	0x00000010	/* Receive FIFO 1/3-to-2/3-full or */
509                 	        	/* more Service request (read)     */
510 
511 #define SDSR1_RSY	0x00000001	/* Receiver SYnchronized (read)    */
512 #define SDSR1_TBY	0x00000002	/* Transmitter BusY (read)         */
513 #define SDSR1_RNE	0x00000004	/* Receive FIFO Not Empty (read)   */
514 #define SDSR1_TNF	0x00000008	/* Transmit FIFO Not Full (read)   */
515 #define SDSR1_RTD	0x00000010	/* Receive Transition Detected     */
516 #define SDSR1_EOF	0x00000020	/* receive End-Of-Frame (read)     */
517 #define SDSR1_CRE	0x00000040	/* receive CRC Error (read)        */
518 #define SDSR1_ROR	0x00000080	/* Receive FIFO Over-Run (read)    */
519 
520 
521 /*
522  * High-Speed Serial to Parallel controller (HSSP) control registers
523  *
524  * Registers
525  *    Ser2HSCR0 	Serial port 2 High-Speed Serial to Parallel
526  *              	controller (HSSP) Control Register 0 (read/write).
527  *    Ser2HSCR1 	Serial port 2 High-Speed Serial to Parallel
528  *              	controller (HSSP) Control Register 1 (read/write).
529  *    Ser2HSDR  	Serial port 2 High-Speed Serial to Parallel
530  *              	controller (HSSP) Data Register (read/write).
531  *    Ser2HSSR0 	Serial port 2 High-Speed Serial to Parallel
532  *              	controller (HSSP) Status Register 0 (read/write).
533  *    Ser2HSSR1 	Serial port 2 High-Speed Serial to Parallel
534  *              	controller (HSSP) Status Register 1 (read).
535  *    Ser2HSCR2 	Serial port 2 High-Speed Serial to Parallel
536  *              	controller (HSSP) Control Register 2 (read/write).
537  *              	[The HSCR2 register is only implemented in
538  *              	versions 2.0 (rev. = 8) and higher of the StrongARM
539  *              	SA-1100.]
540  */
541 
542 #define Ser2HSCR0	__REG(0x80040060)  /* Ser. port 2 HSSP Control Reg. 0 */
543 #define Ser2HSCR1	__REG(0x80040064)  /* Ser. port 2 HSSP Control Reg. 1 */
544 #define Ser2HSDR	__REG(0x8004006C)  /* Ser. port 2 HSSP Data Reg.      */
545 #define Ser2HSSR0	__REG(0x80040074)  /* Ser. port 2 HSSP Status Reg. 0  */
546 #define Ser2HSSR1	__REG(0x80040078)  /* Ser. port 2 HSSP Status Reg. 1  */
547 #define Ser2HSCR2	__REG(0x90060028)  /* Ser. port 2 HSSP Control Reg. 2 */
548 
549 #define HSCR0_ITR	0x00000001	/* IrDA Transmission Rate          */
550 #define HSCR0_UART	(HSCR0_ITR*0)	/*  UART mode (115.2 kb/s if IrDA) */
551 #define HSCR0_HSSP	(HSCR0_ITR*1)	/*  HSSP mode (4 Mb/s)             */
552 #define HSCR0_LBM	0x00000002	/* Look-Back Mode                  */
553 #define HSCR0_TUS	0x00000004	/* Transmit FIFO Under-run Select  */
554 #define HSCR0_EFrmURn	(HSCR0_TUS*0)	/*  End Frame on Under-Run         */
555 #define HSCR0_AbortURn	(HSCR0_TUS*1)	/*  Abort on Under-Run             */
556 #define HSCR0_TXE	0x00000008	/* Transmit Enable                 */
557 #define HSCR0_RXE	0x00000010	/* Receive Enable                  */
558 #define HSCR0_RIE	0x00000020	/* Receive FIFO 2/5-to-3/5-full or */
559                 	        	/* more Interrupt Enable           */
560 #define HSCR0_TIE	0x00000040	/* Transmit FIFO 1/2-full or less  */
561                 	        	/* Interrupt Enable                */
562 #define HSCR0_AME	0x00000080	/* Address Match Enable            */
563 
564 #define HSCR1_AMV	Fld (8, 0)	/* Address Match Value             */
565 
566 #define HSDR_DATA	Fld (8, 0)	/* receive/transmit DATA FIFOs     */
567 #if 0           	        	/* Hidden receive FIFO bits        */
568 #define HSDR_EOF	0x00000100	/*  receive End-Of-Frame (read)    */
569 #define HSDR_CRE	0x00000200	/*  receive CRC Error (read)       */
570 #define HSDR_ROR	0x00000400	/*  Receive FIFO Over-Run (read)   */
571 #endif /* 0 */
572 
573 #define HSSR0_EIF	0x00000001	/* Error In FIFO (read)            */
574 #define HSSR0_TUR	0x00000002	/* Transmit FIFO Under-Run         */
575 #define HSSR0_RAB	0x00000004	/* Receive ABort                   */
576 #define HSSR0_TFS	0x00000008	/* Transmit FIFO 1/2-full or less  */
577                 	        	/* Service request (read)          */
578 #define HSSR0_RFS	0x00000010	/* Receive FIFO 2/5-to-3/5-full or */
579                 	        	/* more Service request (read)     */
580 #define HSSR0_FRE	0x00000020	/* receive FRaming Error           */
581 
582 #define HSSR1_RSY	0x00000001	/* Receiver SYnchronized (read)    */
583 #define HSSR1_TBY	0x00000002	/* Transmitter BusY (read)         */
584 #define HSSR1_RNE	0x00000004	/* Receive FIFO Not Empty (read)   */
585 #define HSSR1_TNF	0x00000008	/* Transmit FIFO Not Full (read)   */
586 #define HSSR1_EOF	0x00000010	/* receive End-Of-Frame (read)     */
587 #define HSSR1_CRE	0x00000020	/* receive CRC Error (read)        */
588 #define HSSR1_ROR	0x00000040	/* Receive FIFO Over-Run (read)    */
589 
590 #define HSCR2_TXP	0x00040000	/* Transmit data Polarity (TXD_2)  */
591 #define HSCR2_TrDataL	(HSCR2_TXP*0)	/*  Transmit Data active Low       */
592                 	        	/*  (inverted)                     */
593 #define HSCR2_TrDataH	(HSCR2_TXP*1)	/*  Transmit Data active High      */
594                 	        	/*  (non-inverted)                 */
595 #define HSCR2_RXP	0x00080000	/* Receive data Polarity (RXD_2)   */
596 #define HSCR2_RcDataL	(HSCR2_RXP*0)	/*  Receive Data active Low        */
597                 	        	/*  (inverted)                     */
598 #define HSCR2_RcDataH	(HSCR2_RXP*1)	/*  Receive Data active High       */
599                 	        	/*  (non-inverted)                 */
600 
601 
602 /*
603  * Multi-media Communications Port (MCP) control registers
604  *
605  * Registers
606  *    Ser4MCCR0 	Serial port 4 Multi-media Communications Port (MCP)
607  *              	Control Register 0 (read/write).
608  *    Ser4MCDR0 	Serial port 4 Multi-media Communications Port (MCP)
609  *              	Data Register 0 (audio, read/write).
610  *    Ser4MCDR1 	Serial port 4 Multi-media Communications Port (MCP)
611  *              	Data Register 1 (telecom, read/write).
612  *    Ser4MCDR2 	Serial port 4 Multi-media Communications Port (MCP)
613  *              	Data Register 2 (CODEC registers, read/write).
614  *    Ser4MCSR  	Serial port 4 Multi-media Communications Port (MCP)
615  *              	Status Register (read/write).
616  *    Ser4MCCR1 	Serial port 4 Multi-media Communications Port (MCP)
617  *              	Control Register 1 (read/write).
618  *              	[The MCCR1 register is only implemented in
619  *              	versions 2.0 (rev. = 8) and higher of the StrongARM
620  *              	SA-1100.]
621  *
622  * Clocks
623  *    fmc, Tmc  	Frequency, period of the MCP communication (10 MHz,
624  *              	12 MHz, or GPIO [21]).
625  *    faud, Taud	Frequency, period of the audio sampling.
626  *    ftcm, Ttcm	Frequency, period of the telecom sampling.
627  */
628 
629 #define Ser4MCCR0	__REG(0x80060000)  /* Ser. port 4 MCP Control Reg. 0 */
630 #define Ser4MCDR0	__REG(0x80060008)  /* Ser. port 4 MCP Data Reg. 0 (audio) */
631 #define Ser4MCDR1	__REG(0x8006000C)  /* Ser. port 4 MCP Data Reg. 1 (telecom) */
632 #define Ser4MCDR2	__REG(0x80060010)  /* Ser. port 4 MCP Data Reg. 2 (CODEC reg.) */
633 #define Ser4MCSR	__REG(0x80060018)  /* Ser. port 4 MCP Status Reg. */
634 #define Ser4MCCR1	__REG(0x90060030)  /* Ser. port 4 MCP Control Reg. 1 */
635 
636 #define MCCR0_ASD	Fld (7, 0)	/* Audio Sampling rate Divisor/32  */
637                 	        	/* [6..127]                        */
638                 	        	/* faud = fmc/(32*ASD)             */
639                 	        	/* Taud = 32*ASD*Tmc               */
640 #define MCCR0_AudSmpDiv(Div)    	/*  Audio Sampling rate Divisor    */ \
641                 	        	/*  [192..4064]                    */ \
642                 	((Div)/32 << FShft (MCCR0_ASD))
643                 	        	/*  faud = fmc/(32*Floor (Div/32)) */
644                 	        	/*  Taud = 32*Floor (Div/32)*Tmc   */
645 #define MCCR0_CeilAudSmpDiv(Div)	/*  Ceil. of AudSmpDiv [192..4064] */ \
646                 	(((Div) + 31)/32 << FShft (MCCR0_ASD))
647                 	        	/*  faud = fmc/(32*Ceil (Div/32))  */
648                 	        	/*  Taud = 32*Ceil (Div/32)*Tmc    */
649 #define MCCR0_TSD	Fld (7, 8)	/* Telecom Sampling rate           */
650                 	        	/* Divisor/32 [16..127]            */
651                 	        	/* ftcm = fmc/(32*TSD)             */
652                 	        	/* Ttcm = 32*TSD*Tmc               */
653 #define MCCR0_TcmSmpDiv(Div)    	/*  Telecom Sampling rate Divisor  */ \
654                 	        	/*  [512..4064]                    */ \
655                 	((Div)/32 << FShft (MCCR0_TSD))
656                 	        	/*  ftcm = fmc/(32*Floor (Div/32)) */
657                 	        	/*  Ttcm = 32*Floor (Div/32)*Tmc   */
658 #define MCCR0_CeilTcmSmpDiv(Div)	/*  Ceil. of TcmSmpDiv [512..4064] */ \
659                 	(((Div) + 31)/32 << FShft (MCCR0_TSD))
660                 	        	/*  ftcm = fmc/(32*Ceil (Div/32))  */
661                 	        	/*  Ttcm = 32*Ceil (Div/32)*Tmc    */
662 #define MCCR0_MCE	0x00010000	/* MCP Enable                      */
663 #define MCCR0_ECS	0x00020000	/* External Clock Select           */
664 #define MCCR0_IntClk	(MCCR0_ECS*0)	/*  Internal Clock (10 or 12 MHz)  */
665 #define MCCR0_ExtClk	(MCCR0_ECS*1)	/*  External Clock (GPIO [21])     */
666 #define MCCR0_ADM	0x00040000	/* A/D (audio/telecom) data        */
667                 	        	/* sampling/storing Mode           */
668 #define MCCR0_VldBit	(MCCR0_ADM*0)	/*  Valid Bit storing mode         */
669 #define MCCR0_SmpCnt	(MCCR0_ADM*1)	/*  Sampling Counter storing mode  */
670 #define MCCR0_TTE	0x00080000	/* Telecom Transmit FIFO 1/2-full  */
671                 	        	/* or less interrupt Enable        */
672 #define MCCR0_TRE	0x00100000	/* Telecom Receive FIFO 1/2-full   */
673                 	        	/* or more interrupt Enable        */
674 #define MCCR0_ATE	0x00200000	/* Audio Transmit FIFO 1/2-full    */
675                 	        	/* or less interrupt Enable        */
676 #define MCCR0_ARE	0x00400000	/* Audio Receive FIFO 1/2-full or  */
677                 	        	/* more interrupt Enable           */
678 #define MCCR0_LBM	0x00800000	/* Look-Back Mode                  */
679 #define MCCR0_ECP	Fld (2, 24)	/* External Clock Prescaler - 1    */
680 #define MCCR0_ExtClkDiv(Div)    	/*  External Clock Divisor [1..4]  */ \
681                 	(((Div) - 1) << FShft (MCCR0_ECP))
682 
683 #define MCDR0_DATA	Fld (12, 4)	/* receive/transmit audio DATA     */
684                 	        	/* FIFOs                           */
685 
686 #define MCDR1_DATA	Fld (14, 2)	/* receive/transmit telecom DATA   */
687                 	        	/* FIFOs                           */
688 
689                 	        	/* receive/transmit CODEC reg.     */
690                 	        	/* FIFOs:                          */
691 #define MCDR2_DATA	Fld (16, 0)	/*  reg. DATA                      */
692 #define MCDR2_RW	0x00010000	/*  reg. Read/Write (transmit)     */
693 #define MCDR2_Rd	(MCDR2_RW*0)	/*   reg. Read                     */
694 #define MCDR2_Wr	(MCDR2_RW*1)	/*   reg. Write                    */
695 #define MCDR2_ADD	Fld (4, 17)	/*  reg. ADDress                   */
696 
697 #define MCSR_ATS	0x00000001	/* Audio Transmit FIFO 1/2-full    */
698                 	        	/* or less Service request (read)  */
699 #define MCSR_ARS	0x00000002	/* Audio Receive FIFO 1/2-full or  */
700                 	        	/* more Service request (read)     */
701 #define MCSR_TTS	0x00000004	/* Telecom Transmit FIFO 1/2-full  */
702                 	        	/* or less Service request (read)  */
703 #define MCSR_TRS	0x00000008	/* Telecom Receive FIFO 1/2-full   */
704                 	        	/* or more Service request (read)  */
705 #define MCSR_ATU	0x00000010	/* Audio Transmit FIFO Under-run   */
706 #define MCSR_ARO	0x00000020	/* Audio Receive FIFO Over-run     */
707 #define MCSR_TTU	0x00000040	/* Telecom Transmit FIFO Under-run */
708 #define MCSR_TRO	0x00000080	/* Telecom Receive FIFO Over-run   */
709 #define MCSR_ANF	0x00000100	/* Audio transmit FIFO Not Full    */
710                 	        	/* (read)                          */
711 #define MCSR_ANE	0x00000200	/* Audio receive FIFO Not Empty    */
712                 	        	/* (read)                          */
713 #define MCSR_TNF	0x00000400	/* Telecom transmit FIFO Not Full  */
714                 	        	/* (read)                          */
715 #define MCSR_TNE	0x00000800	/* Telecom receive FIFO Not Empty  */
716                 	        	/* (read)                          */
717 #define MCSR_CWC	0x00001000	/* CODEC register Write Completed  */
718                 	        	/* (read)                          */
719 #define MCSR_CRC	0x00002000	/* CODEC register Read Completed   */
720                 	        	/* (read)                          */
721 #define MCSR_ACE	0x00004000	/* Audio CODEC Enabled (read)      */
722 #define MCSR_TCE	0x00008000	/* Telecom CODEC Enabled (read)    */
723 
724 #define MCCR1_CFS	0x00100000	/* Clock Freq. Select              */
725 #define MCCR1_F12MHz	(MCCR1_CFS*0)	/*  Freq. (fmc) = ~ 12 MHz         */
726                 	        	/*  (11.981 MHz)                   */
727 #define MCCR1_F10MHz	(MCCR1_CFS*1)	/*  Freq. (fmc) = ~ 10 MHz         */
728                 	        	/*  (9.585 MHz)                    */
729 
730 
731 /*
732  * Synchronous Serial Port (SSP) control registers
733  *
734  * Registers
735  *    Ser4SSCR0 	Serial port 4 Synchronous Serial Port (SSP) Control
736  *              	Register 0 (read/write).
737  *    Ser4SSCR1 	Serial port 4 Synchronous Serial Port (SSP) Control
738  *              	Register 1 (read/write).
739  *              	[Bits SPO and SP are only implemented in versions 2.0
740  *              	(rev. = 8) and higher of the StrongARM SA-1100.]
741  *    Ser4SSDR  	Serial port 4 Synchronous Serial Port (SSP) Data
742  *              	Register (read/write).
743  *    Ser4SSSR  	Serial port 4 Synchronous Serial Port (SSP) Status
744  *              	Register (read/write).
745  *
746  * Clocks
747  *    fxtl, Txtl	Frequency, period of the system crystal (3.6864 MHz
748  *              	or 3.5795 MHz).
749  *    fss, Tss  	Frequency, period of the SSP communication.
750  */
751 
752 #define Ser4SSCR0	__REG(0x80070060)  /* Ser. port 4 SSP Control Reg. 0 */
753 #define Ser4SSCR1	__REG(0x80070064)  /* Ser. port 4 SSP Control Reg. 1 */
754 #define Ser4SSDR	__REG(0x8007006C)  /* Ser. port 4 SSP Data Reg. */
755 #define Ser4SSSR	__REG(0x80070074)  /* Ser. port 4 SSP Status Reg. */
756 
757 #define SSCR0_DSS	Fld (4, 0)	/* Data Size - 1 Select [3..15]    */
758 #define SSCR0_DataSize(Size)    	/*  Data Size Select [4..16]       */ \
759                 	(((Size) - 1) << FShft (SSCR0_DSS))
760 #define SSCR0_FRF	Fld (2, 4)	/* FRame Format                    */
761 #define SSCR0_Motorola	        	/*  Motorola Serial Peripheral     */ \
762                 	        	/*  Interface (SPI) format         */ \
763                 	(0 << FShft (SSCR0_FRF))
764 #define SSCR0_TI	        	/*  Texas Instruments Synchronous  */ \
765                 	        	/*  Serial format                  */ \
766                 	(1 << FShft (SSCR0_FRF))
767 #define SSCR0_National	        	/*  National Microwire format      */ \
768                 	(2 << FShft (SSCR0_FRF))
769 #define SSCR0_SSE	0x00000080	/* SSP Enable                      */
770 #define SSCR0_SCR	Fld (8, 8)	/* Serial Clock Rate divisor/2 - 1 */
771                 	        	/* fss = fxtl/(2*(SCR + 1))        */
772                 	        	/* Tss = 2*(SCR + 1)*Txtl          */
773 #define SSCR0_SerClkDiv(Div)    	/*  Serial Clock Divisor [2..512]  */ \
774                 	(((Div) - 2)/2 << FShft (SSCR0_SCR))
775                 	        	/*  fss = fxtl/(2*Floor (Div/2))   */
776                 	        	/*  Tss = 2*Floor (Div/2)*Txtl     */
777 #define SSCR0_CeilSerClkDiv(Div)	/*  Ceil. of SerClkDiv [2..512]    */ \
778                 	(((Div) - 1)/2 << FShft (SSCR0_SCR))
779                 	        	/*  fss = fxtl/(2*Ceil (Div/2))    */
780                 	        	/*  Tss = 2*Ceil (Div/2)*Txtl      */
781 
782 #define SSCR1_RIE	0x00000001	/* Receive FIFO 1/2-full or more   */
783                 	        	/* Interrupt Enable                */
784 #define SSCR1_TIE	0x00000002	/* Transmit FIFO 1/2-full or less  */
785                 	        	/* Interrupt Enable                */
786 #define SSCR1_LBM	0x00000004	/* Look-Back Mode                  */
787 #define SSCR1_SPO	0x00000008	/* Sample clock (SCLK) POlarity    */
788 #define SSCR1_SClkIactL	(SSCR1_SPO*0)	/*  Sample Clock Inactive Low      */
789 #define SSCR1_SClkIactH	(SSCR1_SPO*1)	/*  Sample Clock Inactive High     */
790 #define SSCR1_SP	0x00000010	/* Sample clock (SCLK) Phase       */
791 #define SSCR1_SClk1P	(SSCR1_SP*0)	/*  Sample Clock active 1 Period   */
792                 	        	/*  after frame (SFRM, 1st edge)   */
793 #define SSCR1_SClk1_2P	(SSCR1_SP*1)	/*  Sample Clock active 1/2 Period */
794                 	        	/*  after frame (SFRM, 1st edge)   */
795 #define SSCR1_ECS	0x00000020	/* External Clock Select           */
796 #define SSCR1_IntClk	(SSCR1_ECS*0)	/*  Internal Clock                 */
797 #define SSCR1_ExtClk	(SSCR1_ECS*1)	/*  External Clock (GPIO [19])     */
798 
799 #define SSDR_DATA	Fld (16, 0)	/* receive/transmit DATA FIFOs     */
800 
801 #define SSSR_TNF	0x00000002	/* Transmit FIFO Not Full (read)   */
802 #define SSSR_RNE	0x00000004	/* Receive FIFO Not Empty (read)   */
803 #define SSSR_BSY	0x00000008	/* SSP BuSY (read)                 */
804 #define SSSR_TFS	0x00000010	/* Transmit FIFO 1/2-full or less  */
805                 	        	/* Service request (read)          */
806 #define SSSR_RFS	0x00000020	/* Receive FIFO 1/2-full or more   */
807                 	        	/* Service request (read)          */
808 #define SSSR_ROR	0x00000040	/* Receive FIFO Over-Run           */
809 
810 
811 /*
812  * Operating System (OS) timer control registers
813  *
814  * Registers
815  *    OSMR0     	Operating System (OS) timer Match Register 0
816  *              	(read/write).
817  *    OSMR1     	Operating System (OS) timer Match Register 1
818  *              	(read/write).
819  *    OSMR2     	Operating System (OS) timer Match Register 2
820  *              	(read/write).
821  *    OSMR3     	Operating System (OS) timer Match Register 3
822  *              	(read/write).
823  *    OSCR      	Operating System (OS) timer Counter Register
824  *              	(read/write).
825  *    OSSR      	Operating System (OS) timer Status Register
826  *              	(read/write).
827  *    OWER      	Operating System (OS) timer Watch-dog Enable Register
828  *              	(read/write).
829  *    OIER      	Operating System (OS) timer Interrupt Enable Register
830  *              	(read/write).
831  */
832 
833 #define OSMR0  		io_p2v(0x90000000)  /* OS timer Match Reg. 0 */
834 #define OSMR1  		io_p2v(0x90000004)  /* OS timer Match Reg. 1 */
835 #define OSMR2  		io_p2v(0x90000008)  /* OS timer Match Reg. 2 */
836 #define OSMR3  		io_p2v(0x9000000c)  /* OS timer Match Reg. 3 */
837 #define OSCR   		io_p2v(0x90000010)  /* OS timer Counter Reg. */
838 #define OSSR   		io_p2v(0x90000014)  /* OS timer Status Reg. */
839 #define OWER   		io_p2v(0x90000018)  /* OS timer Watch-dog Enable Reg. */
840 #define OIER  	 	io_p2v(0x9000001C)  /* OS timer Interrupt Enable Reg. */
841 
842 #define OSSR_M(Nb)	        	/* Match detected [0..3]           */ \
843                 	(0x00000001 << (Nb))
844 #define OSSR_M0 	OSSR_M (0)	/* Match detected 0                */
845 #define OSSR_M1 	OSSR_M (1)	/* Match detected 1                */
846 #define OSSR_M2 	OSSR_M (2)	/* Match detected 2                */
847 #define OSSR_M3 	OSSR_M (3)	/* Match detected 3                */
848 
849 #define OWER_WME	0x00000001	/* Watch-dog Match Enable          */
850                 	        	/* (set only)                      */
851 
852 #define OIER_E(Nb)	        	/* match interrupt Enable [0..3]   */ \
853                 	(0x00000001 << (Nb))
854 #define OIER_E0 	OIER_E (0)	/* match interrupt Enable 0        */
855 #define OIER_E1 	OIER_E (1)	/* match interrupt Enable 1        */
856 #define OIER_E2 	OIER_E (2)	/* match interrupt Enable 2        */
857 #define OIER_E3 	OIER_E (3)	/* match interrupt Enable 3        */
858 
859 
860 /*
861  * Power Manager (PM) control registers
862  *
863  * Registers
864  *    PMCR      	Power Manager (PM) Control Register (read/write).
865  *    PSSR      	Power Manager (PM) Sleep Status Register (read/write).
866  *    PSPR      	Power Manager (PM) Scratch-Pad Register (read/write).
867  *    PWER      	Power Manager (PM) Wake-up Enable Register
868  *              	(read/write).
869  *    PCFR      	Power Manager (PM) general ConFiguration Register
870  *              	(read/write).
871  *    PPCR      	Power Manager (PM) Phase-Locked Loop (PLL)
872  *              	Configuration Register (read/write).
873  *    PGSR      	Power Manager (PM) General-Purpose Input/Output (GPIO)
874  *              	Sleep state Register (read/write, see GPIO pins).
875  *    POSR      	Power Manager (PM) Oscillator Status Register (read).
876  *
877  * Clocks
878  *    fxtl, Txtl	Frequency, period of the system crystal (3.6864 MHz
879  *              	or 3.5795 MHz).
880  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
881  */
882 
883 #define PMCR		__REG(0x90020000)  /* PM Control Reg. */
884 #define PSSR		__REG(0x90020004)  /* PM Sleep Status Reg. */
885 #define PSPR		__REG(0x90020008)  /* PM Scratch-Pad Reg. */
886 #define PWER		__REG(0x9002000C)  /* PM Wake-up Enable Reg. */
887 #define PCFR		__REG(0x90020010)  /* PM general ConFiguration Reg. */
888 #define PPCR		__REG(0x90020014)  /* PM PLL Configuration Reg. */
889 #define PGSR		__REG(0x90020018)  /* PM GPIO Sleep state Reg. */
890 #define POSR		__REG(0x9002001C)  /* PM Oscillator Status Reg. */
891 
892 #define PMCR_SF 	0x00000001	/* Sleep Force (set only)          */
893 
894 #define PSSR_SS 	0x00000001	/* Software Sleep                  */
895 #define PSSR_BFS	0x00000002	/* Battery Fault Status            */
896                 	        	/* (BATT_FAULT)                    */
897 #define PSSR_VFS	0x00000004	/* Vdd Fault Status (VDD_FAULT)    */
898 #define PSSR_DH 	0x00000008	/* DRAM control Hold               */
899 #define PSSR_PH 	0x00000010	/* Peripheral control Hold         */
900 
901 #define PWER_GPIO(Nb)	GPIO_GPIO (Nb)	/* GPIO [0..27] wake-up enable     */
902 #define PWER_GPIO0	PWER_GPIO (0)	/* GPIO  [0] wake-up enable        */
903 #define PWER_GPIO1	PWER_GPIO (1)	/* GPIO  [1] wake-up enable        */
904 #define PWER_GPIO2	PWER_GPIO (2)	/* GPIO  [2] wake-up enable        */
905 #define PWER_GPIO3	PWER_GPIO (3)	/* GPIO  [3] wake-up enable        */
906 #define PWER_GPIO4	PWER_GPIO (4)	/* GPIO  [4] wake-up enable        */
907 #define PWER_GPIO5	PWER_GPIO (5)	/* GPIO  [5] wake-up enable        */
908 #define PWER_GPIO6	PWER_GPIO (6)	/* GPIO  [6] wake-up enable        */
909 #define PWER_GPIO7	PWER_GPIO (7)	/* GPIO  [7] wake-up enable        */
910 #define PWER_GPIO8	PWER_GPIO (8)	/* GPIO  [8] wake-up enable        */
911 #define PWER_GPIO9	PWER_GPIO (9)	/* GPIO  [9] wake-up enable        */
912 #define PWER_GPIO10	PWER_GPIO (10)	/* GPIO [10] wake-up enable        */
913 #define PWER_GPIO11	PWER_GPIO (11)	/* GPIO [11] wake-up enable        */
914 #define PWER_GPIO12	PWER_GPIO (12)	/* GPIO [12] wake-up enable        */
915 #define PWER_GPIO13	PWER_GPIO (13)	/* GPIO [13] wake-up enable        */
916 #define PWER_GPIO14	PWER_GPIO (14)	/* GPIO [14] wake-up enable        */
917 #define PWER_GPIO15	PWER_GPIO (15)	/* GPIO [15] wake-up enable        */
918 #define PWER_GPIO16	PWER_GPIO (16)	/* GPIO [16] wake-up enable        */
919 #define PWER_GPIO17	PWER_GPIO (17)	/* GPIO [17] wake-up enable        */
920 #define PWER_GPIO18	PWER_GPIO (18)	/* GPIO [18] wake-up enable        */
921 #define PWER_GPIO19	PWER_GPIO (19)	/* GPIO [19] wake-up enable        */
922 #define PWER_GPIO20	PWER_GPIO (20)	/* GPIO [20] wake-up enable        */
923 #define PWER_GPIO21	PWER_GPIO (21)	/* GPIO [21] wake-up enable        */
924 #define PWER_GPIO22	PWER_GPIO (22)	/* GPIO [22] wake-up enable        */
925 #define PWER_GPIO23	PWER_GPIO (23)	/* GPIO [23] wake-up enable        */
926 #define PWER_GPIO24	PWER_GPIO (24)	/* GPIO [24] wake-up enable        */
927 #define PWER_GPIO25	PWER_GPIO (25)	/* GPIO [25] wake-up enable        */
928 #define PWER_GPIO26	PWER_GPIO (26)	/* GPIO [26] wake-up enable        */
929 #define PWER_GPIO27	PWER_GPIO (27)	/* GPIO [27] wake-up enable        */
930 #define PWER_RTC	0x80000000	/* RTC alarm wake-up enable        */
931 
932 #define PCFR_OPDE	0x00000001	/* Oscillator Power-Down Enable    */
933 #define PCFR_ClkRun	(PCFR_OPDE*0)	/*  Clock Running in sleep mode    */
934 #define PCFR_ClkStp	(PCFR_OPDE*1)	/*  Clock Stopped in sleep mode    */
935 #define PCFR_FP 	0x00000002	/* Float PCMCIA pins               */
936 #define PCFR_PCMCIANeg	(PCFR_FP*0)	/*  PCMCIA pins Negated (1)        */
937 #define PCFR_PCMCIAFlt	(PCFR_FP*1)	/*  PCMCIA pins Floating           */
938 #define PCFR_FS 	0x00000004	/* Float Static memory pins        */
939 #define PCFR_StMemNeg	(PCFR_FS*0)	/*  Static Memory pins Negated (1) */
940 #define PCFR_StMemFlt	(PCFR_FS*1)	/*  Static Memory pins Floating    */
941 #define PCFR_FO 	0x00000008	/* Force RTC oscillator            */
942                 	        	/* (32.768 kHz) enable On          */
943 
944 #define PPCR_CCF	Fld (5, 0)	/* CPU core Clock (CCLK) Freq.     */
945 #define PPCR_Fx16	        	/*  Freq. x 16 (fcpu = 16*fxtl)    */ \
946                 	(0x00 << FShft (PPCR_CCF))
947 #define PPCR_Fx20	        	/*  Freq. x 20 (fcpu = 20*fxtl)    */ \
948                 	(0x01 << FShft (PPCR_CCF))
949 #define PPCR_Fx24	        	/*  Freq. x 24 (fcpu = 24*fxtl)    */ \
950                 	(0x02 << FShft (PPCR_CCF))
951 #define PPCR_Fx28	        	/*  Freq. x 28 (fcpu = 28*fxtl)    */ \
952                 	(0x03 << FShft (PPCR_CCF))
953 #define PPCR_Fx32	        	/*  Freq. x 32 (fcpu = 32*fxtl)    */ \
954                 	(0x04 << FShft (PPCR_CCF))
955 #define PPCR_Fx36	        	/*  Freq. x 36 (fcpu = 36*fxtl)    */ \
956                 	(0x05 << FShft (PPCR_CCF))
957 #define PPCR_Fx40	        	/*  Freq. x 40 (fcpu = 40*fxtl)    */ \
958                 	(0x06 << FShft (PPCR_CCF))
959 #define PPCR_Fx44	        	/*  Freq. x 44 (fcpu = 44*fxtl)    */ \
960                 	(0x07 << FShft (PPCR_CCF))
961 #define PPCR_Fx48	        	/*  Freq. x 48 (fcpu = 48*fxtl)    */ \
962                 	(0x08 << FShft (PPCR_CCF))
963 #define PPCR_Fx52	        	/*  Freq. x 52 (fcpu = 52*fxtl)    */ \
964                 	(0x09 << FShft (PPCR_CCF))
965 #define PPCR_Fx56	        	/*  Freq. x 56 (fcpu = 56*fxtl)    */ \
966                 	(0x0A << FShft (PPCR_CCF))
967 #define PPCR_Fx60	        	/*  Freq. x 60 (fcpu = 60*fxtl)    */ \
968                 	(0x0B << FShft (PPCR_CCF))
969 #define PPCR_Fx64	        	/*  Freq. x 64 (fcpu = 64*fxtl)    */ \
970                 	(0x0C << FShft (PPCR_CCF))
971 #define PPCR_Fx68	        	/*  Freq. x 68 (fcpu = 68*fxtl)    */ \
972                 	(0x0D << FShft (PPCR_CCF))
973 #define PPCR_Fx72	        	/*  Freq. x 72 (fcpu = 72*fxtl)    */ \
974                 	(0x0E << FShft (PPCR_CCF))
975 #define PPCR_Fx76	        	/*  Freq. x 76 (fcpu = 76*fxtl)    */ \
976                 	(0x0F << FShft (PPCR_CCF))
977                 	        	/*  3.6864 MHz crystal (fxtl):     */
978 #define PPCR_F59_0MHz	PPCR_Fx16	/*   Freq. (fcpu) =  59.0 MHz      */
979 #define PPCR_F73_7MHz	PPCR_Fx20	/*   Freq. (fcpu) =  73.7 MHz      */
980 #define PPCR_F88_5MHz	PPCR_Fx24	/*   Freq. (fcpu) =  88.5 MHz      */
981 #define PPCR_F103_2MHz	PPCR_Fx28	/*   Freq. (fcpu) = 103.2 MHz      */
982 #define PPCR_F118_0MHz	PPCR_Fx32	/*   Freq. (fcpu) = 118.0 MHz      */
983 #define PPCR_F132_7MHz	PPCR_Fx36	/*   Freq. (fcpu) = 132.7 MHz      */
984 #define PPCR_F147_5MHz	PPCR_Fx40	/*   Freq. (fcpu) = 147.5 MHz      */
985 #define PPCR_F162_2MHz	PPCR_Fx44	/*   Freq. (fcpu) = 162.2 MHz      */
986 #define PPCR_F176_9MHz	PPCR_Fx48	/*   Freq. (fcpu) = 176.9 MHz      */
987 #define PPCR_F191_7MHz	PPCR_Fx52	/*   Freq. (fcpu) = 191.7 MHz      */
988 #define PPCR_F206_4MHz	PPCR_Fx56	/*   Freq. (fcpu) = 206.4 MHz      */
989 #define PPCR_F221_2MHz	PPCR_Fx60	/*   Freq. (fcpu) = 221.2 MHz      */
990 #define PPCR_F239_6MHz	PPCR_Fx64	/*   Freq. (fcpu) = 239.6 MHz      */
991 #define PPCR_F250_7MHz	PPCR_Fx68	/*   Freq. (fcpu) = 250.7 MHz      */
992 #define PPCR_F265_4MHz	PPCR_Fx72	/*   Freq. (fcpu) = 265.4 MHz      */
993 #define PPCR_F280_2MHz	PPCR_Fx76	/*   Freq. (fcpu) = 280.2 MHz      */
994                 	        	/*  3.5795 MHz crystal (fxtl):     */
995 #define PPCR_F57_3MHz	PPCR_Fx16	/*   Freq. (fcpu) =  57.3 MHz      */
996 #define PPCR_F71_6MHz	PPCR_Fx20	/*   Freq. (fcpu) =  71.6 MHz      */
997 #define PPCR_F85_9MHz	PPCR_Fx24	/*   Freq. (fcpu) =  85.9 MHz      */
998 #define PPCR_F100_2MHz	PPCR_Fx28	/*   Freq. (fcpu) = 100.2 MHz      */
999 #define PPCR_F114_5MHz	PPCR_Fx32	/*   Freq. (fcpu) = 114.5 MHz      */
1000 #define PPCR_F128_9MHz	PPCR_Fx36	/*   Freq. (fcpu) = 128.9 MHz      */
1001 #define PPCR_F143_2MHz	PPCR_Fx40	/*   Freq. (fcpu) = 143.2 MHz      */
1002 #define PPCR_F157_5MHz	PPCR_Fx44	/*   Freq. (fcpu) = 157.5 MHz      */
1003 #define PPCR_F171_8MHz	PPCR_Fx48	/*   Freq. (fcpu) = 171.8 MHz      */
1004 #define PPCR_F186_1MHz	PPCR_Fx52	/*   Freq. (fcpu) = 186.1 MHz      */
1005 #define PPCR_F200_5MHz	PPCR_Fx56	/*   Freq. (fcpu) = 200.5 MHz      */
1006 #define PPCR_F214_8MHz	PPCR_Fx60	/*   Freq. (fcpu) = 214.8 MHz      */
1007 #define PPCR_F229_1MHz	PPCR_Fx64	/*   Freq. (fcpu) = 229.1 MHz      */
1008 #define PPCR_F243_4MHz	PPCR_Fx68	/*   Freq. (fcpu) = 243.4 MHz      */
1009 #define PPCR_F257_7MHz	PPCR_Fx72	/*   Freq. (fcpu) = 257.7 MHz      */
1010 #define PPCR_F272_0MHz	PPCR_Fx76	/*   Freq. (fcpu) = 272.0 MHz      */
1011 
1012 #define POSR_OOK	0x00000001	/* RTC Oscillator (32.768 kHz) OK  */
1013 
1014 
1015 /*
1016  * Reset Controller (RC) control registers
1017  *
1018  * Registers
1019  *    RSRR      	Reset Controller (RC) Software Reset Register
1020  *              	(read/write).
1021  *    RCSR      	Reset Controller (RC) Status Register (read/write).
1022  */
1023 
1024 #define RSRR		__REG(0x90030000)  /* RC Software Reset Reg. */
1025 #define RCSR		__REG(0x90030004)  /* RC Status Reg. */
1026 
1027 #define RSRR_SWR	0x00000001	/* SoftWare Reset (set only)       */
1028 
1029 #define RCSR_HWR	0x00000001	/* HardWare Reset                  */
1030 #define RCSR_SWR	0x00000002	/* SoftWare Reset                  */
1031 #define RCSR_WDR	0x00000004	/* Watch-Dog Reset                 */
1032 #define RCSR_SMR	0x00000008	/* Sleep-Mode Reset                */
1033 
1034 
1035 /*
1036  * Test unit control registers
1037  *
1038  * Registers
1039  *    TUCR      	Test Unit Control Register (read/write).
1040  */
1041 
1042 #define TUCR		__REG(0x90030008)  /* Test Unit Control Reg. */
1043 
1044 #define TUCR_TIC	0x00000040	/* TIC mode                        */
1045 #define TUCR_TTST	0x00000080	/* Trim TeST mode                  */
1046 #define TUCR_RCRC	0x00000100	/* Richard's Cyclic Redundancy     */
1047                 	        	/* Check                           */
1048 #define TUCR_PMD	0x00000200	/* Power Management Disable        */
1049 #define TUCR_MR 	0x00000400	/* Memory Request mode             */
1050 #define TUCR_NoMB	(TUCR_MR*0)	/*  No Memory Bus request & grant  */
1051 #define TUCR_MBGPIO	(TUCR_MR*1)	/*  Memory Bus request (MBREQ) &   */
1052                 	        	/*  grant (MBGNT) on GPIO [22:21]  */
1053 #define TUCR_CTB	Fld (3, 20)	/* Clock Test Bits                 */
1054 #define TUCR_FDC	0x00800000	/* RTC Force Delete Count          */
1055 #define TUCR_FMC	0x01000000	/* Force Michelle's Control mode   */
1056 #define TUCR_TMC	0x02000000	/* RTC Trimmer Multiplexer Control */
1057 #define TUCR_DPS	0x04000000	/* Disallow Pad Sleep              */
1058 #define TUCR_TSEL	Fld (3, 29)	/* clock Test SELect on GPIO [27]  */
1059 #define TUCR_32_768kHz	        	/*  32.768 kHz osc. on GPIO [27]   */ \
1060                 	(0 << FShft (TUCR_TSEL))
1061 #define TUCR_3_6864MHz	        	/*  3.6864 MHz osc. on GPIO [27]   */ \
1062                 	(1 << FShft (TUCR_TSEL))
1063 #define TUCR_VDD	        	/*  VDD ring osc./16 on GPIO [27]  */ \
1064                 	(2 << FShft (TUCR_TSEL))
1065 #define TUCR_96MHzPLL	        	/*  96 MHz PLL/4 on GPIO [27]      */ \
1066                 	(3 << FShft (TUCR_TSEL))
1067 #define TUCR_Clock	        	/*  internal (fcpu/2) & 32.768 kHz */ \
1068                 	        	/*  Clocks on GPIO [26:27]         */ \
1069                 	(4 << FShft (TUCR_TSEL))
1070 #define TUCR_3_6864MHzA	        	/*  3.6864 MHz osc. on GPIO [27]   */ \
1071                 	        	/*  (Alternative)                  */ \
1072                 	(5 << FShft (TUCR_TSEL))
1073 #define TUCR_MainPLL	        	/*  Main PLL/16 on GPIO [27]       */ \
1074                 	(6 << FShft (TUCR_TSEL))
1075 #define TUCR_VDDL	        	/*  VDDL ring osc./4 on GPIO [27]  */ \
1076                 	(7 << FShft (TUCR_TSEL))
1077 
1078 
1079 /*
1080  * General-Purpose Input/Output (GPIO) control registers
1081  *
1082  * Registers
1083  *    GPLR      	General-Purpose Input/Output (GPIO) Pin Level
1084  *              	Register (read).
1085  *    GPDR      	General-Purpose Input/Output (GPIO) Pin Direction
1086  *              	Register (read/write).
1087  *    GPSR      	General-Purpose Input/Output (GPIO) Pin output Set
1088  *              	Register (write).
1089  *    GPCR      	General-Purpose Input/Output (GPIO) Pin output Clear
1090  *              	Register (write).
1091  *    GRER      	General-Purpose Input/Output (GPIO) Rising-Edge
1092  *              	detect Register (read/write).
1093  *    GFER      	General-Purpose Input/Output (GPIO) Falling-Edge
1094  *              	detect Register (read/write).
1095  *    GEDR      	General-Purpose Input/Output (GPIO) Edge Detect
1096  *              	status Register (read/write).
1097  *    GAFR      	General-Purpose Input/Output (GPIO) Alternate
1098  *              	Function Register (read/write).
1099  *
1100  * Clock
1101  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
1102  */
1103 
1104 #define GPLR		__REG(0x90040000)  /* GPIO Pin Level Reg.             */
1105 #define GPDR		__REG(0x90040004)  /* GPIO Pin Direction Reg.         */
1106 #define GPSR		__REG(0x90040008)  /* GPIO Pin output Set Reg.        */
1107 #define GPCR		__REG(0x9004000C)  /* GPIO Pin output Clear Reg.      */
1108 #define GRER		__REG(0x90040010)  /* GPIO Rising-Edge detect Reg.    */
1109 #define GFER		__REG(0x90040014)  /* GPIO Falling-Edge detect Reg.   */
1110 #define GEDR		__REG(0x90040018)  /* GPIO Edge Detect status Reg.    */
1111 #define GAFR		__REG(0x9004001C)  /* GPIO Alternate Function Reg.    */
1112 
1113 #define GPIO_MIN	(0)
1114 #define GPIO_MAX	(27)
1115 
1116 #define GPIO_GPIO(Nb)	        	/* GPIO [0..27]                    */ \
1117                 	(0x00000001 << (Nb))
1118 #define GPIO_GPIO0	GPIO_GPIO (0)	/* GPIO  [0]                       */
1119 #define GPIO_GPIO1	GPIO_GPIO (1)	/* GPIO  [1]                       */
1120 #define GPIO_GPIO2	GPIO_GPIO (2)	/* GPIO  [2]                       */
1121 #define GPIO_GPIO3	GPIO_GPIO (3)	/* GPIO  [3]                       */
1122 #define GPIO_GPIO4	GPIO_GPIO (4)	/* GPIO  [4]                       */
1123 #define GPIO_GPIO5	GPIO_GPIO (5)	/* GPIO  [5]                       */
1124 #define GPIO_GPIO6	GPIO_GPIO (6)	/* GPIO  [6]                       */
1125 #define GPIO_GPIO7	GPIO_GPIO (7)	/* GPIO  [7]                       */
1126 #define GPIO_GPIO8	GPIO_GPIO (8)	/* GPIO  [8]                       */
1127 #define GPIO_GPIO9	GPIO_GPIO (9)	/* GPIO  [9]                       */
1128 #define GPIO_GPIO10	GPIO_GPIO (10)	/* GPIO [10]                       */
1129 #define GPIO_GPIO11	GPIO_GPIO (11)	/* GPIO [11]                       */
1130 #define GPIO_GPIO12	GPIO_GPIO (12)	/* GPIO [12]                       */
1131 #define GPIO_GPIO13	GPIO_GPIO (13)	/* GPIO [13]                       */
1132 #define GPIO_GPIO14	GPIO_GPIO (14)	/* GPIO [14]                       */
1133 #define GPIO_GPIO15	GPIO_GPIO (15)	/* GPIO [15]                       */
1134 #define GPIO_GPIO16	GPIO_GPIO (16)	/* GPIO [16]                       */
1135 #define GPIO_GPIO17	GPIO_GPIO (17)	/* GPIO [17]                       */
1136 #define GPIO_GPIO18	GPIO_GPIO (18)	/* GPIO [18]                       */
1137 #define GPIO_GPIO19	GPIO_GPIO (19)	/* GPIO [19]                       */
1138 #define GPIO_GPIO20	GPIO_GPIO (20)	/* GPIO [20]                       */
1139 #define GPIO_GPIO21	GPIO_GPIO (21)	/* GPIO [21]                       */
1140 #define GPIO_GPIO22	GPIO_GPIO (22)	/* GPIO [22]                       */
1141 #define GPIO_GPIO23	GPIO_GPIO (23)	/* GPIO [23]                       */
1142 #define GPIO_GPIO24	GPIO_GPIO (24)	/* GPIO [24]                       */
1143 #define GPIO_GPIO25	GPIO_GPIO (25)	/* GPIO [25]                       */
1144 #define GPIO_GPIO26	GPIO_GPIO (26)	/* GPIO [26]                       */
1145 #define GPIO_GPIO27	GPIO_GPIO (27)	/* GPIO [27]                       */
1146 
1147 #define GPIO_LDD(Nb)	        	/* LCD Data [8..15] (O)            */ \
1148                 	GPIO_GPIO ((Nb) - 6)
1149 #define GPIO_LDD8	GPIO_LDD (8)	/* LCD Data  [8] (O)               */
1150 #define GPIO_LDD9	GPIO_LDD (9)	/* LCD Data  [9] (O)               */
1151 #define GPIO_LDD10	GPIO_LDD (10)	/* LCD Data [10] (O)               */
1152 #define GPIO_LDD11	GPIO_LDD (11)	/* LCD Data [11] (O)               */
1153 #define GPIO_LDD12	GPIO_LDD (12)	/* LCD Data [12] (O)               */
1154 #define GPIO_LDD13	GPIO_LDD (13)	/* LCD Data [13] (O)               */
1155 #define GPIO_LDD14	GPIO_LDD (14)	/* LCD Data [14] (O)               */
1156 #define GPIO_LDD15	GPIO_LDD (15)	/* LCD Data [15] (O)               */
1157                 	        	/* ser. port 4:                    */
1158 #define GPIO_SSP_TXD	GPIO_GPIO (10)	/*  SSP Transmit Data (O)          */
1159 #define GPIO_SSP_RXD	GPIO_GPIO (11)	/*  SSP Receive Data (I)           */
1160 #define GPIO_SSP_SCLK	GPIO_GPIO (12)	/*  SSP Sample CLocK (O)           */
1161 #define GPIO_SSP_SFRM	GPIO_GPIO (13)	/*  SSP Sample FRaMe (O)           */
1162                 	        	/* ser. port 1:                    */
1163 #define GPIO_UART_TXD	GPIO_GPIO (14)	/*  UART Transmit Data (O)         */
1164 #define GPIO_UART_RXD	GPIO_GPIO (15)	/*  UART Receive Data (I)          */
1165 #define GPIO_SDLC_SCLK	GPIO_GPIO (16)	/*  SDLC Sample CLocK (I/O)        */
1166 #define GPIO_SDLC_AAF	GPIO_GPIO (17)	/*  SDLC Abort After Frame (O)     */
1167 #define GPIO_UART_SCLK1	GPIO_GPIO (18)	/*  UART Sample CLocK 1 (I)        */
1168                 	        	/* ser. port 4:                    */
1169 #define GPIO_SSP_CLK	GPIO_GPIO (19)	/*  SSP external CLocK (I)         */
1170                 	        	/* ser. port 3:                    */
1171 #define GPIO_UART_SCLK3	GPIO_GPIO (20)	/*  UART Sample CLocK 3 (I)        */
1172                 	        	/* ser. port 4:                    */
1173 #define GPIO_MCP_CLK	GPIO_GPIO (21)	/*  MCP CLocK (I)                  */
1174                 	        	/* test controller:                */
1175 #define GPIO_TIC_ACK	GPIO_GPIO (21)	/*  TIC ACKnowledge (O)            */
1176 #define GPIO_MBGNT	GPIO_GPIO (21)	/*  Memory Bus GraNT (O)           */
1177 #define GPIO_TREQA	GPIO_GPIO (22)	/*  TIC REQuest A (I)              */
1178 #define GPIO_MBREQ	GPIO_GPIO (22)	/*  Memory Bus REQuest (I)         */
1179 #define GPIO_TREQB	GPIO_GPIO (23)	/*  TIC REQuest B (I)              */
1180 #define GPIO_1Hz	GPIO_GPIO (25)	/* 1 Hz clock (O)                  */
1181 #define GPIO_RCLK	GPIO_GPIO (26)	/* internal (R) CLocK (O, fcpu/2)  */
1182 #define GPIO_32_768kHz	GPIO_GPIO (27)	/* 32.768 kHz clock (O, RTC)       */
1183 
1184 #define GPDR_In 	0       	/* Input                           */
1185 #define GPDR_Out	1       	/* Output                          */
1186 
1187 
1188 /*
1189  * Interrupt Controller (IC) control registers
1190  *
1191  * Registers
1192  *    ICIP      	Interrupt Controller (IC) Interrupt ReQuest (IRQ)
1193  *              	Pending register (read).
1194  *    ICMR      	Interrupt Controller (IC) Mask Register (read/write).
1195  *    ICLR      	Interrupt Controller (IC) Level Register (read/write).
1196  *    ICCR      	Interrupt Controller (IC) Control Register
1197  *              	(read/write).
1198  *              	[The ICCR register is only implemented in versions 2.0
1199  *              	(rev. = 8) and higher of the StrongARM SA-1100.]
1200  *    ICFP      	Interrupt Controller (IC) Fast Interrupt reQuest
1201  *              	(FIQ) Pending register (read).
1202  *    ICPR      	Interrupt Controller (IC) Pending Register (read).
1203  *              	[The ICPR register is active low (inverted) in
1204  *              	versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1205  *              	StrongARM SA-1100, it is active high (non-inverted) in
1206  *              	versions 2.0 (rev. = 8) and higher.]
1207  */
1208 
1209 #define ICIP		__REG(0x90050000)  /* IC IRQ Pending reg.             */
1210 #define ICMR		__REG(0x90050004)  /* IC Mask Reg.                    */
1211 #define ICLR		__REG(0x90050008)  /* IC Level Reg.                   */
1212 #define ICCR		__REG(0x9005000C)  /* IC Control Reg.                 */
1213 #define ICFP		__REG(0x90050010)  /* IC FIQ Pending reg.             */
1214 #define ICPR		__REG(0x90050020)  /* IC Pending Reg.                 */
1215 
1216 #define IC_GPIO(Nb)	        	/* GPIO [0..10]                    */ \
1217                 	(0x00000001 << (Nb))
1218 #define IC_GPIO0	IC_GPIO (0)	/* GPIO  [0]                       */
1219 #define IC_GPIO1	IC_GPIO (1)	/* GPIO  [1]                       */
1220 #define IC_GPIO2	IC_GPIO (2)	/* GPIO  [2]                       */
1221 #define IC_GPIO3	IC_GPIO (3)	/* GPIO  [3]                       */
1222 #define IC_GPIO4	IC_GPIO (4)	/* GPIO  [4]                       */
1223 #define IC_GPIO5	IC_GPIO (5)	/* GPIO  [5]                       */
1224 #define IC_GPIO6	IC_GPIO (6)	/* GPIO  [6]                       */
1225 #define IC_GPIO7	IC_GPIO (7)	/* GPIO  [7]                       */
1226 #define IC_GPIO8	IC_GPIO (8)	/* GPIO  [8]                       */
1227 #define IC_GPIO9	IC_GPIO (9)	/* GPIO  [9]                       */
1228 #define IC_GPIO10	IC_GPIO (10)	/* GPIO [10]                       */
1229 #define IC_GPIO11_27	0x00000800	/* GPIO [11:27] (ORed)             */
1230 #define IC_LCD  	0x00001000	/* LCD controller                  */
1231 #define IC_Ser0UDC	0x00002000	/* Ser. port 0 UDC                 */
1232 #define IC_Ser1SDLC	0x00004000	/* Ser. port 1 SDLC                */
1233 #define IC_Ser1UART	0x00008000	/* Ser. port 1 UART                */
1234 #define IC_Ser2ICP	0x00010000	/* Ser. port 2 ICP                 */
1235 #define IC_Ser3UART	0x00020000	/* Ser. port 3 UART                */
1236 #define IC_Ser4MCP	0x00040000	/* Ser. port 4 MCP                 */
1237 #define IC_Ser4SSP	0x00080000	/* Ser. port 4 SSP                 */
1238 #define IC_DMA(Nb)	        	/* DMA controller channel [0..5]   */ \
1239                 	(0x00100000 << (Nb))
1240 #define IC_DMA0 	IC_DMA (0)	/* DMA controller channel 0        */
1241 #define IC_DMA1 	IC_DMA (1)	/* DMA controller channel 1        */
1242 #define IC_DMA2 	IC_DMA (2)	/* DMA controller channel 2        */
1243 #define IC_DMA3 	IC_DMA (3)	/* DMA controller channel 3        */
1244 #define IC_DMA4 	IC_DMA (4)	/* DMA controller channel 4        */
1245 #define IC_DMA5 	IC_DMA (5)	/* DMA controller channel 5        */
1246 #define IC_OST(Nb)	        	/* OS Timer match [0..3]           */ \
1247                 	(0x04000000 << (Nb))
1248 #define IC_OST0 	IC_OST (0)	/* OS Timer match 0                */
1249 #define IC_OST1 	IC_OST (1)	/* OS Timer match 1                */
1250 #define IC_OST2 	IC_OST (2)	/* OS Timer match 2                */
1251 #define IC_OST3 	IC_OST (3)	/* OS Timer match 3                */
1252 #define IC_RTC1Hz	0x40000000	/* RTC 1 Hz clock                  */
1253 #define IC_RTCAlrm	0x80000000	/* RTC Alarm                       */
1254 
1255 #define ICLR_IRQ	0       	/* Interrupt ReQuest               */
1256 #define ICLR_FIQ	1       	/* Fast Interrupt reQuest          */
1257 
1258 #define ICCR_DIM	0x00000001	/* Disable Idle-mode interrupt     */
1259                 	        	/* Mask                            */
1260 #define ICCR_IdleAllInt	(ICCR_DIM*0)	/*  Idle-mode All Interrupt enable */
1261                 	        	/*  (ICMR ignored)                 */
1262 #define ICCR_IdleMskInt	(ICCR_DIM*1)	/*  Idle-mode non-Masked Interrupt */
1263                 	        	/*  enable (ICMR used)             */
1264 
1265 
1266 /*
1267  * Peripheral Pin Controller (PPC) control registers
1268  *
1269  * Registers
1270  *    PPDR      	Peripheral Pin Controller (PPC) Pin Direction
1271  *              	Register (read/write).
1272  *    PPSR      	Peripheral Pin Controller (PPC) Pin State Register
1273  *              	(read/write).
1274  *    PPAR      	Peripheral Pin Controller (PPC) Pin Assignment
1275  *              	Register (read/write).
1276  *    PSDR      	Peripheral Pin Controller (PPC) Sleep-mode pin
1277  *              	Direction Register (read/write).
1278  *    PPFR      	Peripheral Pin Controller (PPC) Pin Flag Register
1279  *              	(read).
1280  */
1281 
1282 #define PPDR		__REG(0x90060000)  /* PPC Pin Direction Reg.          */
1283 #define PPSR		__REG(0x90060004)  /* PPC Pin State Reg.              */
1284 #define PPAR		__REG(0x90060008)  /* PPC Pin Assignment Reg.         */
1285 #define PSDR		__REG(0x9006000C)  /* PPC Sleep-mode pin Direction Reg. */
1286 #define PPFR		__REG(0x90060010)  /* PPC Pin Flag Reg.               */
1287 
1288 #define PPC_LDD(Nb)	        	/* LCD Data [0..7]                 */ \
1289                 	(0x00000001 << (Nb))
1290 #define PPC_LDD0	PPC_LDD (0)	/* LCD Data [0]                    */
1291 #define PPC_LDD1	PPC_LDD (1)	/* LCD Data [1]                    */
1292 #define PPC_LDD2	PPC_LDD (2)	/* LCD Data [2]                    */
1293 #define PPC_LDD3	PPC_LDD (3)	/* LCD Data [3]                    */
1294 #define PPC_LDD4	PPC_LDD (4)	/* LCD Data [4]                    */
1295 #define PPC_LDD5	PPC_LDD (5)	/* LCD Data [5]                    */
1296 #define PPC_LDD6	PPC_LDD (6)	/* LCD Data [6]                    */
1297 #define PPC_LDD7	PPC_LDD (7)	/* LCD Data [7]                    */
1298 #define PPC_L_PCLK	0x00000100	/* LCD Pixel CLocK                 */
1299 #define PPC_L_LCLK	0x00000200	/* LCD Line CLocK                  */
1300 #define PPC_L_FCLK	0x00000400	/* LCD Frame CLocK                 */
1301 #define PPC_L_BIAS	0x00000800	/* LCD AC BIAS                     */
1302                 	        	/* ser. port 1:                    */
1303 #define PPC_TXD1	0x00001000	/*  SDLC/UART Transmit Data 1      */
1304 #define PPC_RXD1	0x00002000	/*  SDLC/UART Receive Data 1       */
1305                 	        	/* ser. port 2:                    */
1306 #define PPC_TXD2	0x00004000	/*  IPC Transmit Data 2            */
1307 #define PPC_RXD2	0x00008000	/*  IPC Receive Data 2             */
1308                 	        	/* ser. port 3:                    */
1309 #define PPC_TXD3	0x00010000	/*  UART Transmit Data 3           */
1310 #define PPC_RXD3	0x00020000	/*  UART Receive Data 3            */
1311                 	        	/* ser. port 4:                    */
1312 #define PPC_TXD4	0x00040000	/*  MCP/SSP Transmit Data 4        */
1313 #define PPC_RXD4	0x00080000	/*  MCP/SSP Receive Data 4         */
1314 #define PPC_SCLK	0x00100000	/*  MCP/SSP Sample CLocK           */
1315 #define PPC_SFRM	0x00200000	/*  MCP/SSP Sample FRaMe           */
1316 
1317 #define PPDR_In 	0       	/* Input                           */
1318 #define PPDR_Out	1       	/* Output                          */
1319 
1320                 	        	/* ser. port 1:                    */
1321 #define PPAR_UPR	0x00001000	/*  UART Pin Reassignment          */
1322 #define PPAR_UARTTR	(PPAR_UPR*0)	/*   UART on TXD_1 & RXD_1         */
1323 #define PPAR_UARTGPIO	(PPAR_UPR*1)	/*   UART on GPIO [14:15]          */
1324                 	        	/* ser. port 4:                    */
1325 #define PPAR_SPR	0x00040000	/*  SSP Pin Reassignment           */
1326 #define PPAR_SSPTRSS	(PPAR_SPR*0)	/*   SSP on TXD_C, RXD_C, SCLK_C,  */
1327                 	        	/*   & SFRM_C                      */
1328 #define PPAR_SSPGPIO	(PPAR_SPR*1)	/*   SSP on GPIO [10:13]           */
1329 
1330 #define PSDR_OutL	0       	/* Output Low in sleep mode        */
1331 #define PSDR_Flt	1       	/* Floating (input) in sleep mode  */
1332 
1333 #define PPFR_LCD	0x00000001	/* LCD controller                  */
1334 #define PPFR_SP1TX	0x00001000	/* Ser. Port 1 SDLC/UART Transmit  */
1335 #define PPFR_SP1RX	0x00002000	/* Ser. Port 1 SDLC/UART Receive   */
1336 #define PPFR_SP2TX	0x00004000	/* Ser. Port 2 ICP Transmit        */
1337 #define PPFR_SP2RX	0x00008000	/* Ser. Port 2 ICP Receive         */
1338 #define PPFR_SP3TX	0x00010000	/* Ser. Port 3 UART Transmit       */
1339 #define PPFR_SP3RX	0x00020000	/* Ser. Port 3 UART Receive        */
1340 #define PPFR_SP4	0x00040000	/* Ser. Port 4 MCP/SSP             */
1341 #define PPFR_PerEn	0       	/* Peripheral Enabled              */
1342 #define PPFR_PPCEn	1       	/* PPC Enabled                     */
1343 
1344 
1345 /*
1346  * Dynamic Random-Access Memory (DRAM) control registers
1347  *
1348  * Registers
1349  *    MDCNFG    	Memory system: Dynamic Random-Access Memory (DRAM)
1350  *              	CoNFiGuration register (read/write).
1351  *    MDCAS0    	Memory system: Dynamic Random-Access Memory (DRAM)
1352  *              	Column Address Strobe (CAS) shift register 0
1353  *              	(read/write).
1354  *    MDCAS1    	Memory system: Dynamic Random-Access Memory (DRAM)
1355  *              	Column Address Strobe (CAS) shift register 1
1356  *              	(read/write).
1357  *    MDCAS2    	Memory system: Dynamic Random-Access Memory (DRAM)
1358  *              	Column Address Strobe (CAS) shift register 2
1359  *              	(read/write).
1360  *
1361  * Clocks
1362  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
1363  *    fmem, Tmem	Frequency, period of the memory clock (fmem = fcpu/2).
1364  *    fcas, Tcas	Frequency, period of the DRAM CAS shift registers.
1365  */
1366 
1367 #define MDCNFG		__REG(0xA0000000)  /*  DRAM CoNFiGuration reg. */
1368 #define MDCAS0		__REG(0xA0000004)  /* DRAM CAS shift reg. 0 */
1369 #define MDCAS1		__REG(0xA0000008)  /* DRAM CAS shift reg. 1 */
1370 #define MDCAS2		__REG(0xA000000c)  /* DRAM CAS shift reg. 2 */
1371 
1372 /* SA1100 MDCNFG values */
1373 #define MDCNFG_DE(Nb)	        	/* DRAM Enable bank [0..3]         */ \
1374                 	(0x00000001 << (Nb))
1375 #define MDCNFG_DE0	MDCNFG_DE (0)	/* DRAM Enable bank 0              */
1376 #define MDCNFG_DE1	MDCNFG_DE (1)	/* DRAM Enable bank 1              */
1377 #define MDCNFG_DE2	MDCNFG_DE (2)	/* DRAM Enable bank 2              */
1378 #define MDCNFG_DE3	MDCNFG_DE (3)	/* DRAM Enable bank 3              */
1379 #define MDCNFG_DRAC	Fld (2, 4)	/* DRAM Row Address Count - 9      */
1380 #define MDCNFG_RowAdd(Add)      	/*  Row Address count [9..12]      */ \
1381                 	(((Add) - 9) << FShft (MDCNFG_DRAC))
1382 #define MDCNFG_CDB2	0x00000040	/* shift reg. Clock Divide By 2    */
1383                 	        	/* (fcas = fcpu/2)                 */
1384 #define MDCNFG_TRP	Fld (4, 7)	/* Time RAS Pre-charge - 1 [Tmem]  */
1385 #define MDCNFG_PrChrg(Tcpu)     	/*  Pre-Charge time [2..32 Tcpu]   */ \
1386                 	(((Tcpu) - 2)/2 << FShft (MDCNFG_TRP))
1387 #define MDCNFG_CeilPrChrg(Tcpu) 	/*  Ceil. of PrChrg [2..32 Tcpu]   */ \
1388                 	(((Tcpu) - 1)/2 << FShft (MDCNFG_TRP))
1389 #define MDCNFG_TRASR	Fld (4, 11)	/* Time RAS Refresh - 1 [Tmem]     */
1390 #define MDCNFG_Ref(Tcpu)        	/*  Refresh time [2..32 Tcpu]      */ \
1391                 	(((Tcpu) - 2)/2 << FShft (MDCNFG_TRASR))
1392 #define MDCNFG_CeilRef(Tcpu)    	/*  Ceil. of Ref [2..32 Tcpu]      */ \
1393                 	(((Tcpu) - 1)/2 << FShft (MDCNFG_TRASR))
1394 #define MDCNFG_TDL	Fld (2, 15)	/* Time Data Latch [Tcpu]          */
1395 #define MDCNFG_DataLtch(Tcpu)   	/*  Data Latch delay [0..3 Tcpu]   */ \
1396                 	((Tcpu) << FShft (MDCNFG_TDL))
1397 #define MDCNFG_DRI	Fld (15, 17)	/* min. DRAM Refresh Interval/4    */
1398                 	        	/* [Tmem]                          */
1399 #define MDCNFG_RefInt(Tcpu)     	/*  min. Refresh Interval          */ \
1400                 	        	/*  [0..262136 Tcpu]               */ \
1401                 	((Tcpu)/8 << FShft (MDCNFG_DRI))
1402 
1403 /* SA1110 MDCNFG values */
1404 #define MDCNFG_SA1110_DE0	0x00000001	/* DRAM Enable bank 0        */
1405 #define MDCNFG_SA1110_DE1	0x00000002 	/* DRAM Enable bank 1        */
1406 #define MDCNFG_SA1110_DTIM0	0x00000004	/* DRAM timing type 0/1      */
1407 #define MDCNFG_SA1110_DWID0	0x00000008	/* DRAM bus width 0/1        */
1408 #define MDCNFG_SA1110_DRAC0	Fld(3, 4)	/* DRAM row addr bit count   */
1409                 	        		/* bank 0/1                  */
1410 #define MDCNFG_SA1110_CDB20	0x00000080	/* Mem Clock divide by 2 0/1 */
1411 #define MDCNFG_SA1110_TRP0	Fld(3, 8)	/* RAS precharge 0/1         */
1412 #define MDCNFG_SA1110_TDL0	Fld(2, 12)	/* Data input latch after CAS*/
1413                 	        		/* deassertion 0/1           */
1414 #define MDCNFG_SA1110_TWR0	Fld(2, 14)	/* SDRAM write recovery 0/1  */
1415 #define MDCNFG_SA1110_DE2	0x00010000	/* DRAM Enable bank 0        */
1416 #define MDCNFG_SA1110_DE3	0x00020000 	/* DRAM Enable bank 1        */
1417 #define MDCNFG_SA1110_DTIM2	0x00040000	/* DRAM timing type 0/1      */
1418 #define MDCNFG_SA1110_DWID2	0x00080000	/* DRAM bus width 0/1        */
1419 #define MDCNFG_SA1110_DRAC2	Fld(3, 20)	/* DRAM row addr bit count   */
1420                 	        		/* bank 0/1                  */
1421 #define MDCNFG_SA1110_CDB22	0x00800000	/* Mem Clock divide by 2 0/1 */
1422 #define MDCNFG_SA1110_TRP2	Fld(3, 24)	/* RAS precharge 0/1         */
1423 #define MDCNFG_SA1110_TDL2	Fld(2, 28)	/* Data input latch after CAS*/
1424                 	        		/* deassertion 0/1           */
1425 #define MDCNFG_SA1110_TWR2	Fld(2, 30)	/* SDRAM write recovery 0/1  */
1426 
1427 
1428 /*
1429  * Static memory control registers
1430  *
1431  * Registers
1432  *    MSC0      	Memory system: Static memory Control register 0
1433  *              	(read/write).
1434  *    MSC1      	Memory system: Static memory Control register 1
1435  *              	(read/write).
1436  *
1437  * Clocks
1438  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
1439  *    fmem, Tmem	Frequency, period of the memory clock (fmem = fcpu/2).
1440  */
1441 
1442 #define MSC0		__REG(0xa0000010)  /* Static memory Control reg. 0 */
1443 #define MSC1		__REG(0xa0000014)  /* Static memory Control reg. 1 */
1444 #define MSC2		__REG(0xa000002c)  /* Static memory Control reg. 2, not contiguous   */
1445 
1446 #define MSC_Bnk(Nb)	        	/* static memory Bank [0..3]       */ \
1447                 	Fld (16, ((Nb) Modulo 2)*16)
1448 #define MSC0_Bnk0	MSC_Bnk (0)	/* static memory Bank 0            */
1449 #define MSC0_Bnk1	MSC_Bnk (1)	/* static memory Bank 1            */
1450 #define MSC1_Bnk2	MSC_Bnk (2)	/* static memory Bank 2            */
1451 #define MSC1_Bnk3	MSC_Bnk (3)	/* static memory Bank 3            */
1452 
1453 #define MSC_RT  	Fld (2, 0)	/* ROM/static memory Type          */
1454 #define MSC_NonBrst	        	/*  Non-Burst static memory        */ \
1455                 	(0 << FShft (MSC_RT))
1456 #define MSC_SRAM	        	/*  32-bit byte-writable SRAM      */ \
1457                 	(1 << FShft (MSC_RT))
1458 #define MSC_Brst4	        	/*  Burst-of-4 static memory       */ \
1459                 	(2 << FShft (MSC_RT))
1460 #define MSC_Brst8	        	/*  Burst-of-8 static memory       */ \
1461                 	(3 << FShft (MSC_RT))
1462 #define MSC_RBW 	0x0004  	/* ROM/static memory Bus Width     */
1463 #define MSC_32BitStMem	(MSC_RBW*0)	/*  32-Bit Static Memory           */
1464 #define MSC_16BitStMem	(MSC_RBW*1)	/*  16-Bit Static Memory           */
1465 #define MSC_RDF 	Fld (5, 3)	/* ROM/static memory read Delay    */
1466                 	        	/* First access - 1(.5) [Tmem]     */
1467 #define MSC_1stRdAcc(Tcpu)      	/*  1st Read Access time (burst    */ \
1468                 	        	/*  static memory) [3..65 Tcpu]    */ \
1469                 	((((Tcpu) - 3)/2) << FShft (MSC_RDF))
1470 #define MSC_Ceil1stRdAcc(Tcpu)  	/*  Ceil. of 1stRdAcc [3..65 Tcpu] */ \
1471                 	((((Tcpu) - 2)/2) << FShft (MSC_RDF))
1472 #define MSC_RdAcc(Tcpu)	        	/*  Read Access time (non-burst    */ \
1473                 	        	/*  static memory) [2..64 Tcpu]    */ \
1474                 	((((Tcpu) - 2)/2) << FShft (MSC_RDF))
1475 #define MSC_CeilRdAcc(Tcpu)     	/*  Ceil. of RdAcc [2..64 Tcpu]    */ \
1476                 	((((Tcpu) - 1)/2) << FShft (MSC_RDF))
1477 #define MSC_RDN 	Fld (5, 8)	/* ROM/static memory read Delay    */
1478                 	        	/* Next access - 1 [Tmem]          */
1479 #define MSC_NxtRdAcc(Tcpu)      	/*  Next Read Access time (burst   */ \
1480                 	        	/*  static memory) [2..64 Tcpu]    */ \
1481                 	((((Tcpu) - 2)/2) << FShft (MSC_RDN))
1482 #define MSC_CeilNxtRdAcc(Tcpu)  	/*  Ceil. of NxtRdAcc [2..64 Tcpu] */ \
1483                 	((((Tcpu) - 1)/2) << FShft (MSC_RDN))
1484 #define MSC_WrAcc(Tcpu)	        	/*  Write Access time (non-burst   */ \
1485                 	        	/*  static memory) [2..64 Tcpu]    */ \
1486                 	((((Tcpu) - 2)/2) << FShft (MSC_RDN))
1487 #define MSC_CeilWrAcc(Tcpu)     	/*  Ceil. of WrAcc [2..64 Tcpu]    */ \
1488                 	((((Tcpu) - 1)/2) << FShft (MSC_RDN))
1489 #define MSC_RRR 	Fld (3, 13)	/* ROM/static memory RecoveRy      */
1490                 	        	/* time/2 [Tmem]                   */
1491 #define MSC_Rec(Tcpu)	        	/*  Recovery time [0..28 Tcpu]     */ \
1492                 	(((Tcpu)/4) << FShft (MSC_RRR))
1493 #define MSC_CeilRec(Tcpu)       	/*  Ceil. of Rec [0..28 Tcpu]      */ \
1494                 	((((Tcpu) + 3)/4) << FShft (MSC_RRR))
1495 
1496 
1497 /*
1498  * Personal Computer Memory Card International Association (PCMCIA) control
1499  * register
1500  *
1501  * Register
1502  *    MECR      	Memory system: Expansion memory bus (PCMCIA)
1503  *              	Configuration Register (read/write).
1504  *
1505  * Clocks
1506  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
1507  *    fmem, Tmem	Frequency, period of the memory clock (fmem = fcpu/2).
1508  *    fbclk, Tbclk	Frequency, period of the PCMCIA clock (BCLK).
1509  */
1510 
1511                 	        	/* Memory system:                  */
1512 #define MECR		__REG(0xA0000018)  /*  Expansion memory bus (PCMCIA) Configuration Reg.             */
1513 
1514 #define MECR_PCMCIA(Nb)	        	/* PCMCIA [0..1]                   */ \
1515                 	Fld (15, (Nb)*16)
1516 #define MECR_PCMCIA0	MECR_PCMCIA (0)	/* PCMCIA 0                        */
1517 #define MECR_PCMCIA1	MECR_PCMCIA (1)	/* PCMCIA 1                        */
1518 
1519 #define MECR_BSIO	Fld (5, 0)	/* BCLK Select I/O - 1 [Tmem]      */
1520 #define MECR_IOClk(Tcpu)        	/*  I/O Clock [2..64 Tcpu]         */ \
1521                 	((((Tcpu) - 2)/2) << FShft (MECR_BSIO))
1522 #define MECR_CeilIOClk(Tcpu)    	/*  Ceil. of IOClk [2..64 Tcpu]    */ \
1523                 	((((Tcpu) - 1)/2) << FShft (MECR_BSIO))
1524 #define MECR_BSA	Fld (5, 5)	/* BCLK Select Attribute - 1       */
1525                 	        	/* [Tmem]                          */
1526 #define MECR_AttrClk(Tcpu)      	/*  Attribute Clock [2..64 Tcpu]   */ \
1527                 	((((Tcpu) - 2)/2) << FShft (MECR_BSA))
1528 #define MECR_CeilAttrClk(Tcpu)  	/*  Ceil. of AttrClk [2..64 Tcpu]  */ \
1529                 	((((Tcpu) - 1)/2) << FShft (MECR_BSA))
1530 #define MECR_BSM	Fld (5, 10)	/* BCLK Select Memory - 1 [Tmem]   */
1531 #define MECR_MemClk(Tcpu)       	/*  Memory Clock [2..64 Tcpu]      */ \
1532                 	((((Tcpu) - 2)/2) << FShft (MECR_BSM))
1533 #define MECR_CeilMemClk(Tcpu)   	/*  Ceil. of MemClk [2..64 Tcpu]   */ \
1534                 	((((Tcpu) - 1)/2) << FShft (MECR_BSM))
1535 
1536 /*
1537  * On SA1110 only
1538  */
1539 
1540 #define MDREFR		__REG(0xA000001C)
1541 
1542 #define MDREFR_TRASR		Fld (4, 0)
1543 #define MDREFR_DRI		Fld (12, 4)
1544 #define MDREFR_E0PIN		(1 << 16)
1545 #define MDREFR_K0RUN		(1 << 17)
1546 #define MDREFR_K0DB2		(1 << 18)
1547 #define MDREFR_E1PIN		(1 << 20)
1548 #define MDREFR_K1RUN		(1 << 21)
1549 #define MDREFR_K1DB2		(1 << 22)
1550 #define MDREFR_K2RUN		(1 << 25)
1551 #define MDREFR_K2DB2		(1 << 26)
1552 #define MDREFR_EAPD		(1 << 28)
1553 #define MDREFR_KAPD		(1 << 29)
1554 #define MDREFR_SLFRSH		(1 << 31)
1555 
1556 
1557 /*
1558  * Direct Memory Access (DMA) control registers
1559  */
1560 #define DMA_SIZE	(6 * 0x20)
1561 #define DMA_PHYS	0xb0000000
1562 
1563 
1564 /*
1565  * Liquid Crystal Display (LCD) control registers
1566  *
1567  * Registers
1568  *    LCCR0     	Liquid Crystal Display (LCD) Control Register 0
1569  *              	(read/write).
1570  *              	[Bits LDM, BAM, and ERM are only implemented in
1571  *              	versions 2.0 (rev. = 8) and higher of the StrongARM
1572  *              	SA-1100.]
1573  *    LCSR      	Liquid Crystal Display (LCD) Status Register
1574  *              	(read/write).
1575  *              	[Bit LDD can be only read in versions 1.0 (rev. = 1)
1576  *              	and 1.1 (rev. = 2) of the StrongARM SA-1100, it can be
1577  *              	read and written (cleared) in versions 2.0 (rev. = 8)
1578  *              	and higher.]
1579  *    DBAR1     	Liquid Crystal Display (LCD) Direct Memory Access
1580  *              	(DMA) Base Address Register channel 1 (read/write).
1581  *    DCAR1     	Liquid Crystal Display (LCD) Direct Memory Access
1582  *              	(DMA) Current Address Register channel 1 (read).
1583  *    DBAR2     	Liquid Crystal Display (LCD) Direct Memory Access
1584  *              	(DMA) Base Address Register channel 2 (read/write).
1585  *    DCAR2     	Liquid Crystal Display (LCD) Direct Memory Access
1586  *              	(DMA) Current Address Register channel 2 (read).
1587  *    LCCR1     	Liquid Crystal Display (LCD) Control Register 1
1588  *              	(read/write).
1589  *              	[The LCCR1 register can be only written in
1590  *              	versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1591  *              	StrongARM SA-1100, it can be written and read in
1592  *              	versions 2.0 (rev. = 8) and higher.]
1593  *    LCCR2     	Liquid Crystal Display (LCD) Control Register 2
1594  *              	(read/write).
1595  *              	[The LCCR1 register can be only written in
1596  *              	versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1597  *              	StrongARM SA-1100, it can be written and read in
1598  *              	versions 2.0 (rev. = 8) and higher.]
1599  *    LCCR3     	Liquid Crystal Display (LCD) Control Register 3
1600  *              	(read/write).
1601  *              	[The LCCR1 register can be only written in
1602  *              	versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1603  *              	StrongARM SA-1100, it can be written and read in
1604  *              	versions 2.0 (rev. = 8) and higher. Bit PCP is only
1605  *              	implemented in versions 2.0 (rev. = 8) and higher of
1606  *              	the StrongARM SA-1100.]
1607  *
1608  * Clocks
1609  *    fcpu, Tcpu	Frequency, period of the CPU core clock (CCLK).
1610  *    fmem, Tmem	Frequency, period of the memory clock (fmem = fcpu/2).
1611  *    fpix, Tpix	Frequency, period of the pixel clock.
1612  *    fln, Tln  	Frequency, period of the line clock.
1613  *    fac, Tac  	Frequency, period of the AC bias clock.
1614  */
1615 
1616 #define LCD_PEntrySp	2       	/* LCD Palette Entry Space [byte]  */
1617 #define LCD_4BitPSp	        	/* LCD 4-Bit pixel Palette Space   */ \
1618                 	        	/* [byte]                          */ \
1619                 	(16*LCD_PEntrySp)
1620 #define LCD_8BitPSp	        	/* LCD 8-Bit pixel Palette Space   */ \
1621                 	        	/* [byte]                          */ \
1622                 	(256*LCD_PEntrySp)
1623 #define LCD_12_16BitPSp	        	/* LCD 12/16-Bit pixel             */ \
1624                 	        	/* dummy-Palette Space [byte]      */ \
1625                 	(16*LCD_PEntrySp)
1626 
1627 #define LCD_PGrey	Fld (4, 0)	/* LCD Palette entry Grey value    */
1628 #define LCD_PBlue	Fld (4, 0)	/* LCD Palette entry Blue value    */
1629 #define LCD_PGreen	Fld (4, 4)	/* LCD Palette entry Green value   */
1630 #define LCD_PRed	Fld (4, 8)	/* LCD Palette entry Red value     */
1631 #define LCD_PBS 	Fld (2, 12)	/* LCD Pixel Bit Size              */
1632 #define LCD_4Bit	        	/*  LCD 4-Bit pixel mode           */ \
1633                 	(0 << FShft (LCD_PBS))
1634 #define LCD_8Bit	        	/*  LCD 8-Bit pixel mode           */ \
1635                 	(1 << FShft (LCD_PBS))
1636 #define LCD_12_16Bit	        	/*  LCD 12/16-Bit pixel mode       */ \
1637                 	(2 << FShft (LCD_PBS))
1638 
1639 #define LCD_Int0_0	0x0     	/* LCD Intensity =   0.0% =  0     */
1640 #define LCD_Int11_1	0x1     	/* LCD Intensity =  11.1% =  1/9   */
1641 #define LCD_Int20_0	0x2     	/* LCD Intensity =  20.0% =  1/5   */
1642 #define LCD_Int26_7	0x3     	/* LCD Intensity =  26.7% =  4/15  */
1643 #define LCD_Int33_3	0x4     	/* LCD Intensity =  33.3% =  3/9   */
1644 #define LCD_Int40_0	0x5     	/* LCD Intensity =  40.0% =  2/5   */
1645 #define LCD_Int44_4	0x6     	/* LCD Intensity =  44.4% =  4/9   */
1646 #define LCD_Int50_0	0x7     	/* LCD Intensity =  50.0% =  1/2   */
1647 #define LCD_Int55_6	0x8     	/* LCD Intensity =  55.6% =  5/9   */
1648 #define LCD_Int60_0	0x9     	/* LCD Intensity =  60.0% =  3/5   */
1649 #define LCD_Int66_7	0xA     	/* LCD Intensity =  66.7% =  6/9   */
1650 #define LCD_Int73_3	0xB     	/* LCD Intensity =  73.3% = 11/15  */
1651 #define LCD_Int80_0	0xC     	/* LCD Intensity =  80.0% =  4/5   */
1652 #define LCD_Int88_9	0xD     	/* LCD Intensity =  88.9% =  8/9   */
1653 #define LCD_Int100_0	0xE     	/* LCD Intensity = 100.0% =  1     */
1654 #define LCD_Int100_0A	0xF     	/* LCD Intensity = 100.0% =  1     */
1655                 	        	/* (Alternative)                   */
1656 
1657 #define LCCR0_LEN	0x00000001	/* LCD ENable                      */
1658 #define LCCR0_CMS	0x00000002	/* Color/Monochrome display Select */
1659 #define LCCR0_Color	(LCCR0_CMS*0)	/*  Color display                  */
1660 #define LCCR0_Mono	(LCCR0_CMS*1)	/*  Monochrome display             */
1661 #define LCCR0_SDS	0x00000004	/* Single/Dual panel display       */
1662                 	        	/* Select                          */
1663 #define LCCR0_Sngl	(LCCR0_SDS*0)	/*  Single panel display           */
1664 #define LCCR0_Dual	(LCCR0_SDS*1)	/*  Dual panel display             */
1665 #define LCCR0_LDM	0x00000008	/* LCD Disable done (LDD)          */
1666                 	        	/* interrupt Mask (disable)        */
1667 #define LCCR0_BAM	0x00000010	/* Base Address update (BAU)       */
1668                 	        	/* interrupt Mask (disable)        */
1669 #define LCCR0_ERM	0x00000020	/* LCD ERror (BER, IOL, IUL, IOU,  */
1670                 	        	/* IUU, OOL, OUL, OOU, and OUU)    */
1671                 	        	/* interrupt Mask (disable)        */
1672 #define LCCR0_PAS	0x00000080	/* Passive/Active display Select   */
1673 #define LCCR0_Pas	(LCCR0_PAS*0)	/*  Passive display (STN)          */
1674 #define LCCR0_Act	(LCCR0_PAS*1)	/*  Active display (TFT)           */
1675 #define LCCR0_BLE	0x00000100	/* Big/Little Endian select        */
1676 #define LCCR0_LtlEnd	(LCCR0_BLE*0)	/*  Little Endian frame buffer     */
1677 #define LCCR0_BigEnd	(LCCR0_BLE*1)	/*  Big Endian frame buffer        */
1678 #define LCCR0_DPD	0x00000200	/* Double Pixel Data (monochrome   */
1679                 	        	/* display mode)                   */
1680 #define LCCR0_4PixMono	(LCCR0_DPD*0)	/*  4-Pixel/clock Monochrome       */
1681                 	        	/*  display                        */
1682 #define LCCR0_8PixMono	(LCCR0_DPD*1)	/*  8-Pixel/clock Monochrome       */
1683                 	        	/*  display                        */
1684 #define LCCR0_PDD	Fld (8, 12)	/* Palette DMA request Delay       */
1685                 	        	/* [Tmem]                          */
1686 #define LCCR0_DMADel(Tcpu)      	/*  palette DMA request Delay      */ \
1687                 	        	/*  [0..510 Tcpu]                  */ \
1688                 	((Tcpu)/2 << FShft (LCCR0_PDD))
1689 
1690 #define LCSR_LDD	0x00000001	/* LCD Disable Done                */
1691 #define LCSR_BAU	0x00000002	/* Base Address Update (read)      */
1692 #define LCSR_BER	0x00000004	/* Bus ERror                       */
1693 #define LCSR_ABC	0x00000008	/* AC Bias clock Count             */
1694 #define LCSR_IOL	0x00000010	/* Input FIFO Over-run Lower       */
1695                 	        	/* panel                           */
1696 #define LCSR_IUL	0x00000020	/* Input FIFO Under-run Lower      */
1697                 	        	/* panel                           */
1698 #define LCSR_IOU	0x00000040	/* Input FIFO Over-run Upper       */
1699                 	        	/* panel                           */
1700 #define LCSR_IUU	0x00000080	/* Input FIFO Under-run Upper      */
1701                 	        	/* panel                           */
1702 #define LCSR_OOL	0x00000100	/* Output FIFO Over-run Lower      */
1703                 	        	/* panel                           */
1704 #define LCSR_OUL	0x00000200	/* Output FIFO Under-run Lower     */
1705                 	        	/* panel                           */
1706 #define LCSR_OOU	0x00000400	/* Output FIFO Over-run Upper      */
1707                 	        	/* panel                           */
1708 #define LCSR_OUU	0x00000800	/* Output FIFO Under-run Upper     */
1709                 	        	/* panel                           */
1710 
1711 #define LCCR1_PPL	Fld (6, 4)	/* Pixels Per Line/16 - 1          */
1712 #define LCCR1_DisWdth(Pixel)    	/*  Display Width [16..1024 pix.]  */ \
1713                 	(((Pixel) - 16)/16 << FShft (LCCR1_PPL))
1714 #define LCCR1_HSW	Fld (6, 10)	/* Horizontal Synchronization      */
1715                 	        	/* pulse Width - 1 [Tpix] (L_LCLK) */
1716 #define LCCR1_HorSnchWdth(Tpix) 	/*  Horizontal Synchronization     */ \
1717                 	        	/*  pulse Width [1..64 Tpix]       */ \
1718                 	(((Tpix) - 1) << FShft (LCCR1_HSW))
1719 #define LCCR1_ELW	Fld (8, 16)	/* End-of-Line pixel clock Wait    */
1720                 	        	/* count - 1 [Tpix]                */
1721 #define LCCR1_EndLnDel(Tpix)    	/*  End-of-Line Delay              */ \
1722                 	        	/*  [1..256 Tpix]                  */ \
1723                 	(((Tpix) - 1) << FShft (LCCR1_ELW))
1724 #define LCCR1_BLW	Fld (8, 24)	/* Beginning-of-Line pixel clock   */
1725                 	        	/* Wait count - 1 [Tpix]           */
1726 #define LCCR1_BegLnDel(Tpix)    	/*  Beginning-of-Line Delay        */ \
1727                 	        	/*  [1..256 Tpix]                  */ \
1728                 	(((Tpix) - 1) << FShft (LCCR1_BLW))
1729 
1730 #define LCCR2_LPP	Fld (10, 0)	/* Line Per Panel - 1              */
1731 #define LCCR2_DisHght(Line)     	/*  Display Height [1..1024 lines] */ \
1732                 	(((Line) - 1) << FShft (LCCR2_LPP))
1733 #define LCCR2_VSW	Fld (6, 10)	/* Vertical Synchronization pulse  */
1734                 	        	/* Width - 1 [Tln] (L_FCLK)        */
1735 #define LCCR2_VrtSnchWdth(Tln)  	/*  Vertical Synchronization pulse */ \
1736                 	        	/*  Width [1..64 Tln]              */ \
1737                 	(((Tln) - 1) << FShft (LCCR2_VSW))
1738 #define LCCR2_EFW	Fld (8, 16)	/* End-of-Frame line clock Wait    */
1739                 	        	/* count [Tln]                     */
1740 #define LCCR2_EndFrmDel(Tln)    	/*  End-of-Frame Delay             */ \
1741                 	        	/*  [0..255 Tln]                   */ \
1742                 	((Tln) << FShft (LCCR2_EFW))
1743 #define LCCR2_BFW	Fld (8, 24)	/* Beginning-of-Frame line clock   */
1744                 	        	/* Wait count [Tln]                */
1745 #define LCCR2_BegFrmDel(Tln)    	/*  Beginning-of-Frame Delay       */ \
1746                 	        	/*  [0..255 Tln]                   */ \
1747                 	((Tln) << FShft (LCCR2_BFW))
1748 
1749 #define LCCR3_PCD	Fld (8, 0)	/* Pixel Clock Divisor/2 - 2       */
1750                 	        	/* [1..255] (L_PCLK)               */
1751                 	        	/* fpix = fcpu/(2*(PCD + 2))       */
1752                 	        	/* Tpix = 2*(PCD + 2)*Tcpu         */
1753 #define LCCR3_PixClkDiv(Div)    	/*  Pixel Clock Divisor [6..514]   */ \
1754                 	(((Div) - 4)/2 << FShft (LCCR3_PCD))
1755                 	        	/*  fpix = fcpu/(2*Floor (Div/2))  */
1756                 	        	/*  Tpix = 2*Floor (Div/2)*Tcpu    */
1757 #define LCCR3_CeilPixClkDiv(Div)	/*  Ceil. of PixClkDiv [6..514]    */ \
1758                 	(((Div) - 3)/2 << FShft (LCCR3_PCD))
1759                 	        	/*  fpix = fcpu/(2*Ceil (Div/2))   */
1760                 	        	/*  Tpix = 2*Ceil (Div/2)*Tcpu     */
1761 #define LCCR3_ACB	Fld (8, 8)	/* AC Bias clock half period - 1   */
1762                 	        	/* [Tln] (L_BIAS)                  */
1763 #define LCCR3_ACBsDiv(Div)      	/*  AC Bias clock Divisor [2..512] */ \
1764                 	(((Div) - 2)/2 << FShft (LCCR3_ACB))
1765                 	        	/*  fac = fln/(2*Floor (Div/2))    */
1766                 	        	/*  Tac = 2*Floor (Div/2)*Tln      */
1767 #define LCCR3_CeilACBsDiv(Div)  	/*  Ceil. of ACBsDiv [2..512]      */ \
1768                 	(((Div) - 1)/2 << FShft (LCCR3_ACB))
1769                 	        	/*  fac = fln/(2*Ceil (Div/2))     */
1770                 	        	/*  Tac = 2*Ceil (Div/2)*Tln       */
1771 #define LCCR3_API	Fld (4, 16)	/* AC bias Pin transitions per     */
1772                 	        	/* Interrupt                       */
1773 #define LCCR3_ACBsCntOff        	/*  AC Bias clock transition Count */ \
1774                 	        	/*  Off                            */ \
1775                 	(0 << FShft (LCCR3_API))
1776 #define LCCR3_ACBsCnt(Trans)    	/*  AC Bias clock transition Count */ \
1777                 	        	/*  [1..15]                        */ \
1778                 	((Trans) << FShft (LCCR3_API))
1779 #define LCCR3_VSP	0x00100000	/* Vertical Synchronization pulse  */
1780                 	        	/* Polarity (L_FCLK)               */
1781 #define LCCR3_VrtSnchH	(LCCR3_VSP*0)	/*  Vertical Synchronization pulse */
1782                 	        	/*  active High                    */
1783 #define LCCR3_VrtSnchL	(LCCR3_VSP*1)	/*  Vertical Synchronization pulse */
1784                 	        	/*  active Low                     */
1785 #define LCCR3_HSP	0x00200000	/* Horizontal Synchronization      */
1786                 	        	/* pulse Polarity (L_LCLK)         */
1787 #define LCCR3_HorSnchH	(LCCR3_HSP*0)	/*  Horizontal Synchronization     */
1788                 	        	/*  pulse active High              */
1789 #define LCCR3_HorSnchL	(LCCR3_HSP*1)	/*  Horizontal Synchronization     */
1790                 	        	/*  pulse active Low               */
1791 #define LCCR3_PCP	0x00400000	/* Pixel Clock Polarity (L_PCLK)   */
1792 #define LCCR3_PixRsEdg	(LCCR3_PCP*0)	/*  Pixel clock Rising-Edge        */
1793 #define LCCR3_PixFlEdg	(LCCR3_PCP*1)	/*  Pixel clock Falling-Edge       */
1794 #define LCCR3_OEP	0x00800000	/* Output Enable Polarity (L_BIAS, */
1795                 	        	/* active display mode)            */
1796 #define LCCR3_OutEnH	(LCCR3_OEP*0)	/*  Output Enable active High      */
1797 #define LCCR3_OutEnL	(LCCR3_OEP*1)	/*  Output Enable active Low       */
1798