1
2
3
4
5
6
7
8
9
10
11
12
13
14 #define HFCPCI_BTRANS_THRESHOLD 128
15 #define HFCPCI_FILLEMPTY 64
16 #define HFCPCI_BTRANS_THRESMASK 0x00
17
18
19 #define PCI_ENA_MEMIO 0x02
20 #define PCI_ENA_MASTER 0x04
21
22
23 #define HCFPCI_C_I 0x08
24 #define HFCPCI_TRxR 0x0C
25 #define HFCPCI_MON1_D 0x28
26 #define HFCPCI_MON2_D 0x2C
27
28
29 #define HFCPCI_B1_SSL 0x80
30 #define HFCPCI_B2_SSL 0x84
31 #define HFCPCI_AUX1_SSL 0x88
32 #define HFCPCI_AUX2_SSL 0x8C
33 #define HFCPCI_B1_RSL 0x90
34 #define HFCPCI_B2_RSL 0x94
35 #define HFCPCI_AUX1_RSL 0x98
36 #define HFCPCI_AUX2_RSL 0x9C
37
38
39 #define HFCPCI_B1_D 0xA0
40 #define HFCPCI_B2_D 0xA4
41 #define HFCPCI_AUX1_D 0xA8
42 #define HFCPCI_AUX2_D 0xAC
43
44
45 #define HFCPCI_MST_EMOD 0xB4
46 #define HFCPCI_MST_MODE 0xB8
47 #define HFCPCI_CONNECT 0xBC
48
49
50
51 #define HFCPCI_FIFO_EN 0x44
52 #define HFCPCI_TRM 0x48
53 #define HFCPCI_B_MODE 0x4C
54 #define HFCPCI_CHIP_ID 0x58
55 #define HFCPCI_CIRM 0x60
56 #define HFCPCI_CTMT 0x64
57 #define HFCPCI_INT_M1 0x68
58 #define HFCPCI_INT_M2 0x6C
59 #define HFCPCI_INT_S1 0x78
60 #define HFCPCI_INT_S2 0x7C
61 #define HFCPCI_STATUS 0x70
62
63
64 #define HFCPCI_STATES 0xC0
65 #define HFCPCI_SCTRL 0xC4
66 #define HFCPCI_SCTRL_E 0xC8
67 #define HFCPCI_SCTRL_R 0xCC
68 #define HFCPCI_SQ 0xD0
69 #define HFCPCI_CLKDEL 0xDC
70 #define HFCPCI_B1_REC 0xF0
71 #define HFCPCI_B1_SEND 0xF0
72 #define HFCPCI_B2_REC 0xF4
73 #define HFCPCI_B2_SEND 0xF4
74 #define HFCPCI_D_REC 0xF8
75 #define HFCPCI_D_SEND 0xF8
76 #define HFCPCI_E_REC 0xFC
77
78
79
80 #define HFCPCI_PCI_PROC 0x02
81 #define HFCPCI_NBUSY 0x04
82 #define HFCPCI_TIMER_ELAP 0x10
83 #define HFCPCI_STATINT 0x20
84 #define HFCPCI_FRAMEINT 0x40
85 #define HFCPCI_ANYINT 0x80
86
87
88 #define HFCPCI_CLTIMER 0x80
89 #define HFCPCI_TIM3_125 0x04
90 #define HFCPCI_TIM25 0x10
91 #define HFCPCI_TIM50 0x14
92 #define HFCPCI_TIM400 0x18
93 #define HFCPCI_TIM800 0x1C
94 #define HFCPCI_AUTO_TIMER 0x20
95 #define HFCPCI_TRANSB2 0x02
96 #define HFCPCI_TRANSB1 0x01
97
98
99 #define HFCPCI_AUX_MSK 0x07
100 #define HFCPCI_RESET 0x08
101 #define HFCPCI_B1_REV 0x40
102 #define HFCPCI_B2_REV 0x80
103
104
105 #define HFCPCI_INTS_B1TRANS 0x01
106 #define HFCPCI_INTS_B2TRANS 0x02
107 #define HFCPCI_INTS_DTRANS 0x04
108 #define HFCPCI_INTS_B1REC 0x08
109 #define HFCPCI_INTS_B2REC 0x10
110 #define HFCPCI_INTS_DREC 0x20
111 #define HFCPCI_INTS_L1STATE 0x40
112 #define HFCPCI_INTS_TIMER 0x80
113
114
115 #define HFCPCI_PROC_TRANS 0x01
116 #define HFCPCI_GCI_I_CHG 0x02
117 #define HFCPCI_GCI_MON_REC 0x04
118 #define HFCPCI_IRQ_ENABLE 0x08
119 #define HFCPCI_PMESEL 0x80
120
121
122 #define HFCPCI_STATE_MSK 0x0F
123 #define HFCPCI_LOAD_STATE 0x10
124 #define HFCPCI_ACTIVATE 0x20
125 #define HFCPCI_DO_ACTION 0x40
126 #define HFCPCI_NT_G2_G3 0x80
127
128
129 #define HFCPCI_MASTER 0x01
130 #define HFCPCI_SLAVE 0x00
131 #define HFCPCI_F0IO_POSITIV 0x02
132 #define HFCPCI_F0_NEGATIV 0x04
133 #define HFCPCI_F0_2C4 0x08
134
135
136
137 #define SCTRL_B1_ENA 0x01
138 #define SCTRL_B2_ENA 0x02
139 #define SCTRL_MODE_TE 0x00
140 #define SCTRL_MODE_NT 0x04
141 #define SCTRL_LOW_PRIO 0x08
142 #define SCTRL_SQ_ENA 0x10
143 #define SCTRL_TEST 0x20
144 #define SCTRL_NONE_CAP 0x40
145 #define SCTRL_PWR_DOWN 0x80
146
147
148 #define HFCPCI_AUTO_AWAKE 0x01
149 #define HFCPCI_DBIT_1 0x04
150 #define HFCPCI_IGNORE_COL 0x08
151 #define HFCPCI_CHG_B1_B2 0x80
152
153
154 #define HFCPCI_FIFOEN_B1 0x03
155 #define HFCPCI_FIFOEN_B2 0x0C
156 #define HFCPCI_FIFOEN_DTX 0x10
157 #define HFCPCI_FIFOEN_B1TX 0x01
158 #define HFCPCI_FIFOEN_B1RX 0x02
159 #define HFCPCI_FIFOEN_B2TX 0x04
160 #define HFCPCI_FIFOEN_B2RX 0x08
161
162
163
164 #define MAX_D_FRAMES 15
165 #define MAX_B_FRAMES 31
166 #define B_SUB_VAL 0x200
167 #define B_FIFO_SIZE (0x2000 - B_SUB_VAL)
168 #define D_FIFO_SIZE 512
169 #define D_FREG_MASK 0xF
170
171 struct zt {
172 __le16 z1;
173 __le16 z2;
174 };
175
176 struct dfifo {
177 u_char data[D_FIFO_SIZE];
178 u_char fill1[0x20A0 - D_FIFO_SIZE];
179 u_char f1, f2;
180 u_char fill2[0x20C0 - 0x20A2];
181
182 struct zt za[MAX_D_FRAMES + 1];
183 u_char fill3[0x4000 - 0x2100];
184 };
185
186 struct bzfifo {
187 struct zt za[MAX_B_FRAMES + 1];
188 u_char f1, f2;
189 u_char fill[0x2100 - 0x2082];
190 };
191
192
193 union fifo_area {
194 struct {
195 struct dfifo d_tx;
196 struct dfifo d_rx;
197 } d_chan;
198 struct {
199 u_char fill1[0x200];
200 u_char txdat_b1[B_FIFO_SIZE];
201 struct bzfifo txbz_b1;
202 struct bzfifo txbz_b2;
203 u_char txdat_b2[B_FIFO_SIZE];
204 u_char fill2[D_FIFO_SIZE];
205 u_char rxdat_b1[B_FIFO_SIZE];
206 struct bzfifo rxbz_b1;
207 struct bzfifo rxbz_b2;
208 u_char rxdat_b2[B_FIFO_SIZE];
209 } b_chans;
210 u_char fill[32768];
211 };
212
213 #define Write_hfc(a, b, c) (writeb(c, (a->hw.pci_io) + b))
214 #define Read_hfc(a, b) (readb((a->hw.pci_io) + b))