blob: 7589df238a6f9dc556541d8cb452a0543a93cc8a [file] [log] [blame]
wdenk3b58acd2002-03-27 13:48:44 +00001/*
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002 * FILE SA-1100.h
wdenk3b58acd2002-03-27 13:48:44 +00003 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02004 * 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
wdenk3b58acd2002-03-27 13:48:44 +00009 * Language C or ARM Assembly
Wolfgang Denk53677ef2008-05-20 16:00:29 +020010 * 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.
wdenk3b58acd2002-03-27 13:48:44 +000014 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +020015 * Language-specific definitions are selected by the
16 * macro "LANGUAGE", which should be defined as either
17 * "C" (default) or "Assembly".
wdenk3b58acd2002-03-27 13:48:44 +000018 */
19
20
21#ifndef LANGUAGE
22# ifdef __ASSEMBLY__
23# define LANGUAGE Assembly
24# else
25# define LANGUAGE C
26# endif
27#endif
28
29#ifndef io_p2v
30#define io_p2v(PhAdd) (PhAdd)
31#endif
32
33#include <asm/arch-sa1100/bitfield.h>
34
Wolfgang Denk53677ef2008-05-20 16:00:29 +020035#define C 0
wdenk3b58acd2002-03-27 13:48:44 +000036#define Assembly 1
37
38
39#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +020040typedef unsigned short Word16 ;
41typedef unsigned int Word32 ;
42typedef Word32 Word ;
43typedef Word Quad [4] ;
44typedef void *Address ;
45typedef void (*ExcpHndlr) (void) ;
wdenk3b58acd2002-03-27 13:48:44 +000046#endif /* LANGUAGE == C */
47
48
49/*
50 * Memory
51 */
52
Wolfgang Denk53677ef2008-05-20 16:00:29 +020053#define MemBnkSp 0x08000000 /* Memory Bank Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +000054
55#define StMemBnkSp MemBnkSp /* Static Memory Bank Space [byte] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020056#define StMemBnk0Sp StMemBnkSp /* Static Memory Bank 0 Space */
57 /* [byte] */
58#define StMemBnk1Sp StMemBnkSp /* Static Memory Bank 1 Space */
59 /* [byte] */
60#define StMemBnk2Sp StMemBnkSp /* Static Memory Bank 2 Space */
61 /* [byte] */
62#define StMemBnk3Sp StMemBnkSp /* Static Memory Bank 3 Space */
63 /* [byte] */
wdenk3b58acd2002-03-27 13:48:44 +000064
Wolfgang Denk53677ef2008-05-20 16:00:29 +020065#define DRAMBnkSp MemBnkSp /* DRAM Bank Space [byte] */
66#define DRAMBnk0Sp DRAMBnkSp /* DRAM Bank 0 Space [byte] */
67#define DRAMBnk1Sp DRAMBnkSp /* DRAM Bank 1 Space [byte] */
68#define DRAMBnk2Sp DRAMBnkSp /* DRAM Bank 2 Space [byte] */
69#define DRAMBnk3Sp DRAMBnkSp /* DRAM Bank 3 Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +000070
71#define ZeroMemSp MemBnkSp /* Zero Memory bank Space [byte] */
72
Wolfgang Denk53677ef2008-05-20 16:00:29 +020073#define _StMemBnk(Nb) /* Static Memory Bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +000074 (0x00000000 + (Nb)*StMemBnkSp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +020075#define _StMemBnk0 _StMemBnk (0) /* Static Memory Bank 0 */
76#define _StMemBnk1 _StMemBnk (1) /* Static Memory Bank 1 */
77#define _StMemBnk2 _StMemBnk (2) /* Static Memory Bank 2 */
78#define _StMemBnk3 _StMemBnk (3) /* Static Memory Bank 3 */
wdenk3b58acd2002-03-27 13:48:44 +000079
80#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +020081typedef Quad StMemBnkType [StMemBnkSp/sizeof (Quad)] ;
82#define StMemBnk /* Static Memory Bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +000083 ((StMemBnkType *) io_p2v (_StMemBnk (0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +020084#define StMemBnk0 (StMemBnk [0]) /* Static Memory Bank 0 */
85#define StMemBnk1 (StMemBnk [1]) /* Static Memory Bank 1 */
86#define StMemBnk2 (StMemBnk [2]) /* Static Memory Bank 2 */
87#define StMemBnk3 (StMemBnk [3]) /* Static Memory Bank 3 */
wdenk3b58acd2002-03-27 13:48:44 +000088#endif /* LANGUAGE == C */
89
Wolfgang Denk53677ef2008-05-20 16:00:29 +020090#define _DRAMBnk(Nb) /* DRAM Bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +000091 (0xC0000000 + (Nb)*DRAMBnkSp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +020092#define _DRAMBnk0 _DRAMBnk (0) /* DRAM Bank 0 */
93#define _DRAMBnk1 _DRAMBnk (1) /* DRAM Bank 1 */
94#define _DRAMBnk2 _DRAMBnk (2) /* DRAM Bank 2 */
95#define _DRAMBnk3 _DRAMBnk (3) /* DRAM Bank 3 */
wdenk3b58acd2002-03-27 13:48:44 +000096
97#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +020098typedef Quad DRAMBnkType [DRAMBnkSp/sizeof (Quad)] ;
99#define DRAMBnk /* DRAM Bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000100 ((DRAMBnkType *) io_p2v (_DRAMBnk (0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200101#define DRAMBnk0 (DRAMBnk [0]) /* DRAM Bank 0 */
102#define DRAMBnk1 (DRAMBnk [1]) /* DRAM Bank 1 */
103#define DRAMBnk2 (DRAMBnk [2]) /* DRAM Bank 2 */
104#define DRAMBnk3 (DRAMBnk [3]) /* DRAM Bank 3 */
wdenk3b58acd2002-03-27 13:48:44 +0000105#endif /* LANGUAGE == C */
106
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200107#define _ZeroMem 0xE0000000 /* Zero Memory bank */
wdenk3b58acd2002-03-27 13:48:44 +0000108
109#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200110typedef Quad ZeroMemType [ZeroMemSp/sizeof (Quad)] ;
111#define ZeroMem /* Zero Memory bank */ \
wdenk8bde7f72003-06-27 21:31:46 +0000112 (*((ZeroMemType *) io_p2v (_ZeroMem)))
wdenk3b58acd2002-03-27 13:48:44 +0000113#endif /* LANGUAGE == C */
114
115
116/*
117 * Personal Computer Memory Card International Association (PCMCIA) sockets
118 */
119
120#define PCMCIAPrtSp 0x04000000 /* PCMCIA Partition Space [byte] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200121#define PCMCIASp (4*PCMCIAPrtSp) /* PCMCIA Space [byte] */
122#define PCMCIAIOSp PCMCIAPrtSp /* PCMCIA I/O Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +0000123#define PCMCIAAttrSp PCMCIAPrtSp /* PCMCIA Attribute Space [byte] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200124#define PCMCIAMemSp PCMCIAPrtSp /* PCMCIA Memory Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +0000125
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200126#define PCMCIA0Sp PCMCIASp /* PCMCIA 0 Space [byte] */
127#define PCMCIA0IOSp PCMCIAIOSp /* PCMCIA 0 I/O Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +0000128#define PCMCIA0AttrSp PCMCIAAttrSp /* PCMCIA 0 Attribute Space [byte] */
129#define PCMCIA0MemSp PCMCIAMemSp /* PCMCIA 0 Memory Space [byte] */
130
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200131#define PCMCIA1Sp PCMCIASp /* PCMCIA 1 Space [byte] */
132#define PCMCIA1IOSp PCMCIAIOSp /* PCMCIA 1 I/O Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +0000133#define PCMCIA1AttrSp PCMCIAAttrSp /* PCMCIA 1 Attribute Space [byte] */
134#define PCMCIA1MemSp PCMCIAMemSp /* PCMCIA 1 Memory Space [byte] */
135
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200136#define _PCMCIA(Nb) /* PCMCIA [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000137 (0x20000000 + (Nb)*PCMCIASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200138#define _PCMCIAIO(Nb) _PCMCIA (Nb) /* PCMCIA I/O [0..1] */
139#define _PCMCIAAttr(Nb) /* PCMCIA Attribute [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000140 (_PCMCIA (Nb) + 2*PCMCIAPrtSp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200141#define _PCMCIAMem(Nb) /* PCMCIA Memory [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000142 (_PCMCIA (Nb) + 3*PCMCIAPrtSp)
wdenk3b58acd2002-03-27 13:48:44 +0000143
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200144#define _PCMCIA0 _PCMCIA (0) /* PCMCIA 0 */
145#define _PCMCIA0IO _PCMCIAIO (0) /* PCMCIA 0 I/O */
146#define _PCMCIA0Attr _PCMCIAAttr (0) /* PCMCIA 0 Attribute */
147#define _PCMCIA0Mem _PCMCIAMem (0) /* PCMCIA 0 Memory */
wdenk3b58acd2002-03-27 13:48:44 +0000148
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200149#define _PCMCIA1 _PCMCIA (1) /* PCMCIA 1 */
150#define _PCMCIA1IO _PCMCIAIO (1) /* PCMCIA 1 I/O */
151#define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
152#define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */
wdenk3b58acd2002-03-27 13:48:44 +0000153
154#if LANGUAGE == C
155
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200156typedef Quad PCMCIAPrtType [PCMCIAPrtSp/sizeof (Quad)] ;
wdenk3b58acd2002-03-27 13:48:44 +0000157typedef PCMCIAPrtType PCMCIAType [PCMCIASp/PCMCIAPrtSp] ;
158
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200159#define PCMCIA0 /* PCMCIA 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000160 (*((PCMCIAType *) io_p2v (_PCMCIA0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200161#define PCMCIA0IO /* PCMCIA 0 I/O */ \
wdenk8bde7f72003-06-27 21:31:46 +0000162 (*((PCMCIAPrtType *) io_p2v (_PCMCIA0IO)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200163#define PCMCIA0Attr /* PCMCIA 0 Attribute */ \
wdenk8bde7f72003-06-27 21:31:46 +0000164 (*((PCMCIAPrtType *) io_p2v (_PCMCIA0Attr)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200165#define PCMCIA0Mem /* PCMCIA 0 Memory */ \
wdenk8bde7f72003-06-27 21:31:46 +0000166 (*((PCMCIAPrtType *) io_p2v (_PCMCIA0Mem)))
wdenk3b58acd2002-03-27 13:48:44 +0000167
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200168#define PCMCIA1 /* PCMCIA 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000169 (*((PCMCIAType *) io_p2v (_PCMCIA1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200170#define PCMCIA1IO /* PCMCIA 1 I/O */ \
wdenk8bde7f72003-06-27 21:31:46 +0000171 (*((PCMCIAPrtType *) io_p2v (_PCMCIA1IO)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200172#define PCMCIA1Attr /* PCMCIA 1 Attribute */ \
wdenk8bde7f72003-06-27 21:31:46 +0000173 (*((PCMCIAPrtType *) io_p2v (_PCMCIA1Attr)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200174#define PCMCIA1Mem /* PCMCIA 1 Memory */ \
wdenk8bde7f72003-06-27 21:31:46 +0000175 (*((PCMCIAPrtType *) io_p2v (_PCMCIA1Mem)))
wdenk3b58acd2002-03-27 13:48:44 +0000176
177#endif /* LANGUAGE == C */
178
179
180/*
181 * Universal Serial Bus (USB) Device Controller (UDC) control registers
182 *
183 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200184 * Ser0UDCCR Serial port 0 Universal Serial Bus (USB) Device
185 * Controller (UDC) Control Register (read/write).
186 * Ser0UDCAR Serial port 0 Universal Serial Bus (USB) Device
187 * Controller (UDC) Address Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000188 * Ser0UDCOMP Serial port 0 Universal Serial Bus (USB) Device
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200189 * Controller (UDC) Output Maximum Packet size register
190 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000191 * Ser0UDCIMP Serial port 0 Universal Serial Bus (USB) Device
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200192 * Controller (UDC) Input Maximum Packet size register
193 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000194 * Ser0UDCCS0 Serial port 0 Universal Serial Bus (USB) Device
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200195 * Controller (UDC) Control/Status register end-point 0
196 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000197 * Ser0UDCCS1 Serial port 0 Universal Serial Bus (USB) Device
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200198 * Controller (UDC) Control/Status register end-point 1
199 * (output, read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000200 * Ser0UDCCS2 Serial port 0 Universal Serial Bus (USB) Device
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200201 * Controller (UDC) Control/Status register end-point 2
202 * (input, read/write).
203 * Ser0UDCD0 Serial port 0 Universal Serial Bus (USB) Device
204 * Controller (UDC) Data register end-point 0
205 * (read/write).
206 * Ser0UDCWC Serial port 0 Universal Serial Bus (USB) Device
207 * Controller (UDC) Write Count register end-point 0
208 * (read).
209 * Ser0UDCDR Serial port 0 Universal Serial Bus (USB) Device
210 * Controller (UDC) Data Register (read/write).
211 * Ser0UDCSR Serial port 0 Universal Serial Bus (USB) Device
212 * Controller (UDC) Status Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000213 */
214
215#define _Ser0UDCCR 0x80000000 /* Ser. port 0 UDC Control Reg. */
216#define _Ser0UDCAR 0x80000004 /* Ser. port 0 UDC Address Reg. */
217#define _Ser0UDCOMP 0x80000008 /* Ser. port 0 UDC Output Maximum */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200218 /* Packet size reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000219#define _Ser0UDCIMP 0x8000000C /* Ser. port 0 UDC Input Maximum */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200220 /* Packet size reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000221#define _Ser0UDCCS0 0x80000010 /* Ser. port 0 UDC Control/Status */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200222 /* reg. end-point 0 */
wdenk3b58acd2002-03-27 13:48:44 +0000223#define _Ser0UDCCS1 0x80000014 /* Ser. port 0 UDC Control/Status */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200224 /* reg. end-point 1 (output) */
wdenk3b58acd2002-03-27 13:48:44 +0000225#define _Ser0UDCCS2 0x80000018 /* Ser. port 0 UDC Control/Status */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200226 /* reg. end-point 2 (input) */
227#define _Ser0UDCD0 0x8000001C /* Ser. port 0 UDC Data reg. */
228 /* end-point 0 */
229#define _Ser0UDCWC 0x80000020 /* Ser. port 0 UDC Write Count */
230 /* reg. end-point 0 */
231#define _Ser0UDCDR 0x80000028 /* Ser. port 0 UDC Data Reg. */
232#define _Ser0UDCSR 0x80000030 /* Ser. port 0 UDC Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000233
234#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200235#define Ser0UDCCR /* Ser. port 0 UDC Control Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000236 (*((volatile Word *) io_p2v (_Ser0UDCCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200237#define Ser0UDCAR /* Ser. port 0 UDC Address Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000238 (*((volatile Word *) io_p2v (_Ser0UDCAR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200239#define Ser0UDCOMP /* Ser. port 0 UDC Output Maximum */ \
240 /* Packet size reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000241 (*((volatile Word *) io_p2v (_Ser0UDCOMP)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200242#define Ser0UDCIMP /* Ser. port 0 UDC Input Maximum */ \
243 /* Packet size reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000244 (*((volatile Word *) io_p2v (_Ser0UDCIMP)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200245#define Ser0UDCCS0 /* Ser. port 0 UDC Control/Status */ \
246 /* reg. end-point 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000247 (*((volatile Word *) io_p2v (_Ser0UDCCS0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200248#define Ser0UDCCS1 /* Ser. port 0 UDC Control/Status */ \
249 /* reg. end-point 1 (output) */ \
wdenk8bde7f72003-06-27 21:31:46 +0000250 (*((volatile Word *) io_p2v (_Ser0UDCCS1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200251#define Ser0UDCCS2 /* Ser. port 0 UDC Control/Status */ \
252 /* reg. end-point 2 (input) */ \
wdenk8bde7f72003-06-27 21:31:46 +0000253 (*((volatile Word *) io_p2v (_Ser0UDCCS2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200254#define Ser0UDCD0 /* Ser. port 0 UDC Data reg. */ \
255 /* end-point 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000256 (*((volatile Word *) io_p2v (_Ser0UDCD0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200257#define Ser0UDCWC /* Ser. port 0 UDC Write Count */ \
258 /* reg. end-point 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000259 (*((volatile Word *) io_p2v (_Ser0UDCWC)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200260#define Ser0UDCDR /* Ser. port 0 UDC Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000261 (*((volatile Word *) io_p2v (_Ser0UDCDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200262#define Ser0UDCSR /* Ser. port 0 UDC Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000263 (*((volatile Word *) io_p2v (_Ser0UDCSR)))
wdenk3b58acd2002-03-27 13:48:44 +0000264#endif /* LANGUAGE == C */
265
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200266#define UDCCR_UDD 0x00000001 /* UDC Disable */
267#define UDCCR_UDA 0x00000002 /* UDC Active (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000268#define UDCCR_RESIM 0x00000004 /* Resume Interrupt Mask, per errata */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200269#define UDCCR_EIM 0x00000008 /* End-point 0 Interrupt Mask */
270 /* (disable) */
271#define UDCCR_RIM 0x00000010 /* Receive Interrupt Mask */
272 /* (disable) */
273#define UDCCR_TIM 0x00000020 /* Transmit Interrupt Mask */
274 /* (disable) */
wdenk3b58acd2002-03-27 13:48:44 +0000275#define UDCCR_SRM 0x00000040 /* Suspend/Resume interrupt Mask */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200276 /* (disable) */
wdenk3b58acd2002-03-27 13:48:44 +0000277#define UDCCR_SUSIM UDCCR_SRM /* Per errata, SRM just masks suspend */
278#define UDCCR_REM 0x00000080 /* REset interrupt Mask (disable) */
279
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200280#define UDCAR_ADD Fld (7, 0) /* function ADDress */
wdenk3b58acd2002-03-27 13:48:44 +0000281
282#define UDCOMP_OUTMAXP Fld (8, 0) /* OUTput MAXimum Packet size - 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200283 /* [byte] */
284#define UDCOMP_OutMaxPkt(Size) /* Output Maximum Packet size */ \
285 /* [1..256 byte] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000286 (((Size) - 1) << FShft (UDCOMP_OUTMAXP))
wdenk3b58acd2002-03-27 13:48:44 +0000287
288#define UDCIMP_INMAXP Fld (8, 0) /* INput MAXimum Packet size - 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200289 /* [byte] */
290#define UDCIMP_InMaxPkt(Size) /* Input Maximum Packet size */ \
291 /* [1..256 byte] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000292 (((Size) - 1) << FShft (UDCIMP_INMAXP))
wdenk3b58acd2002-03-27 13:48:44 +0000293
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200294#define UDCCS0_OPR 0x00000001 /* Output Packet Ready (read) */
295#define UDCCS0_IPR 0x00000002 /* Input Packet Ready */
296#define UDCCS0_SST 0x00000004 /* Sent STall */
297#define UDCCS0_FST 0x00000008 /* Force STall */
298#define UDCCS0_DE 0x00000010 /* Data End */
299#define UDCCS0_SE 0x00000020 /* Setup End (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000300#define UDCCS0_SO 0x00000040 /* Serviced Output packet ready */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200301 /* (write) */
302#define UDCCS0_SSE 0x00000080 /* Serviced Setup End (write) */
wdenk3b58acd2002-03-27 13:48:44 +0000303
304#define UDCCS1_RFS 0x00000001 /* Receive FIFO 12-bytes or more */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200305 /* Service request (read) */
306#define UDCCS1_RPC 0x00000002 /* Receive Packet Complete */
307#define UDCCS1_RPE 0x00000004 /* Receive Packet Error (read) */
308#define UDCCS1_SST 0x00000008 /* Sent STall */
309#define UDCCS1_FST 0x00000010 /* Force STall */
wdenk3b58acd2002-03-27 13:48:44 +0000310#define UDCCS1_RNE 0x00000020 /* Receive FIFO Not Empty (read) */
311
312#define UDCCS2_TFS 0x00000001 /* Transmit FIFO 8-bytes or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200313 /* Service request (read) */
314#define UDCCS2_TPC 0x00000002 /* Transmit Packet Complete */
wdenk3b58acd2002-03-27 13:48:44 +0000315#define UDCCS2_TPE 0x00000004 /* Transmit Packet Error (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200316#define UDCCS2_TUR 0x00000008 /* Transmit FIFO Under-Run */
317#define UDCCS2_SST 0x00000010 /* Sent STall */
318#define UDCCS2_FST 0x00000020 /* Force STall */
wdenk3b58acd2002-03-27 13:48:44 +0000319
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200320#define UDCD0_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
wdenk3b58acd2002-03-27 13:48:44 +0000321
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200322#define UDCWC_WC Fld (4, 0) /* Write Count */
wdenk3b58acd2002-03-27 13:48:44 +0000323
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200324#define UDCDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
wdenk3b58acd2002-03-27 13:48:44 +0000325
326#define UDCSR_EIR 0x00000001 /* End-point 0 Interrupt Request */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200327#define UDCSR_RIR 0x00000002 /* Receive Interrupt Request */
328#define UDCSR_TIR 0x00000004 /* Transmit Interrupt Request */
329#define UDCSR_SUSIR 0x00000008 /* SUSpend Interrupt Request */
330#define UDCSR_RESIR 0x00000010 /* RESume Interrupt Request */
331#define UDCSR_RSTIR 0x00000020 /* ReSeT Interrupt Request */
wdenk3b58acd2002-03-27 13:48:44 +0000332
333
334/*
335 * Universal Asynchronous Receiver/Transmitter (UART) control registers
336 *
337 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200338 * Ser1UTCR0 Serial port 1 Universal Asynchronous
339 * Receiver/Transmitter (UART) Control Register 0
340 * (read/write).
341 * Ser1UTCR1 Serial port 1 Universal Asynchronous
342 * Receiver/Transmitter (UART) Control Register 1
343 * (read/write).
344 * Ser1UTCR2 Serial port 1 Universal Asynchronous
345 * Receiver/Transmitter (UART) Control Register 2
346 * (read/write).
347 * Ser1UTCR3 Serial port 1 Universal Asynchronous
348 * Receiver/Transmitter (UART) Control Register 3
349 * (read/write).
350 * Ser1UTDR Serial port 1 Universal Asynchronous
351 * Receiver/Transmitter (UART) Data Register
352 * (read/write).
353 * Ser1UTSR0 Serial port 1 Universal Asynchronous
354 * Receiver/Transmitter (UART) Status Register 0
355 * (read/write).
356 * Ser1UTSR1 Serial port 1 Universal Asynchronous
357 * Receiver/Transmitter (UART) Status Register 1 (read).
wdenk3b58acd2002-03-27 13:48:44 +0000358 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200359 * Ser2UTCR0 Serial port 2 Universal Asynchronous
360 * Receiver/Transmitter (UART) Control Register 0
361 * (read/write).
362 * Ser2UTCR1 Serial port 2 Universal Asynchronous
363 * Receiver/Transmitter (UART) Control Register 1
364 * (read/write).
365 * Ser2UTCR2 Serial port 2 Universal Asynchronous
366 * Receiver/Transmitter (UART) Control Register 2
367 * (read/write).
368 * Ser2UTCR3 Serial port 2 Universal Asynchronous
369 * Receiver/Transmitter (UART) Control Register 3
370 * (read/write).
371 * Ser2UTCR4 Serial port 2 Universal Asynchronous
372 * Receiver/Transmitter (UART) Control Register 4
373 * (read/write).
374 * Ser2UTDR Serial port 2 Universal Asynchronous
375 * Receiver/Transmitter (UART) Data Register
376 * (read/write).
377 * Ser2UTSR0 Serial port 2 Universal Asynchronous
378 * Receiver/Transmitter (UART) Status Register 0
379 * (read/write).
380 * Ser2UTSR1 Serial port 2 Universal Asynchronous
381 * Receiver/Transmitter (UART) Status Register 1 (read).
wdenk3b58acd2002-03-27 13:48:44 +0000382 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200383 * Ser3UTCR0 Serial port 3 Universal Asynchronous
384 * Receiver/Transmitter (UART) Control Register 0
385 * (read/write).
386 * Ser3UTCR1 Serial port 3 Universal Asynchronous
387 * Receiver/Transmitter (UART) Control Register 1
388 * (read/write).
389 * Ser3UTCR2 Serial port 3 Universal Asynchronous
390 * Receiver/Transmitter (UART) Control Register 2
391 * (read/write).
392 * Ser3UTCR3 Serial port 3 Universal Asynchronous
393 * Receiver/Transmitter (UART) Control Register 3
394 * (read/write).
395 * Ser3UTDR Serial port 3 Universal Asynchronous
396 * Receiver/Transmitter (UART) Data Register
397 * (read/write).
398 * Ser3UTSR0 Serial port 3 Universal Asynchronous
399 * Receiver/Transmitter (UART) Status Register 0
400 * (read/write).
401 * Ser3UTSR1 Serial port 3 Universal Asynchronous
402 * Receiver/Transmitter (UART) Status Register 1 (read).
wdenk3b58acd2002-03-27 13:48:44 +0000403 *
404 * Clocks
405 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200406 * or 3.5795 MHz).
407 * fua, Tua Frequency, period of the UART communication.
wdenk3b58acd2002-03-27 13:48:44 +0000408 */
409
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200410#define _UTCR0(Nb) /* UART Control Reg. 0 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000411 (0x80010000 + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200412#define _UTCR1(Nb) /* UART Control Reg. 1 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000413 (0x80010004 + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200414#define _UTCR2(Nb) /* UART Control Reg. 2 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000415 (0x80010008 + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200416#define _UTCR3(Nb) /* UART Control Reg. 3 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000417 (0x8001000C + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200418#define _UTCR4(Nb) /* UART Control Reg. 4 [2] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000419 (0x80010010 + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200420#define _UTDR(Nb) /* UART Data Reg. [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000421 (0x80010014 + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200422#define _UTSR0(Nb) /* UART Status Reg. 0 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000423 (0x8001001C + ((Nb) - 1)*0x00020000)
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200424#define _UTSR1(Nb) /* UART Status Reg. 1 [1..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000425 (0x80010020 + ((Nb) - 1)*0x00020000)
wdenk3b58acd2002-03-27 13:48:44 +0000426
427#define _Ser1UTCR0 _UTCR0 (1) /* Ser. port 1 UART Control Reg. 0 */
428#define _Ser1UTCR1 _UTCR1 (1) /* Ser. port 1 UART Control Reg. 1 */
429#define _Ser1UTCR2 _UTCR2 (1) /* Ser. port 1 UART Control Reg. 2 */
430#define _Ser1UTCR3 _UTCR3 (1) /* Ser. port 1 UART Control Reg. 3 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200431#define _Ser1UTDR _UTDR (1) /* Ser. port 1 UART Data Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000432#define _Ser1UTSR0 _UTSR0 (1) /* Ser. port 1 UART Status Reg. 0 */
433#define _Ser1UTSR1 _UTSR1 (1) /* Ser. port 1 UART Status Reg. 1 */
434
435#define _Ser2UTCR0 _UTCR0 (2) /* Ser. port 2 UART Control Reg. 0 */
436#define _Ser2UTCR1 _UTCR1 (2) /* Ser. port 2 UART Control Reg. 1 */
437#define _Ser2UTCR2 _UTCR2 (2) /* Ser. port 2 UART Control Reg. 2 */
438#define _Ser2UTCR3 _UTCR3 (2) /* Ser. port 2 UART Control Reg. 3 */
439#define _Ser2UTCR4 _UTCR4 (2) /* Ser. port 2 UART Control Reg. 4 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200440#define _Ser2UTDR _UTDR (2) /* Ser. port 2 UART Data Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000441#define _Ser2UTSR0 _UTSR0 (2) /* Ser. port 2 UART Status Reg. 0 */
442#define _Ser2UTSR1 _UTSR1 (2) /* Ser. port 2 UART Status Reg. 1 */
443
444#define _Ser3UTCR0 _UTCR0 (3) /* Ser. port 3 UART Control Reg. 0 */
445#define _Ser3UTCR1 _UTCR1 (3) /* Ser. port 3 UART Control Reg. 1 */
446#define _Ser3UTCR2 _UTCR2 (3) /* Ser. port 3 UART Control Reg. 2 */
447#define _Ser3UTCR3 _UTCR3 (3) /* Ser. port 3 UART Control Reg. 3 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200448#define _Ser3UTDR _UTDR (3) /* Ser. port 3 UART Data Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000449#define _Ser3UTSR0 _UTSR0 (3) /* Ser. port 3 UART Status Reg. 0 */
450#define _Ser3UTSR1 _UTSR1 (3) /* Ser. port 3 UART Status Reg. 1 */
451
452#if LANGUAGE == C
453
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200454#define Ser1UTCR0 /* Ser. port 1 UART Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000455 (*((volatile Word *) io_p2v (_Ser1UTCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200456#define Ser1UTCR1 /* Ser. port 1 UART Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000457 (*((volatile Word *) io_p2v (_Ser1UTCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200458#define Ser1UTCR2 /* Ser. port 1 UART Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000459 (*((volatile Word *) io_p2v (_Ser1UTCR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200460#define Ser1UTCR3 /* Ser. port 1 UART Control Reg. 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000461 (*((volatile Word *) io_p2v (_Ser1UTCR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200462#define Ser1UTDR /* Ser. port 1 UART Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000463 (*((volatile Word *) io_p2v (_Ser1UTDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200464#define Ser1UTSR0 /* Ser. port 1 UART Status Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000465 (*((volatile Word *) io_p2v (_Ser1UTSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200466#define Ser1UTSR1 /* Ser. port 1 UART Status Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000467 (*((volatile Word *) io_p2v (_Ser1UTSR1)))
wdenk3b58acd2002-03-27 13:48:44 +0000468
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200469#define Ser2UTCR0 /* Ser. port 2 UART Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000470 (*((volatile Word *) io_p2v (_Ser2UTCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200471#define Ser2UTCR1 /* Ser. port 2 UART Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000472 (*((volatile Word *) io_p2v (_Ser2UTCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200473#define Ser2UTCR2 /* Ser. port 2 UART Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000474 (*((volatile Word *) io_p2v (_Ser2UTCR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200475#define Ser2UTCR3 /* Ser. port 2 UART Control Reg. 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000476 (*((volatile Word *) io_p2v (_Ser2UTCR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200477#define Ser2UTCR4 /* Ser. port 2 UART Control Reg. 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000478 (*((volatile Word *) io_p2v (_Ser2UTCR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200479#define Ser2UTDR /* Ser. port 2 UART Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000480 (*((volatile Word *) io_p2v (_Ser2UTDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200481#define Ser2UTSR0 /* Ser. port 2 UART Status Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000482 (*((volatile Word *) io_p2v (_Ser2UTSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200483#define Ser2UTSR1 /* Ser. port 2 UART Status Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000484 (*((volatile Word *) io_p2v (_Ser2UTSR1)))
wdenk3b58acd2002-03-27 13:48:44 +0000485
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200486#define Ser3UTCR0 /* Ser. port 3 UART Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000487 (*((volatile Word *) io_p2v (_Ser3UTCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200488#define Ser3UTCR1 /* Ser. port 3 UART Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000489 (*((volatile Word *) io_p2v (_Ser3UTCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200490#define Ser3UTCR2 /* Ser. port 3 UART Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000491 (*((volatile Word *) io_p2v (_Ser3UTCR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200492#define Ser3UTCR3 /* Ser. port 3 UART Control Reg. 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000493 (*((volatile Word *) io_p2v (_Ser3UTCR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200494#define Ser3UTDR /* Ser. port 3 UART Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000495 (*((volatile Word *) io_p2v (_Ser3UTDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200496#define Ser3UTSR0 /* Ser. port 3 UART Status Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000497 (*((volatile Word *) io_p2v (_Ser3UTSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200498#define Ser3UTSR1 /* Ser. port 3 UART Status Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000499 (*((volatile Word *) io_p2v (_Ser3UTSR1)))
wdenk3b58acd2002-03-27 13:48:44 +0000500
501#elif LANGUAGE == Assembly
502#define Ser1UTCR0 ( io_p2v (_Ser1UTCR0))
503#define Ser1UTCR1 ( io_p2v (_Ser1UTCR1))
504#define Ser1UTCR2 ( io_p2v (_Ser1UTCR2))
505#define Ser1UTCR3 ( io_p2v (_Ser1UTCR3))
506#define Ser1UTDR ( io_p2v (_Ser1UTDR))
507#define Ser1UTSR0 ( io_p2v (_Ser1UTSR0))
508#define Ser1UTSR1 ( io_p2v (_Ser1UTSR1))
509
510#define Ser2UTCR0 ( io_p2v (_Ser2UTCR0))
511#define Ser2UTCR1 ( io_p2v (_Ser2UTCR1))
512#define Ser2UTCR2 ( io_p2v (_Ser2UTCR2))
513#define Ser2UTCR3 ( io_p2v (_Ser2UTCR3))
514#define Ser2UTCR4 ( io_p2v (_Ser2UTCR4))
515#define Ser2UTDR ( io_p2v (_Ser2UTDR))
516#define Ser2UTSR0 ( io_p2v (_Ser2UTSR0))
517#define Ser2UTSR1 ( io_p2v (_Ser2UTSR1))
518
519#define Ser3UTCR0 ( io_p2v (_Ser3UTCR0))
520#define Ser3UTCR1 ( io_p2v (_Ser3UTCR1))
521#define Ser3UTCR2 ( io_p2v (_Ser3UTCR2))
522#define Ser3UTCR3 ( io_p2v (_Ser3UTCR3))
523#define Ser3UTDR ( io_p2v (_Ser3UTDR))
524#define Ser3UTSR0 ( io_p2v (_Ser3UTSR0))
525#define Ser3UTSR1 ( io_p2v (_Ser3UTSR1))
526
527#endif /* LANGUAGE == C */
528
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200529#define UTCR0_PE 0x00000001 /* Parity Enable */
530#define UTCR0_OES 0x00000002 /* Odd/Even parity Select */
531#define UTCR0_OddPar (UTCR0_OES*0) /* Odd Parity */
532#define UTCR0_EvenPar (UTCR0_OES*1) /* Even Parity */
533#define UTCR0_SBS 0x00000004 /* Stop Bit Select */
534#define UTCR0_1StpBit (UTCR0_SBS*0) /* 1 Stop Bit per frame */
535#define UTCR0_2StpBit (UTCR0_SBS*1) /* 2 Stop Bits per frame */
536#define UTCR0_DSS 0x00000008 /* Data Size Select */
537#define UTCR0_7BitData (UTCR0_DSS*0) /* 7-Bit Data */
538#define UTCR0_8BitData (UTCR0_DSS*1) /* 8-Bit Data */
539#define UTCR0_SCE 0x00000010 /* Sample Clock Enable */
540 /* (ser. port 1: GPIO [18], */
541 /* ser. port 3: GPIO [20]) */
542#define UTCR0_RCE 0x00000020 /* Receive Clock Edge select */
543#define UTCR0_RcRsEdg (UTCR0_RCE*0) /* Receive clock Rising-Edge */
544#define UTCR0_RcFlEdg (UTCR0_RCE*1) /* Receive clock Falling-Edge */
545#define UTCR0_TCE 0x00000040 /* Transmit Clock Edge select */
546#define UTCR0_TrRsEdg (UTCR0_TCE*0) /* Transmit clock Rising-Edge */
wdenk3b58acd2002-03-27 13:48:44 +0000547#define UTCR0_TrFlEdg (UTCR0_TCE*1) /* Transmit clock Falling-Edge */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200548#define UTCR0_Ser2IrDA /* Ser. port 2 IrDA settings */ \
wdenk8bde7f72003-06-27 21:31:46 +0000549 (UTCR0_1StpBit + UTCR0_8BitData)
wdenk3b58acd2002-03-27 13:48:44 +0000550
551#define UTCR1_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
552#define UTCR2_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
wdenk8bde7f72003-06-27 21:31:46 +0000553 /* fua = fxtl/(16*(BRD[11:0] + 1)) */
554 /* Tua = 16*(BRD [11:0] + 1)*Txtl */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200555#define UTCR1_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000556 (((Div) - 16)/16 >> FSize (UTCR2_BRD) << \
557 FShft (UTCR1_BRD))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200558#define UTCR2_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000559 (((Div) - 16)/16 & FAlnMsk (UTCR2_BRD) << \
560 FShft (UTCR2_BRD))
561 /* fua = fxtl/(16*Floor (Div/16)) */
562 /* Tua = 16*Floor (Div/16)*Txtl */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200563#define UTCR1_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000564 (((Div) - 1)/16 >> FSize (UTCR2_BRD) << \
565 FShft (UTCR1_BRD))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200566#define UTCR2_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000567 (((Div) - 1)/16 & FAlnMsk (UTCR2_BRD) << \
568 FShft (UTCR2_BRD))
569 /* fua = fxtl/(16*Ceil (Div/16)) */
570 /* Tua = 16*Ceil (Div/16)*Txtl */
wdenk3b58acd2002-03-27 13:48:44 +0000571
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200572#define UTCR3_RXE 0x00000001 /* Receive Enable */
573#define UTCR3_TXE 0x00000002 /* Transmit Enable */
574#define UTCR3_BRK 0x00000004 /* BReaK mode */
wdenk3b58acd2002-03-27 13:48:44 +0000575#define UTCR3_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200576 /* more Interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000577#define UTCR3_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200578 /* Interrupt Enable */
579#define UTCR3_LBM 0x00000020 /* Look-Back Mode */
580#define UTCR3_Ser2IrDA /* Ser. port 2 IrDA settings (RIE, */ \
wdenk8bde7f72003-06-27 21:31:46 +0000581 /* TIE, LBM can be set or cleared) */ \
582 (UTCR3_RXE + UTCR3_TXE)
wdenk3b58acd2002-03-27 13:48:44 +0000583
584#define UTCR4_HSE 0x00000001 /* Hewlett-Packard Serial InfraRed */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200585 /* (HP-SIR) modulation Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000586#define UTCR4_NRZ (UTCR4_HSE*0) /* Non-Return to Zero modulation */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200587#define UTCR4_HPSIR (UTCR4_HSE*1) /* HP-SIR modulation */
588#define UTCR4_LPM 0x00000002 /* Low-Power Mode */
589#define UTCR4_Z3_16Bit (UTCR4_LPM*0) /* Zero pulse = 3/16 Bit time */
590#define UTCR4_Z1_6us (UTCR4_LPM*1) /* Zero pulse = 1.6 us */
wdenk3b58acd2002-03-27 13:48:44 +0000591
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200592#define UTDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
593#if 0 /* Hidden receive FIFO bits */
wdenk3b58acd2002-03-27 13:48:44 +0000594#define UTDR_PRE 0x00000100 /* receive PaRity Error (read) */
595#define UTDR_FRE 0x00000200 /* receive FRaming Error (read) */
596#define UTDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
597#endif /* 0 */
598
599#define UTSR0_TFS 0x00000001 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200600 /* Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000601#define UTSR0_RFS 0x00000002 /* Receive FIFO 1/3-to-2/3-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200602 /* more Service request (read) */
603#define UTSR0_RID 0x00000004 /* Receiver IDle */
604#define UTSR0_RBB 0x00000008 /* Receive Beginning of Break */
605#define UTSR0_REB 0x00000010 /* Receive End of Break */
606#define UTSR0_EIF 0x00000020 /* Error In FIFO (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000607
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200608#define UTSR1_TBY 0x00000001 /* Transmitter BusY (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000609#define UTSR1_RNE 0x00000002 /* Receive FIFO Not Empty (read) */
610#define UTSR1_TNF 0x00000004 /* Transmit FIFO Not Full (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200611#define UTSR1_PRE 0x00000008 /* receive PaRity Error (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000612#define UTSR1_FRE 0x00000010 /* receive FRaming Error (read) */
613#define UTSR1_ROR 0x00000020 /* Receive FIFO Over-Run (read) */
614
615
616/*
617 * Synchronous Data Link Controller (SDLC) control registers
618 *
619 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200620 * Ser1SDCR0 Serial port 1 Synchronous Data Link Controller (SDLC)
621 * Control Register 0 (read/write).
622 * Ser1SDCR1 Serial port 1 Synchronous Data Link Controller (SDLC)
623 * Control Register 1 (read/write).
624 * Ser1SDCR2 Serial port 1 Synchronous Data Link Controller (SDLC)
625 * Control Register 2 (read/write).
626 * Ser1SDCR3 Serial port 1 Synchronous Data Link Controller (SDLC)
627 * Control Register 3 (read/write).
628 * Ser1SDCR4 Serial port 1 Synchronous Data Link Controller (SDLC)
629 * Control Register 4 (read/write).
630 * Ser1SDDR Serial port 1 Synchronous Data Link Controller (SDLC)
631 * Data Register (read/write).
632 * Ser1SDSR0 Serial port 1 Synchronous Data Link Controller (SDLC)
633 * Status Register 0 (read/write).
634 * Ser1SDSR1 Serial port 1 Synchronous Data Link Controller (SDLC)
635 * Status Register 1 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +0000636 *
637 * Clocks
638 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200639 * or 3.5795 MHz).
640 * fsd, Tsd Frequency, period of the SDLC communication.
wdenk3b58acd2002-03-27 13:48:44 +0000641 */
642
643#define _Ser1SDCR0 0x80020060 /* Ser. port 1 SDLC Control Reg. 0 */
644#define _Ser1SDCR1 0x80020064 /* Ser. port 1 SDLC Control Reg. 1 */
645#define _Ser1SDCR2 0x80020068 /* Ser. port 1 SDLC Control Reg. 2 */
646#define _Ser1SDCR3 0x8002006C /* Ser. port 1 SDLC Control Reg. 3 */
647#define _Ser1SDCR4 0x80020070 /* Ser. port 1 SDLC Control Reg. 4 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200648#define _Ser1SDDR 0x80020078 /* Ser. port 1 SDLC Data Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000649#define _Ser1SDSR0 0x80020080 /* Ser. port 1 SDLC Status Reg. 0 */
650#define _Ser1SDSR1 0x80020084 /* Ser. port 1 SDLC Status Reg. 1 */
651
652#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200653#define Ser1SDCR0 /* Ser. port 1 SDLC Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000654 (*((volatile Word *) io_p2v (_Ser1SDCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200655#define Ser1SDCR1 /* Ser. port 1 SDLC Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000656 (*((volatile Word *) io_p2v (_Ser1SDCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200657#define Ser1SDCR2 /* Ser. port 1 SDLC Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000658 (*((volatile Word *) io_p2v (_Ser1SDCR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200659#define Ser1SDCR3 /* Ser. port 1 SDLC Control Reg. 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000660 (*((volatile Word *) io_p2v (_Ser1SDCR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200661#define Ser1SDCR4 /* Ser. port 1 SDLC Control Reg. 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000662 (*((volatile Word *) io_p2v (_Ser1SDCR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200663#define Ser1SDDR /* Ser. port 1 SDLC Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000664 (*((volatile Word *) io_p2v (_Ser1SDDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200665#define Ser1SDSR0 /* Ser. port 1 SDLC Status Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000666 (*((volatile Word *) io_p2v (_Ser1SDSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200667#define Ser1SDSR1 /* Ser. port 1 SDLC Status Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000668 (*((volatile Word *) io_p2v (_Ser1SDSR1)))
wdenk3b58acd2002-03-27 13:48:44 +0000669#endif /* LANGUAGE == C */
670
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200671#define SDCR0_SUS 0x00000001 /* SDLC/UART Select */
672#define SDCR0_SDLC (SDCR0_SUS*0) /* SDLC mode (TXD1 & RXD1) */
673#define SDCR0_UART (SDCR0_SUS*1) /* UART mode (TXD1 & RXD1) */
wdenk3b58acd2002-03-27 13:48:44 +0000674#define SDCR0_SDF 0x00000002 /* Single/Double start Flag select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200675#define SDCR0_SglFlg (SDCR0_SDF*0) /* Single start Flag */
676#define SDCR0_DblFlg (SDCR0_SDF*1) /* Double start Flag */
677#define SDCR0_LBM 0x00000004 /* Look-Back Mode */
678#define SDCR0_BMS 0x00000008 /* Bit Modulation Select */
679#define SDCR0_FM0 (SDCR0_BMS*0) /* Freq. Modulation zero (0) */
wdenk3b58acd2002-03-27 13:48:44 +0000680#define SDCR0_NRZ (SDCR0_BMS*1) /* Non-Return to Zero modulation */
681#define SDCR0_SCE 0x00000010 /* Sample Clock Enable (GPIO [16]) */
682#define SDCR0_SCD 0x00000020 /* Sample Clock Direction select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200683 /* (GPIO [16]) */
684#define SDCR0_SClkIn (SDCR0_SCD*0) /* Sample Clock Input */
685#define SDCR0_SClkOut (SDCR0_SCD*1) /* Sample Clock Output */
686#define SDCR0_RCE 0x00000040 /* Receive Clock Edge select */
687#define SDCR0_RcRsEdg (SDCR0_RCE*0) /* Receive clock Rising-Edge */
688#define SDCR0_RcFlEdg (SDCR0_RCE*1) /* Receive clock Falling-Edge */
689#define SDCR0_TCE 0x00000080 /* Transmit Clock Edge select */
690#define SDCR0_TrRsEdg (SDCR0_TCE*0) /* Transmit clock Rising-Edge */
wdenk3b58acd2002-03-27 13:48:44 +0000691#define SDCR0_TrFlEdg (SDCR0_TCE*1) /* Transmit clock Falling-Edge */
692
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200693#define SDCR1_AAF 0x00000001 /* Abort After Frame enable */
694 /* (GPIO [17]) */
695#define SDCR1_TXE 0x00000002 /* Transmit Enable */
696#define SDCR1_RXE 0x00000004 /* Receive Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000697#define SDCR1_RIE 0x00000008 /* Receive FIFO 1/3-to-2/3-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200698 /* more Interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000699#define SDCR1_TIE 0x00000010 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200700 /* Interrupt Enable */
701#define SDCR1_AME 0x00000020 /* Address Match Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000702#define SDCR1_TUS 0x00000040 /* Transmit FIFO Under-run Select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200703#define SDCR1_EFrmURn (SDCR1_TUS*0) /* End Frame on Under-Run */
704#define SDCR1_AbortURn (SDCR1_TUS*1) /* Abort on Under-Run */
wdenk3b58acd2002-03-27 13:48:44 +0000705#define SDCR1_RAE 0x00000080 /* Receive Abort interrupt Enable */
706
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200707#define SDCR2_AMV Fld (8, 0) /* Address Match Value */
wdenk3b58acd2002-03-27 13:48:44 +0000708
709#define SDCR3_BRD Fld (4, 0) /* Baud Rate Divisor/16 - 1 [11:8] */
710#define SDCR4_BRD Fld (8, 0) /* Baud Rate Divisor/16 - 1 [7:0] */
wdenk8bde7f72003-06-27 21:31:46 +0000711 /* fsd = fxtl/(16*(BRD[11:0] + 1)) */
712 /* Tsd = 16*(BRD[11:0] + 1)*Txtl */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200713#define SDCR3_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000714 (((Div) - 16)/16 >> FSize (SDCR4_BRD) << \
715 FShft (SDCR3_BRD))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200716#define SDCR4_BdRtDiv(Div) /* Baud Rate Divisor [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000717 (((Div) - 16)/16 & FAlnMsk (SDCR4_BRD) << \
718 FShft (SDCR4_BRD))
719 /* fsd = fxtl/(16*Floor (Div/16)) */
720 /* Tsd = 16*Floor (Div/16)*Txtl */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200721#define SDCR3_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000722 (((Div) - 1)/16 >> FSize (SDCR4_BRD) << \
723 FShft (SDCR3_BRD))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200724#define SDCR4_CeilBdRtDiv(Div) /* Ceil. of BdRtDiv [16..65536] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000725 (((Div) - 1)/16 & FAlnMsk (SDCR4_BRD) << \
726 FShft (SDCR4_BRD))
727 /* fsd = fxtl/(16*Ceil (Div/16)) */
728 /* Tsd = 16*Ceil (Div/16)*Txtl */
wdenk3b58acd2002-03-27 13:48:44 +0000729
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200730#define SDDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
731#if 0 /* Hidden receive FIFO bits */
wdenk3b58acd2002-03-27 13:48:44 +0000732#define SDDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200733#define SDDR_CRE 0x00000200 /* receive CRC Error (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000734#define SDDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
735#endif /* 0 */
736
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200737#define SDSR0_EIF 0x00000001 /* Error In FIFO (read) */
738#define SDSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
739#define SDSR0_RAB 0x00000004 /* Receive ABort */
wdenk3b58acd2002-03-27 13:48:44 +0000740#define SDSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200741 /* Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000742#define SDSR0_RFS 0x00000010 /* Receive FIFO 1/3-to-2/3-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200743 /* more Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000744
745#define SDSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200746#define SDSR1_TBY 0x00000002 /* Transmitter BusY (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000747#define SDSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
748#define SDSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200749#define SDSR1_RTD 0x00000010 /* Receive Transition Detected */
750#define SDSR1_EOF 0x00000020 /* receive End-Of-Frame (read) */
751#define SDSR1_CRE 0x00000040 /* receive CRC Error (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000752#define SDSR1_ROR 0x00000080 /* Receive FIFO Over-Run (read) */
753
754
755/*
756 * High-Speed Serial to Parallel controller (HSSP) control registers
757 *
758 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200759 * Ser2HSCR0 Serial port 2 High-Speed Serial to Parallel
760 * controller (HSSP) Control Register 0 (read/write).
761 * Ser2HSCR1 Serial port 2 High-Speed Serial to Parallel
762 * controller (HSSP) Control Register 1 (read/write).
763 * Ser2HSDR Serial port 2 High-Speed Serial to Parallel
764 * controller (HSSP) Data Register (read/write).
765 * Ser2HSSR0 Serial port 2 High-Speed Serial to Parallel
766 * controller (HSSP) Status Register 0 (read/write).
767 * Ser2HSSR1 Serial port 2 High-Speed Serial to Parallel
768 * controller (HSSP) Status Register 1 (read).
769 * Ser2HSCR2 Serial port 2 High-Speed Serial to Parallel
770 * controller (HSSP) Control Register 2 (read/write).
771 * [The HSCR2 register is only implemented in
772 * versions 2.0 (rev. = 8) and higher of the StrongARM
773 * SA-1100.]
wdenk3b58acd2002-03-27 13:48:44 +0000774 */
775
776#define _Ser2HSCR0 0x80040060 /* Ser. port 2 HSSP Control Reg. 0 */
777#define _Ser2HSCR1 0x80040064 /* Ser. port 2 HSSP Control Reg. 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200778#define _Ser2HSDR 0x8004006C /* Ser. port 2 HSSP Data Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000779#define _Ser2HSSR0 0x80040074 /* Ser. port 2 HSSP Status Reg. 0 */
780#define _Ser2HSSR1 0x80040078 /* Ser. port 2 HSSP Status Reg. 1 */
781#define _Ser2HSCR2 0x90060028 /* Ser. port 2 HSSP Control Reg. 2 */
782
783#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200784#define Ser2HSCR0 /* Ser. port 2 HSSP Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000785 (*((volatile Word *) io_p2v (_Ser2HSCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200786#define Ser2HSCR1 /* Ser. port 2 HSSP Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000787 (*((volatile Word *) io_p2v (_Ser2HSCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200788#define Ser2HSDR /* Ser. port 2 HSSP Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000789 (*((volatile Word *) io_p2v (_Ser2HSDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200790#define Ser2HSSR0 /* Ser. port 2 HSSP Status Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000791 (*((volatile Word *) io_p2v (_Ser2HSSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200792#define Ser2HSSR1 /* Ser. port 2 HSSP Status Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000793 (*((volatile Word *) io_p2v (_Ser2HSSR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200794#define Ser2HSCR2 /* Ser. port 2 HSSP Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000795 (*((volatile Word *) io_p2v (_Ser2HSCR2)))
wdenk3b58acd2002-03-27 13:48:44 +0000796#endif /* LANGUAGE == C */
797
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200798#define HSCR0_ITR 0x00000001 /* IrDA Transmission Rate */
wdenk3b58acd2002-03-27 13:48:44 +0000799#define HSCR0_UART (HSCR0_ITR*0) /* UART mode (115.2 kb/s if IrDA) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200800#define HSCR0_HSSP (HSCR0_ITR*1) /* HSSP mode (4 Mb/s) */
801#define HSCR0_LBM 0x00000002 /* Look-Back Mode */
wdenk3b58acd2002-03-27 13:48:44 +0000802#define HSCR0_TUS 0x00000004 /* Transmit FIFO Under-run Select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200803#define HSCR0_EFrmURn (HSCR0_TUS*0) /* End Frame on Under-Run */
804#define HSCR0_AbortURn (HSCR0_TUS*1) /* Abort on Under-Run */
805#define HSCR0_TXE 0x00000008 /* Transmit Enable */
806#define HSCR0_RXE 0x00000010 /* Receive Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000807#define HSCR0_RIE 0x00000020 /* Receive FIFO 2/5-to-3/5-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200808 /* more Interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000809#define HSCR0_TIE 0x00000040 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200810 /* Interrupt Enable */
811#define HSCR0_AME 0x00000080 /* Address Match Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000812
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200813#define HSCR1_AMV Fld (8, 0) /* Address Match Value */
wdenk3b58acd2002-03-27 13:48:44 +0000814
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200815#define HSDR_DATA Fld (8, 0) /* receive/transmit DATA FIFOs */
816#if 0 /* Hidden receive FIFO bits */
wdenk3b58acd2002-03-27 13:48:44 +0000817#define HSDR_EOF 0x00000100 /* receive End-Of-Frame (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200818#define HSDR_CRE 0x00000200 /* receive CRC Error (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000819#define HSDR_ROR 0x00000400 /* Receive FIFO Over-Run (read) */
820#endif /* 0 */
821
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200822#define HSSR0_EIF 0x00000001 /* Error In FIFO (read) */
823#define HSSR0_TUR 0x00000002 /* Transmit FIFO Under-Run */
824#define HSSR0_RAB 0x00000004 /* Receive ABort */
wdenk3b58acd2002-03-27 13:48:44 +0000825#define HSSR0_TFS 0x00000008 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200826 /* Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000827#define HSSR0_RFS 0x00000010 /* Receive FIFO 2/5-to-3/5-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200828 /* more Service request (read) */
829#define HSSR0_FRE 0x00000020 /* receive FRaming Error */
wdenk3b58acd2002-03-27 13:48:44 +0000830
831#define HSSR1_RSY 0x00000001 /* Receiver SYnchronized (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200832#define HSSR1_TBY 0x00000002 /* Transmitter BusY (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000833#define HSSR1_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
834#define HSSR1_TNF 0x00000008 /* Transmit FIFO Not Full (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200835#define HSSR1_EOF 0x00000010 /* receive End-Of-Frame (read) */
836#define HSSR1_CRE 0x00000020 /* receive CRC Error (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000837#define HSSR1_ROR 0x00000040 /* Receive FIFO Over-Run (read) */
838
839#define HSCR2_TXP 0x00040000 /* Transmit data Polarity (TXD_2) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200840#define HSCR2_TrDataL (HSCR2_TXP*0) /* Transmit Data active Low */
841 /* (inverted) */
842#define HSCR2_TrDataH (HSCR2_TXP*1) /* Transmit Data active High */
843 /* (non-inverted) */
wdenk3b58acd2002-03-27 13:48:44 +0000844#define HSCR2_RXP 0x00080000 /* Receive data Polarity (RXD_2) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200845#define HSCR2_RcDataL (HSCR2_RXP*0) /* Receive Data active Low */
846 /* (inverted) */
847#define HSCR2_RcDataH (HSCR2_RXP*1) /* Receive Data active High */
848 /* (non-inverted) */
wdenk3b58acd2002-03-27 13:48:44 +0000849
850
851/*
852 * Multi-media Communications Port (MCP) control registers
853 *
854 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200855 * Ser4MCCR0 Serial port 4 Multi-media Communications Port (MCP)
856 * Control Register 0 (read/write).
857 * Ser4MCDR0 Serial port 4 Multi-media Communications Port (MCP)
858 * Data Register 0 (audio, read/write).
859 * Ser4MCDR1 Serial port 4 Multi-media Communications Port (MCP)
860 * Data Register 1 (telecom, read/write).
861 * Ser4MCDR2 Serial port 4 Multi-media Communications Port (MCP)
862 * Data Register 2 (CODEC registers, read/write).
863 * Ser4MCSR Serial port 4 Multi-media Communications Port (MCP)
864 * Status Register (read/write).
865 * Ser4MCCR1 Serial port 4 Multi-media Communications Port (MCP)
866 * Control Register 1 (read/write).
867 * [The MCCR1 register is only implemented in
868 * versions 2.0 (rev. = 8) and higher of the StrongARM
869 * SA-1100.]
wdenk3b58acd2002-03-27 13:48:44 +0000870 *
871 * Clocks
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200872 * fmc, Tmc Frequency, period of the MCP communication (10 MHz,
873 * 12 MHz, or GPIO [21]).
wdenk3b58acd2002-03-27 13:48:44 +0000874 * faud, Taud Frequency, period of the audio sampling.
875 * ftcm, Ttcm Frequency, period of the telecom sampling.
876 */
877
878#define _Ser4MCCR0 0x80060000 /* Ser. port 4 MCP Control Reg. 0 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200879#define _Ser4MCDR0 0x80060008 /* Ser. port 4 MCP Data Reg. 0 */
880 /* (audio) */
881#define _Ser4MCDR1 0x8006000C /* Ser. port 4 MCP Data Reg. 1 */
882 /* (telecom) */
883#define _Ser4MCDR2 0x80060010 /* Ser. port 4 MCP Data Reg. 2 */
884 /* (CODEC reg.) */
885#define _Ser4MCSR 0x80060018 /* Ser. port 4 MCP Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +0000886#define _Ser4MCCR1 0x90060030 /* Ser. port 4 MCP Control Reg. 1 */
887
888#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200889#define Ser4MCCR0 /* Ser. port 4 MCP Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000890 (*((volatile Word *) io_p2v (_Ser4MCCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200891#define Ser4MCDR0 /* Ser. port 4 MCP Data Reg. 0 */ \
892 /* (audio) */ \
wdenk8bde7f72003-06-27 21:31:46 +0000893 (*((volatile Word *) io_p2v (_Ser4MCDR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200894#define Ser4MCDR1 /* Ser. port 4 MCP Data Reg. 1 */ \
895 /* (telecom) */ \
wdenk8bde7f72003-06-27 21:31:46 +0000896 (*((volatile Word *) io_p2v (_Ser4MCDR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200897#define Ser4MCDR2 /* Ser. port 4 MCP Data Reg. 2 */ \
898 /* (CODEC reg.) */ \
wdenk8bde7f72003-06-27 21:31:46 +0000899 (*((volatile Word *) io_p2v (_Ser4MCDR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200900#define Ser4MCSR /* Ser. port 4 MCP Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +0000901 (*((volatile Word *) io_p2v (_Ser4MCSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200902#define Ser4MCCR1 /* Ser. port 4 MCP Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +0000903 (*((volatile Word *) io_p2v (_Ser4MCCR1)))
wdenk3b58acd2002-03-27 13:48:44 +0000904#endif /* LANGUAGE == C */
905
906#define MCCR0_ASD Fld (7, 0) /* Audio Sampling rate Divisor/32 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200907 /* [6..127] */
908 /* faud = fmc/(32*ASD) */
909 /* Taud = 32*ASD*Tmc */
910#define MCCR0_AudSmpDiv(Div) /* Audio Sampling rate Divisor */ \
911 /* [192..4064] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000912 ((Div)/32 << FShft (MCCR0_ASD))
913 /* faud = fmc/(32*Floor (Div/32)) */
914 /* Taud = 32*Floor (Div/32)*Tmc */
wdenk3b58acd2002-03-27 13:48:44 +0000915#define MCCR0_CeilAudSmpDiv(Div) /* Ceil. of AudSmpDiv [192..4064] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000916 (((Div) + 31)/32 << FShft (MCCR0_ASD))
917 /* faud = fmc/(32*Ceil (Div/32)) */
918 /* Taud = 32*Ceil (Div/32)*Tmc */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200919#define MCCR0_TSD Fld (7, 8) /* Telecom Sampling rate */
920 /* Divisor/32 [16..127] */
921 /* ftcm = fmc/(32*TSD) */
922 /* Ttcm = 32*TSD*Tmc */
923#define MCCR0_TcmSmpDiv(Div) /* Telecom Sampling rate Divisor */ \
924 /* [512..4064] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000925 ((Div)/32 << FShft (MCCR0_TSD))
926 /* ftcm = fmc/(32*Floor (Div/32)) */
927 /* Ttcm = 32*Floor (Div/32)*Tmc */
wdenk3b58acd2002-03-27 13:48:44 +0000928#define MCCR0_CeilTcmSmpDiv(Div) /* Ceil. of TcmSmpDiv [512..4064] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000929 (((Div) + 31)/32 << FShft (MCCR0_TSD))
930 /* ftcm = fmc/(32*Ceil (Div/32)) */
931 /* Ttcm = 32*Ceil (Div/32)*Tmc */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200932#define MCCR0_MCE 0x00010000 /* MCP Enable */
933#define MCCR0_ECS 0x00020000 /* External Clock Select */
wdenk3b58acd2002-03-27 13:48:44 +0000934#define MCCR0_IntClk (MCCR0_ECS*0) /* Internal Clock (10 or 12 MHz) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200935#define MCCR0_ExtClk (MCCR0_ECS*1) /* External Clock (GPIO [21]) */
936#define MCCR0_ADM 0x00040000 /* A/D (audio/telecom) data */
937 /* sampling/storing Mode */
938#define MCCR0_VldBit (MCCR0_ADM*0) /* Valid Bit storing mode */
wdenk3b58acd2002-03-27 13:48:44 +0000939#define MCCR0_SmpCnt (MCCR0_ADM*1) /* Sampling Counter storing mode */
940#define MCCR0_TTE 0x00080000 /* Telecom Transmit FIFO 1/2-full */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200941 /* or less interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000942#define MCCR0_TRE 0x00100000 /* Telecom Receive FIFO 1/2-full */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200943 /* or more interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000944#define MCCR0_ATE 0x00200000 /* Audio Transmit FIFO 1/2-full */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200945 /* or less interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +0000946#define MCCR0_ARE 0x00400000 /* Audio Receive FIFO 1/2-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200947 /* more interrupt Enable */
948#define MCCR0_LBM 0x00800000 /* Look-Back Mode */
wdenk3b58acd2002-03-27 13:48:44 +0000949#define MCCR0_ECP Fld (2, 24) /* External Clock Prescaler - 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200950#define MCCR0_ExtClkDiv(Div) /* External Clock Divisor [1..4] */ \
wdenk8bde7f72003-06-27 21:31:46 +0000951 (((Div) - 1) << FShft (MCCR0_ECP))
wdenk3b58acd2002-03-27 13:48:44 +0000952
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200953#define MCDR0_DATA Fld (12, 4) /* receive/transmit audio DATA */
954 /* FIFOs */
wdenk3b58acd2002-03-27 13:48:44 +0000955
956#define MCDR1_DATA Fld (14, 2) /* receive/transmit telecom DATA */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200957 /* FIFOs */
wdenk3b58acd2002-03-27 13:48:44 +0000958
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200959 /* receive/transmit CODEC reg. */
960 /* FIFOs: */
961#define MCDR2_DATA Fld (16, 0) /* reg. DATA */
962#define MCDR2_RW 0x00010000 /* reg. Read/Write (transmit) */
963#define MCDR2_Rd (MCDR2_RW*0) /* reg. Read */
964#define MCDR2_Wr (MCDR2_RW*1) /* reg. Write */
965#define MCDR2_ADD Fld (4, 17) /* reg. ADDress */
wdenk3b58acd2002-03-27 13:48:44 +0000966
967#define MCSR_ATS 0x00000001 /* Audio Transmit FIFO 1/2-full */
wdenk8bde7f72003-06-27 21:31:46 +0000968 /* or less Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000969#define MCSR_ARS 0x00000002 /* Audio Receive FIFO 1/2-full or */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200970 /* more Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000971#define MCSR_TTS 0x00000004 /* Telecom Transmit FIFO 1/2-full */
wdenk8bde7f72003-06-27 21:31:46 +0000972 /* or less Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000973#define MCSR_TRS 0x00000008 /* Telecom Receive FIFO 1/2-full */
wdenk8bde7f72003-06-27 21:31:46 +0000974 /* or more Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000975#define MCSR_ATU 0x00000010 /* Audio Transmit FIFO Under-run */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200976#define MCSR_ARO 0x00000020 /* Audio Receive FIFO Over-run */
wdenk3b58acd2002-03-27 13:48:44 +0000977#define MCSR_TTU 0x00000040 /* Telecom Transmit FIFO Under-run */
978#define MCSR_TRO 0x00000080 /* Telecom Receive FIFO Over-run */
979#define MCSR_ANF 0x00000100 /* Audio transmit FIFO Not Full */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200980 /* (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000981#define MCSR_ANE 0x00000200 /* Audio receive FIFO Not Empty */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200982 /* (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000983#define MCSR_TNF 0x00000400 /* Telecom transmit FIFO Not Full */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200984 /* (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000985#define MCSR_TNE 0x00000800 /* Telecom receive FIFO Not Empty */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200986 /* (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000987#define MCSR_CWC 0x00001000 /* CODEC register Write Completed */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200988 /* (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000989#define MCSR_CRC 0x00002000 /* CODEC register Read Completed */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200990 /* (read) */
991#define MCSR_ACE 0x00004000 /* Audio CODEC Enabled (read) */
wdenk3b58acd2002-03-27 13:48:44 +0000992#define MCSR_TCE 0x00008000 /* Telecom CODEC Enabled (read) */
993
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200994#define MCCR1_CFS 0x00100000 /* Clock Freq. Select */
995#define MCCR1_F12MHz (MCCR1_CFS*0) /* Freq. (fmc) = ~ 12 MHz */
996 /* (11.981 MHz) */
997#define MCCR1_F10MHz (MCCR1_CFS*1) /* Freq. (fmc) = ~ 10 MHz */
998 /* (9.585 MHz) */
wdenk3b58acd2002-03-27 13:48:44 +0000999
1000
1001/*
1002 * Synchronous Serial Port (SSP) control registers
1003 *
1004 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001005 * Ser4SSCR0 Serial port 4 Synchronous Serial Port (SSP) Control
1006 * Register 0 (read/write).
1007 * Ser4SSCR1 Serial port 4 Synchronous Serial Port (SSP) Control
1008 * Register 1 (read/write).
1009 * [Bits SPO and SP are only implemented in versions 2.0
1010 * (rev. = 8) and higher of the StrongARM SA-1100.]
1011 * Ser4SSDR Serial port 4 Synchronous Serial Port (SSP) Data
1012 * Register (read/write).
1013 * Ser4SSSR Serial port 4 Synchronous Serial Port (SSP) Status
1014 * Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001015 *
1016 * Clocks
1017 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001018 * or 3.5795 MHz).
1019 * fss, Tss Frequency, period of the SSP communication.
wdenk3b58acd2002-03-27 13:48:44 +00001020 */
1021
1022#define _Ser4SSCR0 0x80070060 /* Ser. port 4 SSP Control Reg. 0 */
1023#define _Ser4SSCR1 0x80070064 /* Ser. port 4 SSP Control Reg. 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001024#define _Ser4SSDR 0x8007006C /* Ser. port 4 SSP Data Reg. */
1025#define _Ser4SSSR 0x80070074 /* Ser. port 4 SSP Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001026
1027#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001028#define Ser4SSCR0 /* Ser. port 4 SSP Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00001029 (*((volatile Word *) io_p2v (_Ser4SSCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001030#define Ser4SSCR1 /* Ser. port 4 SSP Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00001031 (*((volatile Word *) io_p2v (_Ser4SSCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001032#define Ser4SSDR /* Ser. port 4 SSP Data Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001033 (*((volatile Word *) io_p2v (_Ser4SSDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001034#define Ser4SSSR /* Ser. port 4 SSP Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001035 (*((volatile Word *) io_p2v (_Ser4SSSR)))
wdenk3b58acd2002-03-27 13:48:44 +00001036#endif /* LANGUAGE == C */
1037
1038#define SSCR0_DSS Fld (4, 0) /* Data Size - 1 Select [3..15] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001039#define SSCR0_DataSize(Size) /* Data Size Select [4..16] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001040 (((Size) - 1) << FShft (SSCR0_DSS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001041#define SSCR0_FRF Fld (2, 4) /* FRame Format */
1042#define SSCR0_Motorola /* Motorola Serial Peripheral */ \
1043 /* Interface (SPI) format */ \
wdenk8bde7f72003-06-27 21:31:46 +00001044 (0 << FShft (SSCR0_FRF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001045#define SSCR0_TI /* Texas Instruments Synchronous */ \
1046 /* Serial format */ \
wdenk8bde7f72003-06-27 21:31:46 +00001047 (1 << FShft (SSCR0_FRF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001048#define SSCR0_National /* National Microwire format */ \
wdenk8bde7f72003-06-27 21:31:46 +00001049 (2 << FShft (SSCR0_FRF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001050#define SSCR0_SSE 0x00000080 /* SSP Enable */
wdenk3b58acd2002-03-27 13:48:44 +00001051#define SSCR0_SCR Fld (8, 8) /* Serial Clock Rate divisor/2 - 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001052 /* fss = fxtl/(2*(SCR + 1)) */
1053 /* Tss = 2*(SCR + 1)*Txtl */
1054#define SSCR0_SerClkDiv(Div) /* Serial Clock Divisor [2..512] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001055 (((Div) - 2)/2 << FShft (SSCR0_SCR))
1056 /* fss = fxtl/(2*Floor (Div/2)) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001057 /* Tss = 2*Floor (Div/2)*Txtl */
wdenk3b58acd2002-03-27 13:48:44 +00001058#define SSCR0_CeilSerClkDiv(Div) /* Ceil. of SerClkDiv [2..512] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001059 (((Div) - 1)/2 << FShft (SSCR0_SCR))
1060 /* fss = fxtl/(2*Ceil (Div/2)) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001061 /* Tss = 2*Ceil (Div/2)*Txtl */
wdenk3b58acd2002-03-27 13:48:44 +00001062
1063#define SSCR1_RIE 0x00000001 /* Receive FIFO 1/2-full or more */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001064 /* Interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +00001065#define SSCR1_TIE 0x00000002 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001066 /* Interrupt Enable */
1067#define SSCR1_LBM 0x00000004 /* Look-Back Mode */
wdenk3b58acd2002-03-27 13:48:44 +00001068#define SSCR1_SPO 0x00000008 /* Sample clock (SCLK) POlarity */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001069#define SSCR1_SClkIactL (SSCR1_SPO*0) /* Sample Clock Inactive Low */
1070#define SSCR1_SClkIactH (SSCR1_SPO*1) /* Sample Clock Inactive High */
1071#define SSCR1_SP 0x00000010 /* Sample clock (SCLK) Phase */
wdenk3b58acd2002-03-27 13:48:44 +00001072#define SSCR1_SClk1P (SSCR1_SP*0) /* Sample Clock active 1 Period */
wdenk8bde7f72003-06-27 21:31:46 +00001073 /* after frame (SFRM, 1st edge) */
wdenk3b58acd2002-03-27 13:48:44 +00001074#define SSCR1_SClk1_2P (SSCR1_SP*1) /* Sample Clock active 1/2 Period */
wdenk8bde7f72003-06-27 21:31:46 +00001075 /* after frame (SFRM, 1st edge) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001076#define SSCR1_ECS 0x00000020 /* External Clock Select */
1077#define SSCR1_IntClk (SSCR1_ECS*0) /* Internal Clock */
1078#define SSCR1_ExtClk (SSCR1_ECS*1) /* External Clock (GPIO [19]) */
wdenk3b58acd2002-03-27 13:48:44 +00001079
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001080#define SSDR_DATA Fld (16, 0) /* receive/transmit DATA FIFOs */
wdenk3b58acd2002-03-27 13:48:44 +00001081
1082#define SSSR_TNF 0x00000002 /* Transmit FIFO Not Full (read) */
1083#define SSSR_RNE 0x00000004 /* Receive FIFO Not Empty (read) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001084#define SSSR_BSY 0x00000008 /* SSP BuSY (read) */
wdenk3b58acd2002-03-27 13:48:44 +00001085#define SSSR_TFS 0x00000010 /* Transmit FIFO 1/2-full or less */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001086 /* Service request (read) */
wdenk3b58acd2002-03-27 13:48:44 +00001087#define SSSR_RFS 0x00000020 /* Receive FIFO 1/2-full or more */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001088 /* Service request (read) */
1089#define SSSR_ROR 0x00000040 /* Receive FIFO Over-Run */
wdenk3b58acd2002-03-27 13:48:44 +00001090
1091
1092/*
1093 * Operating System (OS) timer control registers
1094 *
1095 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001096 * OSMR0 Operating System (OS) timer Match Register 0
1097 * (read/write).
1098 * OSMR1 Operating System (OS) timer Match Register 1
1099 * (read/write).
1100 * OSMR2 Operating System (OS) timer Match Register 2
1101 * (read/write).
1102 * OSMR3 Operating System (OS) timer Match Register 3
1103 * (read/write).
1104 * OSCR Operating System (OS) timer Counter Register
1105 * (read/write).
1106 * OSSR Operating System (OS) timer Status Register
1107 * (read/write).
1108 * OWER Operating System (OS) timer Watch-dog Enable Register
1109 * (read/write).
1110 * OIER Operating System (OS) timer Interrupt Enable Register
1111 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001112 */
1113
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001114#define _OSMR(Nb) /* OS timer Match Reg. [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001115 (0x90000000 + (Nb)*4)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001116#define _OSMR0 _OSMR (0) /* OS timer Match Reg. 0 */
1117#define _OSMR1 _OSMR (1) /* OS timer Match Reg. 1 */
1118#define _OSMR2 _OSMR (2) /* OS timer Match Reg. 2 */
1119#define _OSMR3 _OSMR (3) /* OS timer Match Reg. 3 */
1120#define _OSCR 0x90000010 /* OS timer Counter Reg. */
1121#define _OSSR 0x90000014 /* OS timer Status Reg. */
1122#define _OWER 0x90000018 /* OS timer Watch-dog Enable Reg. */
1123#define _OIER 0x9000001C /* OS timer Interrupt Enable Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001124
1125#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001126#define OSMR /* OS timer Match Reg. [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001127 ((volatile Word *) io_p2v (_OSMR (0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001128#define OSMR0 (OSMR [0]) /* OS timer Match Reg. 0 */
1129#define OSMR1 (OSMR [1]) /* OS timer Match Reg. 1 */
1130#define OSMR2 (OSMR [2]) /* OS timer Match Reg. 2 */
1131#define OSMR3 (OSMR [3]) /* OS timer Match Reg. 3 */
1132#define OSCR /* OS timer Counter Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001133 (*((volatile Word *) io_p2v (_OSCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001134#define OSSR /* OS timer Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001135 (*((volatile Word *) io_p2v (_OSSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001136#define OWER /* OS timer Watch-dog Enable Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001137 (*((volatile Word *) io_p2v (_OWER)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001138#define OIER /* OS timer Interrupt Enable Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001139 (*((volatile Word *) io_p2v (_OIER)))
wdenk3b58acd2002-03-27 13:48:44 +00001140#endif /* LANGUAGE == C */
1141
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001142#define OSSR_M(Nb) /* Match detected [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001143 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001144#define OSSR_M0 OSSR_M (0) /* Match detected 0 */
1145#define OSSR_M1 OSSR_M (1) /* Match detected 1 */
1146#define OSSR_M2 OSSR_M (2) /* Match detected 2 */
1147#define OSSR_M3 OSSR_M (3) /* Match detected 3 */
wdenk3b58acd2002-03-27 13:48:44 +00001148
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001149#define OWER_WME 0x00000001 /* Watch-dog Match Enable */
1150 /* (set only) */
wdenk3b58acd2002-03-27 13:48:44 +00001151
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001152#define OIER_E(Nb) /* match interrupt Enable [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001153 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001154#define OIER_E0 OIER_E (0) /* match interrupt Enable 0 */
1155#define OIER_E1 OIER_E (1) /* match interrupt Enable 1 */
1156#define OIER_E2 OIER_E (2) /* match interrupt Enable 2 */
1157#define OIER_E3 OIER_E (3) /* match interrupt Enable 3 */
wdenk3b58acd2002-03-27 13:48:44 +00001158
1159
1160/*
1161 * Real-Time Clock (RTC) control registers
1162 *
1163 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001164 * RTAR Real-Time Clock (RTC) Alarm Register (read/write).
1165 * RCNR Real-Time Clock (RTC) CouNt Register (read/write).
1166 * RTTR Real-Time Clock (RTC) Trim Register (read/write).
1167 * RTSR Real-Time Clock (RTC) Status Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001168 *
1169 * Clocks
1170 * frtx, Trtx Frequency, period of the real-time clock crystal
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001171 * (32.768 kHz nominal).
wdenk3b58acd2002-03-27 13:48:44 +00001172 * frtc, Trtc Frequency, period of the real-time clock counter
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001173 * (1 Hz nominal).
wdenk3b58acd2002-03-27 13:48:44 +00001174 */
1175
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001176#define _RTAR 0x90010000 /* RTC Alarm Reg. */
1177#define _RCNR 0x90010004 /* RTC CouNt Reg. */
1178#define _RTTR 0x90010008 /* RTC Trim Reg. */
1179#define _RTSR 0x90010010 /* RTC Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001180
1181#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001182#define RTAR /* RTC Alarm Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001183 (*((volatile Word *) io_p2v (_RTAR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001184#define RCNR /* RTC CouNt Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001185 (*((volatile Word *) io_p2v (_RCNR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001186#define RTTR /* RTC Trim Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001187 (*((volatile Word *) io_p2v (_RTTR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001188#define RTSR /* RTC Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001189 (*((volatile Word *) io_p2v (_RTSR)))
wdenk3b58acd2002-03-27 13:48:44 +00001190#endif /* LANGUAGE == C */
1191
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001192#define RTTR_C Fld (16, 0) /* clock divider Count - 1 */
1193#define RTTR_D Fld (10, 16) /* trim Delete count */
wdenk8bde7f72003-06-27 21:31:46 +00001194 /* frtc = (1023*(C + 1) - D)*frtx/ */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001195 /* (1023*(C + 1)^2) */
wdenk8bde7f72003-06-27 21:31:46 +00001196 /* Trtc = (1023*(C + 1)^2)*Trtx/ */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001197 /* (1023*(C + 1) - D) */
wdenk3b58acd2002-03-27 13:48:44 +00001198
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001199#define RTSR_AL 0x00000001 /* ALarm detected */
1200#define RTSR_HZ 0x00000002 /* 1 Hz clock detected */
1201#define RTSR_ALE 0x00000004 /* ALarm interrupt Enable */
1202#define RTSR_HZE 0x00000008 /* 1 Hz clock interrupt Enable */
wdenk3b58acd2002-03-27 13:48:44 +00001203
1204
1205/*
1206 * Power Manager (PM) control registers
1207 *
1208 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001209 * PMCR Power Manager (PM) Control Register (read/write).
1210 * PSSR Power Manager (PM) Sleep Status Register (read/write).
1211 * PSPR Power Manager (PM) Scratch-Pad Register (read/write).
1212 * PWER Power Manager (PM) Wake-up Enable Register
1213 * (read/write).
1214 * PCFR Power Manager (PM) general ConFiguration Register
1215 * (read/write).
1216 * PPCR Power Manager (PM) Phase-Locked Loop (PLL)
1217 * Configuration Register (read/write).
1218 * PGSR Power Manager (PM) General-Purpose Input/Output (GPIO)
1219 * Sleep state Register (read/write, see GPIO pins).
1220 * POSR Power Manager (PM) Oscillator Status Register (read).
wdenk3b58acd2002-03-27 13:48:44 +00001221 *
1222 * Clocks
1223 * fxtl, Txtl Frequency, period of the system crystal (3.6864 MHz
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001224 * or 3.5795 MHz).
wdenk3b58acd2002-03-27 13:48:44 +00001225 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1226 */
1227
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001228#define _PMCR 0x90020000 /* PM Control Reg. */
1229#define _PSSR 0x90020004 /* PM Sleep Status Reg. */
1230#define _PSPR 0x90020008 /* PM Scratch-Pad Reg. */
1231#define _PWER 0x9002000C /* PM Wake-up Enable Reg. */
1232#define _PCFR 0x90020010 /* PM general ConFiguration Reg. */
1233#define _PPCR 0x90020014 /* PM PLL Configuration Reg. */
1234#define _PGSR 0x90020018 /* PM GPIO Sleep state Reg. */
1235#define _POSR 0x9002001C /* PM Oscillator Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001236
1237#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001238#define PMCR /* PM Control Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001239 (*((volatile Word *) io_p2v (_PMCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001240#define PSSR /* PM Sleep Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001241 (*((volatile Word *) io_p2v (_PSSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001242#define PSPR /* PM Scratch-Pad Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001243 (*((volatile Word *) io_p2v (_PSPR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001244#define PWER /* PM Wake-up Enable Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001245 (*((volatile Word *) io_p2v (_PWER)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001246#define PCFR /* PM general ConFiguration Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001247 (*((volatile Word *) io_p2v (_PCFR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001248#define PPCR /* PM PLL Configuration Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001249 (*((volatile Word *) io_p2v (_PPCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001250#define PGSR /* PM GPIO Sleep state Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001251 (*((volatile Word *) io_p2v (_PGSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001252#define POSR /* PM Oscillator Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001253 (*((volatile Word *) io_p2v (_POSR)))
wdenk3b58acd2002-03-27 13:48:44 +00001254
1255#elif LANGUAGE == Assembly
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001256#define PMCR (io_p2v (_PMCR))
1257#define PSSR (io_p2v (_PSSR))
1258#define PSPR (io_p2v (_PSPR))
1259#define PWER (io_p2v (_PWER))
1260#define PCFR (io_p2v (_PCFR))
1261#define PPCR (io_p2v (_PPCR))
1262#define PGSR (io_p2v (_PGSR))
1263#define POSR (io_p2v (_POSR))
wdenk3b58acd2002-03-27 13:48:44 +00001264
1265#endif /* LANGUAGE == C */
1266
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001267#define PMCR_SF 0x00000001 /* Sleep Force (set only) */
wdenk3b58acd2002-03-27 13:48:44 +00001268
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001269#define PSSR_SS 0x00000001 /* Software Sleep */
1270#define PSSR_BFS 0x00000002 /* Battery Fault Status */
1271 /* (BATT_FAULT) */
wdenk3b58acd2002-03-27 13:48:44 +00001272#define PSSR_VFS 0x00000004 /* Vdd Fault Status (VDD_FAULT) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001273#define PSSR_DH 0x00000008 /* DRAM control Hold */
1274#define PSSR_PH 0x00000010 /* Peripheral control Hold */
wdenk3b58acd2002-03-27 13:48:44 +00001275
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001276#define PWER_GPIO(Nb) GPIO_GPIO (Nb) /* GPIO [0..27] wake-up enable */
1277#define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
1278#define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
1279#define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
1280#define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
1281#define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
1282#define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
1283#define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
1284#define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
1285#define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
1286#define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
1287#define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
1288#define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
1289#define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
1290#define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
1291#define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
1292#define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
1293#define PWER_GPIO16 PWER_GPIO (16) /* GPIO [16] wake-up enable */
1294#define PWER_GPIO17 PWER_GPIO (17) /* GPIO [17] wake-up enable */
1295#define PWER_GPIO18 PWER_GPIO (18) /* GPIO [18] wake-up enable */
1296#define PWER_GPIO19 PWER_GPIO (19) /* GPIO [19] wake-up enable */
1297#define PWER_GPIO20 PWER_GPIO (20) /* GPIO [20] wake-up enable */
1298#define PWER_GPIO21 PWER_GPIO (21) /* GPIO [21] wake-up enable */
1299#define PWER_GPIO22 PWER_GPIO (22) /* GPIO [22] wake-up enable */
1300#define PWER_GPIO23 PWER_GPIO (23) /* GPIO [23] wake-up enable */
1301#define PWER_GPIO24 PWER_GPIO (24) /* GPIO [24] wake-up enable */
1302#define PWER_GPIO25 PWER_GPIO (25) /* GPIO [25] wake-up enable */
1303#define PWER_GPIO26 PWER_GPIO (26) /* GPIO [26] wake-up enable */
1304#define PWER_GPIO27 PWER_GPIO (27) /* GPIO [27] wake-up enable */
1305#define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
wdenk3b58acd2002-03-27 13:48:44 +00001306
1307#define PCFR_OPDE 0x00000001 /* Oscillator Power-Down Enable */
1308#define PCFR_ClkRun (PCFR_OPDE*0) /* Clock Running in sleep mode */
1309#define PCFR_ClkStp (PCFR_OPDE*1) /* Clock Stopped in sleep mode */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001310#define PCFR_FP 0x00000002 /* Float PCMCIA pins */
1311#define PCFR_PCMCIANeg (PCFR_FP*0) /* PCMCIA pins Negated (1) */
1312#define PCFR_PCMCIAFlt (PCFR_FP*1) /* PCMCIA pins Floating */
1313#define PCFR_FS 0x00000004 /* Float Static memory pins */
wdenk3b58acd2002-03-27 13:48:44 +00001314#define PCFR_StMemNeg (PCFR_FS*0) /* Static Memory pins Negated (1) */
1315#define PCFR_StMemFlt (PCFR_FS*1) /* Static Memory pins Floating */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001316#define PCFR_FO 0x00000008 /* Force RTC oscillator */
1317 /* (32.768 kHz) enable On */
wdenk3b58acd2002-03-27 13:48:44 +00001318
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001319#define PPCR_CCF Fld (5, 0) /* CPU core Clock (CCLK) Freq. */
1320#define PPCR_Fx16 /* Freq. x 16 (fcpu = 16*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001321 (0x00 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001322#define PPCR_Fx20 /* Freq. x 20 (fcpu = 20*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001323 (0x01 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001324#define PPCR_Fx24 /* Freq. x 24 (fcpu = 24*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001325 (0x02 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001326#define PPCR_Fx28 /* Freq. x 28 (fcpu = 28*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001327 (0x03 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001328#define PPCR_Fx32 /* Freq. x 32 (fcpu = 32*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001329 (0x04 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001330#define PPCR_Fx36 /* Freq. x 36 (fcpu = 36*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001331 (0x05 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001332#define PPCR_Fx40 /* Freq. x 40 (fcpu = 40*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001333 (0x06 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001334#define PPCR_Fx44 /* Freq. x 44 (fcpu = 44*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001335 (0x07 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001336#define PPCR_Fx48 /* Freq. x 48 (fcpu = 48*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001337 (0x08 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001338#define PPCR_Fx52 /* Freq. x 52 (fcpu = 52*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001339 (0x09 << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001340#define PPCR_Fx56 /* Freq. x 56 (fcpu = 56*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001341 (0x0A << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001342#define PPCR_Fx60 /* Freq. x 60 (fcpu = 60*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001343 (0x0B << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001344#define PPCR_Fx64 /* Freq. x 64 (fcpu = 64*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001345 (0x0C << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001346#define PPCR_Fx68 /* Freq. x 68 (fcpu = 68*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001347 (0x0D << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001348#define PPCR_Fx72 /* Freq. x 72 (fcpu = 72*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001349 (0x0E << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001350#define PPCR_Fx76 /* Freq. x 76 (fcpu = 76*fxtl) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001351 (0x0F << FShft (PPCR_CCF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001352 /* 3.6864 MHz crystal (fxtl): */
1353#define PPCR_F59_0MHz PPCR_Fx16 /* Freq. (fcpu) = 59.0 MHz */
1354#define PPCR_F73_7MHz PPCR_Fx20 /* Freq. (fcpu) = 73.7 MHz */
1355#define PPCR_F88_5MHz PPCR_Fx24 /* Freq. (fcpu) = 88.5 MHz */
1356#define PPCR_F103_2MHz PPCR_Fx28 /* Freq. (fcpu) = 103.2 MHz */
1357#define PPCR_F118_0MHz PPCR_Fx32 /* Freq. (fcpu) = 118.0 MHz */
1358#define PPCR_F132_7MHz PPCR_Fx36 /* Freq. (fcpu) = 132.7 MHz */
1359#define PPCR_F147_5MHz PPCR_Fx40 /* Freq. (fcpu) = 147.5 MHz */
1360#define PPCR_F162_2MHz PPCR_Fx44 /* Freq. (fcpu) = 162.2 MHz */
1361#define PPCR_F176_9MHz PPCR_Fx48 /* Freq. (fcpu) = 176.9 MHz */
1362#define PPCR_F191_7MHz PPCR_Fx52 /* Freq. (fcpu) = 191.7 MHz */
1363#define PPCR_F206_4MHz PPCR_Fx56 /* Freq. (fcpu) = 206.4 MHz */
1364#define PPCR_F221_2MHz PPCR_Fx60 /* Freq. (fcpu) = 221.2 MHz */
1365#define PPCR_F239_6MHz PPCR_Fx64 /* Freq. (fcpu) = 239.6 MHz */
1366#define PPCR_F250_7MHz PPCR_Fx68 /* Freq. (fcpu) = 250.7 MHz */
1367#define PPCR_F265_4MHz PPCR_Fx72 /* Freq. (fcpu) = 265.4 MHz */
1368#define PPCR_F280_2MHz PPCR_Fx76 /* Freq. (fcpu) = 280.2 MHz */
1369 /* 3.5795 MHz crystal (fxtl): */
1370#define PPCR_F57_3MHz PPCR_Fx16 /* Freq. (fcpu) = 57.3 MHz */
1371#define PPCR_F71_6MHz PPCR_Fx20 /* Freq. (fcpu) = 71.6 MHz */
1372#define PPCR_F85_9MHz PPCR_Fx24 /* Freq. (fcpu) = 85.9 MHz */
1373#define PPCR_F100_2MHz PPCR_Fx28 /* Freq. (fcpu) = 100.2 MHz */
1374#define PPCR_F114_5MHz PPCR_Fx32 /* Freq. (fcpu) = 114.5 MHz */
1375#define PPCR_F128_9MHz PPCR_Fx36 /* Freq. (fcpu) = 128.9 MHz */
1376#define PPCR_F143_2MHz PPCR_Fx40 /* Freq. (fcpu) = 143.2 MHz */
1377#define PPCR_F157_5MHz PPCR_Fx44 /* Freq. (fcpu) = 157.5 MHz */
1378#define PPCR_F171_8MHz PPCR_Fx48 /* Freq. (fcpu) = 171.8 MHz */
1379#define PPCR_F186_1MHz PPCR_Fx52 /* Freq. (fcpu) = 186.1 MHz */
1380#define PPCR_F200_5MHz PPCR_Fx56 /* Freq. (fcpu) = 200.5 MHz */
1381#define PPCR_F214_8MHz PPCR_Fx60 /* Freq. (fcpu) = 214.8 MHz */
1382#define PPCR_F229_1MHz PPCR_Fx64 /* Freq. (fcpu) = 229.1 MHz */
1383#define PPCR_F243_4MHz PPCR_Fx68 /* Freq. (fcpu) = 243.4 MHz */
1384#define PPCR_F257_7MHz PPCR_Fx72 /* Freq. (fcpu) = 257.7 MHz */
1385#define PPCR_F272_0MHz PPCR_Fx76 /* Freq. (fcpu) = 272.0 MHz */
wdenk3b58acd2002-03-27 13:48:44 +00001386
1387#define POSR_OOK 0x00000001 /* RTC Oscillator (32.768 kHz) OK */
1388
1389
1390/*
1391 * Reset Controller (RC) control registers
1392 *
1393 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001394 * RSRR Reset Controller (RC) Software Reset Register
1395 * (read/write).
1396 * RCSR Reset Controller (RC) Status Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001397 */
1398
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001399#define _RSRR 0x90030000 /* RC Software Reset Reg. */
1400#define _RCSR 0x90030004 /* RC Status Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001401
1402#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001403#define RSRR /* RC Software Reset Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001404 (*((volatile Word *) io_p2v (_RSRR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001405#define RCSR /* RC Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001406 (*((volatile Word *) io_p2v (_RCSR)))
wdenk3b58acd2002-03-27 13:48:44 +00001407#endif /* LANGUAGE == C */
1408
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001409#define RSRR_SWR 0x00000001 /* SoftWare Reset (set only) */
wdenk3b58acd2002-03-27 13:48:44 +00001410
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001411#define RCSR_HWR 0x00000001 /* HardWare Reset */
1412#define RCSR_SWR 0x00000002 /* SoftWare Reset */
1413#define RCSR_WDR 0x00000004 /* Watch-Dog Reset */
1414#define RCSR_SMR 0x00000008 /* Sleep-Mode Reset */
wdenk3b58acd2002-03-27 13:48:44 +00001415
1416
1417/*
1418 * Test unit control registers
1419 *
1420 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001421 * TUCR Test Unit Control Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001422 */
1423
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001424#define _TUCR 0x90030008 /* Test Unit Control Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001425
1426#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001427#define TUCR /* Test Unit Control Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001428 (*((volatile Word *) io_p2v (_TUCR)))
wdenk3b58acd2002-03-27 13:48:44 +00001429#endif /* LANGUAGE == C */
1430
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001431#define TUCR_TIC 0x00000040 /* TIC mode */
1432#define TUCR_TTST 0x00000080 /* Trim TeST mode */
1433#define TUCR_RCRC 0x00000100 /* Richard's Cyclic Redundancy */
1434 /* Check */
1435#define TUCR_PMD 0x00000200 /* Power Management Disable */
1436#define TUCR_MR 0x00000400 /* Memory Request mode */
wdenk3b58acd2002-03-27 13:48:44 +00001437#define TUCR_NoMB (TUCR_MR*0) /* No Memory Bus request & grant */
1438#define TUCR_MBGPIO (TUCR_MR*1) /* Memory Bus request (MBREQ) & */
wdenk8bde7f72003-06-27 21:31:46 +00001439 /* grant (MBGNT) on GPIO [22:21] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001440#define TUCR_CTB Fld (3, 20) /* Clock Test Bits */
1441#define TUCR_FDC 0x00800000 /* RTC Force Delete Count */
wdenk3b58acd2002-03-27 13:48:44 +00001442#define TUCR_FMC 0x01000000 /* Force Michelle's Control mode */
1443#define TUCR_TMC 0x02000000 /* RTC Trimmer Multiplexer Control */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001444#define TUCR_DPS 0x04000000 /* Disallow Pad Sleep */
wdenk3b58acd2002-03-27 13:48:44 +00001445#define TUCR_TSEL Fld (3, 29) /* clock Test SELect on GPIO [27] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001446#define TUCR_32_768kHz /* 32.768 kHz osc. on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001447 (0 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001448#define TUCR_3_6864MHz /* 3.6864 MHz osc. on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001449 (1 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001450#define TUCR_VDD /* VDD ring osc./16 on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001451 (2 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001452#define TUCR_96MHzPLL /* 96 MHz PLL/4 on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001453 (3 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001454#define TUCR_Clock /* internal (fcpu/2) & 32.768 kHz */ \
1455 /* Clocks on GPIO [26:27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001456 (4 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001457#define TUCR_3_6864MHzA /* 3.6864 MHz osc. on GPIO [27] */ \
1458 /* (Alternative) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001459 (5 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001460#define TUCR_MainPLL /* Main PLL/16 on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001461 (6 << FShft (TUCR_TSEL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001462#define TUCR_VDDL /* VDDL ring osc./4 on GPIO [27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001463 (7 << FShft (TUCR_TSEL))
wdenk3b58acd2002-03-27 13:48:44 +00001464
1465
1466/*
1467 * General-Purpose Input/Output (GPIO) control registers
1468 *
1469 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001470 * GPLR General-Purpose Input/Output (GPIO) Pin Level
1471 * Register (read).
1472 * GPDR General-Purpose Input/Output (GPIO) Pin Direction
1473 * Register (read/write).
1474 * GPSR General-Purpose Input/Output (GPIO) Pin output Set
1475 * Register (write).
1476 * GPCR General-Purpose Input/Output (GPIO) Pin output Clear
1477 * Register (write).
1478 * GRER General-Purpose Input/Output (GPIO) Rising-Edge
1479 * detect Register (read/write).
1480 * GFER General-Purpose Input/Output (GPIO) Falling-Edge
1481 * detect Register (read/write).
1482 * GEDR General-Purpose Input/Output (GPIO) Edge Detect
1483 * status Register (read/write).
1484 * GAFR General-Purpose Input/Output (GPIO) Alternate
1485 * Function Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001486 *
1487 * Clock
1488 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1489 */
1490
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001491#define _GPLR 0x90040000 /* GPIO Pin Level Reg. */
1492#define _GPDR 0x90040004 /* GPIO Pin Direction Reg. */
1493#define _GPSR 0x90040008 /* GPIO Pin output Set Reg. */
1494#define _GPCR 0x9004000C /* GPIO Pin output Clear Reg. */
1495#define _GRER 0x90040010 /* GPIO Rising-Edge detect Reg. */
1496#define _GFER 0x90040014 /* GPIO Falling-Edge detect Reg. */
1497#define _GEDR 0x90040018 /* GPIO Edge Detect status Reg. */
1498#define _GAFR 0x9004001C /* GPIO Alternate Function Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001499
1500#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001501#define GPLR /* GPIO Pin Level Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001502 (*((volatile Word *) io_p2v (_GPLR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001503#define GPDR /* GPIO Pin Direction Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001504 (*((volatile Word *) io_p2v (_GPDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001505#define GPSR /* GPIO Pin output Set Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001506 (*((volatile Word *) io_p2v (_GPSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001507#define GPCR /* GPIO Pin output Clear Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001508 (*((volatile Word *) io_p2v (_GPCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001509#define GRER /* GPIO Rising-Edge detect Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001510 (*((volatile Word *) io_p2v (_GRER)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001511#define GFER /* GPIO Falling-Edge detect Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001512 (*((volatile Word *) io_p2v (_GFER)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001513#define GEDR /* GPIO Edge Detect status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001514 (*((volatile Word *) io_p2v (_GEDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001515#define GAFR /* GPIO Alternate Function Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001516 (*((volatile Word *) io_p2v (_GAFR)))
wdenk3b58acd2002-03-27 13:48:44 +00001517#elif LANGUAGE == Assembly
1518
1519#define GPLR (io_p2v (_GPLR))
1520#define GPDR (io_p2v (_GPDR))
1521#define GPSR (io_p2v (_GPSR))
1522#define GPCR (io_p2v (_GPCR))
1523#define GRER (io_p2v (_GRER))
1524#define GFER (io_p2v (_GFER))
1525#define GEDR (io_p2v (_GEDR))
1526#define GAFR (io_p2v (_GAFR))
1527
1528#endif /* LANGUAGE == C */
1529
1530#define GPIO_MIN (0)
1531#define GPIO_MAX (27)
1532
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001533#define GPIO_GPIO(Nb) /* GPIO [0..27] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001534 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001535#define GPIO_GPIO0 GPIO_GPIO (0) /* GPIO [0] */
1536#define GPIO_GPIO1 GPIO_GPIO (1) /* GPIO [1] */
1537#define GPIO_GPIO2 GPIO_GPIO (2) /* GPIO [2] */
1538#define GPIO_GPIO3 GPIO_GPIO (3) /* GPIO [3] */
1539#define GPIO_GPIO4 GPIO_GPIO (4) /* GPIO [4] */
1540#define GPIO_GPIO5 GPIO_GPIO (5) /* GPIO [5] */
1541#define GPIO_GPIO6 GPIO_GPIO (6) /* GPIO [6] */
1542#define GPIO_GPIO7 GPIO_GPIO (7) /* GPIO [7] */
1543#define GPIO_GPIO8 GPIO_GPIO (8) /* GPIO [8] */
1544#define GPIO_GPIO9 GPIO_GPIO (9) /* GPIO [9] */
1545#define GPIO_GPIO10 GPIO_GPIO (10) /* GPIO [10] */
1546#define GPIO_GPIO11 GPIO_GPIO (11) /* GPIO [11] */
1547#define GPIO_GPIO12 GPIO_GPIO (12) /* GPIO [12] */
1548#define GPIO_GPIO13 GPIO_GPIO (13) /* GPIO [13] */
1549#define GPIO_GPIO14 GPIO_GPIO (14) /* GPIO [14] */
1550#define GPIO_GPIO15 GPIO_GPIO (15) /* GPIO [15] */
1551#define GPIO_GPIO16 GPIO_GPIO (16) /* GPIO [16] */
1552#define GPIO_GPIO17 GPIO_GPIO (17) /* GPIO [17] */
1553#define GPIO_GPIO18 GPIO_GPIO (18) /* GPIO [18] */
1554#define GPIO_GPIO19 GPIO_GPIO (19) /* GPIO [19] */
1555#define GPIO_GPIO20 GPIO_GPIO (20) /* GPIO [20] */
1556#define GPIO_GPIO21 GPIO_GPIO (21) /* GPIO [21] */
1557#define GPIO_GPIO22 GPIO_GPIO (22) /* GPIO [22] */
1558#define GPIO_GPIO23 GPIO_GPIO (23) /* GPIO [23] */
1559#define GPIO_GPIO24 GPIO_GPIO (24) /* GPIO [24] */
1560#define GPIO_GPIO25 GPIO_GPIO (25) /* GPIO [25] */
1561#define GPIO_GPIO26 GPIO_GPIO (26) /* GPIO [26] */
1562#define GPIO_GPIO27 GPIO_GPIO (27) /* GPIO [27] */
wdenk3b58acd2002-03-27 13:48:44 +00001563
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001564#define GPIO_LDD(Nb) /* LCD Data [8..15] (O) */ \
wdenk8bde7f72003-06-27 21:31:46 +00001565 GPIO_GPIO ((Nb) - 6)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001566#define GPIO_LDD8 GPIO_LDD (8) /* LCD Data [8] (O) */
1567#define GPIO_LDD9 GPIO_LDD (9) /* LCD Data [9] (O) */
1568#define GPIO_LDD10 GPIO_LDD (10) /* LCD Data [10] (O) */
1569#define GPIO_LDD11 GPIO_LDD (11) /* LCD Data [11] (O) */
1570#define GPIO_LDD12 GPIO_LDD (12) /* LCD Data [12] (O) */
1571#define GPIO_LDD13 GPIO_LDD (13) /* LCD Data [13] (O) */
1572#define GPIO_LDD14 GPIO_LDD (14) /* LCD Data [14] (O) */
1573#define GPIO_LDD15 GPIO_LDD (15) /* LCD Data [15] (O) */
1574 /* ser. port 4: */
1575#define GPIO_SSP_TXD GPIO_GPIO (10) /* SSP Transmit Data (O) */
1576#define GPIO_SSP_RXD GPIO_GPIO (11) /* SSP Receive Data (I) */
1577#define GPIO_SSP_SCLK GPIO_GPIO (12) /* SSP Sample CLocK (O) */
1578#define GPIO_SSP_SFRM GPIO_GPIO (13) /* SSP Sample FRaMe (O) */
1579 /* ser. port 1: */
1580#define GPIO_UART_TXD GPIO_GPIO (14) /* UART Transmit Data (O) */
1581#define GPIO_UART_RXD GPIO_GPIO (15) /* UART Receive Data (I) */
1582#define GPIO_SDLC_SCLK GPIO_GPIO (16) /* SDLC Sample CLocK (I/O) */
1583#define GPIO_SDLC_AAF GPIO_GPIO (17) /* SDLC Abort After Frame (O) */
1584#define GPIO_UART_SCLK1 GPIO_GPIO (18) /* UART Sample CLocK 1 (I) */
1585 /* ser. port 4: */
1586#define GPIO_SSP_CLK GPIO_GPIO (19) /* SSP external CLocK (I) */
1587 /* ser. port 3: */
1588#define GPIO_UART_SCLK3 GPIO_GPIO (20) /* UART Sample CLocK 3 (I) */
1589 /* ser. port 4: */
1590#define GPIO_MCP_CLK GPIO_GPIO (21) /* MCP CLocK (I) */
1591 /* test controller: */
1592#define GPIO_TIC_ACK GPIO_GPIO (21) /* TIC ACKnowledge (O) */
1593#define GPIO_MBGNT GPIO_GPIO (21) /* Memory Bus GraNT (O) */
1594#define GPIO_TREQA GPIO_GPIO (22) /* TIC REQuest A (I) */
1595#define GPIO_MBREQ GPIO_GPIO (22) /* Memory Bus REQuest (I) */
1596#define GPIO_TREQB GPIO_GPIO (23) /* TIC REQuest B (I) */
1597#define GPIO_1Hz GPIO_GPIO (25) /* 1 Hz clock (O) */
wdenk3b58acd2002-03-27 13:48:44 +00001598#define GPIO_RCLK GPIO_GPIO (26) /* internal (R) CLocK (O, fcpu/2) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001599#define GPIO_32_768kHz GPIO_GPIO (27) /* 32.768 kHz clock (O, RTC) */
wdenk3b58acd2002-03-27 13:48:44 +00001600
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001601#define GPDR_In 0 /* Input */
1602#define GPDR_Out 1 /* Output */
wdenk3b58acd2002-03-27 13:48:44 +00001603
1604
1605/*
1606 * Interrupt Controller (IC) control registers
1607 *
1608 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001609 * ICIP Interrupt Controller (IC) Interrupt ReQuest (IRQ)
1610 * Pending register (read).
1611 * ICMR Interrupt Controller (IC) Mask Register (read/write).
1612 * ICLR Interrupt Controller (IC) Level Register (read/write).
1613 * ICCR Interrupt Controller (IC) Control Register
1614 * (read/write).
1615 * [The ICCR register is only implemented in versions 2.0
1616 * (rev. = 8) and higher of the StrongARM SA-1100.]
1617 * ICFP Interrupt Controller (IC) Fast Interrupt reQuest
1618 * (FIQ) Pending register (read).
1619 * ICPR Interrupt Controller (IC) Pending Register (read).
1620 * [The ICPR register is active low (inverted) in
1621 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
1622 * StrongARM SA-1100, it is active high (non-inverted) in
1623 * versions 2.0 (rev. = 8) and higher.]
wdenk3b58acd2002-03-27 13:48:44 +00001624 */
1625
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001626#define _ICIP 0x90050000 /* IC IRQ Pending reg. */
1627#define _ICMR 0x90050004 /* IC Mask Reg. */
1628#define _ICLR 0x90050008 /* IC Level Reg. */
1629#define _ICCR 0x9005000C /* IC Control Reg. */
1630#define _ICFP 0x90050010 /* IC FIQ Pending reg. */
1631#define _ICPR 0x90050020 /* IC Pending Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001632
1633#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001634#define ICIP /* IC IRQ Pending reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001635 (*((volatile Word *) io_p2v (_ICIP)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001636#define ICMR /* IC Mask Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001637 (*((volatile Word *) io_p2v (_ICMR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001638#define ICLR /* IC Level Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001639 (*((volatile Word *) io_p2v (_ICLR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001640#define ICCR /* IC Control Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001641 (*((volatile Word *) io_p2v (_ICCR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001642#define ICFP /* IC FIQ Pending reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001643 (*((volatile Word *) io_p2v (_ICFP)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001644#define ICPR /* IC Pending Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001645 (*((volatile Word *) io_p2v (_ICPR)))
wdenk3b58acd2002-03-27 13:48:44 +00001646#endif /* LANGUAGE == C */
1647
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001648#define IC_GPIO(Nb) /* GPIO [0..10] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001649 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001650#define IC_GPIO0 IC_GPIO (0) /* GPIO [0] */
1651#define IC_GPIO1 IC_GPIO (1) /* GPIO [1] */
1652#define IC_GPIO2 IC_GPIO (2) /* GPIO [2] */
1653#define IC_GPIO3 IC_GPIO (3) /* GPIO [3] */
1654#define IC_GPIO4 IC_GPIO (4) /* GPIO [4] */
1655#define IC_GPIO5 IC_GPIO (5) /* GPIO [5] */
1656#define IC_GPIO6 IC_GPIO (6) /* GPIO [6] */
1657#define IC_GPIO7 IC_GPIO (7) /* GPIO [7] */
1658#define IC_GPIO8 IC_GPIO (8) /* GPIO [8] */
1659#define IC_GPIO9 IC_GPIO (9) /* GPIO [9] */
1660#define IC_GPIO10 IC_GPIO (10) /* GPIO [10] */
1661#define IC_GPIO11_27 0x00000800 /* GPIO [11:27] (ORed) */
1662#define IC_LCD 0x00001000 /* LCD controller */
1663#define IC_Ser0UDC 0x00002000 /* Ser. port 0 UDC */
1664#define IC_Ser1SDLC 0x00004000 /* Ser. port 1 SDLC */
1665#define IC_Ser1UART 0x00008000 /* Ser. port 1 UART */
1666#define IC_Ser2ICP 0x00010000 /* Ser. port 2 ICP */
1667#define IC_Ser3UART 0x00020000 /* Ser. port 3 UART */
1668#define IC_Ser4MCP 0x00040000 /* Ser. port 4 MCP */
1669#define IC_Ser4SSP 0x00080000 /* Ser. port 4 SSP */
1670#define IC_DMA(Nb) /* DMA controller channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001671 (0x00100000 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001672#define IC_DMA0 IC_DMA (0) /* DMA controller channel 0 */
1673#define IC_DMA1 IC_DMA (1) /* DMA controller channel 1 */
1674#define IC_DMA2 IC_DMA (2) /* DMA controller channel 2 */
1675#define IC_DMA3 IC_DMA (3) /* DMA controller channel 3 */
1676#define IC_DMA4 IC_DMA (4) /* DMA controller channel 4 */
1677#define IC_DMA5 IC_DMA (5) /* DMA controller channel 5 */
1678#define IC_OST(Nb) /* OS Timer match [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001679 (0x04000000 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001680#define IC_OST0 IC_OST (0) /* OS Timer match 0 */
1681#define IC_OST1 IC_OST (1) /* OS Timer match 1 */
1682#define IC_OST2 IC_OST (2) /* OS Timer match 2 */
1683#define IC_OST3 IC_OST (3) /* OS Timer match 3 */
1684#define IC_RTC1Hz 0x40000000 /* RTC 1 Hz clock */
1685#define IC_RTCAlrm 0x80000000 /* RTC Alarm */
wdenk3b58acd2002-03-27 13:48:44 +00001686
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001687#define ICLR_IRQ 0 /* Interrupt ReQuest */
1688#define ICLR_FIQ 1 /* Fast Interrupt reQuest */
wdenk3b58acd2002-03-27 13:48:44 +00001689
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001690#define ICCR_DIM 0x00000001 /* Disable Idle-mode interrupt */
1691 /* Mask */
wdenk3b58acd2002-03-27 13:48:44 +00001692#define ICCR_IdleAllInt (ICCR_DIM*0) /* Idle-mode All Interrupt enable */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001693 /* (ICMR ignored) */
wdenk3b58acd2002-03-27 13:48:44 +00001694#define ICCR_IdleMskInt (ICCR_DIM*1) /* Idle-mode non-Masked Interrupt */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001695 /* enable (ICMR used) */
wdenk3b58acd2002-03-27 13:48:44 +00001696
1697
1698/*
1699 * Peripheral Pin Controller (PPC) control registers
1700 *
1701 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001702 * PPDR Peripheral Pin Controller (PPC) Pin Direction
1703 * Register (read/write).
1704 * PPSR Peripheral Pin Controller (PPC) Pin State Register
1705 * (read/write).
1706 * PPAR Peripheral Pin Controller (PPC) Pin Assignment
1707 * Register (read/write).
1708 * PSDR Peripheral Pin Controller (PPC) Sleep-mode pin
1709 * Direction Register (read/write).
1710 * PPFR Peripheral Pin Controller (PPC) Pin Flag Register
1711 * (read).
wdenk3b58acd2002-03-27 13:48:44 +00001712 */
1713
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001714#define _PPDR 0x90060000 /* PPC Pin Direction Reg. */
1715#define _PPSR 0x90060004 /* PPC Pin State Reg. */
1716#define _PPAR 0x90060008 /* PPC Pin Assignment Reg. */
1717#define _PSDR 0x9006000C /* PPC Sleep-mode pin Direction */
1718 /* Reg. */
1719#define _PPFR 0x90060010 /* PPC Pin Flag Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00001720
1721#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001722#define PPDR /* PPC Pin Direction Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001723 (*((volatile Word *) io_p2v (_PPDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001724#define PPSR /* PPC Pin State Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001725 (*((volatile Word *) io_p2v (_PPSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001726#define PPAR /* PPC Pin Assignment Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001727 (*((volatile Word *) io_p2v (_PPAR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001728#define PSDR /* PPC Sleep-mode pin Direction */ \
1729 /* Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001730 (*((volatile Word *) io_p2v (_PSDR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001731#define PPFR /* PPC Pin Flag Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001732 (*((volatile Word *) io_p2v (_PPFR)))
wdenk3b58acd2002-03-27 13:48:44 +00001733#endif /* LANGUAGE == C */
1734
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001735#define PPC_LDD(Nb) /* LCD Data [0..7] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001736 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001737#define PPC_LDD0 PPC_LDD (0) /* LCD Data [0] */
1738#define PPC_LDD1 PPC_LDD (1) /* LCD Data [1] */
1739#define PPC_LDD2 PPC_LDD (2) /* LCD Data [2] */
1740#define PPC_LDD3 PPC_LDD (3) /* LCD Data [3] */
1741#define PPC_LDD4 PPC_LDD (4) /* LCD Data [4] */
1742#define PPC_LDD5 PPC_LDD (5) /* LCD Data [5] */
1743#define PPC_LDD6 PPC_LDD (6) /* LCD Data [6] */
1744#define PPC_LDD7 PPC_LDD (7) /* LCD Data [7] */
1745#define PPC_L_PCLK 0x00000100 /* LCD Pixel CLocK */
1746#define PPC_L_LCLK 0x00000200 /* LCD Line CLocK */
1747#define PPC_L_FCLK 0x00000400 /* LCD Frame CLocK */
1748#define PPC_L_BIAS 0x00000800 /* LCD AC BIAS */
1749 /* ser. port 1: */
1750#define PPC_TXD1 0x00001000 /* SDLC/UART Transmit Data 1 */
1751#define PPC_RXD1 0x00002000 /* SDLC/UART Receive Data 1 */
1752 /* ser. port 2: */
1753#define PPC_TXD2 0x00004000 /* IPC Transmit Data 2 */
1754#define PPC_RXD2 0x00008000 /* IPC Receive Data 2 */
1755 /* ser. port 3: */
1756#define PPC_TXD3 0x00010000 /* UART Transmit Data 3 */
1757#define PPC_RXD3 0x00020000 /* UART Receive Data 3 */
1758 /* ser. port 4: */
1759#define PPC_TXD4 0x00040000 /* MCP/SSP Transmit Data 4 */
1760#define PPC_RXD4 0x00080000 /* MCP/SSP Receive Data 4 */
1761#define PPC_SCLK 0x00100000 /* MCP/SSP Sample CLocK */
1762#define PPC_SFRM 0x00200000 /* MCP/SSP Sample FRaMe */
wdenk3b58acd2002-03-27 13:48:44 +00001763
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001764#define PPDR_In 0 /* Input */
1765#define PPDR_Out 1 /* Output */
wdenk3b58acd2002-03-27 13:48:44 +00001766
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001767 /* ser. port 1: */
1768#define PPAR_UPR 0x00001000 /* UART Pin Reassignment */
1769#define PPAR_UARTTR (PPAR_UPR*0) /* UART on TXD_1 & RXD_1 */
1770#define PPAR_UARTGPIO (PPAR_UPR*1) /* UART on GPIO [14:15] */
1771 /* ser. port 4: */
1772#define PPAR_SPR 0x00040000 /* SSP Pin Reassignment */
wdenk3b58acd2002-03-27 13:48:44 +00001773#define PPAR_SSPTRSS (PPAR_SPR*0) /* SSP on TXD_C, RXD_C, SCLK_C, */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001774 /* & SFRM_C */
1775#define PPAR_SSPGPIO (PPAR_SPR*1) /* SSP on GPIO [10:13] */
wdenk3b58acd2002-03-27 13:48:44 +00001776
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001777#define PSDR_OutL 0 /* Output Low in sleep mode */
1778#define PSDR_Flt 1 /* Floating (input) in sleep mode */
wdenk3b58acd2002-03-27 13:48:44 +00001779
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001780#define PPFR_LCD 0x00000001 /* LCD controller */
wdenk3b58acd2002-03-27 13:48:44 +00001781#define PPFR_SP1TX 0x00001000 /* Ser. Port 1 SDLC/UART Transmit */
1782#define PPFR_SP1RX 0x00002000 /* Ser. Port 1 SDLC/UART Receive */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001783#define PPFR_SP2TX 0x00004000 /* Ser. Port 2 ICP Transmit */
1784#define PPFR_SP2RX 0x00008000 /* Ser. Port 2 ICP Receive */
1785#define PPFR_SP3TX 0x00010000 /* Ser. Port 3 UART Transmit */
1786#define PPFR_SP3RX 0x00020000 /* Ser. Port 3 UART Receive */
1787#define PPFR_SP4 0x00040000 /* Ser. Port 4 MCP/SSP */
1788#define PPFR_PerEn 0 /* Peripheral Enabled */
1789#define PPFR_PPCEn 1 /* PPC Enabled */
wdenk3b58acd2002-03-27 13:48:44 +00001790
1791
1792/*
1793 * Dynamic Random-Access Memory (DRAM) control registers
1794 *
1795 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001796 * MDCNFG Memory system: Dynamic Random-Access Memory (DRAM)
1797 * CoNFiGuration register (read/write).
1798 * MDCAS0 Memory system: Dynamic Random-Access Memory (DRAM)
1799 * Column Address Strobe (CAS) shift register 0
1800 * (read/write).
1801 * MDCAS1 Memory system: Dynamic Random-Access Memory (DRAM)
1802 * Column Address Strobe (CAS) shift register 1
1803 * (read/write).
1804 * MDCAS2 Memory system: Dynamic Random-Access Memory (DRAM)
1805 * Column Address Strobe (CAS) shift register 2
1806 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001807 *
1808 * Clocks
1809 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1810 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1811 * fcas, Tcas Frequency, period of the DRAM CAS shift registers.
1812 */
1813
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001814 /* Memory system: */
1815#define _MDCNFG 0xA0000000 /* DRAM CoNFiGuration reg. */
1816#define _MDCAS(Nb) /* DRAM CAS shift reg. [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001817 (0xA0000004 + (Nb)*4)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001818#define _MDCAS0 _MDCAS (0) /* DRAM CAS shift reg. 0 */
1819#define _MDCAS1 _MDCAS (1) /* DRAM CAS shift reg. 1 */
1820#define _MDCAS2 _MDCAS (2) /* DRAM CAS shift reg. 2 */
wdenk3b58acd2002-03-27 13:48:44 +00001821
1822#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001823 /* Memory system: */
1824#define MDCNFG /* DRAM CoNFiGuration reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00001825 (*((volatile Word *) io_p2v (_MDCNFG)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001826#define MDCAS /* DRAM CAS shift reg. [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001827 ((volatile Word *) io_p2v (_MDCAS (0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001828#define MDCAS0 (MDCAS [0]) /* DRAM CAS shift reg. 0 */
1829#define MDCAS1 (MDCAS [1]) /* DRAM CAS shift reg. 1 */
1830#define MDCAS2 (MDCAS [2]) /* DRAM CAS shift reg. 2 */
wdenk3b58acd2002-03-27 13:48:44 +00001831
1832#elif LANGUAGE == Assembly
1833
1834#define MDCNFG (io_p2v(_MDCNFG))
1835
1836#endif /* LANGUAGE == C */
1837
1838/* SA1100 MDCNFG values */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001839#define MDCNFG_DE(Nb) /* DRAM Enable bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001840 (0x00000001 << (Nb))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001841#define MDCNFG_DE0 MDCNFG_DE (0) /* DRAM Enable bank 0 */
1842#define MDCNFG_DE1 MDCNFG_DE (1) /* DRAM Enable bank 1 */
1843#define MDCNFG_DE2 MDCNFG_DE (2) /* DRAM Enable bank 2 */
1844#define MDCNFG_DE3 MDCNFG_DE (3) /* DRAM Enable bank 3 */
1845#define MDCNFG_DRAC Fld (2, 4) /* DRAM Row Address Count - 9 */
1846#define MDCNFG_RowAdd(Add) /* Row Address count [9..12] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001847 (((Add) - 9) << FShft (MDCNFG_DRAC))
wdenk3b58acd2002-03-27 13:48:44 +00001848#define MDCNFG_CDB2 0x00000040 /* shift reg. Clock Divide By 2 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001849 /* (fcas = fcpu/2) */
wdenk3b58acd2002-03-27 13:48:44 +00001850#define MDCNFG_TRP Fld (4, 7) /* Time RAS Pre-charge - 1 [Tmem] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001851#define MDCNFG_PrChrg(Tcpu) /* Pre-Charge time [2..32 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001852 (((Tcpu) - 2)/2 << FShft (MDCNFG_TRP))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001853#define MDCNFG_CeilPrChrg(Tcpu) /* Ceil. of PrChrg [2..32 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001854 (((Tcpu) - 1)/2 << FShft (MDCNFG_TRP))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001855#define MDCNFG_TRASR Fld (4, 11) /* Time RAS Refresh - 1 [Tmem] */
1856#define MDCNFG_Ref(Tcpu) /* Refresh time [2..32 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001857 (((Tcpu) - 2)/2 << FShft (MDCNFG_TRASR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001858#define MDCNFG_CeilRef(Tcpu) /* Ceil. of Ref [2..32 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001859 (((Tcpu) - 1)/2 << FShft (MDCNFG_TRASR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001860#define MDCNFG_TDL Fld (2, 15) /* Time Data Latch [Tcpu] */
1861#define MDCNFG_DataLtch(Tcpu) /* Data Latch delay [0..3 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001862 ((Tcpu) << FShft (MDCNFG_TDL))
wdenk3b58acd2002-03-27 13:48:44 +00001863#define MDCNFG_DRI Fld (15, 17) /* min. DRAM Refresh Interval/4 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001864 /* [Tmem] */
1865#define MDCNFG_RefInt(Tcpu) /* min. Refresh Interval */ \
1866 /* [0..262136 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001867 ((Tcpu)/8 << FShft (MDCNFG_DRI))
wdenk3b58acd2002-03-27 13:48:44 +00001868
1869/* SA1110 MDCNFG values */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001870#define MDCNFG_SA1110_DE0 0x00000001 /* DRAM Enable bank 0 */
1871#define MDCNFG_SA1110_DE1 0x00000002 /* DRAM Enable bank 1 */
wdenk3b58acd2002-03-27 13:48:44 +00001872#define MDCNFG_SA1110_DTIM0 0x00000004 /* DRAM timing type 0/1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001873#define MDCNFG_SA1110_DWID0 0x00000008 /* DRAM bus width 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001874#define MDCNFG_SA1110_DRAC0 Fld(3, 4) /* DRAM row addr bit count */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001875 /* bank 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001876#define MDCNFG_SA1110_CDB20 0x00000080 /* Mem Clock divide by 2 0/1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001877#define MDCNFG_SA1110_TRP0 Fld(3, 8) /* RAS precharge 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001878#define MDCNFG_SA1110_TDL0 Fld(2, 12) /* Data input latch after CAS*/
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001879 /* deassertion 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001880#define MDCNFG_SA1110_TWR0 Fld(2, 14) /* SDRAM write recovery 0/1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001881#define MDCNFG_SA1110_DE2 0x00010000 /* DRAM Enable bank 0 */
1882#define MDCNFG_SA1110_DE3 0x00020000 /* DRAM Enable bank 1 */
wdenk3b58acd2002-03-27 13:48:44 +00001883#define MDCNFG_SA1110_DTIM2 0x00040000 /* DRAM timing type 0/1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001884#define MDCNFG_SA1110_DWID2 0x00080000 /* DRAM bus width 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001885#define MDCNFG_SA1110_DRAC2 Fld(3, 20) /* DRAM row addr bit count */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001886 /* bank 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001887#define MDCNFG_SA1110_CDB22 0x00800000 /* Mem Clock divide by 2 0/1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001888#define MDCNFG_SA1110_TRP2 Fld(3, 24) /* RAS precharge 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001889#define MDCNFG_SA1110_TDL2 Fld(2, 28) /* Data input latch after CAS*/
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001890 /* deassertion 0/1 */
wdenk3b58acd2002-03-27 13:48:44 +00001891#define MDCNFG_SA1110_TWR2 Fld(2, 30) /* SDRAM write recovery 0/1 */
1892
1893
1894/*
1895 * Static memory control registers
1896 *
1897 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001898 * MSC0 Memory system: Static memory Control register 0
1899 * (read/write).
1900 * MSC1 Memory system: Static memory Control register 1
1901 * (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001902 *
1903 * Clocks
1904 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1905 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1906 */
1907
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001908 /* Memory system: */
1909#define _MSC(Nb) /* Static memory Control reg. */ \
1910 /* [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001911 (0xA0000010 + (Nb)*4)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001912#define _MSC0 _MSC (0) /* Static memory Control reg. 0 */
1913#define _MSC1 _MSC (1) /* Static memory Control reg. 1 */
wdenk3b58acd2002-03-27 13:48:44 +00001914#define _MSC2 0xA000002C /* Static memory Control reg. 2, not contiguous */
1915
1916#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001917 /* Memory system: */
1918#define MSC /* Static memory Control reg. */ \
1919 /* [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001920 ((volatile Word *) io_p2v (_MSC (0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001921#define MSC0 (MSC [0]) /* Static memory Control reg. 0 */
1922#define MSC1 (MSC [1]) /* Static memory Control reg. 1 */
1923#define MSC2 (*(volatile Word *) io_p2v (_MSC2)) /* Static memory Control reg. 2 */
wdenk3b58acd2002-03-27 13:48:44 +00001924
1925#elif LANGUAGE == Assembly
1926
1927#define MSC0 io_p2v(0xa0000010)
1928#define MSC1 io_p2v(0xa0000014)
1929#define MSC2 io_p2v(0xa000002c)
1930
1931#endif /* LANGUAGE == C */
1932
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001933#define MSC_Bnk(Nb) /* static memory Bank [0..3] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001934 Fld (16, ((Nb) Modulo 2)*16)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001935#define MSC0_Bnk0 MSC_Bnk (0) /* static memory Bank 0 */
1936#define MSC0_Bnk1 MSC_Bnk (1) /* static memory Bank 1 */
1937#define MSC1_Bnk2 MSC_Bnk (2) /* static memory Bank 2 */
1938#define MSC1_Bnk3 MSC_Bnk (3) /* static memory Bank 3 */
wdenk3b58acd2002-03-27 13:48:44 +00001939
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001940#define MSC_RT Fld (2, 0) /* ROM/static memory Type */
1941#define MSC_NonBrst /* Non-Burst static memory */ \
wdenk8bde7f72003-06-27 21:31:46 +00001942 (0 << FShft (MSC_RT))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001943#define MSC_SRAM /* 32-bit byte-writable SRAM */ \
wdenk8bde7f72003-06-27 21:31:46 +00001944 (1 << FShft (MSC_RT))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001945#define MSC_Brst4 /* Burst-of-4 static memory */ \
wdenk8bde7f72003-06-27 21:31:46 +00001946 (2 << FShft (MSC_RT))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001947#define MSC_Brst8 /* Burst-of-8 static memory */ \
wdenk8bde7f72003-06-27 21:31:46 +00001948 (3 << FShft (MSC_RT))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001949#define MSC_RBW 0x0004 /* ROM/static memory Bus Width */
1950#define MSC_32BitStMem (MSC_RBW*0) /* 32-Bit Static Memory */
1951#define MSC_16BitStMem (MSC_RBW*1) /* 16-Bit Static Memory */
1952#define MSC_RDF Fld (5, 3) /* ROM/static memory read Delay */
1953 /* First access - 1(.5) [Tmem] */
1954#define MSC_1stRdAcc(Tcpu) /* 1st Read Access time (burst */ \
wdenk8bde7f72003-06-27 21:31:46 +00001955 /* static memory) [3..65 Tcpu] */ \
1956 ((((Tcpu) - 3)/2) << FShft (MSC_RDF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001957#define MSC_Ceil1stRdAcc(Tcpu) /* Ceil. of 1stRdAcc [3..65 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001958 ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001959#define MSC_RdAcc(Tcpu) /* Read Access time (non-burst */ \
wdenk8bde7f72003-06-27 21:31:46 +00001960 /* static memory) [2..64 Tcpu] */ \
1961 ((((Tcpu) - 2)/2) << FShft (MSC_RDF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001962#define MSC_CeilRdAcc(Tcpu) /* Ceil. of RdAcc [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001963 ((((Tcpu) - 1)/2) << FShft (MSC_RDF))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001964#define MSC_RDN Fld (5, 8) /* ROM/static memory read Delay */
1965 /* Next access - 1 [Tmem] */
1966#define MSC_NxtRdAcc(Tcpu) /* Next Read Access time (burst */ \
wdenk8bde7f72003-06-27 21:31:46 +00001967 /* static memory) [2..64 Tcpu] */ \
1968 ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001969#define MSC_CeilNxtRdAcc(Tcpu) /* Ceil. of NxtRdAcc [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001970 ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001971#define MSC_WrAcc(Tcpu) /* Write Access time (non-burst */ \
wdenk8bde7f72003-06-27 21:31:46 +00001972 /* static memory) [2..64 Tcpu] */ \
1973 ((((Tcpu) - 2)/2) << FShft (MSC_RDN))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001974#define MSC_CeilWrAcc(Tcpu) /* Ceil. of WrAcc [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001975 ((((Tcpu) - 1)/2) << FShft (MSC_RDN))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001976#define MSC_RRR Fld (3, 13) /* ROM/static memory RecoveRy */
1977 /* time/2 [Tmem] */
1978#define MSC_Rec(Tcpu) /* Recovery time [0..28 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001979 (((Tcpu)/4) << FShft (MSC_RRR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001980#define MSC_CeilRec(Tcpu) /* Ceil. of Rec [0..28 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00001981 ((((Tcpu) + 3)/4) << FShft (MSC_RRR))
wdenk3b58acd2002-03-27 13:48:44 +00001982
1983
1984/*
1985 * Personal Computer Memory Card International Association (PCMCIA) control
1986 * register
1987 *
1988 * Register
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001989 * MECR Memory system: Expansion memory bus (PCMCIA)
1990 * Configuration Register (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00001991 *
1992 * Clocks
1993 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
1994 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
1995 * fbclk, Tbclk Frequency, period of the PCMCIA clock (BCLK).
1996 */
1997
Wolfgang Denk53677ef2008-05-20 16:00:29 +02001998 /* Memory system: */
1999#define _MECR 0xA0000018 /* Expansion memory bus (PCMCIA) */
2000 /* Configuration Reg. */
wdenk3b58acd2002-03-27 13:48:44 +00002001
2002#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002003 /* Memory system: */
2004#define MECR /* Expansion memory bus (PCMCIA) */ \
2005 /* Configuration Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00002006 (*((volatile Word *) io_p2v (_MECR)))
wdenk3b58acd2002-03-27 13:48:44 +00002007#endif /* LANGUAGE == C */
2008
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002009#define MECR_PCMCIA(Nb) /* PCMCIA [0..1] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002010 Fld (15, (Nb)*16)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002011#define MECR_PCMCIA0 MECR_PCMCIA (0) /* PCMCIA 0 */
2012#define MECR_PCMCIA1 MECR_PCMCIA (1) /* PCMCIA 1 */
wdenk3b58acd2002-03-27 13:48:44 +00002013
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002014#define MECR_BSIO Fld (5, 0) /* BCLK Select I/O - 1 [Tmem] */
2015#define MECR_IOClk(Tcpu) /* I/O Clock [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002016 ((((Tcpu) - 2)/2) << FShft (MECR_BSIO))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002017#define MECR_CeilIOClk(Tcpu) /* Ceil. of IOClk [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002018 ((((Tcpu) - 1)/2) << FShft (MECR_BSIO))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002019#define MECR_BSA Fld (5, 5) /* BCLK Select Attribute - 1 */
2020 /* [Tmem] */
2021#define MECR_AttrClk(Tcpu) /* Attribute Clock [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002022 ((((Tcpu) - 2)/2) << FShft (MECR_BSA))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002023#define MECR_CeilAttrClk(Tcpu) /* Ceil. of AttrClk [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002024 ((((Tcpu) - 1)/2) << FShft (MECR_BSA))
wdenk3b58acd2002-03-27 13:48:44 +00002025#define MECR_BSM Fld (5, 10) /* BCLK Select Memory - 1 [Tmem] */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002026#define MECR_MemClk(Tcpu) /* Memory Clock [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002027 ((((Tcpu) - 2)/2) << FShft (MECR_BSM))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002028#define MECR_CeilMemClk(Tcpu) /* Ceil. of MemClk [2..64 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002029 ((((Tcpu) - 1)/2) << FShft (MECR_BSM))
wdenk3b58acd2002-03-27 13:48:44 +00002030
2031/*
2032 * On SA1110 only
2033 */
2034
2035#define _MDREFR 0xA000001C
2036
2037#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002038 /* Memory system: */
wdenk3b58acd2002-03-27 13:48:44 +00002039#define MDREFR \
wdenk8bde7f72003-06-27 21:31:46 +00002040 (*((volatile Word *) io_p2v (_MDREFR)))
wdenk3b58acd2002-03-27 13:48:44 +00002041
2042#elif LANGUAGE == Assembly
2043
2044#define MDREFR (io_p2v(_MDREFR))
2045
2046#endif /* LANGUAGE == C */
2047
2048#define MDREFR_TRASR Fld (4, 0)
2049#define MDREFR_DRI Fld (12, 4)
2050#define MDREFR_E0PIN (1 << 16)
2051#define MDREFR_K0RUN (1 << 17)
2052#define MDREFR_K0DB2 (1 << 18)
2053#define MDREFR_E1PIN (1 << 20)
2054#define MDREFR_K1RUN (1 << 21)
2055#define MDREFR_K1DB2 (1 << 22)
2056#define MDREFR_K2RUN (1 << 25)
2057#define MDREFR_K2DB2 (1 << 26)
2058#define MDREFR_EAPD (1 << 28)
2059#define MDREFR_KAPD (1 << 29)
2060#define MDREFR_SLFRSH (1 << 31)
2061
2062
2063/*
2064 * Direct Memory Access (DMA) control registers
2065 *
2066 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002067 * DDAR0 Direct Memory Access (DMA) Device Address Register
2068 * channel 0 (read/write).
2069 * DCSR0 Direct Memory Access (DMA) Control and Status
2070 * Register channel 0 (read/write).
2071 * DBSA0 Direct Memory Access (DMA) Buffer Start address
2072 * register A channel 0 (read/write).
2073 * DBTA0 Direct Memory Access (DMA) Buffer Transfer count
2074 * register A channel 0 (read/write).
2075 * DBSB0 Direct Memory Access (DMA) Buffer Start address
2076 * register B channel 0 (read/write).
2077 * DBTB0 Direct Memory Access (DMA) Buffer Transfer count
2078 * register B channel 0 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002079 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002080 * DDAR1 Direct Memory Access (DMA) Device Address Register
2081 * channel 1 (read/write).
2082 * DCSR1 Direct Memory Access (DMA) Control and Status
2083 * Register channel 1 (read/write).
2084 * DBSA1 Direct Memory Access (DMA) Buffer Start address
2085 * register A channel 1 (read/write).
2086 * DBTA1 Direct Memory Access (DMA) Buffer Transfer count
2087 * register A channel 1 (read/write).
2088 * DBSB1 Direct Memory Access (DMA) Buffer Start address
2089 * register B channel 1 (read/write).
2090 * DBTB1 Direct Memory Access (DMA) Buffer Transfer count
2091 * register B channel 1 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002092 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002093 * DDAR2 Direct Memory Access (DMA) Device Address Register
2094 * channel 2 (read/write).
2095 * DCSR2 Direct Memory Access (DMA) Control and Status
2096 * Register channel 2 (read/write).
2097 * DBSA2 Direct Memory Access (DMA) Buffer Start address
2098 * register A channel 2 (read/write).
2099 * DBTA2 Direct Memory Access (DMA) Buffer Transfer count
2100 * register A channel 2 (read/write).
2101 * DBSB2 Direct Memory Access (DMA) Buffer Start address
2102 * register B channel 2 (read/write).
2103 * DBTB2 Direct Memory Access (DMA) Buffer Transfer count
2104 * register B channel 2 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002105 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002106 * DDAR3 Direct Memory Access (DMA) Device Address Register
2107 * channel 3 (read/write).
2108 * DCSR3 Direct Memory Access (DMA) Control and Status
2109 * Register channel 3 (read/write).
2110 * DBSA3 Direct Memory Access (DMA) Buffer Start address
2111 * register A channel 3 (read/write).
2112 * DBTA3 Direct Memory Access (DMA) Buffer Transfer count
2113 * register A channel 3 (read/write).
2114 * DBSB3 Direct Memory Access (DMA) Buffer Start address
2115 * register B channel 3 (read/write).
2116 * DBTB3 Direct Memory Access (DMA) Buffer Transfer count
2117 * register B channel 3 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002118 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002119 * DDAR4 Direct Memory Access (DMA) Device Address Register
2120 * channel 4 (read/write).
2121 * DCSR4 Direct Memory Access (DMA) Control and Status
2122 * Register channel 4 (read/write).
2123 * DBSA4 Direct Memory Access (DMA) Buffer Start address
2124 * register A channel 4 (read/write).
2125 * DBTA4 Direct Memory Access (DMA) Buffer Transfer count
2126 * register A channel 4 (read/write).
2127 * DBSB4 Direct Memory Access (DMA) Buffer Start address
2128 * register B channel 4 (read/write).
2129 * DBTB4 Direct Memory Access (DMA) Buffer Transfer count
2130 * register B channel 4 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002131 *
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002132 * DDAR5 Direct Memory Access (DMA) Device Address Register
2133 * channel 5 (read/write).
2134 * DCSR5 Direct Memory Access (DMA) Control and Status
2135 * Register channel 5 (read/write).
2136 * DBSA5 Direct Memory Access (DMA) Buffer Start address
2137 * register A channel 5 (read/write).
2138 * DBTA5 Direct Memory Access (DMA) Buffer Transfer count
2139 * register A channel 5 (read/write).
2140 * DBSB5 Direct Memory Access (DMA) Buffer Start address
2141 * register B channel 5 (read/write).
2142 * DBTB5 Direct Memory Access (DMA) Buffer Transfer count
2143 * register B channel 5 (read/write).
wdenk3b58acd2002-03-27 13:48:44 +00002144 */
2145
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002146#define DMASp 0x00000020 /* DMA control reg. Space [byte] */
wdenk3b58acd2002-03-27 13:48:44 +00002147
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002148#define _DDAR(Nb) /* DMA Device Address Reg. */ \
2149 /* channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002150 (0xB0000000 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002151#define _SetDCSR(Nb) /* Set DMA Control & Status Reg. */ \
2152 /* channel [0..5] (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002153 (0xB0000004 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002154#define _ClrDCSR(Nb) /* Clear DMA Control & Status Reg. */ \
2155 /* channel [0..5] (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002156 (0xB0000008 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002157#define _RdDCSR(Nb) /* Read DMA Control & Status Reg. */ \
2158 /* channel [0..5] (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002159 (0xB000000C + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002160#define _DBSA(Nb) /* DMA Buffer Start address reg. A */ \
2161 /* channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002162 (0xB0000010 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002163#define _DBTA(Nb) /* DMA Buffer Transfer count */ \
2164 /* reg. A channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002165 (0xB0000014 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002166#define _DBSB(Nb) /* DMA Buffer Start address reg. B */ \
2167 /* channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002168 (0xB0000018 + (Nb)*DMASp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002169#define _DBTB(Nb) /* DMA Buffer Transfer count */ \
2170 /* reg. B channel [0..5] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002171 (0xB000001C + (Nb)*DMASp)
wdenk3b58acd2002-03-27 13:48:44 +00002172
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002173#define _DDAR0 _DDAR (0) /* DMA Device Address Reg. */
2174 /* channel 0 */
wdenk3b58acd2002-03-27 13:48:44 +00002175#define _SetDCSR0 _SetDCSR (0) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002176 /* channel 0 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002177#define _ClrDCSR0 _ClrDCSR (0) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002178 /* channel 0 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002179#define _RdDCSR0 _RdDCSR (0) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002180 /* channel 0 (read) */
2181#define _DBSA0 _DBSA (0) /* DMA Buffer Start address reg. A */
2182 /* channel 0 */
2183#define _DBTA0 _DBTA (0) /* DMA Buffer Transfer count */
2184 /* reg. A channel 0 */
2185#define _DBSB0 _DBSB (0) /* DMA Buffer Start address reg. B */
2186 /* channel 0 */
2187#define _DBTB0 _DBTB (0) /* DMA Buffer Transfer count */
2188 /* reg. B channel 0 */
wdenk3b58acd2002-03-27 13:48:44 +00002189
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002190#define _DDAR1 _DDAR (1) /* DMA Device Address Reg. */
2191 /* channel 1 */
wdenk3b58acd2002-03-27 13:48:44 +00002192#define _SetDCSR1 _SetDCSR (1) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002193 /* channel 1 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002194#define _ClrDCSR1 _ClrDCSR (1) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002195 /* channel 1 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002196#define _RdDCSR1 _RdDCSR (1) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002197 /* channel 1 (read) */
2198#define _DBSA1 _DBSA (1) /* DMA Buffer Start address reg. A */
2199 /* channel 1 */
2200#define _DBTA1 _DBTA (1) /* DMA Buffer Transfer count */
2201 /* reg. A channel 1 */
2202#define _DBSB1 _DBSB (1) /* DMA Buffer Start address reg. B */
2203 /* channel 1 */
2204#define _DBTB1 _DBTB (1) /* DMA Buffer Transfer count */
2205 /* reg. B channel 1 */
wdenk3b58acd2002-03-27 13:48:44 +00002206
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002207#define _DDAR2 _DDAR (2) /* DMA Device Address Reg. */
2208 /* channel 2 */
wdenk3b58acd2002-03-27 13:48:44 +00002209#define _SetDCSR2 _SetDCSR (2) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002210 /* channel 2 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002211#define _ClrDCSR2 _ClrDCSR (2) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002212 /* channel 2 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002213#define _RdDCSR2 _RdDCSR (2) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002214 /* channel 2 (read) */
2215#define _DBSA2 _DBSA (2) /* DMA Buffer Start address reg. A */
2216 /* channel 2 */
2217#define _DBTA2 _DBTA (2) /* DMA Buffer Transfer count */
2218 /* reg. A channel 2 */
2219#define _DBSB2 _DBSB (2) /* DMA Buffer Start address reg. B */
2220 /* channel 2 */
2221#define _DBTB2 _DBTB (2) /* DMA Buffer Transfer count */
2222 /* reg. B channel 2 */
wdenk3b58acd2002-03-27 13:48:44 +00002223
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002224#define _DDAR3 _DDAR (3) /* DMA Device Address Reg. */
2225 /* channel 3 */
wdenk3b58acd2002-03-27 13:48:44 +00002226#define _SetDCSR3 _SetDCSR (3) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002227 /* channel 3 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002228#define _ClrDCSR3 _ClrDCSR (3) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002229 /* channel 3 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002230#define _RdDCSR3 _RdDCSR (3) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002231 /* channel 3 (read) */
2232#define _DBSA3 _DBSA (3) /* DMA Buffer Start address reg. A */
2233 /* channel 3 */
2234#define _DBTA3 _DBTA (3) /* DMA Buffer Transfer count */
2235 /* reg. A channel 3 */
2236#define _DBSB3 _DBSB (3) /* DMA Buffer Start address reg. B */
2237 /* channel 3 */
2238#define _DBTB3 _DBTB (3) /* DMA Buffer Transfer count */
2239 /* reg. B channel 3 */
wdenk3b58acd2002-03-27 13:48:44 +00002240
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002241#define _DDAR4 _DDAR (4) /* DMA Device Address Reg. */
2242 /* channel 4 */
wdenk3b58acd2002-03-27 13:48:44 +00002243#define _SetDCSR4 _SetDCSR (4) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002244 /* channel 4 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002245#define _ClrDCSR4 _ClrDCSR (4) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002246 /* channel 4 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002247#define _RdDCSR4 _RdDCSR (4) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002248 /* channel 4 (read) */
2249#define _DBSA4 _DBSA (4) /* DMA Buffer Start address reg. A */
2250 /* channel 4 */
2251#define _DBTA4 _DBTA (4) /* DMA Buffer Transfer count */
2252 /* reg. A channel 4 */
2253#define _DBSB4 _DBSB (4) /* DMA Buffer Start address reg. B */
2254 /* channel 4 */
2255#define _DBTB4 _DBTB (4) /* DMA Buffer Transfer count */
2256 /* reg. B channel 4 */
wdenk3b58acd2002-03-27 13:48:44 +00002257
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002258#define _DDAR5 _DDAR (5) /* DMA Device Address Reg. */
2259 /* channel 5 */
wdenk3b58acd2002-03-27 13:48:44 +00002260#define _SetDCSR5 _SetDCSR (5) /* Set DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002261 /* channel 5 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002262#define _ClrDCSR5 _ClrDCSR (5) /* Clear DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002263 /* channel 5 (write) */
wdenk3b58acd2002-03-27 13:48:44 +00002264#define _RdDCSR5 _RdDCSR (5) /* Read DMA Control & Status Reg. */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002265 /* channel 5 (read) */
2266#define _DBSA5 _DBSA (5) /* DMA Buffer Start address reg. A */
2267 /* channel 5 */
2268#define _DBTA5 _DBTA (5) /* DMA Buffer Transfer count */
2269 /* reg. A channel 5 */
2270#define _DBSB5 _DBSB (5) /* DMA Buffer Start address reg. B */
2271 /* channel 5 */
2272#define _DBTB5 _DBTB (5) /* DMA Buffer Transfer count */
2273 /* reg. B channel 5 */
wdenk3b58acd2002-03-27 13:48:44 +00002274
2275#if LANGUAGE == C
2276
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002277#define DDAR0 /* DMA Device Address Reg. */ \
2278 /* channel 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002279 (*((volatile Word *) io_p2v (_DDAR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002280#define SetDCSR0 /* Set DMA Control & Status Reg. */ \
2281 /* channel 0 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002282 (*((volatile Word *) io_p2v (_SetDCSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002283#define ClrDCSR0 /* Clear DMA Control & Status Reg. */ \
2284 /* channel 0 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002285 (*((volatile Word *) io_p2v (_ClrDCSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002286#define RdDCSR0 /* Read DMA Control & Status Reg. */ \
2287 /* channel 0 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002288 (*((volatile Word *) io_p2v (_RdDCSR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002289#define DBSA0 /* DMA Buffer Start address reg. A */ \
2290 /* channel 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002291 (*((volatile Address *) io_p2v (_DBSA0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002292#define DBTA0 /* DMA Buffer Transfer count */ \
2293 /* reg. A channel 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002294 (*((volatile Word *) io_p2v (_DBTA0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002295#define DBSB0 /* DMA Buffer Start address reg. B */ \
2296 /* channel 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002297 (*((volatile Address *) io_p2v (_DBSB0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002298#define DBTB0 /* DMA Buffer Transfer count */ \
2299 /* reg. B channel 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002300 (*((volatile Word *) io_p2v (_DBTB0)))
wdenk3b58acd2002-03-27 13:48:44 +00002301
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002302#define DDAR1 /* DMA Device Address Reg. */ \
2303 /* channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002304 (*((volatile Word *) io_p2v (_DDAR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002305#define SetDCSR1 /* Set DMA Control & Status Reg. */ \
2306 /* channel 1 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002307 (*((volatile Word *) io_p2v (_SetDCSR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002308#define ClrDCSR1 /* Clear DMA Control & Status Reg. */ \
2309 /* channel 1 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002310 (*((volatile Word *) io_p2v (_ClrDCSR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002311#define RdDCSR1 /* Read DMA Control & Status Reg. */ \
2312 /* channel 1 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002313 (*((volatile Word *) io_p2v (_RdDCSR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002314#define DBSA1 /* DMA Buffer Start address reg. A */ \
2315 /* channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002316 (*((volatile Address *) io_p2v (_DBSA1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002317#define DBTA1 /* DMA Buffer Transfer count */ \
2318 /* reg. A channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002319 (*((volatile Word *) io_p2v (_DBTA1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002320#define DBSB1 /* DMA Buffer Start address reg. B */ \
2321 /* channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002322 (*((volatile Address *) io_p2v (_DBSB1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002323#define DBTB1 /* DMA Buffer Transfer count */ \
2324 /* reg. B channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002325 (*((volatile Word *) io_p2v (_DBTB1)))
wdenk3b58acd2002-03-27 13:48:44 +00002326
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002327#define DDAR2 /* DMA Device Address Reg. */ \
2328 /* channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002329 (*((volatile Word *) io_p2v (_DDAR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002330#define SetDCSR2 /* Set DMA Control & Status Reg. */ \
2331 /* channel 2 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002332 (*((volatile Word *) io_p2v (_SetDCSR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002333#define ClrDCSR2 /* Clear DMA Control & Status Reg. */ \
2334 /* channel 2 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002335 (*((volatile Word *) io_p2v (_ClrDCSR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002336#define RdDCSR2 /* Read DMA Control & Status Reg. */ \
2337 /* channel 2 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002338 (*((volatile Word *) io_p2v (_RdDCSR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002339#define DBSA2 /* DMA Buffer Start address reg. A */ \
2340 /* channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002341 (*((volatile Address *) io_p2v (_DBSA2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002342#define DBTA2 /* DMA Buffer Transfer count */ \
2343 /* reg. A channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002344 (*((volatile Word *) io_p2v (_DBTA2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002345#define DBSB2 /* DMA Buffer Start address reg. B */ \
2346 /* channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002347 (*((volatile Address *) io_p2v (_DBSB2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002348#define DBTB2 /* DMA Buffer Transfer count */ \
2349 /* reg. B channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002350 (*((volatile Word *) io_p2v (_DBTB2)))
wdenk3b58acd2002-03-27 13:48:44 +00002351
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002352#define DDAR3 /* DMA Device Address Reg. */ \
2353 /* channel 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002354 (*((volatile Word *) io_p2v (_DDAR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002355#define SetDCSR3 /* Set DMA Control & Status Reg. */ \
2356 /* channel 3 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002357 (*((volatile Word *) io_p2v (_SetDCSR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002358#define ClrDCSR3 /* Clear DMA Control & Status Reg. */ \
2359 /* channel 3 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002360 (*((volatile Word *) io_p2v (_ClrDCSR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002361#define RdDCSR3 /* Read DMA Control & Status Reg. */ \
2362 /* channel 3 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002363 (*((volatile Word *) io_p2v (_RdDCSR3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002364#define DBSA3 /* DMA Buffer Start address reg. A */ \
2365 /* channel 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002366 (*((volatile Address *) io_p2v (_DBSA3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002367#define DBTA3 /* DMA Buffer Transfer count */ \
2368 /* reg. A channel 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002369 (*((volatile Word *) io_p2v (_DBTA3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002370#define DBSB3 /* DMA Buffer Start address reg. B */ \
2371 /* channel 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002372 (*((volatile Address *) io_p2v (_DBSB3)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002373#define DBTB3 /* DMA Buffer Transfer count */ \
2374 /* reg. B channel 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002375 (*((volatile Word *) io_p2v (_DBTB3)))
wdenk3b58acd2002-03-27 13:48:44 +00002376
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002377#define DDAR4 /* DMA Device Address Reg. */ \
2378 /* channel 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002379 (*((volatile Word *) io_p2v (_DDAR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002380#define SetDCSR4 /* Set DMA Control & Status Reg. */ \
2381 /* channel 4 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002382 (*((volatile Word *) io_p2v (_SetDCSR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002383#define ClrDCSR4 /* Clear DMA Control & Status Reg. */ \
2384 /* channel 4 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002385 (*((volatile Word *) io_p2v (_ClrDCSR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002386#define RdDCSR4 /* Read DMA Control & Status Reg. */ \
2387 /* channel 4 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002388 (*((volatile Word *) io_p2v (_RdDCSR4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002389#define DBSA4 /* DMA Buffer Start address reg. A */ \
2390 /* channel 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002391 (*((volatile Address *) io_p2v (_DBSA4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002392#define DBTA4 /* DMA Buffer Transfer count */ \
2393 /* reg. A channel 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002394 (*((volatile Word *) io_p2v (_DBTA4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002395#define DBSB4 /* DMA Buffer Start address reg. B */ \
2396 /* channel 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002397 (*((volatile Address *) io_p2v (_DBSB4)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002398#define DBTB4 /* DMA Buffer Transfer count */ \
2399 /* reg. B channel 4 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002400 (*((volatile Word *) io_p2v (_DBTB4)))
wdenk3b58acd2002-03-27 13:48:44 +00002401
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002402#define DDAR5 /* DMA Device Address Reg. */ \
2403 /* channel 5 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002404 (*((volatile Word *) io_p2v (_DDAR5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002405#define SetDCSR5 /* Set DMA Control & Status Reg. */ \
2406 /* channel 5 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002407 (*((volatile Word *) io_p2v (_SetDCSR5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002408#define ClrDCSR5 /* Clear DMA Control & Status Reg. */ \
2409 /* channel 5 (write) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002410 (*((volatile Word *) io_p2v (_ClrDCSR5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002411#define RdDCSR5 /* Read DMA Control & Status Reg. */ \
2412 /* channel 5 (read) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002413 (*((volatile Word *) io_p2v (_RdDCSR5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002414#define DBSA5 /* DMA Buffer Start address reg. A */ \
2415 /* channel 5 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002416 (*((volatile Address *) io_p2v (_DBSA5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002417#define DBTA5 /* DMA Buffer Transfer count */ \
2418 /* reg. A channel 5 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002419 (*((volatile Word *) io_p2v (_DBTA5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002420#define DBSB5 /* DMA Buffer Start address reg. B */ \
2421 /* channel 5 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002422 (*((volatile Address *) io_p2v (_DBSB5)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002423#define DBTB5 /* DMA Buffer Transfer count */ \
2424 /* reg. B channel 5 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002425 (*((volatile Word *) io_p2v (_DBTB5)))
wdenk3b58acd2002-03-27 13:48:44 +00002426
2427#endif /* LANGUAGE == C */
2428
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002429#define DDAR_RW 0x00000001 /* device data Read/Write */
2430#define DDAR_DevWr (DDAR_RW*0) /* Device data Write */
2431 /* (memory -> device) */
2432#define DDAR_DevRd (DDAR_RW*1) /* Device data Read */
2433 /* (device -> memory) */
2434#define DDAR_E 0x00000002 /* big/little Endian device */
2435#define DDAR_LtlEnd (DDAR_E*0) /* Little Endian device */
2436#define DDAR_BigEnd (DDAR_E*1) /* Big Endian device */
2437#define DDAR_BS 0x00000004 /* device Burst Size */
2438#define DDAR_Brst4 (DDAR_BS*0) /* Burst-of-4 device */
2439#define DDAR_Brst8 (DDAR_BS*1) /* Burst-of-8 device */
2440#define DDAR_DW 0x00000008 /* device Data Width */
2441#define DDAR_8BitDev (DDAR_DW*0) /* 8-Bit Device */
2442#define DDAR_16BitDev (DDAR_DW*1) /* 16-Bit Device */
2443#define DDAR_DS Fld (4, 4) /* Device Select */
2444#define DDAR_Ser0UDCTr /* Ser. port 0 UDC Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002445 (0x0 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002446#define DDAR_Ser0UDCRc /* Ser. port 0 UDC Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002447 (0x1 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002448#define DDAR_Ser1SDLCTr /* Ser. port 1 SDLC Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002449 (0x2 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002450#define DDAR_Ser1SDLCRc /* Ser. port 1 SDLC Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002451 (0x3 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002452#define DDAR_Ser1UARTTr /* Ser. port 1 UART Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002453 (0x4 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002454#define DDAR_Ser1UARTRc /* Ser. port 1 UART Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002455 (0x5 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002456#define DDAR_Ser2ICPTr /* Ser. port 2 ICP Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002457 (0x6 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002458#define DDAR_Ser2ICPRc /* Ser. port 2 ICP Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002459 (0x7 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002460#define DDAR_Ser3UARTTr /* Ser. port 3 UART Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002461 (0x8 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002462#define DDAR_Ser3UARTRc /* Ser. port 3 UART Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002463 (0x9 << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002464#define DDAR_Ser4MCP0Tr /* Ser. port 4 MCP 0 Transmit */ \
2465 /* (audio) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002466 (0xA << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002467#define DDAR_Ser4MCP0Rc /* Ser. port 4 MCP 0 Receive */ \
2468 /* (audio) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002469 (0xB << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002470#define DDAR_Ser4MCP1Tr /* Ser. port 4 MCP 1 Transmit */ \
2471 /* (telecom) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002472 (0xC << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002473#define DDAR_Ser4MCP1Rc /* Ser. port 4 MCP 1 Receive */ \
2474 /* (telecom) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002475 (0xD << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002476#define DDAR_Ser4SSPTr /* Ser. port 4 SSP Transmit */ \
wdenk8bde7f72003-06-27 21:31:46 +00002477 (0xE << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002478#define DDAR_Ser4SSPRc /* Ser. port 4 SSP Receive */ \
wdenk8bde7f72003-06-27 21:31:46 +00002479 (0xF << FShft (DDAR_DS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002480#define DDAR_DA Fld (24, 8) /* Device Address */
2481#define DDAR_DevAdd(Add) /* Device Address */ \
wdenk8bde7f72003-06-27 21:31:46 +00002482 (((Add) & 0xF0000000) | \
2483 (((Add) & 0X003FFFFC) << (FShft (DDAR_DA) - 2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002484#define DDAR_Ser0UDCWr /* Ser. port 0 UDC Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002485 (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
2486 DDAR_Ser0UDCTr + DDAR_DevAdd (_Ser0UDCDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002487#define DDAR_Ser0UDCRd /* Ser. port 0 UDC Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002488 (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \
2489 DDAR_Ser0UDCRc + DDAR_DevAdd (_Ser0UDCDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002490#define DDAR_Ser1UARTWr /* Ser. port 1 UART Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002491 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
2492 DDAR_Ser1UARTTr + DDAR_DevAdd (_Ser1UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002493#define DDAR_Ser1UARTRd /* Ser. port 1 UART Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002494 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
2495 DDAR_Ser1UARTRc + DDAR_DevAdd (_Ser1UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002496#define DDAR_Ser1SDLCWr /* Ser. port 1 SDLC Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002497 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
2498 DDAR_Ser1SDLCTr + DDAR_DevAdd (_Ser1SDDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002499#define DDAR_Ser1SDLCRd /* Ser. port 1 SDLC Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002500 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
2501 DDAR_Ser1SDLCRc + DDAR_DevAdd (_Ser1SDDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002502#define DDAR_Ser2UARTWr /* Ser. port 2 UART Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002503 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
2504 DDAR_Ser2ICPTr + DDAR_DevAdd (_Ser2UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002505#define DDAR_Ser2UARTRd /* Ser. port 2 UART Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002506 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
2507 DDAR_Ser2ICPRc + DDAR_DevAdd (_Ser2UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002508#define DDAR_Ser2HSSPWr /* Ser. port 2 HSSP Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002509 (DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
2510 DDAR_Ser2ICPTr + DDAR_DevAdd (_Ser2HSDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002511#define DDAR_Ser2HSSPRd /* Ser. port 2 HSSP Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002512 (DDAR_DevRd + DDAR_Brst8 + DDAR_8BitDev + \
2513 DDAR_Ser2ICPRc + DDAR_DevAdd (_Ser2HSDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002514#define DDAR_Ser3UARTWr /* Ser. port 3 UART Write */ \
wdenk8bde7f72003-06-27 21:31:46 +00002515 (DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev + \
2516 DDAR_Ser3UARTTr + DDAR_DevAdd (_Ser3UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002517#define DDAR_Ser3UARTRd /* Ser. port 3 UART Read */ \
wdenk8bde7f72003-06-27 21:31:46 +00002518 (DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev + \
2519 DDAR_Ser3UARTRc + DDAR_DevAdd (_Ser3UTDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002520#define DDAR_Ser4MCP0Wr /* Ser. port 4 MCP 0 Write (audio) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002521 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
2522 DDAR_Ser4MCP0Tr + DDAR_DevAdd (_Ser4MCDR0))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002523#define DDAR_Ser4MCP0Rd /* Ser. port 4 MCP 0 Read (audio) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002524 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
2525 DDAR_Ser4MCP0Rc + DDAR_DevAdd (_Ser4MCDR0))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002526#define DDAR_Ser4MCP1Wr /* Ser. port 4 MCP 1 Write */ \
2527 /* (telecom) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002528 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
2529 DDAR_Ser4MCP1Tr + DDAR_DevAdd (_Ser4MCDR1))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002530#define DDAR_Ser4MCP1Rd /* Ser. port 4 MCP 1 Read */ \
2531 /* (telecom) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002532 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
2533 DDAR_Ser4MCP1Rc + DDAR_DevAdd (_Ser4MCDR1))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002534#define DDAR_Ser4SSPWr /* Ser. port 4 SSP Write (16 bits) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002535 (DDAR_DevWr + DDAR_Brst4 + DDAR_16BitDev + \
2536 DDAR_Ser4SSPTr + DDAR_DevAdd (_Ser4SSDR))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002537#define DDAR_Ser4SSPRd /* Ser. port 4 SSP Read (16 bits) */ \
wdenk8bde7f72003-06-27 21:31:46 +00002538 (DDAR_DevRd + DDAR_Brst4 + DDAR_16BitDev + \
2539 DDAR_Ser4SSPRc + DDAR_DevAdd (_Ser4SSDR))
wdenk3b58acd2002-03-27 13:48:44 +00002540
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002541#define DCSR_RUN 0x00000001 /* DMA RUNing */
2542#define DCSR_IE 0x00000002 /* DMA Interrupt Enable */
2543#define DCSR_ERROR 0x00000004 /* DMA ERROR */
2544#define DCSR_DONEA 0x00000008 /* DONE DMA transfer buffer A */
wdenk3b58acd2002-03-27 13:48:44 +00002545#define DCSR_STRTA 0x00000010 /* STaRTed DMA transfer buffer A */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002546#define DCSR_DONEB 0x00000020 /* DONE DMA transfer buffer B */
wdenk3b58acd2002-03-27 13:48:44 +00002547#define DCSR_STRTB 0x00000040 /* STaRTed DMA transfer buffer B */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002548#define DCSR_BIU 0x00000080 /* DMA Buffer In Use */
2549#define DCSR_BufA (DCSR_BIU*0) /* DMA Buffer A in use */
2550#define DCSR_BufB (DCSR_BIU*1) /* DMA Buffer B in use */
wdenk3b58acd2002-03-27 13:48:44 +00002551
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002552#define DBT_TC Fld (13, 0) /* Transfer Count */
2553#define DBTA_TCA DBT_TC /* Transfer Count buffer A */
2554#define DBTB_TCB DBT_TC /* Transfer Count buffer B */
wdenk3b58acd2002-03-27 13:48:44 +00002555
2556
2557/*
2558 * Liquid Crystal Display (LCD) control registers
2559 *
2560 * Registers
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002561 * LCCR0 Liquid Crystal Display (LCD) Control Register 0
2562 * (read/write).
2563 * [Bits LDM, BAM, and ERM are only implemented in
2564 * versions 2.0 (rev. = 8) and higher of the StrongARM
2565 * SA-1100.]
2566 * LCSR Liquid Crystal Display (LCD) Status Register
2567 * (read/write).
2568 * [Bit LDD can be only read in versions 1.0 (rev. = 1)
2569 * and 1.1 (rev. = 2) of the StrongARM SA-1100, it can be
2570 * read and written (cleared) in versions 2.0 (rev. = 8)
2571 * and higher.]
2572 * DBAR1 Liquid Crystal Display (LCD) Direct Memory Access
2573 * (DMA) Base Address Register channel 1 (read/write).
2574 * DCAR1 Liquid Crystal Display (LCD) Direct Memory Access
2575 * (DMA) Current Address Register channel 1 (read).
2576 * DBAR2 Liquid Crystal Display (LCD) Direct Memory Access
2577 * (DMA) Base Address Register channel 2 (read/write).
2578 * DCAR2 Liquid Crystal Display (LCD) Direct Memory Access
2579 * (DMA) Current Address Register channel 2 (read).
2580 * LCCR1 Liquid Crystal Display (LCD) Control Register 1
2581 * (read/write).
2582 * [The LCCR1 register can be only written in
2583 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
2584 * StrongARM SA-1100, it can be written and read in
2585 * versions 2.0 (rev. = 8) and higher.]
2586 * LCCR2 Liquid Crystal Display (LCD) Control Register 2
2587 * (read/write).
2588 * [The LCCR1 register can be only written in
2589 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
2590 * StrongARM SA-1100, it can be written and read in
2591 * versions 2.0 (rev. = 8) and higher.]
2592 * LCCR3 Liquid Crystal Display (LCD) Control Register 3
2593 * (read/write).
2594 * [The LCCR1 register can be only written in
2595 * versions 1.0 (rev. = 1) and 1.1 (rev. = 2) of the
2596 * StrongARM SA-1100, it can be written and read in
2597 * versions 2.0 (rev. = 8) and higher. Bit PCP is only
2598 * implemented in versions 2.0 (rev. = 8) and higher of
2599 * the StrongARM SA-1100.]
wdenk3b58acd2002-03-27 13:48:44 +00002600 *
2601 * Clocks
2602 * fcpu, Tcpu Frequency, period of the CPU core clock (CCLK).
2603 * fmem, Tmem Frequency, period of the memory clock (fmem = fcpu/2).
2604 * fpix, Tpix Frequency, period of the pixel clock.
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002605 * fln, Tln Frequency, period of the line clock.
2606 * fac, Tac Frequency, period of the AC bias clock.
wdenk3b58acd2002-03-27 13:48:44 +00002607 */
2608
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002609#define LCD_PEntrySp 2 /* LCD Palette Entry Space [byte] */
2610#define LCD_4BitPSp /* LCD 4-Bit pixel Palette Space */ \
2611 /* [byte] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002612 (16*LCD_PEntrySp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002613#define LCD_8BitPSp /* LCD 8-Bit pixel Palette Space */ \
2614 /* [byte] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002615 (256*LCD_PEntrySp)
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002616#define LCD_12_16BitPSp /* LCD 12/16-Bit pixel */ \
2617 /* dummy-Palette Space [byte] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002618 (16*LCD_PEntrySp)
wdenk3b58acd2002-03-27 13:48:44 +00002619
2620#define LCD_PGrey Fld (4, 0) /* LCD Palette entry Grey value */
2621#define LCD_PBlue Fld (4, 0) /* LCD Palette entry Blue value */
2622#define LCD_PGreen Fld (4, 4) /* LCD Palette entry Green value */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002623#define LCD_PRed Fld (4, 8) /* LCD Palette entry Red value */
2624#define LCD_PBS Fld (2, 12) /* LCD Pixel Bit Size */
2625#define LCD_4Bit /* LCD 4-Bit pixel mode */ \
wdenk8bde7f72003-06-27 21:31:46 +00002626 (0 << FShft (LCD_PBS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002627#define LCD_8Bit /* LCD 8-Bit pixel mode */ \
wdenk8bde7f72003-06-27 21:31:46 +00002628 (1 << FShft (LCD_PBS))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002629#define LCD_12_16Bit /* LCD 12/16-Bit pixel mode */ \
wdenk8bde7f72003-06-27 21:31:46 +00002630 (2 << FShft (LCD_PBS))
wdenk3b58acd2002-03-27 13:48:44 +00002631
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002632#define LCD_Int0_0 0x0 /* LCD Intensity = 0.0% = 0 */
2633#define LCD_Int11_1 0x1 /* LCD Intensity = 11.1% = 1/9 */
2634#define LCD_Int20_0 0x2 /* LCD Intensity = 20.0% = 1/5 */
2635#define LCD_Int26_7 0x3 /* LCD Intensity = 26.7% = 4/15 */
2636#define LCD_Int33_3 0x4 /* LCD Intensity = 33.3% = 3/9 */
2637#define LCD_Int40_0 0x5 /* LCD Intensity = 40.0% = 2/5 */
2638#define LCD_Int44_4 0x6 /* LCD Intensity = 44.4% = 4/9 */
2639#define LCD_Int50_0 0x7 /* LCD Intensity = 50.0% = 1/2 */
2640#define LCD_Int55_6 0x8 /* LCD Intensity = 55.6% = 5/9 */
2641#define LCD_Int60_0 0x9 /* LCD Intensity = 60.0% = 3/5 */
2642#define LCD_Int66_7 0xA /* LCD Intensity = 66.7% = 6/9 */
2643#define LCD_Int73_3 0xB /* LCD Intensity = 73.3% = 11/15 */
2644#define LCD_Int80_0 0xC /* LCD Intensity = 80.0% = 4/5 */
2645#define LCD_Int88_9 0xD /* LCD Intensity = 88.9% = 8/9 */
2646#define LCD_Int100_0 0xE /* LCD Intensity = 100.0% = 1 */
2647#define LCD_Int100_0A 0xF /* LCD Intensity = 100.0% = 1 */
2648 /* (Alternative) */
wdenk3b58acd2002-03-27 13:48:44 +00002649
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002650#define _LCCR0 0xB0100000 /* LCD Control Reg. 0 */
2651#define _LCSR 0xB0100004 /* LCD Status Reg. */
2652#define _DBAR1 0xB0100010 /* LCD DMA Base Address Reg. */
2653 /* channel 1 */
2654#define _DCAR1 0xB0100014 /* LCD DMA Current Address Reg. */
2655 /* channel 1 */
2656#define _DBAR2 0xB0100018 /* LCD DMA Base Address Reg. */
2657 /* channel 2 */
2658#define _DCAR2 0xB010001C /* LCD DMA Current Address Reg. */
2659 /* channel 2 */
2660#define _LCCR1 0xB0100020 /* LCD Control Reg. 1 */
2661#define _LCCR2 0xB0100024 /* LCD Control Reg. 2 */
2662#define _LCCR3 0xB0100028 /* LCD Control Reg. 3 */
wdenk3b58acd2002-03-27 13:48:44 +00002663
2664#if LANGUAGE == C
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002665#define LCCR0 /* LCD Control Reg. 0 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002666 (*((volatile Word *) io_p2v (_LCCR0)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002667#define LCSR /* LCD Status Reg. */ \
wdenk8bde7f72003-06-27 21:31:46 +00002668 (*((volatile Word *) io_p2v (_LCSR)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002669#define DBAR1 /* LCD DMA Base Address Reg. */ \
2670 /* channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002671 (*((volatile Address *) io_p2v (_DBAR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002672#define DCAR1 /* LCD DMA Current Address Reg. */ \
2673 /* channel 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002674 (*((volatile Address *) io_p2v (_DCAR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002675#define DBAR2 /* LCD DMA Base Address Reg. */ \
2676 /* channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002677 (*((volatile Address *) io_p2v (_DBAR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002678#define DCAR2 /* LCD DMA Current Address Reg. */ \
2679 /* channel 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002680 (*((volatile Address *) io_p2v (_DCAR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002681#define LCCR1 /* LCD Control Reg. 1 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002682 (*((volatile Word *) io_p2v (_LCCR1)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002683#define LCCR2 /* LCD Control Reg. 2 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002684 (*((volatile Word *) io_p2v (_LCCR2)))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002685#define LCCR3 /* LCD Control Reg. 3 */ \
wdenk8bde7f72003-06-27 21:31:46 +00002686 (*((volatile Word *) io_p2v (_LCCR3)))
wdenk3b58acd2002-03-27 13:48:44 +00002687#endif /* LANGUAGE == C */
2688
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002689#define LCCR0_LEN 0x00000001 /* LCD ENable */
wdenk3b58acd2002-03-27 13:48:44 +00002690#define LCCR0_CMS 0x00000002 /* Color/Monochrome display Select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002691#define LCCR0_Color (LCCR0_CMS*0) /* Color display */
2692#define LCCR0_Mono (LCCR0_CMS*1) /* Monochrome display */
2693#define LCCR0_SDS 0x00000004 /* Single/Dual panel display */
2694 /* Select */
2695#define LCCR0_Sngl (LCCR0_SDS*0) /* Single panel display */
2696#define LCCR0_Dual (LCCR0_SDS*1) /* Dual panel display */
2697#define LCCR0_LDM 0x00000008 /* LCD Disable done (LDD) */
2698 /* interrupt Mask (disable) */
2699#define LCCR0_BAM 0x00000010 /* Base Address update (BAU) */
2700 /* interrupt Mask (disable) */
wdenk3b58acd2002-03-27 13:48:44 +00002701#define LCCR0_ERM 0x00000020 /* LCD ERror (BER, IOL, IUL, IOU, */
wdenk8bde7f72003-06-27 21:31:46 +00002702 /* IUU, OOL, OUL, OOU, and OUU) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002703 /* interrupt Mask (disable) */
wdenk3b58acd2002-03-27 13:48:44 +00002704#define LCCR0_PAS 0x00000080 /* Passive/Active display Select */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002705#define LCCR0_Pas (LCCR0_PAS*0) /* Passive display (STN) */
2706#define LCCR0_Act (LCCR0_PAS*1) /* Active display (TFT) */
2707#define LCCR0_BLE 0x00000100 /* Big/Little Endian select */
2708#define LCCR0_LtlEnd (LCCR0_BLE*0) /* Little Endian frame buffer */
2709#define LCCR0_BigEnd (LCCR0_BLE*1) /* Big Endian frame buffer */
wdenk3b58acd2002-03-27 13:48:44 +00002710#define LCCR0_DPD 0x00000200 /* Double Pixel Data (monochrome */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002711 /* display mode) */
2712#define LCCR0_4PixMono (LCCR0_DPD*0) /* 4-Pixel/clock Monochrome */
2713 /* display */
2714#define LCCR0_8PixMono (LCCR0_DPD*1) /* 8-Pixel/clock Monochrome */
2715 /* display */
2716#define LCCR0_PDD Fld (8, 12) /* Palette DMA request Delay */
2717 /* [Tmem] */
2718#define LCCR0_DMADel(Tcpu) /* palette DMA request Delay */ \
2719 /* [0..510 Tcpu] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002720 ((Tcpu)/2 << FShft (LCCR0_PDD))
wdenk3b58acd2002-03-27 13:48:44 +00002721
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002722#define LCSR_LDD 0x00000001 /* LCD Disable Done */
2723#define LCSR_BAU 0x00000002 /* Base Address Update (read) */
2724#define LCSR_BER 0x00000004 /* Bus ERror */
2725#define LCSR_ABC 0x00000008 /* AC Bias clock Count */
2726#define LCSR_IOL 0x00000010 /* Input FIFO Over-run Lower */
2727 /* panel */
2728#define LCSR_IUL 0x00000020 /* Input FIFO Under-run Lower */
2729 /* panel */
2730#define LCSR_IOU 0x00000040 /* Input FIFO Over-run Upper */
2731 /* panel */
2732#define LCSR_IUU 0x00000080 /* Input FIFO Under-run Upper */
2733 /* panel */
2734#define LCSR_OOL 0x00000100 /* Output FIFO Over-run Lower */
2735 /* panel */
2736#define LCSR_OUL 0x00000200 /* Output FIFO Under-run Lower */
2737 /* panel */
2738#define LCSR_OOU 0x00000400 /* Output FIFO Over-run Upper */
2739 /* panel */
2740#define LCSR_OUU 0x00000800 /* Output FIFO Under-run Upper */
2741 /* panel */
wdenk3b58acd2002-03-27 13:48:44 +00002742
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002743#define LCCR1_PPL Fld (6, 4) /* Pixels Per Line/16 - 1 */
2744#define LCCR1_DisWdth(Pixel) /* Display Width [16..1024 pix.] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002745 (((Pixel) - 16)/16 << FShft (LCCR1_PPL))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002746#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */
wdenk8bde7f72003-06-27 21:31:46 +00002747 /* pulse Width - 2 [Tpix] (L_LCLK) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002748#define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \
2749 /* pulse Width [2..65 Tpix] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002750 (((Tpix) - 2) << FShft (LCCR1_HSW))
wdenk3b58acd2002-03-27 13:48:44 +00002751#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002752 /* count - 1 [Tpix] */
2753#define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \
2754 /* [1..256 Tpix] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002755 (((Tpix) - 1) << FShft (LCCR1_ELW))
wdenk3b58acd2002-03-27 13:48:44 +00002756#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002757 /* Wait count - 1 [Tpix] */
2758#define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \
2759 /* [1..256 Tpix] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002760 (((Tpix) - 1) << FShft (LCCR1_BLW))
wdenk3b58acd2002-03-27 13:48:44 +00002761
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002762#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */
2763#define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002764 (((Line) - 1) << FShft (LCCR2_LPP))
wdenk3b58acd2002-03-27 13:48:44 +00002765#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002766 /* Width - 1 [Tln] (L_FCLK) */
2767#define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \
2768 /* Width [1..64 Tln] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002769 (((Tln) - 1) << FShft (LCCR2_VSW))
wdenk3b58acd2002-03-27 13:48:44 +00002770#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002771 /* count [Tln] */
2772#define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \
2773 /* [0..255 Tln] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002774 ((Tln) << FShft (LCCR2_EFW))
wdenk3b58acd2002-03-27 13:48:44 +00002775#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002776 /* Wait count [Tln] */
2777#define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \
2778 /* [0..255 Tln] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002779 ((Tln) << FShft (LCCR2_BFW))
wdenk3b58acd2002-03-27 13:48:44 +00002780
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002781#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor/2 - 2 */
2782 /* [1..255] (L_PCLK) */
2783 /* fpix = fcpu/(2*(PCD + 2)) */
2784 /* Tpix = 2*(PCD + 2)*Tcpu */
2785#define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor [6..514] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002786 (((Div) - 4)/2 << FShft (LCCR3_PCD))
2787 /* fpix = fcpu/(2*Floor (Div/2)) */
2788 /* Tpix = 2*Floor (Div/2)*Tcpu */
wdenk3b58acd2002-03-27 13:48:44 +00002789#define LCCR3_CeilPixClkDiv(Div) /* Ceil. of PixClkDiv [6..514] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002790 (((Div) - 3)/2 << FShft (LCCR3_PCD))
2791 /* fpix = fcpu/(2*Ceil (Div/2)) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002792 /* Tpix = 2*Ceil (Div/2)*Tcpu */
wdenk3b58acd2002-03-27 13:48:44 +00002793#define LCCR3_ACB Fld (8, 8) /* AC Bias clock half period - 1 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002794 /* [Tln] (L_BIAS) */
2795#define LCCR3_ACBsDiv(Div) /* AC Bias clock Divisor [2..512] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002796 (((Div) - 2)/2 << FShft (LCCR3_ACB))
2797 /* fac = fln/(2*Floor (Div/2)) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002798 /* Tac = 2*Floor (Div/2)*Tln */
2799#define LCCR3_CeilACBsDiv(Div) /* Ceil. of ACBsDiv [2..512] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002800 (((Div) - 1)/2 << FShft (LCCR3_ACB))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002801 /* fac = fln/(2*Ceil (Div/2)) */
2802 /* Tac = 2*Ceil (Div/2)*Tln */
2803#define LCCR3_API Fld (4, 16) /* AC bias Pin transitions per */
2804 /* Interrupt */
2805#define LCCR3_ACBsCntOff /* AC Bias clock transition Count */ \
2806 /* Off */ \
wdenk8bde7f72003-06-27 21:31:46 +00002807 (0 << FShft (LCCR3_API))
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002808#define LCCR3_ACBsCnt(Trans) /* AC Bias clock transition Count */ \
2809 /* [1..15] */ \
wdenk8bde7f72003-06-27 21:31:46 +00002810 ((Trans) << FShft (LCCR3_API))
wdenk3b58acd2002-03-27 13:48:44 +00002811#define LCCR3_VSP 0x00100000 /* Vertical Synchronization pulse */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002812 /* Polarity (L_FCLK) */
wdenk3b58acd2002-03-27 13:48:44 +00002813#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002814 /* active High */
wdenk3b58acd2002-03-27 13:48:44 +00002815#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002816 /* active Low */
2817#define LCCR3_HSP 0x00200000 /* Horizontal Synchronization */
2818 /* pulse Polarity (L_LCLK) */
2819#define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */
2820 /* pulse active High */
2821#define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */
2822 /* pulse active Low */
wdenk3b58acd2002-03-27 13:48:44 +00002823#define LCCR3_PCP 0x00400000 /* Pixel Clock Polarity (L_PCLK) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002824#define LCCR3_PixRsEdg (LCCR3_PCP*0) /* Pixel clock Rising-Edge */
2825#define LCCR3_PixFlEdg (LCCR3_PCP*1) /* Pixel clock Falling-Edge */
wdenk3b58acd2002-03-27 13:48:44 +00002826#define LCCR3_OEP 0x00800000 /* Output Enable Polarity (L_BIAS, */
Wolfgang Denk53677ef2008-05-20 16:00:29 +02002827 /* active display mode) */
2828#define LCCR3_OutEnH (LCCR3_OEP*0) /* Output Enable active High */
2829#define LCCR3_OutEnL (LCCR3_OEP*1) /* Output Enable active Low */
wdenk3b58acd2002-03-27 13:48:44 +00002830
2831
2832#undef C
2833#undef Assembly