1 /* $NetBSD: oboereg.h,v 1.1 2001/12/02 16:30:31 augustss Exp $ */
4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 * Toshiba OBOE SIR/FIR driver header file.
40 /*Receive and transmit task registers (read only) */
41 #define OBOE_RCVT (0x00)
42 #define OBOE_XMTT (0x01)
43 #define OBOE_XMTT_OFFSET 0x40
45 /*Page pointers to the TaskFile structure */
46 #define OBOE_TFP2 (0x02)
47 #define OBOE_TFP0 (0x04)
48 #define OBOE_TFP1 (0x05)
51 #define OBOE_REG_3 (0x03)
53 /*Number of tasks to use in Xmit and Recv queues */
54 #define OBOE_NTR (0x07)
55 #define OBOE_NTR_XMIT4 0x00
56 #define OBOE_NTR_XMIT8 0x10
57 #define OBOE_NTR_XMIT16 0x30
58 #define OBOE_NTR_XMIT32 0x70
59 #define OBOE_NTR_XMIT64 0xf0
60 #define OBOE_NTR_RECV4 0x00
61 #define OBOE_NTR_RECV8 0x01
62 #define OBOE_NTR_RECV6 0x03
63 #define OBOE_NTR_RECV32 0x07
64 #define OBOE_NTR_RECV64 0x0f
67 #define OBOE_REG_9 (0x09)
69 /* Interrupt Status Register */
70 #define OBOE_ISR (0x0c)
71 #define OBOE_ISR_TXDONE 0x80
72 #define OBOE_ISR_RXDONE 0x40
73 #define OBOE_ISR_20 0x20
74 #define OBOE_ISR_10 0x10
75 #define OBOE_ISR_8 0x08 /*This is collision or parity or something */
76 #define OBOE_ISR_4 0x08
77 #define OBOE_ISR_2 0x08
78 #define OBOE_ISR_1 0x08
81 #define OBOE_REG_D (0x0d)
83 /*Register Lock Register */
84 #define OBOE_LOCK (0x0e)
86 /*Speed control registers */
87 #define OBOE_PMDL (0x10)
88 #define OBOE_PMDL_SIR 0x18
89 #define OBOE_PMDL_MIR 0xa0
90 #define OBOE_PMDL_FIR 0x40
92 #define OBOE_SMDL (0x18)
93 #define OBOE_SMDL_SIR 0x20
94 #define OBOE_SMDL_MIR 0x01
95 #define OBOE_SMDL_FIR 0x0f
97 #define OBOE_UDIV (0x19)
100 #define OBOE_REG_11 (0x11)
102 /*Chip Reset Register */
103 #define OBOE_RST (0x15)
104 #define OBOE_RST_WRAP 0x8
107 #define OBOE_REG_1A (0x1a)
108 #define OBOE_REG_1B (0x1b)
110 #define OBOE_IOSIZE 0x1f
114 typedef unsigned int dword
;
115 typedef unsigned short int word
;
116 typedef unsigned char byte
;
126 #define OBOE_NTASKS 64
128 struct OboeTaskFile
{
129 struct OboeTask recv
[OBOE_NTASKS
];
130 struct OboeTask xmit
[OBOE_NTASKS
];
133 #define OBOE_TASK_BUF_LEN (sizeof(struct OboeTaskFile) << 1)
135 /*These set the number of slots in use */
139 #define RX_BUF_SZ 4196
140 #define TX_BUF_SZ 4196
142 /* You need also to change this, toshiba uses 4,8 and 4,4 */
143 /* It makes no difference if you are only going to use ONETASK mode */
144 /* remember each buffer use XX_BUF_SZ more _PHYSICAL_ memory */
145 #define OBOE_NTR_VAL (OBOE_NTR_XMIT8 | OBOE_NTR_RECV8)
147 #define OUTB(sc, val, off) \
148 bus_space_write_1(sc->sc_iot, sc->sc_ioh, off, val)
150 #define INB(sc, off) \
151 bus_space_read_1(sc->sc_iot, sc->sc_ioh, off)