summaryrefslogtreecommitdiffstats
path: root/sys/dev/hfa/fore_slave.h
blob: 33d73c21dceda470fdc195df0fbc175c07d22bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*-
 *
 * ===================================
 * HARP  |  Host ATM Research Platform
 * ===================================
 *
 *
 * This Host ATM Research Platform ("HARP") file (the "Software") is
 * made available by Network Computing Services, Inc. ("NetworkCS")
 * "AS IS".  NetworkCS does not provide maintenance, improvements or
 * support of any kind.
 *
 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
 * In no event shall NetworkCS be responsible for any damages, including
 * but not limited to consequential damages, arising from or relating to
 * any use of the Software or related support.
 *
 * Copyright 1994-1998 Network Computing Services, Inc.
 *
 * Copies of this Software may be made, however, the above copyright
 * notice must be reproduced on all copies.
 *
 *	@(#) $FreeBSD$
 *
 */

/*
 * FORE Systems 200-Series Adapter Support
 * ---------------------------------------
 *
 * Slave Interface definitions
 *
 */

#ifndef _FORE_SLAVE_H
#define _FORE_SLAVE_H

/*
 * This file contains the (mostly hardware) definitions for each of the
 * supported 200-series slave interfaces.
 */


/*
 * Structure defining the supported FORE 200-series interfaces
 */
struct fore_device {
	char		*fd_name;	/* Device name (from PROM) */
	Atm_device	fd_devtyp;	/* Device type */
};
typedef struct fore_device	Fore_device;



/*
 * Common definitions
 * ------------------
 */
#define	MON960_BASE	0x400		/* Address offset of Mon960 */
#define	AALI_BASE	0x4d40		/* Address offset of Aali */

typedef volatile unsigned int	Fore_reg;	/* Slave control register */
typedef volatile unsigned char	Fore_mem;	/* Slave memory */


/*
 * SBA-200E SBus Slave Interface
 * -----------------------------
 */

#define	SBA200E_PROM_NAME	"FORE,sba-200e"

/*
 * SBA-200E Host Control Register (HCR)
 */
#define	SBA200E_READ_BITS	0x1ff	/* Valid read data bits */
#define	SBA200E_WRITE_BITS	0x01f	/* Valid write data bits */
#define	SBA200E_STICKY_BITS	0x013	/* Sticky data bits */

/* Read access */
#define	SBA200E_SBUS_INTR_RD	0x100	/* State of SBus interrupt */
#define	SBA200E_TEST_MODE	0x080	/* Device is in test-mode  */
#define	SBA200E_IFIFO_FULL	0x040	/* Input FIFO almost full (when 0) */
#define	SBA200E_ESP_HOLD_RD	0x020	/* State of ESP bus hold */
#define	SBA200E_SBUS_ENA_RD	0x010	/* State of SBus interrupt enable */
#define	SBA200E_OFIFO_FULL	0x008	/* Output FIFO almost full */
#define	SBA200E_SELFTEST_FAIL	0x004	/* i960 self-test failed (when 0) */
#define	SBA200E_HOLD_LOCK_RD	0x002	/* State of i960 hold lock signal */
#define	SBA200E_RESET_RD	0x001	/* State of board reset signal */

/* Write access - bit set (clear) */
#define	SBA200E_SBUS_ENA	0x010	/* Enable (disable) SBus interrupts */
#define	SBA200E_CLR_SBUS_INTR	0x008	/* Clear SBus interrupt */
#define	SBA200E_I960_INTR	0x004	/* Issue interrupt to i960 */
#define	SBA200E_HOLD_LOCK	0x002	/* Set (clear) i960 hold lock signal */
#define	SBA200E_RESET		0x001	/* Set (clear) board reset signal */

#define	SBA200E_HCR_INIT(hcr,bits) \
			((hcr) = (SBA200E_WRITE_BITS & (bits)))
#define	SBA200E_HCR_SET(hcr,bits) \
			((hcr) = (((hcr) & SBA200E_STICKY_BITS) | (bits)))
#define	SBA200E_HCR_CLR(hcr,bits) \
			((hcr) = ((hcr) & (SBA200E_STICKY_BITS ^ (bits))))



/*
 * SBA-200 SBus Slave Interface
 * ----------------------------
 */

#define	SBA200_PROM_NAME	"FORE,sba-200"

/*
 * SBA-200 Board Control Register (BCR)
 */
/* Write access - bit set */
#define	SBA200_CLR_SBUS_INTR	0x04	/* Clear SBus interrupt */
#define	SBA200_RESET		0x01	/* Assert board reset signal */

/* Write access - bit clear */
#define	SBA200_RESET_CLR	0x00	/* Clear board reset signal */



/*
 * PCA-200E PCI Bus Slave Interface
 * --------------------------------
 */

/*
 * PCI Identifiers
 */
#define	FORE_VENDOR_ID		0x1127

/*
 * PCA-200E PCI Configuration Space
 */
#define	PCA200E_PCI_MEMBASE	0x10	/* Memory base address */
#define	PCA200E_PCI_MCTL	0x40	/* Master control */

/*
 * PCA-200E Address Space
 */
#define	PCA200E_RAM_SIZE	0x100000
#define	PCA200E_HCR_OFFSET	0x100000
#define	PCA200E_IMASK_OFFSET	0x100004
#define	PCA200E_PSR_OFFSET	0x100008
#define	PCA200E_MMAP_SIZE	0x10000c

/*
 * PCA-200E Master Control
 */
#define	PCA200E_MCTL_SWAP	0x4000	/* Convert Slave endianess */

/*
 * PCA-200E Host Control Register (HCR)
 */
#define	PCA200E_READ_BITS	0x0ff	/* Valid read data bits */
#define	PCA200E_WRITE_BITS	0x01f	/* Valid write data bits */
#define	PCA200E_STICKY_BITS	0x000	/* Sticky data bits */

/* Read access */
#define	PCA200E_TEST_MODE	0x080	/* Device is in test-mode */
#define	PCA200E_IFIFO_FULL	0x040	/* Input FIFO almost full */
#define	PCA200E_ESP_HOLD_RD	0x020	/* State of ESP hold bus */
#define	PCA200E_OFIFO_FULL	0x010	/* Output FIFO almost full */
#define	PCA200E_HOLD_ACK	0x008	/* State of Hold Ack */
#define	PCA200E_SELFTEST_FAIL	0x004	/* i960 self-test failed */
#define	PCA200E_HOLD_LOCK_RD	0x002	/* State of i960 hold lock signal */
#define	PCA200E_RESET_BD	0x001	/* State of board reset signal */

/* Write access */
#define	PCA200E_CLR_HBUS_INT	0x010	/* Clear host bus interrupt */
#define	PCA200E_I960_INTRA	0x008	/* Set slave interrupt A */
#define	PCA200E_I960_INTRB	0x004	/* Set slave interrupt B */
#define	PCA200E_HOLD_LOCK	0x002	/* Set (clear) i960 hold lock signal */
#define	PCA200E_RESET		0x001	/* Set (clear) board reset signal */

#define	PCA200E_HCR_INIT(hcr,bits) \
			((hcr) = (PCA200E_WRITE_BITS & (bits)))
#define	PCA200E_HCR_SET(hcr,bits) \
			((hcr) = (bits))
#define	PCA200E_HCR_CLR(hcr,bits) \
			((hcr) = 0)

#endif	/* _FORE_SLAVE_H */
OpenPOWER on IntegriCloud