File: /usr/src/linux/include/asm-mips/au1000.h

1     /*
2      *
3      * BRIEF MODULE DESCRIPTION
4      *	Include file for Alchemy Semiconductor's Au1000 CPU.
5      *
6      * Copyright 2000 MontaVista Software Inc.
7      * Author: MontaVista Software, Inc.
8      *         	ppopov@mvista.com or source@mvista.com
9      *
10      *  This program is free software; you can redistribute  it and/or modify it
11      *  under  the terms of  the GNU General  Public License as published by the
12      *  Free Software Foundation;  either version 2 of the  License, or (at your
13      *  option) any later version.
14      *
15      *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
16      *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
17      *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
18      *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
19      *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20      *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
21      *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22      *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
23      *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24      *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25      *
26      *  You should have received a copy of the  GNU General Public License along
27      *  with this program; if not, write  to the Free Software Foundation, Inc.,
28      *  675 Mass Ave, Cambridge, MA 02139, USA.
29      */
30     
31     #ifndef _AU1000_H_
32     #define _AU1000_H_
33     
34     /* SDRAM Controller */
35     #define CS_MODE_0                0x14000000
36     #define CS_MODE_1                0x14000004
37     #define CS_MODE_2                0x14000008
38     
39     #define CS_CONFIG_0              0x1400000C
40     #define CS_CONFIG_1              0x14000010
41     #define CS_CONFIG_2              0x14000014
42     
43     #define REFRESH_CONFIG           0x14000018
44     #define PRECHARGE_CMD            0x1400001C
45     #define AUTO_REFRESH_CMD         0x14000020
46     
47     #define WRITE_EXTERN_0           0x14000024
48     #define WRITE_EXTERN_1           0x14000028
49     #define WRITE_EXTERN_2           0x1400002C
50     
51     #define SDRAM_SLEEP              0x14000030
52     #define TOGGLE_CKE               0x14000034
53     
54     /* Static Bus Controller */
55     #define STATIC_CONFIG_0          0x14001000
56     #define STATIC_TIMING_0          0x14001004
57     #define STATIC_ADDRESS_0         0x14001008
58     
59     #define STATIC_CONFIG_1          0x14001010
60     #define STATIC_TIMING_1          0x14001014
61     #define STATIC_ADDRESS_1         0x14001018
62     
63     #define STATIC_CONFIG_2          0x14001020
64     #define STATIC_TIMING_2          0x14001024
65     #define STATIC_ADDRESS_2         0x14001028
66     
67     #define STATIC_CONFIG_3          0x14001030
68     #define STATIC_TIMING_3          0x14001034
69     #define STATIC_ADDRESS_3         0x14001038
70     
71     /* DMA Controller 0 */
72     #define DMA0_MODE_SET            0x14002000
73     #define DMA0_MODE_CLEAR          0x14002004
74     #define DMA0_PERIPHERAL_ADDR     0x14002008
75     #define DMA0_BUFFER0_START       0x1400200C
76     #define DMA0_BUFFER0_COUNT       0x14002010
77     #define DMA0_BUFFER1_START       0x14002014
78     #define DMA0_BUFFER1_COUNT       0x14002018
79     
80     /* DMA Controller 1 */
81     #define DMA1_MODE_SET            0x14002100
82     #define DMA1_MODE_CLEAR          0x14002104
83     #define DMA1_PERIPHERAL_ADDR     0x14002108
84     #define DMA1_BUFFER0_START       0x1400210C
85     #define DMA1_BUFFER0_COUNT       0x14002110
86     #define DMA1_BUFFER1_START       0x14002114
87     #define DMA1_BUFFER1_COUNT       0x14002118
88     
89     /* DMA Controller 2 */
90     #define DMA2_MODE_SET            0x14002200
91     #define DMA2_MODE_CLEAR          0x14002204
92     #define DMA2_PERIPHERAL_ADDR     0x14002208
93     #define DMA2_BUFFER0_START       0x1400220C
94     #define DMA2_BUFFER0_COUNT       0x14002210
95     #define DMA2_BUFFER1_START       0x14002214
96     #define DMA2_BUFFER1_COUNT       0x14002218
97     
98     /* DMA Controller 3 */
99     #define DMA3_MODE_SET            0x14002300
100     #define DMA3_MODE_CLEAR          0x14002304
101     #define DMA3_PERIPHERAL_ADDR     0x14002308
102     #define DMA3_BUFFER0_START       0x1400230C
103     #define DMA3_BUFFER0_COUNT       0x14002310
104     #define DMA3_BUFFER1_START       0x14002314
105     #define DMA3_BUFFER1_COUNT       0x14002318
106     
107     /* DMA Controller 4 */
108     #define DMA4_MODE_SET            0x14002400
109     #define DMA4_MODE_CLEAR          0x14002404
110     #define DMA4_PERIPHERAL_ADDR     0x14002408
111     #define DMA4_BUFFER0_START       0x1400240C
112     #define DMA4_BUFFER0_COUNT       0x14002410
113     #define DMA4_BUFFER1_START       0x14002414
114     #define DMA4_BUFFER1_COUNT       0x14002418
115     
116     /* DMA Controller 5 */
117     #define DMA5_MODE_SET            0x14002500
118     #define DMA5_MODE_CLEAR          0x14002504
119     #define DMA5_PERIPHERAL_ADDR     0x14002508
120     #define DMA5_BUFFER0_START       0x1400250C
121     #define DMA5_BUFFER0_COUNT       0x14002510
122     #define DMA5_BUFFER1_START       0x14002514
123     #define DMA5_BUFFER1_COUNT       0x14002518
124     
125     /* DMA Controller 6 */
126     #define DMA6_MODE_SET            0x14002600
127     #define DMA6_MODE_CLEAR          0x14002604
128     #define DMA6_PERIPHERAL_ADDR     0x14002608
129     #define DMA6_BUFFER0_START       0x1400260C
130     #define DMA6_BUFFER0_COUNT       0x14002610
131     #define DMA6_BUFFER1_START       0x14002614
132     #define DMA6_BUFFER1_COUNT       0x14002618
133     
134     /* DMA Controller 7 */
135     #define DMA7_MODE_SET            0x14002700
136     #define DMA7_MODE_CLEAR          0x14002704
137     #define DMA7_PERIPHERAL_ADDR     0x14002708
138     #define DMA7_BUFFER0_START       0x1400270C
139     #define DMA7_BUFFER0_COUNT       0x14002710
140     #define DMA7_BUFFER1_START       0x14002714
141     #define DMA7_BUFFER1_COUNT       0x14002718
142     
143     /* Interrupt Controller 0 */
144     #define INTC0_CONFIG0_READ        0x10400040
145     #define INTC0_CONFIG0_SET         0x10400040
146     #define INTC0_CONFIG0_CLEAR       0x10400044
147     
148     #define INTC0_CONFIG1_READ        0x10400048
149     #define INTC0_CONFIG1_SET         0x10400048
150     #define INTC0_CONFIG1_CLEAR       0x1040004C
151     
152     #define INTC0_CONFIG2_READ        0x10400050
153     #define INTC0_CONFIG2_SET         0x10400050
154     #define INTC0_CONFIG2_CLEAR       0x10400054
155     
156     #define INTC0_REQ0_INT            0x10400054
157     #define INTC0_SOURCE_READ         0x10400058
158     #define INTC0_SOURCE_SET          0x10400058
159     #define INTC0_SOURCE_CLEAR        0x1040005C
160     #define INTC0_REQ1_INT            0x1040005C
161     
162     #define INTC0_ASSIGN_REQ_READ     0x10400060
163     #define INTC0_ASSIGN_REQ_SET      0x10400060
164     #define INTC0_ASSIGN_REQ_CLEAR    0x10400064
165     
166     #define INTC0_WAKEUP_READ         0x10400068
167     #define INTC0_WAKEUP_SET          0x10400068
168     #define INTC0_WAKEUP_CLEAR        0x1040006C
169     
170     #define INTC0_MASK_READ           0x10400070
171     #define INTC0_MASK_SET            0x10400070
172     #define INTC0_MASK_CLEAR          0x10400074
173     
174     #define INTC0_R_EDGE_DETECT       0x10400078
175     #define INTC0_R_EDGE_DETECT_CLEAR 0x10400078
176     #define INTC0_F_EDGE_DETECT_CLEAR 0x1040007C
177     
178     #define INTC0_TEST_BIT            0x10400080
179     
180     /* Interrupt Controller 1 */
181     #define INTC1_CONFIG0_READ        0x11800040
182     #define INTC1_CONFIG0_SET         0x11800040
183     #define INTC1_CONFIG0_CLEAR       0x11800044
184     
185     #define INTC1_CONFIG1_READ        0x11800048
186     #define INTC1_CONFIG1_SET         0x11800048
187     #define INTC1_CONFIG1_CLEAR       0x1180004C
188     
189     #define INTC1_CONFIG2_READ        0x11800050
190     #define INTC1_CONFIG2_SET         0x11800050
191     #define INTC1_CONFIG2_CLEAR       0x11800054
192     
193     #define INTC1_REQ0_INT            0x11800054
194     #define INTC1_SOURCE_READ         0x11800058
195     #define INTC1_SOURCE_SET          0x11800058
196     #define INTC1_SOURCE_CLEAR        0x1180005C
197     #define INTC1_REQ1_INT            0x1180005C
198     
199     #define INTC1_ASSIGN_REQ_READ     0x11800060
200     #define INTC1_ASSIGN_REQ_SET      0x11800060
201     #define INTC1_ASSIGN_REQ_CLEAR    0x11800064
202     
203     #define INTC1_WAKEUP_READ         0x11800068
204     #define INTC1_WAKEUP_SET          0x11800068
205     #define INTC1_WAKEUP_CLEAR        0x1180006C
206     
207     #define INTC1_MASK_READ           0x11800070
208     #define INTC1_MASK_SET            0x11800070
209     #define INTC1_MASK_CLEAR          0x11800074
210     
211     #define INTC1_R_EDGE_DETECT       0x11800078
212     #define INTC1_R_EDGE_DETECT_CLEAR 0x11800078
213     #define INTC1_F_EDGE_DETECT_CLEAR 0x1180007C
214     
215     #define INTC1_TEST_BIT            0x11800080
216     
217     /* Interrupt Configuration Modes */
218     #define INTC_INT_DISABLED                0
219     #define INTC_INT_RISE_EDGE             0x1
220     #define INTC_INT_FALL_EDGE             0x2
221     #define INTC_INT_RISE_AND_FALL_EDGE    0x3
222     #define INTC_INT_HIGH_LEVEL            0x5
223     #define INTC_INT_LOW_LEVEL             0x6
224     #define INTC_INT_HIGH_AND_LOW_LEVEL    0x7
225     
226     /* Interrupt Numbers */
227     #define AU1000_UART0_INT          0
228     #define AU1000_UART1_INT          1
229     #define AU1000_UART2_INT          2
230     #define AU1000_UART3_INT          3
231     #define AU1000_SSI0_INT           4
232     #define AU1000_SSI1_INT           5
233     #define AU1000_DMA0_INT           6
234     #define AU1000_DMA1_INT           7
235     #define AU1000_DMA2_INT           8
236     #define AU1000_DMA3_INT           9
237     #define AU1000_DMA4_INT           10
238     #define AU1000_DMA5_INT           11
239     #define AU1000_DMA6_INT           12
240     #define AU1000_DMA7_INT           13
241     #define AU1000_PC0_INT            14
242     #define AU1000_PC0_MATCH0_INT     15
243     #define AU1000_PC0_MATCH1_INT     16
244     #define AU1000_PC0_MATCH2_INT     17
245     #define AU1000_PC1_INT            18
246     #define AU1000_PC1_MATCH0_INT     19
247     #define AU1000_PC1_MATCH1_INT     20
248     #define AU1000_PC1_MATCH2_INT     21
249     #define AU1000_IRDA_TX_INT        22
250     #define AU1000_IRDA_RX_INT        23
251     #define AU1000_USB_DEV_REQ_INT    24
252     #define AU1000_USB_DEV_SUS_INT    25
253     #define AU1000_USB_HOST_INT       26
254     #define AU1000_ACSYNC_INT         27
255     #define AU1000_MAC0_DMA_INT       28
256     #define AU1000_MAC1_DMA_INT       29
257     #define AU1000_ETH0_IRQ           AU1000_MAC0_DMA_INT
258     #define AU1000_ETH1_IRQ           AU1000_MAC1_DMA_INT
259     #define AU1000_I2S_UO_INT         30
260     #define AU1000_AC97_INT           31
261     #define AU1000_LAST_INTC0_INT     AU1000_AC97_INT
262     #define AU1000_GPIO_0             32
263     #define AU1000_GPIO_1             33
264     #define AU1000_GPIO_2             34
265     #define AU1000_GPIO_3             35
266     #define AU1000_GPIO_4             36
267     #define AU1000_GPIO_5             37
268     #define AU1000_GPIO_6             38
269     #define AU1000_GPIO_7             39
270     #define AU1000_GPIO_8             40
271     #define AU1000_GPIO_9             41
272     #define AU1000_GPIO_10            42
273     #define AU1000_GPIO_11            43
274     #define AU1000_GPIO_12            44
275     #define AU1000_GPIO_13            45
276     #define AU1000_GPIO_14            46
277     #define AU1000_GPIO_15            47
278     #define AU1000_GPIO_16            48
279     #define AU1000_GPIO_17            49
280     #define AU1000_GPIO_18            50
281     #define AU1000_GPIO_19            51
282     #define AU1000_GPIO_20            52
283     #define AU1000_GPIO_21            53
284     #define AU1000_GPIO_22            54
285     #define AU1000_GPIO_23            55
286     #define AU1000_GPIO_24            56
287     #define AU1000_GPIO_25            57
288     #define AU1000_GPIO_26            58
289     #define AU1000_GPIO_27            59
290     #define AU1000_GPIO_28            60
291     #define AU1000_GPIO_29            61
292     #define AU1000_GPIO_30            62
293     #define AU1000_GPIO_31            63
294     
295     /* Programmable Counters 0 and 1 */
296     #define PC_BASE                   0x11900000
297     #define PC_COUNTER_CNTRL          (PC_BASE + 0x14)
298       #define PC_CNTRL_E1S            (1<<23)
299       #define PC_CNTRL_T1S            (1<<20)
300       #define PC_CNTRL_M21            (1<<19)
301       #define PC_CNTRL_M11            (1<<18)
302       #define PC_CNTRL_M01            (1<<17)
303       #define PC_CNTRL_C1S            (1<<16)
304       #define PC_CNTRL_BP             (1<<14)
305       #define PC_CNTRL_EN1            (1<<13)
306       #define PC_CNTRL_BT1            (1<<12)
307       #define PC_CNTRL_EN0            (1<<11)
308       #define PC_CNTRL_BT0            (1<<10)
309       #define PC_CNTRL_E0             (1<<8)
310       #define PC_CNTRL_E0S            (1<<7)
311       #define PC_CNTRL_32S            (1<<5)
312       #define PC_CNTRL_T0S            (1<<4)
313       #define PC_CNTRL_M20            (1<<3)
314       #define PC_CNTRL_M10            (1<<2)
315       #define PC_CNTRL_M00            (1<<1)
316       #define PC_CNTRL_C0S            (1<<0)
317     
318     /* Programmable Counter 0 Registers */
319     #define PC0_TRIM                  (PC_BASE + 0)
320     #define PC0_COUNTER_WRITE         (PC_BASE + 4)
321     #define PC0_MATCH0                (PC_BASE + 8)
322     #define PC0_MATCH1                (PC_BASE + 0xC)
323     #define PC0_MATCH2                (PC_BASE + 0x10)
324     #define PC0_COUNTER_READ          (PC_BASE + 0x40)
325     
326     /* Programmable Counter 1 Registers */
327     #define PC1_TRIM                  (PC_BASE + 0x44)
328     #define PC1_COUNTER_WRITE         (PC_BASE + 0x48)
329     #define PC1_MATCH0                (PC_BASE + 0x4C)
330     #define PC1_MATCH1                (PC_BASE + 0x50)
331     #define PC1_MATCH2                (PC_BASE + 0x54)
332     #define PC1_COUNTER_READ          (PC_BASE + 0x58)
333     
334     
335     /* I2S Controller */
336     #define I2S_DATA                  0x11000000
337     #define I2S_CONFIG_STATUS         0x11000001
338     #define I2S_CONTROL               0x11000002
339     
340     /* Ethernet Controllers  */
341     #define AU1000_ETH0_BASE          0x10500000
342     #define AU1000_ETH1_BASE          0x10510000
343     
344     /* 4 byte offsets from AU1000_ETH_BASE */
345     #define MAC_CONTROL                     0x0
346       #define MAC_RX_ENABLE               (1<<2) 
347       #define MAC_TX_ENABLE               (1<<3)
348       #define MAC_DEF_CHECK               (1<<5) 
349       #define MAC_SET_BL(X)       (((X)&0x3)<<6)
350       #define MAC_AUTO_PAD                (1<<8)
351       #define MAC_DISABLE_RETRY          (1<<10)
352       #define MAC_DISABLE_BCAST          (1<<11)
353       #define MAC_LATE_COL               (1<<12)
354       #define MAC_HASH_MODE              (1<<13)
355       #define MAC_HASH_ONLY              (1<<15)
356       #define MAC_PASS_ALL               (1<<16)
357       #define MAC_INVERSE_FILTER         (1<<17)
358       #define MAC_PROMISCUOUS            (1<<18)
359       #define MAC_PASS_ALL_MULTI         (1<<19)
360       #define MAC_FULL_DUPLEX            (1<<20)
361       #define MAC_NORMAL_MODE                 0
362       #define MAC_INT_LOOPBACK           (1<<21)
363       #define MAC_EXT_LOOPBACK           (1<<22)
364       #define MAC_DISABLE_RX_OWN         (1<<23)
365       #define MAC_BIG_ENDIAN             (1<<30)
366       #define MAC_RX_ALL                 (1<<31)
367     #define MAC_ADDRESS_HIGH                0x4
368     #define MAC_ADDRESS_LOW                 0x8
369     #define MAC_MCAST_HIGH                  0xC
370     #define MAC_MCAST_LOW                  0x10
371     #define MAC_MII_CNTRL                  0x14
372       #define MAC_MII_BUSY                (1<<0)
373       #define MAC_MII_READ                     0 
374       #define MAC_MII_WRITE               (1<<1)
375       #define MAC_SET_MII_SELECT_REG(X)   (((X)&0x1f)<<6)
376       #define MAC_SET_MII_SELECT_PHY(X)   (((X)&0x1f)<<11)
377     #define MAC_MII_DATA                   0x18
378     #define MAC_FLOW_CNTRL                 0x1C
379       #define MAC_FLOW_CNTRL_BUSY         (1<<0)
380       #define MAC_FLOW_CNTRL_ENABLE       (1<<1)
381       #define MAC_PASS_CONTROL            (1<<2)
382       #define MAC_SET_PAUSE(X)        (((X)&0xffff)<<16)
383     #define MAC_VLAN1_TAG                  0x20
384     #define MAC_VLAN2_TAG                  0x24
385     
386     /* Ethernet Controller Enable */
387     #define MAC0_ENABLE               0x10520000
388     #define MAC1_ENABLE               0x10520004
389       #define MAC_EN_CLOCK_ENABLE         (1<<0)
390       #define MAC_EN_RESET0               (1<<1)
391       #define MAC_EN_TOSS                 (1<<2)
392       #define MAC_EN_CACHEABLE            (1<<3)
393       #define MAC_EN_RESET1               (1<<4)
394       #define MAC_EN_RESET2               (1<<5)
395       #define MAC_DMA_RESET               (1<<6)
396     
397     /* Ethernet Controller DMA Channels */
398     
399     #define MAC0_TX_DMA_ADDR         0x14004000
400     #define MAC1_TX_DMA_ADDR         0x14004200
401     /* offsets from MAC_TX_RING_ADDR address */
402     #define MAC_TX_BUFF0_STATUS             0x0
403       #define TX_FRAME_ABORTED            (1<<0)
404       #define TX_JAB_TIMEOUT              (1<<1)
405       #define TX_NO_CARRIER               (1<<2)
406       #define TX_LOSS_CARRIER             (1<<3)
407       #define TX_EXC_DEF                  (1<<4)
408       #define TX_LATE_COLL_ABORT          (1<<5)
409       #define TX_EXC_COLL                 (1<<6)
410       #define TX_UNDERRUN                 (1<<7)
411       #define TX_DEFERRED                 (1<<8)
412       #define TX_LATE_COLL                (1<<9)
413       #define TX_COLL_CNT_MASK         (0xF<<10)
414       #define TX_PKT_RETRY               (1<<31)
415     #define MAC_TX_BUFF0_ADDR                0x4
416       #define TX_DMA_ENABLE               (1<<0)
417       #define TX_T_DONE                   (1<<1)
418       #define TX_GET_DMA_BUFFER(X)    (((X)>>2)&0x3)
419     #define MAC_TX_BUFF0_LEN                 0x8
420     #define MAC_TX_BUFF1_STATUS             0x10
421     #define MAC_TX_BUFF1_ADDR               0x14
422     #define MAC_TX_BUFF1_LEN                0x18
423     #define MAC_TX_BUFF2_STATUS             0x20
424     #define MAC_TX_BUFF2_ADDR               0x24
425     #define MAC_TX_BUFF2_LEN                0x28
426     #define MAC_TX_BUFF3_STATUS             0x30
427     #define MAC_TX_BUFF3_ADDR               0x34
428     #define MAC_TX_BUFF3_LEN                0x38
429     
430     #define MAC0_RX_DMA_ADDR         0x14004100
431     #define MAC1_RX_DMA_ADDR         0x14004300
432     /* offsets from MAC_RX_RING_ADDR */
433     #define MAC_RX_BUFF0_STATUS              0x0
434       #define RX_FRAME_LEN_MASK           0x3fff
435       #define RX_WDOG_TIMER              (1<<14)
436       #define RX_RUNT                    (1<<15)
437       #define RX_OVERLEN                 (1<<16)
438       #define RX_COLL                    (1<<17)
439       #define RX_ETHER                   (1<<18)
440       #define RX_MII_ERROR               (1<<19)
441       #define RX_DRIBBLING               (1<<20)
442       #define RX_CRC_ERROR               (1<<21)
443       #define RX_VLAN1                   (1<<22)
444       #define RX_VLAN2                   (1<<23)
445       #define RX_LEN_ERROR               (1<<24)
446       #define RX_CNTRL_FRAME             (1<<25)
447       #define RX_U_CNTRL_FRAME           (1<<26)
448       #define RX_MCAST_FRAME             (1<<27)
449       #define RX_BCAST_FRAME             (1<<28)
450       #define RX_FILTER_FAIL             (1<<29)
451       #define RX_PACKET_FILTER           (1<<30)
452       #define RX_MISSED_FRAME            (1<<31)
453       
454       #define RX_ERROR (RX_WDOG_TIMER | RX_RUNT | RX_OVERLEN |  \
455                         RX_COLL | RX_MII_ERROR | RX_CRC_ERROR | \
456                         RX_LEN_ERROR | RX_U_CNTRL_FRAME | RX_MISSED_FRAME)
457     #define MAC_RX_BUFF0_ADDR                0x4
458       #define RX_DMA_ENABLE               (1<<0)
459       #define RX_T_DONE                   (1<<1)
460       #define RX_GET_DMA_BUFFER(X)    (((X)>>2)&0x3)
461       #define RX_SET_BUFF_ADDR(X)     ((X)&0xffffffc0)
462     #define MAC_RX_BUFF1_STATUS              0x10
463     #define MAC_RX_BUFF1_ADDR                0x14
464     #define MAC_RX_BUFF2_STATUS              0x20
465     #define MAC_RX_BUFF2_ADDR                0x24
466     #define MAC_RX_BUFF3_STATUS              0x30
467     #define MAC_RX_BUFF3_ADDR                0x34
468     
469     
470     /* UARTS 0-3 */
471     #define UART0_ADDR                0x11100000
472     #define UART1_ADDR                0x11200000
473     #define UART2_ADDR                0x11300000
474     #define UART3_ADDR                0x11400000
475     
476     #define UART_RX		0	/* Receive buffer */
477     #define UART_TX		4	/* Transmit buffer */
478     #define UART_IER	8	/* Interrupt Enable Register */
479     #define UART_IIR	0xC	/* Interrupt ID Register */
480     #define UART_FCR	0x10	/* FIFO Control Register */
481     #define UART_LCR	0x14	/* Line Control Register */
482     #define UART_MCR	0x18	/* Modem Control Register */
483     #define UART_LSR	0x1C	/* Line Status Register */
484     #define UART_MSR	0x20	/* Modem Status Register */
485     #define UART_CLK	0x28	/* Baud Rat4e Clock Divider */
486     #define UART_MOD_CNTRL	0x100	/* Module Control */
487     
488     #define UART_FCR_ENABLE_FIFO	0x01 /* Enable the FIFO */
489     #define UART_FCR_CLEAR_RCVR	0x02 /* Clear the RCVR FIFO */
490     #define UART_FCR_CLEAR_XMIT	0x04 /* Clear the XMIT FIFO */
491     #define UART_FCR_DMA_SELECT	0x08 /* For DMA applications */
492     #define UART_FCR_TRIGGER_MASK	0xF0 /* Mask for the FIFO trigger range */
493     #define UART_FCR_R_TRIGGER_1	0x00 /* Mask for receive trigger set at 1 */
494     #define UART_FCR_R_TRIGGER_4	0x40 /* Mask for receive trigger set at 4 */
495     #define UART_FCR_R_TRIGGER_8	0x80 /* Mask for receive trigger set at 8 */
496     #define UART_FCR_R_TRIGGER_14   0xA0 /* Mask for receive trigger set at 14 */
497     #define UART_FCR_T_TRIGGER_0	0x00 /* Mask for transmit trigger set at 0 */
498     #define UART_FCR_T_TRIGGER_4	0x10 /* Mask for transmit trigger set at 4 */
499     #define UART_FCR_T_TRIGGER_8    0x20 /* Mask for transmit trigger set at 8 */
500     #define UART_FCR_T_TRIGGER_12	0x30 /* Mask for transmit trigger set at 12 */
501     
502     /*
503      * These are the definitions for the Line Control Register
504      */
505     #define UART_LCR_SBC	0x40	/* Set break control */
506     #define UART_LCR_SPAR	0x20	/* Stick parity (?) */
507     #define UART_LCR_EPAR	0x10	/* Even parity select */
508     #define UART_LCR_PARITY	0x08	/* Parity Enable */
509     #define UART_LCR_STOP	0x04	/* Stop bits: 0=1 stop bit, 1= 2 stop bits */
510     #define UART_LCR_WLEN5  0x00	/* Wordlength: 5 bits */
511     #define UART_LCR_WLEN6  0x01	/* Wordlength: 6 bits */
512     #define UART_LCR_WLEN7  0x02	/* Wordlength: 7 bits */
513     #define UART_LCR_WLEN8  0x03	/* Wordlength: 8 bits */
514     
515     /*
516      * These are the definitions for the Line Status Register
517      */
518     #define UART_LSR_TEMT	0x40	/* Transmitter empty */
519     #define UART_LSR_THRE	0x20	/* Transmit-hold-register empty */
520     #define UART_LSR_BI	0x10	/* Break interrupt indicator */
521     #define UART_LSR_FE	0x08	/* Frame error indicator */
522     #define UART_LSR_PE	0x04	/* Parity error indicator */
523     #define UART_LSR_OE	0x02	/* Overrun error indicator */
524     #define UART_LSR_DR	0x01	/* Receiver data ready */
525     
526     /*
527      * These are the definitions for the Interrupt Identification Register
528      */
529     #define UART_IIR_NO_INT	0x01	/* No interrupts pending */
530     #define UART_IIR_ID	0x06	/* Mask for the interrupt ID */
531     #define UART_IIR_MSI	0x00	/* Modem status interrupt */
532     #define UART_IIR_THRI	0x02	/* Transmitter holding register empty */
533     #define UART_IIR_RDI	0x04	/* Receiver data interrupt */
534     #define UART_IIR_RLSI	0x06	/* Receiver line status interrupt */
535     
536     /*
537      * These are the definitions for the Interrupt Enable Register
538      */
539     #define UART_IER_MSI	0x08	/* Enable Modem status interrupt */
540     #define UART_IER_RLSI	0x04	/* Enable receiver line status interrupt */
541     #define UART_IER_THRI	0x02	/* Enable Transmitter holding register int. */
542     #define UART_IER_RDI	0x01	/* Enable receiver data interrupt */
543     
544     /*
545      * These are the definitions for the Modem Control Register
546      */
547     #define UART_MCR_LOOP	0x10	/* Enable loopback test mode */
548     #define UART_MCR_OUT2	0x08	/* Out2 complement */
549     #define UART_MCR_OUT1	0x04	/* Out1 complement */
550     #define UART_MCR_RTS	0x02	/* RTS complement */
551     #define UART_MCR_DTR	0x01	/* DTR complement */
552     
553     /*
554      * These are the definitions for the Modem Status Register
555      */
556     #define UART_MSR_DCD	0x80	/* Data Carrier Detect */
557     #define UART_MSR_RI	0x40	/* Ring Indicator */
558     #define UART_MSR_DSR	0x20	/* Data Set Ready */
559     #define UART_MSR_CTS	0x10	/* Clear to Send */
560     #define UART_MSR_DDCD	0x08	/* Delta DCD */
561     #define UART_MSR_TERI	0x04	/* Trailing edge ring indicator */
562     #define UART_MSR_DDSR	0x02	/* Delta DSR */
563     #define UART_MSR_DCTS	0x01	/* Delta CTS */
564     #define UART_MSR_ANY_DELTA 0x0F	/* Any of the delta bits! */
565     
566     
567     
568     /* SSIO */
569     #define SSI0_STATUS                0x11600000
570     #define SSI0_INT                   0x11600004
571     #define SSI0_INT_ENABLE            0x11600008
572     #define SSI0_CONFIG                0x11600020
573     #define SSI0_ADATA                 0x11600024
574     #define SSI0_CLKDIV                0x11600028
575     #define SSI0_CONTROL               0x11600100
576     
577     /* SSI1 */
578     #define SSI1_STATUS                0x11680000
579     #define SSI1_INT                   0x11680004
580     #define SSI1_INT_ENABLE            0x11680008
581     #define SSI1_CONFIG                0x11680020
582     #define SSI1_ADATA                 0x11680024
583     #define SSI1_CLKDIV                0x11680028
584     #define SSI1_CONTROL               0x11680100
585     
586     /* IrDA Controller */
587     #define IR_RING_PTR_STATUS        0x11500000
588     #define IR_RING_BASE_ADDR_H       0x11500004
589     #define IR_RING_BASE_ADDR_L       0x11500008
590     #define IR_RING_SIZE              0x1150000C
591     #define IR_RING_PROMPT            0x11500010
592     #define IR_RING_ADDR_CMPR         0x11500014
593     #define IR_CONFIG_1               0x11500020
594     #define IR_SIR_FLAGS              0x11500024
595     #define IR_ENABLE                 0x11500028
596     #define IR_READ_PHY_CONFIG        0x1150002C
597     #define IR_WRITE_PHY_CONFIG       0x11500030
598     #define IR_MAX_PKT_LEN            0x11500034
599     #define IR_RX_BYTE_CNT            0x11500038
600     #define IR_CONFIG_2               0x1150003C
601     #define IR_INTERFACE_CONFIG       0x11500040
602     
603     /* GPIO */
604     #define TSTATE_STATE_READ         0x11900100
605     #define TSTATE_STATE_SET          0x11900100
606     #define OUTPUT_STATE_READ         0x11900108
607     #define OUTPUT_STATE_SET          0x11900108
608     #define OUTPUT_STATE_CLEAR        0x1190010C
609     #define PIN_STATE                 0x11900110
610     
611     /* Power Management */
612     #define PM_SCRATCH_0                 0x11900018
613     #define PM_SCRATCH_1                 0x1190001C
614     #define PM_WAKEUP_SOURCE_MASK        0x11900034
615     #define PM_ENDIANESS                 0x11900038
616     #define PM_POWERUP_CONTROL           0x1190003C
617     #define PM_WAKEUP_CAUSE              0x1190005C
618     #define PM_SLEEP_POWER               0x11900078
619     #define PM_SLEEP                     0x1190007C
620     
621     /* Clock Controller */
622     #define FQ_CNTRL_1                0x11900020
623     #define FQ_CNTRL_2                0x11900024
624     #define CLOCK_SOURCE_CNTRL        0x11900028
625     #define CPU_PLL_CNTRL             0x11900060
626     #define AUX_PLL_CNTRL             0x11900064
627     
628     /* AC97 Controller */
629     #define AC97_CONFIG               0x10000000
630     #define AC97_STATUS               0x10000004
631     #define AC97_DATA                 0x10000008
632     #define AC97_CMD                  0x1000000C
633     #define AC97_CNTRL                0x10000010
634     
635     #endif
636