summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1/isic/i4b_ipac.h
blob: 8892288957cad48b0bd7a727334efb2146cff951 (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
 * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *---------------------------------------------------------------------------
 *
 *	i4b_ipac.h - definitions for the Siemens IPAC PSB2115 chip
 *	==========================================================
 *
 * $FreeBSD$
 *
 *      last edit-date: [Wed Jan 24 09:10:09 2001]
 *
 *---------------------------------------------------------------------------
 */
 
#ifndef _I4B_IPAC_H_
#define _I4B_IPAC_H_

#define IPAC_BFIFO_LEN	64	/* 64 bytes B-channel FIFO on chip	*/

#define IPAC_HSCXA_OFF	0x00
#define IPAC_HSCXB_OFF	0x40
#define IPAC_ISAC_OFF	0x80
#define IPAC_IPAC_OFF	0xc0

/* chip version */

#define	IPAC_V11	0x01	/* IPAC Version 1.1 */
#define	IPAC_V12	0x02	/* IPAC Version 1.2 */

/*
 * definitions of registers and bits for the IPAC ISDN chip.
 */
 
typedef struct ipac_reg {

	/* most registers can be read/written, but have different names */
	/* so define a union with read/write names to make that clear */

	union {
		struct {
			unsigned char ipac_conf;
			unsigned char ipac_ista;
			unsigned char ipac_id;
			unsigned char ipac_acfg;
			unsigned char ipac_aoe;
			unsigned char ipac_arx;
			unsigned char ipac_pita1;
			unsigned char ipac_pita2;
			unsigned char ipac_pota1;
			unsigned char ipac_pota2;
			unsigned char ipac_pcfg;
			unsigned char ipac_scfg;
			unsigned char ipac_timr2;
		} ipac_r;
		struct {
			unsigned char ipac_conf;
			unsigned char ipac_mask;
			unsigned char ipac_dummy;
			unsigned char ipac_acfg;
			unsigned char ipac_aoe;
			unsigned char ipac_atx;
			unsigned char ipac_pita1;
			unsigned char ipac_pita2;
			unsigned char ipac_pota1;
			unsigned char ipac_pota2;
			unsigned char ipac_pcfg;
			unsigned char ipac_scfg;
			unsigned char ipac_timr2;
		} ipac_w;
	} ipac_rw;
} ipac_reg_t;

#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))

/* IPAC read registers */

#define IPAC_CONF  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_conf)
#define IPAC_ISTA  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_ista)
#define IPAC_ID    REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_id)
#define IPAC_ACFG  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_acfg)
#define IPAC_AOE   REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_aoe)
#define IPAC_ARX   REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_arx)
#define IPAC_PITA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita1)
#define IPAC_PITA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pita2)
#define IPAC_POTA1 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota1)
#define IPAC_POTA2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pota2)
#define IPAC_PCFG  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_pcfg)
#define IPAC_SCFG  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_scfg)
#define IPAC_TIMR2 REG_OFFSET(ipac_reg_t, ipac_rw.ipac_r.ipac_timr2)

/* IPAC write registers */

#define IPAC_MASK  REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_mask)
#define IPAC_ATX   REG_OFFSET(ipac_reg_t, ipac_rw.ipac_w.ipac_atx)

/* register bits */

#define IPAC_CONF_AMP  0x80
#define IPAC_CONF_CFS  0x40
#define IPAC_CONF_TEM  0x20
#define IPAC_CONF_PDS  0x10
#define IPAC_CONF_IDH  0x08
#define IPAC_CONF_SGO  0x04
#define IPAC_CONF_ODS  0x02
#define IPAC_CONF_IOF  0x01

#define IPAC_ISTA_INT1 0x80
#define IPAC_ISTA_INT0 0x40
#define IPAC_ISTA_ICD  0x20
#define IPAC_ISTA_EXD  0x10
#define IPAC_ISTA_ICA  0x08
#define IPAC_ISTA_EXA  0x04
#define IPAC_ISTA_ICB  0x02
#define IPAC_ISTA_EXB  0x01

#define IPAC_MASK_INT1 0x80
#define IPAC_MASK_INT0 0x40
#define IPAC_MASK_ICD  0x20
#define IPAC_MASK_EXD  0x10
#define IPAC_MASK_ICA  0x08
#define IPAC_MASK_EXA  0x04
#define IPAC_MASK_ICB  0x02
#define IPAC_MASK_EXB  0x01

#define IPAC_ACFG_OD7  0x80
#define IPAC_ACFG_OD6  0x40
#define IPAC_ACFG_OD5  0x20
#define IPAC_ACFG_OD4  0x10
#define IPAC_ACFG_OD3  0x08
#define IPAC_ACFG_OD2  0x04
#define IPAC_ACFG_EL1  0x02
#define IPAC_ACFG_EL2  0x01

#define IPAC_AOE_OE7   0x80
#define IPAC_AOE_OE6   0x40
#define IPAC_AOE_OE5   0x20
#define IPAC_AOE_OE4   0x10
#define IPAC_AOE_OE3   0x08
#define IPAC_AOE_OE2   0x04

#define IPAC_ARX_AR7   0x80
#define IPAC_ARX_AR6   0x40
#define IPAC_ARX_AR5   0x20
#define IPAC_ARX_AR4   0x10
#define IPAC_ARX_AR3   0x08
#define IPAC_ARX_AR2   0x04

#define IPAC_ATX_AT7   0x80
#define IPAC_ATX_AT6   0x40
#define IPAC_ATX_AT5   0x20
#define IPAC_ATX_AT4   0x10
#define IPAC_ATX_AT3   0x08
#define IPAC_ATX_AT2   0x04

#define IPAC_PITA1_ENA  0x80
#define IPAC_PITA1_DUDD 0x40

#define IPAC_PITA2_ENA  0x80
#define IPAC_PITA2_DUDD 0x40

#define IPAC_POTA1_ENA  0x80
#define IPAC_POTA1_DUDD 0x40

#define IPAC_POTA2_ENA  0x80
#define IPAC_POTA2_DUDD 0x40

#define IPAC_PCFG_DPS  0x80
#define IPAC_PCFG_ACL  0x40
#define IPAC_PCFG_LED  0x20
#define IPAC_PCFG_PLD  0x10
#define IPAC_PCFG_FBS  0x08
#define IPAC_PCFG_CSL2 0x04
#define IPAC_PCFG_CSL1 0x02
#define IPAC_PCFG_CSL0 0x01

#define IPAC_SCFG_PRI  0x80
#define IPAC_SCFG_TXD  0x40
#define IPAC_SCFG_TLEN 0x20

#define IPAC_TIMR2_TMD 0x80

#endif /* _I4B_IPAC_H_ */
OpenPOWER on IntegriCloud