OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-ia64/] [sn/] [ioc3.h] - Blame information for rev 1275

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * Copyright (c) 2002-2003 Silicon Graphics, Inc.  All Rights Reserved.
3
 *
4
 * This program is free software; you can redistribute it and/or modify it
5
 * under the terms of version 2 of the GNU General Public License
6
 * as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it would be useful, but
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * Further, this software is distributed without any warranty that it is
13
 * free of the rightful claim of any third person regarding infringement
14
 * or the like.  Any license provided herein, whether implied or
15
 * otherwise, applies only to this software file.  Patent licenses, if
16
 * any, provided herein do not apply to combinations of this program with
17
 * other software, or any other product whatsoever.
18
 *
19
 * You should have received a copy of the GNU General Public
20
 * License along with this program; if not, write the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22
 *
23
 * Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
 * Mountain View, CA  94043, or:
25
 *
26
 * http://www.sgi.com
27
 *
28
 * For further information regarding this notice, see:
29
 *
30
 * http://oss.sgi.com/projects/GenInfo/NoticeExplan
31
 */
32
 
33
/* $Id: ioc3.h,v 1.1.1.1 2004-04-15 02:42:33 phoenix Exp $
34
 *
35
 * Copyright (C) 1999 Ralf Baechle
36
 * This file is part of the Linux driver for the SGI IOC3.
37
 */
38
#ifndef _ASM_IA64_SN_IOC3_H
39
#define _ASM_IA64_SN_IOC3_H
40
 
41
#include <asm/types.h>
42
 
43
/* SUPERIO uart register map */
44
typedef volatile struct ioc3_uartregs {
45
        union {
46
                volatile u8     rbr;    /* read only, DLAB == 0 */
47
                volatile u8     thr;    /* write only, DLAB == 0 */
48
                volatile u8     dll;    /* DLAB == 1 */
49
        } u1;
50
        union {
51
                volatile u8     ier;    /* DLAB == 0 */
52
                volatile u8     dlm;    /* DLAB == 1 */
53
        } u2;
54
        union {
55
                volatile u8     iir;    /* read only */
56
                volatile u8     fcr;    /* write only */
57
        } u3;
58
        volatile u8         iu_lcr;
59
        volatile u8         iu_mcr;
60
        volatile u8         iu_lsr;
61
        volatile u8         iu_msr;
62
        volatile u8         iu_scr;
63
} ioc3_uregs_t;
64
 
65
#define iu_rbr u1.rbr
66
#define iu_thr u1.thr
67
#define iu_dll u1.dll
68
#define iu_ier u2.ier
69
#define iu_dlm u2.dlm
70
#define iu_iir u3.iir
71
#define iu_fcr u3.fcr
72
 
73
struct ioc3_sioregs {
74
        volatile u8             fill[0x141];    /* starts at 0x141 */
75
 
76
        volatile u8             uartc;
77
        volatile u8             kbdcg;
78
 
79
        volatile u8             fill0[0x150 - 0x142 - 1];
80
 
81
        volatile u8             pp_data;
82
        volatile u8             pp_dsr;
83
        volatile u8             pp_dcr;
84
 
85
        volatile u8             fill1[0x158 - 0x152 - 1];
86
 
87
        volatile u8             pp_fifa;
88
        volatile u8             pp_cfgb;
89
        volatile u8             pp_ecr;
90
 
91
        volatile u8             fill2[0x168 - 0x15a - 1];
92
 
93
        volatile u8             rtcad;
94
        volatile u8             rtcdat;
95
 
96
        volatile u8             fill3[0x170 - 0x169 - 1];
97
 
98
        struct ioc3_uartregs    uartb;  /* 0x20170  */
99
        struct ioc3_uartregs    uarta;  /* 0x20178  */
100
};
101
 
102
/* Register layout of IOC3 in configuration space.  */
103
struct ioc3 {
104
        volatile u32    pad0[7];        /* 0x00000  */
105
        volatile u32    sio_ir;         /* 0x0001c  */
106
        volatile u32    sio_ies;        /* 0x00020  */
107
        volatile u32    sio_iec;        /* 0x00024  */
108
        volatile u32    sio_cr;         /* 0x00028  */
109
        volatile u32    int_out;        /* 0x0002c  */
110
        volatile u32    mcr;            /* 0x00030  */
111
 
112
        /* General Purpose I/O registers  */
113
        volatile u32    gpcr_s;         /* 0x00034  */
114
        volatile u32    gpcr_c;         /* 0x00038  */
115
        volatile u32    gpdr;           /* 0x0003c  */
116
        volatile u32    gppr_0;         /* 0x00040  */
117
        volatile u32    gppr_1;         /* 0x00044  */
118
        volatile u32    gppr_2;         /* 0x00048  */
119
        volatile u32    gppr_3;         /* 0x0004c  */
120
        volatile u32    gppr_4;         /* 0x00050  */
121
        volatile u32    gppr_5;         /* 0x00054  */
122
        volatile u32    gppr_6;         /* 0x00058  */
123
        volatile u32    gppr_7;         /* 0x0005c  */
124
        volatile u32    gppr_8;         /* 0x00060  */
125
        volatile u32    gppr_9;         /* 0x00064  */
126
        volatile u32    gppr_10;        /* 0x00068  */
127
        volatile u32    gppr_11;        /* 0x0006c  */
128
        volatile u32    gppr_12;        /* 0x00070  */
129
        volatile u32    gppr_13;        /* 0x00074  */
130
        volatile u32    gppr_14;        /* 0x00078  */
131
        volatile u32    gppr_15;        /* 0x0007c  */
132
 
133
        /* Parallel Port Registers  */
134
        volatile u32    ppbr_h_a;       /* 0x00080  */
135
        volatile u32    ppbr_l_a;       /* 0x00084  */
136
        volatile u32    ppcr_a;         /* 0x00088  */
137
        volatile u32    ppcr;           /* 0x0008c  */
138
        volatile u32    ppbr_h_b;       /* 0x00090  */
139
        volatile u32    ppbr_l_b;       /* 0x00094  */
140
        volatile u32    ppcr_b;         /* 0x00098  */
141
 
142
        /* Keyboard and Mouse Registers  */
143
        volatile u32    km_csr;         /* 0x0009c  */
144
        volatile u32    k_rd;           /* 0x000a0  */
145
        volatile u32    m_rd;           /* 0x000a4  */
146
        volatile u32    k_wd;           /* 0x000a8  */
147
        volatile u32    m_wd;           /* 0x000ac  */
148
 
149
        /* Serial Port Registers  */
150
        volatile u32    sbbr_h;         /* 0x000b0  */
151
        volatile u32    sbbr_l;         /* 0x000b4  */
152
        volatile u32    sscr_a;         /* 0x000b8  */
153
        volatile u32    stpir_a;        /* 0x000bc  */
154
        volatile u32    stcir_a;        /* 0x000c0  */
155
        volatile u32    srpir_a;        /* 0x000c4  */
156
        volatile u32    srcir_a;        /* 0x000c8  */
157
        volatile u32    srtr_a;         /* 0x000cc  */
158
        volatile u32    shadow_a;       /* 0x000d0  */
159
        volatile u32    sscr_b;         /* 0x000d4  */
160
        volatile u32    stpir_b;        /* 0x000d8  */
161
        volatile u32    stcir_b;        /* 0x000dc  */
162
        volatile u32    srpir_b;        /* 0x000e0  */
163
        volatile u32    srcir_b;        /* 0x000e4  */
164
        volatile u32    srtr_b;         /* 0x000e8  */
165
        volatile u32    shadow_b;       /* 0x000ec  */
166
 
167
        /* Ethernet Registers  */
168
        volatile u32    emcr;           /* 0x000f0  */
169
        volatile u32    eisr;           /* 0x000f4  */
170
        volatile u32    eier;           /* 0x000f8  */
171
        volatile u32    ercsr;          /* 0x000fc  */
172
        volatile u32    erbr_h;         /* 0x00100  */
173
        volatile u32    erbr_l;         /* 0x00104  */
174
        volatile u32    erbar;          /* 0x00108  */
175
        volatile u32    ercir;          /* 0x0010c  */
176
        volatile u32    erpir;          /* 0x00110  */
177
        volatile u32    ertr;           /* 0x00114  */
178
        volatile u32    etcsr;          /* 0x00118  */
179
        volatile u32    ersr;           /* 0x0011c  */
180
        volatile u32    etcdc;          /* 0x00120  */
181
        volatile u32    ebir;           /* 0x00124  */
182
        volatile u32    etbr_h;         /* 0x00128  */
183
        volatile u32    etbr_l;         /* 0x0012c  */
184
        volatile u32    etcir;          /* 0x00130  */
185
        volatile u32    etpir;          /* 0x00134  */
186
        volatile u32    emar_h;         /* 0x00138  */
187
        volatile u32    emar_l;         /* 0x0013c  */
188
        volatile u32    ehar_h;         /* 0x00140  */
189
        volatile u32    ehar_l;         /* 0x00144  */
190
        volatile u32    micr;           /* 0x00148  */
191
        volatile u32    midr_r;         /* 0x0014c  */
192
        volatile u32    midr_w;           /* 0x00150  */
193
        volatile u32    pad1[(0x20000 - 0x00154) / 4];
194
 
195
        /* SuperIO Registers  XXX */
196
        struct ioc3_sioregs     sregs;  /* 0x20000 */
197
        volatile u32    pad2[(0x40000 - 0x20180) / 4];
198
 
199
        /* SSRAM Diagnostic Access */
200
        volatile u32    ssram[(0x80000 - 0x40000) / 4];
201
 
202
        /* Bytebus device offsets
203
           0x80000 -   Access to the generic devices selected with   DEV0
204
           0x9FFFF     bytebus DEV_SEL_0
205
           0xA0000 -   Access to the generic devices selected with   DEV1
206
           0xBFFFF     bytebus DEV_SEL_1
207
           0xC0000 -   Access to the generic devices selected with   DEV2
208
           0xDFFFF     bytebus DEV_SEL_2
209
           0xE0000 -   Access to the generic devices selected with   DEV3
210
           0xFFFFF     bytebus DEV_SEL_3  */
211
};
212
 
213
/*
214
 * Ethernet RX Buffer
215
 */
216
struct ioc3_erxbuf {
217
        u32     w0;                     /* first word (valid,bcnt,cksum) */
218
        u32     err;                    /* second word various errors */
219
        /* next comes n bytes of padding */
220
        /* then the received ethernet frame itself */
221
};
222
 
223
#define ERXBUF_IPCKSUM_MASK     0x0000ffff
224
#define ERXBUF_BYTECNT_MASK     0x07ff0000
225
#define ERXBUF_BYTECNT_SHIFT    16
226
#define ERXBUF_V                0x80000000
227
 
228
#define ERXBUF_CRCERR           0x00000001      /* aka RSV15 */
229
#define ERXBUF_FRAMERR          0x00000002      /* aka RSV14 */
230
#define ERXBUF_CODERR           0x00000004      /* aka RSV13 */
231
#define ERXBUF_INVPREAMB        0x00000008      /* aka RSV18 */
232
#define ERXBUF_LOLEN            0x00007000      /* aka RSV2_0 */
233
#define ERXBUF_HILEN            0x03ff0000      /* aka RSV12_3 */
234
#define ERXBUF_MULTICAST        0x04000000      /* aka RSV16 */
235
#define ERXBUF_BROADCAST        0x08000000      /* aka RSV17 */
236
#define ERXBUF_LONGEVENT        0x10000000      /* aka RSV19 */
237
#define ERXBUF_BADPKT           0x20000000      /* aka RSV20 */
238
#define ERXBUF_GOODPKT          0x40000000      /* aka RSV21 */
239
#define ERXBUF_CARRIER          0x80000000      /* aka RSV22 */
240
 
241
/*
242
 * Ethernet TX Descriptor
243
 */
244
#define ETXD_DATALEN    104
245
struct ioc3_etxd {
246
        u32     cmd;                            /* command field */
247
        u32     bufcnt;                         /* buffer counts field */
248
        u64     p1;                             /* buffer pointer 1 */
249
        u64     p2;                             /* buffer pointer 2 */
250
        u8      data[ETXD_DATALEN];             /* opt. tx data */
251
};
252
 
253
#define ETXD_BYTECNT_MASK       0x000007ff      /* total byte count */
254
#define ETXD_INTWHENDONE        0x00001000      /* intr when done */
255
#define ETXD_D0V                0x00010000      /* data 0 valid */
256
#define ETXD_B1V                0x00020000      /* buf 1 valid */
257
#define ETXD_B2V                0x00040000      /* buf 2 valid */
258
#define ETXD_DOCHECKSUM         0x00080000      /* insert ip cksum */
259
#define ETXD_CHKOFF_MASK        0x07f00000      /* cksum byte offset */
260
#define ETXD_CHKOFF_SHIFT       20
261
 
262
#define ETXD_D0CNT_MASK         0x0000007f
263
#define ETXD_B1CNT_MASK         0x0007ff00
264
#define ETXD_B1CNT_SHIFT        8
265
#define ETXD_B2CNT_MASK         0x7ff00000
266
#define ETXD_B2CNT_SHIFT        20
267
 
268
/*
269
 * Bytebus device space
270
 */
271
#define IOC3_BYTEBUS_DEV0       0x80000L
272
#define IOC3_BYTEBUS_DEV1       0xa0000L
273
#define IOC3_BYTEBUS_DEV2       0xc0000L
274
#define IOC3_BYTEBUS_DEV3       0xe0000L
275
 
276
/* ------------------------------------------------------------------------- */
277
 
278
/* Superio Registers (PIO Access) */
279
#define IOC3_SIO_BASE           0x20000
280
#define IOC3_SIO_UARTC          (IOC3_SIO_BASE+0x141)   /* UART Config */
281
#define IOC3_SIO_KBDCG          (IOC3_SIO_BASE+0x142)   /* KBD Config */
282
#define IOC3_SIO_PP_BASE        (IOC3_SIO_BASE+PP_BASE)         /* Parallel Port */
283
#define IOC3_SIO_RTC_BASE       (IOC3_SIO_BASE+0x168)   /* Real Time Clock */
284
#define IOC3_SIO_UB_BASE        (IOC3_SIO_BASE+UARTB_BASE)      /* UART B */
285
#define IOC3_SIO_UA_BASE        (IOC3_SIO_BASE+UARTA_BASE)      /* UART A */
286
 
287
/* SSRAM Diagnostic Access */
288
#define IOC3_SSRAM      IOC3_RAM_OFF    /* base of SSRAM diagnostic access */
289
#define IOC3_SSRAM_LEN  0x40000 /* 256kb (address space size, may not be fully populated) */
290
#define IOC3_SSRAM_DM   0x0000ffff      /* data mask */
291
#define IOC3_SSRAM_PM   0x00010000      /* parity mask */
292
 
293
/* bitmasks for PCI_SCR */
294
#define PCI_SCR_PAR_RESP_EN     0x00000040      /* enb PCI parity checking */
295
#define PCI_SCR_SERR_EN         0x00000100      /* enable the SERR# driver */
296
#define PCI_SCR_DROP_MODE_EN    0x00008000      /* drop pios on parity err */
297
#define PCI_SCR_RX_SERR         (0x1 << 16)
298
#define PCI_SCR_DROP_MODE       (0x1 << 17)
299
#define PCI_SCR_SIG_PAR_ERR     (0x1 << 24)
300
#define PCI_SCR_SIG_TAR_ABRT    (0x1 << 27)
301
#define PCI_SCR_RX_TAR_ABRT     (0x1 << 28)
302
#define PCI_SCR_SIG_MST_ABRT    (0x1 << 29)
303
#define PCI_SCR_SIG_SERR        (0x1 << 30)
304
#define PCI_SCR_PAR_ERR         (0x1 << 31)
305
 
306
/* bitmasks for IOC3_KM_CSR */
307
#define KM_CSR_K_WRT_PEND 0x00000001    /* kbd port xmitting or resetting */
308
#define KM_CSR_M_WRT_PEND 0x00000002    /* mouse port xmitting or resetting */
309
#define KM_CSR_K_LCB      0x00000004    /* Line Cntrl Bit for last KBD write */
310
#define KM_CSR_M_LCB      0x00000008    /* same for mouse */
311
#define KM_CSR_K_DATA     0x00000010    /* state of kbd data line */
312
#define KM_CSR_K_CLK      0x00000020    /* state of kbd clock line */
313
#define KM_CSR_K_PULL_DATA 0x00000040   /* pull kbd data line low */
314
#define KM_CSR_K_PULL_CLK 0x00000080    /* pull kbd clock line low */
315
#define KM_CSR_M_DATA     0x00000100    /* state of ms data line */
316
#define KM_CSR_M_CLK      0x00000200    /* state of ms clock line */
317
#define KM_CSR_M_PULL_DATA 0x00000400   /* pull ms data line low */
318
#define KM_CSR_M_PULL_CLK 0x00000800    /* pull ms clock line low */
319
#define KM_CSR_EMM_MODE   0x00001000    /* emulation mode */
320
#define KM_CSR_SIM_MODE   0x00002000    /* clock X8 */
321
#define KM_CSR_K_SM_IDLE  0x00004000    /* Keyboard is idle */
322
#define KM_CSR_M_SM_IDLE  0x00008000    /* Mouse is idle */
323
#define KM_CSR_K_TO       0x00010000    /* Keyboard trying to send/receive */
324
#define KM_CSR_M_TO       0x00020000    /* Mouse trying to send/receive */
325
#define KM_CSR_K_TO_EN    0x00040000    /* KM_CSR_K_TO + KM_CSR_K_TO_EN = cause
326
                                           SIO_IR to assert */
327
#define KM_CSR_M_TO_EN    0x00080000    /* KM_CSR_M_TO + KM_CSR_M_TO_EN = cause
328
                                           SIO_IR to assert */
329
#define KM_CSR_K_CLAMP_ONE      0x00100000      /* Pull K_CLK low after rec. one char */
330
#define KM_CSR_M_CLAMP_ONE      0x00200000      /* Pull M_CLK low after rec. one char */
331
#define KM_CSR_K_CLAMP_THREE    0x00400000      /* Pull K_CLK low after rec. three chars */
332
#define KM_CSR_M_CLAMP_THREE    0x00800000      /* Pull M_CLK low after rec. three char */
333
 
334
/* bitmasks for IOC3_K_RD and IOC3_M_RD */
335
#define KM_RD_DATA_2    0x000000ff      /* 3rd char recvd since last read */
336
#define KM_RD_DATA_2_SHIFT 0
337
#define KM_RD_DATA_1    0x0000ff00      /* 2nd char recvd since last read */
338
#define KM_RD_DATA_1_SHIFT 8
339
#define KM_RD_DATA_0    0x00ff0000      /* 1st char recvd since last read */
340
#define KM_RD_DATA_0_SHIFT 16
341
#define KM_RD_FRAME_ERR_2 0x01000000    /*  framing or parity error in byte 2 */
342
#define KM_RD_FRAME_ERR_1 0x02000000    /* same for byte 1 */
343
#define KM_RD_FRAME_ERR_0 0x04000000    /* same for byte 0 */
344
 
345
#define KM_RD_KBD_MSE   0x08000000      /* 0 if from kbd, 1 if from mouse */
346
#define KM_RD_OFLO      0x10000000      /* 4th char recvd before this read */
347
#define KM_RD_VALID_2   0x20000000      /* DATA_2 valid */
348
#define KM_RD_VALID_1   0x40000000      /* DATA_1 valid */
349
#define KM_RD_VALID_0   0x80000000      /* DATA_0 valid */
350
#define KM_RD_VALID_ALL (KM_RD_VALID_0|KM_RD_VALID_1|KM_RD_VALID_2)
351
 
352
/* bitmasks for IOC3_K_WD & IOC3_M_WD */
353
#define KM_WD_WRT_DATA  0x000000ff      /* write to keyboard/mouse port */
354
#define KM_WD_WRT_DATA_SHIFT 0
355
 
356
/* bitmasks for serial RX status byte */
357
#define RXSB_OVERRUN    0x01    /* char(s) lost */
358
#define RXSB_PAR_ERR    0x02    /* parity error */
359
#define RXSB_FRAME_ERR  0x04    /* framing error */
360
#define RXSB_BREAK      0x08    /* break character */
361
#define RXSB_CTS        0x10    /* state of CTS */
362
#define RXSB_DCD        0x20    /* state of DCD */
363
#define RXSB_MODEM_VALID 0x40   /* DCD, CTS and OVERRUN are valid */
364
#define RXSB_DATA_VALID 0x80    /* data byte, FRAME_ERR PAR_ERR & BREAK valid */
365
 
366
/* bitmasks for serial TX control byte */
367
#define TXCB_INT_WHEN_DONE 0x20 /* interrupt after this byte is sent */
368
#define TXCB_INVALID    0x00    /* byte is invalid */
369
#define TXCB_VALID      0x40    /* byte is valid */
370
#define TXCB_MCR        0x80    /* data<7:0> to modem control register */
371
#define TXCB_DELAY      0xc0    /* delay data<7:0> mSec */
372
 
373
/* bitmasks for IOC3_SBBR_L */
374
#define SBBR_L_SIZE     0x00000001      /* 0 == 1KB rings, 1 == 4KB rings */
375
#define SBBR_L_BASE     0xfffff000      /* lower serial ring base addr */
376
 
377
/* bitmasks for IOC3_SSCR_<A:B> */
378
#define SSCR_RX_THRESHOLD 0x000001ff    /* hiwater mark */
379
#define SSCR_TX_TIMER_BUSY 0x00010000   /* TX timer in progress */
380
#define SSCR_HFC_EN     0x00020000      /* hardware flow control enabled */
381
#define SSCR_RX_RING_DCD 0x00040000     /* post RX record on delta-DCD */
382
#define SSCR_RX_RING_CTS 0x00080000     /* post RX record on delta-CTS */
383
#define SSCR_HIGH_SPD   0x00100000      /* 4X speed */
384
#define SSCR_DIAG       0x00200000      /* bypass clock divider for sim */
385
#define SSCR_RX_DRAIN   0x08000000      /* drain RX buffer to memory */
386
#define SSCR_DMA_EN     0x10000000      /* enable ring buffer DMA */
387
#define SSCR_DMA_PAUSE  0x20000000      /* pause DMA */
388
#define SSCR_PAUSE_STATE 0x40000000     /* sets when PAUSE takes effect */
389
#define SSCR_RESET      0x80000000      /* reset DMA channels */
390
 
391
/* all producer/comsumer pointers are the same bitfield */
392
#define PROD_CONS_PTR_4K 0x00000ff8     /* for 4K buffers */
393
#define PROD_CONS_PTR_1K 0x000003f8     /* for 1K buffers */
394
#define PROD_CONS_PTR_OFF 3
395
 
396
/* bitmasks for IOC3_SRCIR_<A:B> */
397
#define SRCIR_ARM       0x80000000      /* arm RX timer */
398
 
399
/* bitmasks for IOC3_SRPIR_<A:B> */
400
#define SRPIR_BYTE_CNT  0x07000000      /* bytes in packer */
401
#define SRPIR_BYTE_CNT_SHIFT 24
402
 
403
/* bitmasks for IOC3_STCIR_<A:B> */
404
#define STCIR_BYTE_CNT  0x0f000000      /* bytes in unpacker */
405
#define STCIR_BYTE_CNT_SHIFT 24
406
 
407
/* bitmasks for IOC3_SHADOW_<A:B> */
408
#define SHADOW_DR       0x00000001      /* data ready */
409
#define SHADOW_OE       0x00000002      /* overrun error */
410
#define SHADOW_PE       0x00000004      /* parity error */
411
#define SHADOW_FE       0x00000008      /* framing error */
412
#define SHADOW_BI       0x00000010      /* break interrupt */
413
#define SHADOW_THRE     0x00000020      /* transmit holding register empty */
414
#define SHADOW_TEMT     0x00000040      /* transmit shift register empty */
415
#define SHADOW_RFCE     0x00000080      /* char in RX fifo has an error */
416
#define SHADOW_DCTS     0x00010000      /* delta clear to send */
417
#define SHADOW_DDCD     0x00080000      /* delta data carrier detect */
418
#define SHADOW_CTS      0x00100000      /* clear to send */
419
#define SHADOW_DCD      0x00800000      /* data carrier detect */
420
#define SHADOW_DTR      0x01000000      /* data terminal ready */
421
#define SHADOW_RTS      0x02000000      /* request to send */
422
#define SHADOW_OUT1     0x04000000      /* 16550 OUT1 bit */
423
#define SHADOW_OUT2     0x08000000      /* 16550 OUT2 bit */
424
#define SHADOW_LOOP     0x10000000      /* loopback enabled */
425
 
426
/* bitmasks for IOC3_SRTR_<A:B> */
427
#define SRTR_CNT        0x00000fff      /* reload value for RX timer */
428
#define SRTR_CNT_VAL    0x0fff0000      /* current value of RX timer */
429
#define SRTR_CNT_VAL_SHIFT 16
430
#define SRTR_HZ         16000   /* SRTR clock frequency */
431
 
432
/* bitmasks for IOC3_SIO_IR, IOC3_SIO_IEC and IOC3_SIO_IES  */
433
#define SIO_IR_SA_TX_MT         0x00000001      /* Serial port A TX empty */
434
#define SIO_IR_SA_RX_FULL       0x00000002      /* port A RX buf full */
435
#define SIO_IR_SA_RX_HIGH       0x00000004      /* port A RX hiwat */
436
#define SIO_IR_SA_RX_TIMER      0x00000008      /* port A RX timeout */
437
#define SIO_IR_SA_DELTA_DCD     0x00000010      /* port A delta DCD */
438
#define SIO_IR_SA_DELTA_CTS     0x00000020      /* port A delta CTS */
439
#define SIO_IR_SA_INT           0x00000040      /* port A pass-thru intr */
440
#define SIO_IR_SA_TX_EXPLICIT   0x00000080      /* port A explicit TX thru */
441
#define SIO_IR_SA_MEMERR        0x00000100      /* port A PCI error */
442
#define SIO_IR_SB_TX_MT         0x00000200      /* */
443
#define SIO_IR_SB_RX_FULL       0x00000400      /* */
444
#define SIO_IR_SB_RX_HIGH       0x00000800      /* */
445
#define SIO_IR_SB_RX_TIMER      0x00001000      /* */
446
#define SIO_IR_SB_DELTA_DCD     0x00002000      /* */
447
#define SIO_IR_SB_DELTA_CTS     0x00004000      /* */
448
#define SIO_IR_SB_INT           0x00008000      /* */
449
#define SIO_IR_SB_TX_EXPLICIT   0x00010000      /* */
450
#define SIO_IR_SB_MEMERR        0x00020000      /* */
451
#define SIO_IR_PP_INT           0x00040000      /* P port pass-thru intr */
452
#define SIO_IR_PP_INTA          0x00080000      /* PP context A thru */
453
#define SIO_IR_PP_INTB          0x00100000      /* PP context B thru */
454
#define SIO_IR_PP_MEMERR        0x00200000      /* PP PCI error */
455
#define SIO_IR_KBD_INT          0x00400000      /* kbd/mouse intr */
456
#define SIO_IR_RT_INT           0x08000000      /* RT output pulse */
457
#define SIO_IR_GEN_INT1         0x10000000      /* RT input pulse */
458
#define SIO_IR_GEN_INT_SHIFT    28
459
 
460
/* per device interrupt masks */
461
#define SIO_IR_SA               (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL | \
462
                                 SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER | \
463
                                 SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS | \
464
                                 SIO_IR_SA_INT | SIO_IR_SA_TX_EXPLICIT | \
465
                                 SIO_IR_SA_MEMERR)
466
#define SIO_IR_SB               (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL | \
467
                                 SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER | \
468
                                 SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS | \
469
                                 SIO_IR_SB_INT | SIO_IR_SB_TX_EXPLICIT | \
470
                                 SIO_IR_SB_MEMERR)
471
#define SIO_IR_PP               (SIO_IR_PP_INT | SIO_IR_PP_INTA | \
472
                                 SIO_IR_PP_INTB | SIO_IR_PP_MEMERR)
473
#define SIO_IR_RT               (SIO_IR_RT_INT | SIO_IR_GEN_INT1)
474
 
475
/* macro to load pending interrupts */
476
#define IOC3_PENDING_INTRS(mem) (PCI_INW(&((mem)->sio_ir)) & \
477
                                 PCI_INW(&((mem)->sio_ies_ro)))
478
 
479
/* bitmasks for SIO_CR */
480
#define SIO_CR_SIO_RESET        0x00000001      /* reset the SIO */
481
#define SIO_CR_SER_A_BASE       0x000000fe      /* DMA poll addr port A */
482
#define SIO_CR_SER_A_BASE_SHIFT 1
483
#define SIO_CR_SER_B_BASE       0x00007f00      /* DMA poll addr port B */
484
#define SIO_CR_SER_B_BASE_SHIFT 8
485
#define SIO_SR_CMD_PULSE        0x00078000      /* byte bus strobe length */
486
#define SIO_CR_CMD_PULSE_SHIFT  15
487
#define SIO_CR_ARB_DIAG         0x00380000      /* cur !enet PCI requet (ro) */
488
#define SIO_CR_ARB_DIAG_TXA     0x00000000
489
#define SIO_CR_ARB_DIAG_RXA     0x00080000
490
#define SIO_CR_ARB_DIAG_TXB     0x00100000
491
#define SIO_CR_ARB_DIAG_RXB     0x00180000
492
#define SIO_CR_ARB_DIAG_PP      0x00200000
493
#define SIO_CR_ARB_DIAG_IDLE    0x00400000      /* 0 -> active request (ro) */
494
 
495
/* bitmasks for INT_OUT */
496
#define INT_OUT_COUNT   0x0000ffff      /* pulse interval timer */
497
#define INT_OUT_MODE    0x00070000      /* mode mask */
498
#define INT_OUT_MODE_0  0x00000000      /* set output to 0 */
499
#define INT_OUT_MODE_1  0x00040000      /* set output to 1 */
500
#define INT_OUT_MODE_1PULSE 0x00050000  /* send 1 pulse */
501
#define INT_OUT_MODE_PULSES 0x00060000  /* send 1 pulse every interval */
502
#define INT_OUT_MODE_SQW 0x00070000     /* toggle output every interval */
503
#define INT_OUT_DIAG    0x40000000      /* diag mode */
504
#define INT_OUT_INT_OUT 0x80000000      /* current state of INT_OUT */
505
 
506
/* time constants for INT_OUT */
507
#define INT_OUT_NS_PER_TICK (30 * 260)  /* 30 ns PCI clock, divisor=260 */
508
#define INT_OUT_TICKS_PER_PULSE 3       /* outgoing pulse lasts 3 ticks */
509
#define INT_OUT_US_TO_COUNT(x)          /* convert uS to a count value */ \
510
        (((x) * 10 + INT_OUT_NS_PER_TICK / 200) *       \
511
         100 / INT_OUT_NS_PER_TICK - 1)
512
#define INT_OUT_COUNT_TO_US(x)          /* convert count value to uS */ \
513
        (((x) + 1) * INT_OUT_NS_PER_TICK / 1000)
514
#define INT_OUT_MIN_TICKS 3     /* min period is width of pulse in "ticks" */
515
#define INT_OUT_MAX_TICKS INT_OUT_COUNT         /* largest possible count */
516
 
517
/* bitmasks for GPCR */
518
#define GPCR_DIR        0x000000ff      /* tristate pin input or output */
519
#define GPCR_DIR_PIN(x) (1<<(x))        /* access one of the DIR bits */
520
#define GPCR_EDGE       0x000f0000      /* extint edge or level sensitive */
521
#define GPCR_EDGE_PIN(x) (1<<((x)+15))  /* access one of the EDGE bits */
522
 
523
/* values for GPCR */
524
#define GPCR_INT_OUT_EN 0x00100000      /* enable INT_OUT to pin 0 */
525
#define GPCR_MLAN_EN    0x00200000      /* enable MCR to pin 8 */
526
#define GPCR_DIR_SERA_XCVR 0x00000080   /* Port A Transceiver select enable */
527
#define GPCR_DIR_SERB_XCVR 0x00000040   /* Port B Transceiver select enable */
528
#define GPCR_DIR_PHY_RST   0x00000020   /* ethernet PHY reset enable */
529
 
530
/* defs for some of the generic I/O pins */
531
#define GPCR_PHY_RESET          0x20    /* pin is output to PHY reset */
532
#define GPCR_UARTB_MODESEL      0x40    /* pin is output to port B mode sel */
533
#define GPCR_UARTA_MODESEL      0x80    /* pin is output to port A mode sel */
534
 
535
#define GPPR_PHY_RESET_PIN      5       /* GIO pin controlling phy reset */
536
#define GPPR_UARTB_MODESEL_PIN  6       /* GIO pin controlling uart b mode select */
537
#define GPPR_UARTA_MODESEL_PIN  7       /* GIO pin controlling uart a mode select */
538
 
539
#define EMCR_DUPLEX             0x00000001
540
#define EMCR_PROMISC            0x00000002
541
#define EMCR_PADEN              0x00000004
542
#define EMCR_RXOFF_MASK         0x000001f8
543
#define EMCR_RXOFF_SHIFT        3
544
#define EMCR_RAMPAR             0x00000200
545
#define EMCR_BADPAR             0x00000800
546
#define EMCR_BUFSIZ             0x00001000
547
#define EMCR_TXDMAEN            0x00002000
548
#define EMCR_TXEN               0x00004000
549
#define EMCR_RXDMAEN            0x00008000
550
#define EMCR_RXEN               0x00010000
551
#define EMCR_LOOPBACK           0x00020000
552
#define EMCR_ARB_DIAG           0x001c0000
553
#define EMCR_ARB_DIAG_IDLE      0x00200000
554
#define EMCR_RST                0x80000000
555
 
556
#define EISR_RXTIMERINT         0x00000001
557
#define EISR_RXTHRESHINT        0x00000002
558
#define EISR_RXOFLO             0x00000004
559
#define EISR_RXBUFOFLO          0x00000008
560
#define EISR_RXMEMERR           0x00000010
561
#define EISR_RXPARERR           0x00000020
562
#define EISR_TXEMPTY            0x00010000
563
#define EISR_TXRTRY             0x00020000
564
#define EISR_TXEXDEF            0x00040000
565
#define EISR_TXLCOL             0x00080000
566
#define EISR_TXGIANT            0x00100000
567
#define EISR_TXBUFUFLO          0x00200000
568
#define EISR_TXEXPLICIT         0x00400000
569
#define EISR_TXCOLLWRAP         0x00800000
570
#define EISR_TXDEFERWRAP        0x01000000
571
#define EISR_TXMEMERR           0x02000000
572
#define EISR_TXPARERR           0x04000000
573
 
574
#define ERCSR_THRESH_MASK       0x000001ff      /* enet RX threshold */
575
#define ERCSR_RX_TMR            0x40000000      /* simulation only */
576
#define ERCSR_DIAG_OFLO         0x80000000      /* simulation only */
577
 
578
#define ERBR_ALIGNMENT          4096
579
#define ERBR_L_RXRINGBASE_MASK  0xfffff000
580
 
581
#define ERBAR_BARRIER_BIT       0x0100
582
#define ERBAR_RXBARR_MASK       0xffff0000
583
#define ERBAR_RXBARR_SHIFT      16
584
 
585
#define ERCIR_RXCONSUME_MASK    0x00000fff
586
 
587
#define ERPIR_RXPRODUCE_MASK    0x00000fff
588
#define ERPIR_ARM               0x80000000
589
 
590
#define ERTR_CNT_MASK           0x000007ff
591
 
592
#define ETCSR_IPGT_MASK         0x0000007f
593
#define ETCSR_IPGR1_MASK        0x00007f00
594
#define ETCSR_IPGR1_SHIFT       8
595
#define ETCSR_IPGR2_MASK        0x007f0000
596
#define ETCSR_IPGR2_SHIFT       16
597
#define ETCSR_NOTXCLK           0x80000000
598
 
599
#define ETCDC_COLLCNT_MASK      0x0000ffff
600
#define ETCDC_DEFERCNT_MASK     0xffff0000
601
#define ETCDC_DEFERCNT_SHIFT    16
602
 
603
#define ETBR_ALIGNMENT          (64*1024)
604
#define ETBR_L_RINGSZ_MASK      0x00000001
605
#define ETBR_L_RINGSZ128        0
606
#define ETBR_L_RINGSZ512        1
607
#define ETBR_L_TXRINGBASE_MASK  0xffffc000
608
 
609
#define ETCIR_TXCONSUME_MASK    0x0000ffff
610
#define ETCIR_IDLE              0x80000000
611
 
612
#define ETPIR_TXPRODUCE_MASK    0x0000ffff
613
 
614
#define EBIR_TXBUFPROD_MASK     0x0000001f
615
#define EBIR_TXBUFCONS_MASK     0x00001f00
616
#define EBIR_TXBUFCONS_SHIFT    8
617
#define EBIR_RXBUFPROD_MASK     0x007fc000
618
#define EBIR_RXBUFPROD_SHIFT    14
619
#define EBIR_RXBUFCONS_MASK     0xff800000
620
#define EBIR_RXBUFCONS_SHIFT    23
621
 
622
#define MICR_REGADDR_MASK       0x0000001f
623
#define MICR_PHYADDR_MASK       0x000003e0
624
#define MICR_PHYADDR_SHIFT      5
625
#define MICR_READTRIG           0x00000400
626
#define MICR_BUSY               0x00000800
627
 
628
#define MIDR_DATA_MASK          0x0000ffff
629
 
630
#define ERXBUF_IPCKSUM_MASK     0x0000ffff
631
#define ERXBUF_BYTECNT_MASK     0x07ff0000
632
#define ERXBUF_BYTECNT_SHIFT    16
633
#define ERXBUF_V                0x80000000
634
 
635
#define ERXBUF_CRCERR           0x00000001      /* aka RSV15 */
636
#define ERXBUF_FRAMERR          0x00000002      /* aka RSV14 */
637
#define ERXBUF_CODERR           0x00000004      /* aka RSV13 */
638
#define ERXBUF_INVPREAMB        0x00000008      /* aka RSV18 */
639
#define ERXBUF_LOLEN            0x00007000      /* aka RSV2_0 */
640
#define ERXBUF_HILEN            0x03ff0000      /* aka RSV12_3 */
641
#define ERXBUF_MULTICAST        0x04000000      /* aka RSV16 */
642
#define ERXBUF_BROADCAST        0x08000000      /* aka RSV17 */
643
#define ERXBUF_LONGEVENT        0x10000000      /* aka RSV19 */
644
#define ERXBUF_BADPKT           0x20000000      /* aka RSV20 */
645
#define ERXBUF_GOODPKT          0x40000000      /* aka RSV21 */
646
#define ERXBUF_CARRIER          0x80000000      /* aka RSV22 */
647
 
648
#define ETXD_BYTECNT_MASK       0x000007ff      /* total byte count */
649
#define ETXD_INTWHENDONE        0x00001000      /* intr when done */
650
#define ETXD_D0V                0x00010000      /* data 0 valid */
651
#define ETXD_B1V                0x00020000      /* buf 1 valid */
652
#define ETXD_B2V                0x00040000      /* buf 2 valid */
653
#define ETXD_DOCHECKSUM         0x00080000      /* insert ip cksum */
654
#define ETXD_CHKOFF_MASK        0x07f00000      /* cksum byte offset */
655
#define ETXD_CHKOFF_SHIFT       20
656
 
657
#define ETXD_D0CNT_MASK         0x0000007f
658
#define ETXD_B1CNT_MASK         0x0007ff00
659
#define ETXD_B1CNT_SHIFT        8
660
#define ETXD_B2CNT_MASK         0x7ff00000
661
#define ETXD_B2CNT_SHIFT        20
662
 
663
typedef enum ioc3_subdevs_e {
664
    ioc3_subdev_ether,
665
    ioc3_subdev_generic,
666
    ioc3_subdev_nic,
667
    ioc3_subdev_kbms,
668
    ioc3_subdev_ttya,
669
    ioc3_subdev_ttyb,
670
    ioc3_subdev_ecpp,
671
    ioc3_subdev_rt,
672
    ioc3_nsubdevs
673
} ioc3_subdev_t;
674
 
675
/* subdevice disable bits,
676
 * from the standard INFO_LBL_SUBDEVS
677
 */
678
#define IOC3_SDB_ETHER          (1<<ioc3_subdev_ether)
679
#define IOC3_SDB_GENERIC        (1<<ioc3_subdev_generic)
680
#define IOC3_SDB_NIC            (1<<ioc3_subdev_nic)
681
#define IOC3_SDB_KBMS           (1<<ioc3_subdev_kbms)
682
#define IOC3_SDB_TTYA           (1<<ioc3_subdev_ttya)
683
#define IOC3_SDB_TTYB           (1<<ioc3_subdev_ttyb)
684
#define IOC3_SDB_ECPP           (1<<ioc3_subdev_ecpp)
685
#define IOC3_SDB_RT             (1<<ioc3_subdev_rt)
686
 
687
#define IOC3_ALL_SUBDEVS        ((1<<ioc3_nsubdevs)-1)
688
 
689
#define IOC3_SDB_SERIAL         (IOC3_SDB_TTYA|IOC3_SDB_TTYB)
690
 
691
#define IOC3_STD_SUBDEVS        IOC3_ALL_SUBDEVS
692
 
693
#define IOC3_INTA_SUBDEVS       IOC3_SDB_ETHER
694
#define IOC3_INTB_SUBDEVS       (IOC3_SDB_GENERIC|IOC3_SDB_KBMS|IOC3_SDB_SERIAL|IOC3_SDB_ECPP|IOC3_SDB_RT)
695
 
696
/*
697
 * PCI Configuration Space Register Address Map, use offset from IOC3 PCI
698
 * configuration base such that this can be used for multiple IOC3s
699
 */
700
#define IOC3_PCI_ID             0x0     /* ID */
701
 
702
#define IOC3_VENDOR_ID_NUM      0x10A9
703
#define IOC3_DEVICE_ID_NUM      0x0003
704
 
705
#endif /* _ASM_IA64_SN_IOC3_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.