1 |
1275 |
phoenix |
/******************************************************************************
|
2 |
|
|
Device driver for Interphase ATM PCI adapter cards
|
3 |
|
|
Author: Peter Wang <pwang@iphase.com>
|
4 |
|
|
Interphase Corporation <www.iphase.com>
|
5 |
|
|
Version: 1.0
|
6 |
|
|
iphase.h: This is the header file for iphase.c.
|
7 |
|
|
*******************************************************************************
|
8 |
|
|
|
9 |
|
|
This software may be used and distributed according to the terms
|
10 |
|
|
of the GNU General Public License (GPL), incorporated herein by reference.
|
11 |
|
|
Drivers based on this skeleton fall under the GPL and must retain
|
12 |
|
|
the authorship (implicit copyright) notice.
|
13 |
|
|
|
14 |
|
|
This program is distributed in the hope that it will be useful, but
|
15 |
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
17 |
|
|
General Public License for more details.
|
18 |
|
|
|
19 |
|
|
Modified from an incomplete driver for Interphase 5575 1KVC 1M card which
|
20 |
|
|
was originally written by Monalisa Agrawal at UNH. Now this driver
|
21 |
|
|
supports a variety of varients of Interphase ATM PCI (i)Chip adapter
|
22 |
|
|
card family (See www.iphase.com/products/ClassSheet.cfm?ClassID=ATM)
|
23 |
|
|
in terms of PHY type, the size of control memory and the size of
|
24 |
|
|
packet memory. The followings are the change log and history:
|
25 |
|
|
|
26 |
|
|
Bugfix the Mona's UBR driver.
|
27 |
|
|
Modify the basic memory allocation and dma logic.
|
28 |
|
|
Port the driver to the latest kernel from 2.0.46.
|
29 |
|
|
Complete the ABR logic of the driver, and added the ABR work-
|
30 |
|
|
around for the hardware anormalies.
|
31 |
|
|
Add the CBR support.
|
32 |
|
|
Add the flow control logic to the driver to allow rate-limit VC.
|
33 |
|
|
Add 4K VC support to the board with 512K control memory.
|
34 |
|
|
Add the support of all the variants of the Interphase ATM PCI
|
35 |
|
|
(i)Chip adapter cards including x575 (155M OC3 and UTP155), x525
|
36 |
|
|
(25M UTP25) and x531 (DS3 and E3).
|
37 |
|
|
Add SMP support.
|
38 |
|
|
|
39 |
|
|
Support and updates available at: ftp://ftp.iphase.com/pub/atm
|
40 |
|
|
|
41 |
|
|
*******************************************************************************/
|
42 |
|
|
|
43 |
|
|
#ifndef IPHASE_H
|
44 |
|
|
#define IPHASE_H
|
45 |
|
|
|
46 |
|
|
#include <linux/config.h>
|
47 |
|
|
|
48 |
|
|
/************************ IADBG DEFINE *********************************/
|
49 |
|
|
/* IADebugFlag Bit Map */
|
50 |
|
|
#define IF_IADBG_INIT_ADAPTER 0x00000001 // init adapter info
|
51 |
|
|
#define IF_IADBG_TX 0x00000002 // debug TX
|
52 |
|
|
#define IF_IADBG_RX 0x00000004 // debug RX
|
53 |
|
|
#define IF_IADBG_QUERY_INFO 0x00000008 // debug Request call
|
54 |
|
|
#define IF_IADBG_SHUTDOWN 0x00000010 // debug shutdown event
|
55 |
|
|
#define IF_IADBG_INTR 0x00000020 // debug interrupt DPC
|
56 |
|
|
#define IF_IADBG_TXPKT 0x00000040 // debug TX PKT
|
57 |
|
|
#define IF_IADBG_RXPKT 0x00000080 // debug RX PKT
|
58 |
|
|
#define IF_IADBG_ERR 0x00000100 // debug system error
|
59 |
|
|
#define IF_IADBG_EVENT 0x00000200 // debug event
|
60 |
|
|
#define IF_IADBG_DIS_INTR 0x00001000 // debug disable interrupt
|
61 |
|
|
#define IF_IADBG_EN_INTR 0x00002000 // debug enable interrupt
|
62 |
|
|
#define IF_IADBG_LOUD 0x00004000 // debugging info
|
63 |
|
|
#define IF_IADBG_VERY_LOUD 0x00008000 // excessive debugging info
|
64 |
|
|
#define IF_IADBG_CBR 0x00100000 //
|
65 |
|
|
#define IF_IADBG_UBR 0x00200000 //
|
66 |
|
|
#define IF_IADBG_ABR 0x00400000 //
|
67 |
|
|
#define IF_IADBG_DESC 0x01000000 //
|
68 |
|
|
#define IF_IADBG_SUNI_STAT 0x02000000 // suni statistics
|
69 |
|
|
#define IF_IADBG_RESET 0x04000000
|
70 |
|
|
|
71 |
|
|
extern unsigned int IADebugFlag;
|
72 |
|
|
|
73 |
|
|
#define IF_IADBG(f) if (IADebugFlag & (f))
|
74 |
|
|
|
75 |
|
|
#ifdef CONFIG_ATM_IA_DEBUG /* Debug build */
|
76 |
|
|
|
77 |
|
|
#define IF_LOUD(A) IF_IADBG(IF_IADBG_LOUD) { A }
|
78 |
|
|
#define IF_ERR(A) IF_IADBG(IF_IADBG_ERR) { A }
|
79 |
|
|
#define IF_VERY_LOUD(A) IF_IADBG( IF_IADBG_VERY_LOUD ) { A }
|
80 |
|
|
|
81 |
|
|
#define IF_INIT_ADAPTER(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
|
82 |
|
|
#define IF_INIT(A) IF_IADBG( IF_IADBG_INIT_ADAPTER ) { A }
|
83 |
|
|
#define IF_SUNI_STAT(A) IF_IADBG( IF_IADBG_SUNI_STAT ) { A }
|
84 |
|
|
#define IF_QUERY_INFO(A) IF_IADBG( IF_IADBG_QUERY_INFO ) { A }
|
85 |
|
|
#define IF_COPY_OVER(A) IF_IADBG( IF_IADBG_COPY_OVER ) { A }
|
86 |
|
|
|
87 |
|
|
#define IF_INTR(A) IF_IADBG( IF_IADBG_INTR ) { A }
|
88 |
|
|
#define IF_DIS_INTR(A) IF_IADBG( IF_IADBG_DIS_INTR ) { A }
|
89 |
|
|
#define IF_EN_INTR(A) IF_IADBG( IF_IADBG_EN_INTR ) { A }
|
90 |
|
|
|
91 |
|
|
#define IF_TX(A) IF_IADBG( IF_IADBG_TX ) { A }
|
92 |
|
|
#define IF_RX(A) IF_IADBG( IF_IADBG_RX ) { A }
|
93 |
|
|
#define IF_TXPKT(A) IF_IADBG( IF_IADBG_TXPKT ) { A }
|
94 |
|
|
#define IF_RXPKT(A) IF_IADBG( IF_IADBG_RXPKT ) { A }
|
95 |
|
|
|
96 |
|
|
#define IF_SHUTDOWN(A) IF_IADBG(IF_IADBG_SHUTDOWN) { A }
|
97 |
|
|
#define IF_CBR(A) IF_IADBG( IF_IADBG_CBR ) { A }
|
98 |
|
|
#define IF_UBR(A) IF_IADBG( IF_IADBG_UBR ) { A }
|
99 |
|
|
#define IF_ABR(A) IF_IADBG( IF_IADBG_ABR ) { A }
|
100 |
|
|
#define IF_EVENT(A) IF_IADBG( IF_IADBG_EVENT) { A }
|
101 |
|
|
|
102 |
|
|
#else /* free build */
|
103 |
|
|
#define IF_LOUD(A)
|
104 |
|
|
#define IF_VERY_LOUD(A)
|
105 |
|
|
#define IF_INIT_ADAPTER(A)
|
106 |
|
|
#define IF_INIT(A)
|
107 |
|
|
#define IF_SUNI_STAT(A)
|
108 |
|
|
#define IF_PVC_CHKPKT(A)
|
109 |
|
|
#define IF_QUERY_INFO(A)
|
110 |
|
|
#define IF_COPY_OVER(A)
|
111 |
|
|
#define IF_HANG(A)
|
112 |
|
|
#define IF_INTR(A)
|
113 |
|
|
#define IF_DIS_INTR(A)
|
114 |
|
|
#define IF_EN_INTR(A)
|
115 |
|
|
#define IF_TX(A)
|
116 |
|
|
#define IF_RX(A)
|
117 |
|
|
#define IF_TXDEBUG(A)
|
118 |
|
|
#define IF_VC(A)
|
119 |
|
|
#define IF_ERR(A)
|
120 |
|
|
#define IF_CBR(A)
|
121 |
|
|
#define IF_UBR(A)
|
122 |
|
|
#define IF_ABR(A)
|
123 |
|
|
#define IF_SHUTDOWN(A)
|
124 |
|
|
#define DbgPrint(A)
|
125 |
|
|
#define IF_EVENT(A)
|
126 |
|
|
#define IF_TXPKT(A)
|
127 |
|
|
#define IF_RXPKT(A)
|
128 |
|
|
#endif /* CONFIG_ATM_IA_DEBUG */
|
129 |
|
|
|
130 |
|
|
#define isprint(a) ((a >=' ')&&(a <= '~'))
|
131 |
|
|
#define ATM_DESC(skb) (skb->protocol)
|
132 |
|
|
#define IA_SKB_STATE(skb) (skb->protocol)
|
133 |
|
|
#define IA_DLED 1
|
134 |
|
|
#define IA_TX_DONE 2
|
135 |
|
|
|
136 |
|
|
/* iadbg defines */
|
137 |
|
|
#define IA_CMD 0x7749
|
138 |
|
|
typedef struct {
|
139 |
|
|
int cmd;
|
140 |
|
|
int sub_cmd;
|
141 |
|
|
int len;
|
142 |
|
|
u32 maddr;
|
143 |
|
|
int status;
|
144 |
|
|
void *buf;
|
145 |
|
|
} IA_CMDBUF, *PIA_CMDBUF;
|
146 |
|
|
|
147 |
|
|
/* cmds */
|
148 |
|
|
#define MEMDUMP 0x01
|
149 |
|
|
|
150 |
|
|
/* sub_cmds */
|
151 |
|
|
#define MEMDUMP_SEGREG 0x2
|
152 |
|
|
#define MEMDUMP_DEV 0x1
|
153 |
|
|
#define MEMDUMP_REASSREG 0x3
|
154 |
|
|
#define MEMDUMP_FFL 0x4
|
155 |
|
|
#define READ_REG 0x5
|
156 |
|
|
#define WAKE_DBG_WAIT 0x6
|
157 |
|
|
|
158 |
|
|
/************************ IADBG DEFINE END ***************************/
|
159 |
|
|
|
160 |
|
|
#define Boolean(x) ((x) ? 1 : 0)
|
161 |
|
|
#define NR_VCI 1024 /* number of VCIs */
|
162 |
|
|
#define NR_VCI_LD 10 /* log2(NR_VCI) */
|
163 |
|
|
#define NR_VCI_4K 4096 /* number of VCIs */
|
164 |
|
|
#define NR_VCI_4K_LD 12 /* log2(NR_VCI) */
|
165 |
|
|
#define MEM_VALID 0xfffffff0 /* mask base address with this */
|
166 |
|
|
|
167 |
|
|
#ifndef PCI_VENDOR_ID_IPHASE
|
168 |
|
|
#define PCI_VENDOR_ID_IPHASE 0x107e
|
169 |
|
|
#endif
|
170 |
|
|
#ifndef PCI_DEVICE_ID_IPHASE_5575
|
171 |
|
|
#define PCI_DEVICE_ID_IPHASE_5575 0x0008
|
172 |
|
|
#endif
|
173 |
|
|
#define DEV_LABEL "ia"
|
174 |
|
|
#define PCR 207692
|
175 |
|
|
#define ICR 100000
|
176 |
|
|
#define MCR 0
|
177 |
|
|
#define TBE 1000
|
178 |
|
|
#define FRTT 1
|
179 |
|
|
#define RIF 2
|
180 |
|
|
#define RDF 4
|
181 |
|
|
#define NRMCODE 5 /* 0 - 7 */
|
182 |
|
|
#define TRMCODE 3 /* 0 - 7 */
|
183 |
|
|
#define CDFCODE 6
|
184 |
|
|
#define ATDFCODE 2 /* 0 - 15 */
|
185 |
|
|
|
186 |
|
|
/*---------------------- Packet/Cell Memory ------------------------*/
|
187 |
|
|
#define TX_PACKET_RAM 0x00000 /* start of Trasnmit Packet memory - 0 */
|
188 |
|
|
#define DFL_TX_BUF_SZ 10240 /* 10 K buffers */
|
189 |
|
|
#define DFL_TX_BUFFERS 50 /* number of packet buffers for Tx
|
190 |
|
|
- descriptor 0 unused */
|
191 |
|
|
#define REASS_RAM_SIZE 0x10000 /* for 64K 1K VC board */
|
192 |
|
|
#define RX_PACKET_RAM 0x80000 /* start of Receive Packet memory - 512K */
|
193 |
|
|
#define DFL_RX_BUF_SZ 10240 /* 10k buffers */
|
194 |
|
|
#define DFL_RX_BUFFERS 50 /* number of packet buffers for Rx
|
195 |
|
|
- descriptor 0 unused */
|
196 |
|
|
|
197 |
|
|
struct cpcs_trailer
|
198 |
|
|
{
|
199 |
|
|
u_short control;
|
200 |
|
|
u_short length;
|
201 |
|
|
u_int crc32;
|
202 |
|
|
};
|
203 |
|
|
|
204 |
|
|
struct cpcs_trailer_desc
|
205 |
|
|
{
|
206 |
|
|
struct cpcs_trailer *cpcs;
|
207 |
|
|
dma_addr_t dma_addr;
|
208 |
|
|
};
|
209 |
|
|
|
210 |
|
|
struct ia_vcc
|
211 |
|
|
{
|
212 |
|
|
int rxing;
|
213 |
|
|
int txing;
|
214 |
|
|
int NumCbrEntry;
|
215 |
|
|
u32 pcr;
|
216 |
|
|
u32 saved_tx_quota;
|
217 |
|
|
int flow_inc;
|
218 |
|
|
struct sk_buff_head txing_skb;
|
219 |
|
|
int ltimeout;
|
220 |
|
|
u8 vc_desc_cnt;
|
221 |
|
|
|
222 |
|
|
};
|
223 |
|
|
|
224 |
|
|
struct abr_vc_table
|
225 |
|
|
{
|
226 |
|
|
u_char status;
|
227 |
|
|
u_char rdf;
|
228 |
|
|
u_short air;
|
229 |
|
|
u_int res[3];
|
230 |
|
|
u_int req_rm_cell_data1;
|
231 |
|
|
u_int req_rm_cell_data2;
|
232 |
|
|
u_int add_rm_cell_data1;
|
233 |
|
|
u_int add_rm_cell_data2;
|
234 |
|
|
};
|
235 |
|
|
|
236 |
|
|
/* 32 byte entries */
|
237 |
|
|
struct main_vc
|
238 |
|
|
{
|
239 |
|
|
u_short type;
|
240 |
|
|
#define ABR 0x8000
|
241 |
|
|
#define UBR 0xc000
|
242 |
|
|
#define CBR 0x0000
|
243 |
|
|
/* ABR fields */
|
244 |
|
|
u_short nrm;
|
245 |
|
|
u_short trm;
|
246 |
|
|
u_short rm_timestamp_hi;
|
247 |
|
|
u_short rm_timestamp_lo:8,
|
248 |
|
|
crm:8;
|
249 |
|
|
u_short remainder; /* ABR and UBR fields - last 10 bits*/
|
250 |
|
|
u_short next_vc_sched;
|
251 |
|
|
u_short present_desc; /* all classes */
|
252 |
|
|
u_short last_cell_slot; /* ABR and UBR */
|
253 |
|
|
u_short pcr;
|
254 |
|
|
u_short fraction;
|
255 |
|
|
u_short icr;
|
256 |
|
|
u_short atdf;
|
257 |
|
|
u_short mcr;
|
258 |
|
|
u_short acr;
|
259 |
|
|
u_short unack:8,
|
260 |
|
|
status:8; /* all classes */
|
261 |
|
|
#define UIOLI 0x80
|
262 |
|
|
#define CRC_APPEND 0x40 /* for status field - CRC-32 append */
|
263 |
|
|
#define ABR_STATE 0x02
|
264 |
|
|
|
265 |
|
|
};
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
/* 8 byte entries */
|
269 |
|
|
struct ext_vc
|
270 |
|
|
{
|
271 |
|
|
u_short atm_hdr1;
|
272 |
|
|
u_short atm_hdr2;
|
273 |
|
|
u_short last_desc;
|
274 |
|
|
u_short out_of_rate_link; /* reserved for UBR and CBR */
|
275 |
|
|
};
|
276 |
|
|
|
277 |
|
|
|
278 |
|
|
#define DLE_ENTRIES 256
|
279 |
|
|
#define DMA_INT_ENABLE 0x0002 /* use for both Tx and Rx */
|
280 |
|
|
#define TX_DLE_PSI 0x0001
|
281 |
|
|
#define DLE_TOTAL_SIZE (sizeof(struct dle)*DLE_ENTRIES)
|
282 |
|
|
|
283 |
|
|
/* Descriptor List Entries (DLE) */
|
284 |
|
|
struct dle
|
285 |
|
|
{
|
286 |
|
|
u32 sys_pkt_addr;
|
287 |
|
|
u32 local_pkt_addr;
|
288 |
|
|
u32 bytes;
|
289 |
|
|
u16 prq_wr_ptr_data;
|
290 |
|
|
u16 mode;
|
291 |
|
|
};
|
292 |
|
|
|
293 |
|
|
struct dle_q
|
294 |
|
|
{
|
295 |
|
|
struct dle *start;
|
296 |
|
|
struct dle *end;
|
297 |
|
|
struct dle *read;
|
298 |
|
|
struct dle *write;
|
299 |
|
|
};
|
300 |
|
|
|
301 |
|
|
struct free_desc_q
|
302 |
|
|
{
|
303 |
|
|
int desc; /* Descriptor number */
|
304 |
|
|
struct free_desc_q *next;
|
305 |
|
|
};
|
306 |
|
|
|
307 |
|
|
struct tx_buf_desc {
|
308 |
|
|
unsigned short desc_mode;
|
309 |
|
|
unsigned short vc_index;
|
310 |
|
|
unsigned short res1; /* reserved field */
|
311 |
|
|
unsigned short bytes;
|
312 |
|
|
unsigned short buf_start_hi;
|
313 |
|
|
unsigned short buf_start_lo;
|
314 |
|
|
unsigned short res2[10]; /* reserved field */
|
315 |
|
|
};
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
struct rx_buf_desc {
|
319 |
|
|
unsigned short desc_mode;
|
320 |
|
|
unsigned short vc_index;
|
321 |
|
|
unsigned short vpi;
|
322 |
|
|
unsigned short bytes;
|
323 |
|
|
unsigned short buf_start_hi;
|
324 |
|
|
unsigned short buf_start_lo;
|
325 |
|
|
unsigned short dma_start_hi;
|
326 |
|
|
unsigned short dma_start_lo;
|
327 |
|
|
unsigned short crc_upper;
|
328 |
|
|
unsigned short crc_lower;
|
329 |
|
|
unsigned short res:8, timeout:8;
|
330 |
|
|
unsigned short res2[5]; /* reserved field */
|
331 |
|
|
};
|
332 |
|
|
|
333 |
|
|
/*--------SAR stuff ---------------------*/
|
334 |
|
|
|
335 |
|
|
#define EPROM_SIZE 0x40000 /* says 64K in the docs ??? */
|
336 |
|
|
#define MAC1_LEN 4
|
337 |
|
|
#define MAC2_LEN 2
|
338 |
|
|
|
339 |
|
|
/*------------ PCI Memory Space Map, 128K SAR memory ----------------*/
|
340 |
|
|
#define IPHASE5575_PCI_CONFIG_REG_BASE 0x0000
|
341 |
|
|
#define IPHASE5575_BUS_CONTROL_REG_BASE 0x1000 /* offsets 0x00 - 0x3c */
|
342 |
|
|
#define IPHASE5575_FRAG_CONTROL_REG_BASE 0x2000
|
343 |
|
|
#define IPHASE5575_REASS_CONTROL_REG_BASE 0x3000
|
344 |
|
|
#define IPHASE5575_DMA_CONTROL_REG_BASE 0x4000
|
345 |
|
|
#define IPHASE5575_FRONT_END_REG_BASE IPHASE5575_DMA_CONTROL_REG_BASE
|
346 |
|
|
#define IPHASE5575_FRAG_CONTROL_RAM_BASE 0x10000
|
347 |
|
|
#define IPHASE5575_REASS_CONTROL_RAM_BASE 0x20000
|
348 |
|
|
|
349 |
|
|
/*------------ Bus interface control registers -----------------*/
|
350 |
|
|
#define IPHASE5575_BUS_CONTROL_REG 0x00
|
351 |
|
|
#define IPHASE5575_BUS_STATUS_REG 0x01 /* actual offset 0x04 */
|
352 |
|
|
#define IPHASE5575_MAC1 0x02
|
353 |
|
|
#define IPHASE5575_REV 0x03
|
354 |
|
|
#define IPHASE5575_MAC2 0x03 /*actual offset 0x0e-reg 0x0c*/
|
355 |
|
|
#define IPHASE5575_EXT_RESET 0x04
|
356 |
|
|
#define IPHASE5575_INT_RESET 0x05 /* addr 1c ?? reg 0x06 */
|
357 |
|
|
#define IPHASE5575_PCI_ADDR_PAGE 0x07 /* reg 0x08, 0x09 ?? */
|
358 |
|
|
#define IPHASE5575_EEPROM_ACCESS 0x0a /* actual offset 0x28 */
|
359 |
|
|
#define IPHASE5575_CELL_FIFO_QUEUE_SZ 0x0b
|
360 |
|
|
#define IPHASE5575_CELL_FIFO_MARK_STATE 0x0c
|
361 |
|
|
#define IPHASE5575_CELL_FIFO_READ_PTR 0x0d
|
362 |
|
|
#define IPHASE5575_CELL_FIFO_WRITE_PTR 0x0e
|
363 |
|
|
#define IPHASE5575_CELL_FIFO_CELLS_AVL 0x0f /* actual offset 0x3c */
|
364 |
|
|
|
365 |
|
|
/* Bus Interface Control Register bits */
|
366 |
|
|
#define CTRL_FE_RST 0x80000000
|
367 |
|
|
#define CTRL_LED 0x40000000
|
368 |
|
|
#define CTRL_25MBPHY 0x10000000
|
369 |
|
|
#define CTRL_ENCMBMEM 0x08000000
|
370 |
|
|
#define CTRL_ENOFFSEG 0x01000000
|
371 |
|
|
#define CTRL_ERRMASK 0x00400000
|
372 |
|
|
#define CTRL_DLETMASK 0x00100000
|
373 |
|
|
#define CTRL_DLERMASK 0x00080000
|
374 |
|
|
#define CTRL_FEMASK 0x00040000
|
375 |
|
|
#define CTRL_SEGMASK 0x00020000
|
376 |
|
|
#define CTRL_REASSMASK 0x00010000
|
377 |
|
|
#define CTRL_CSPREEMPT 0x00002000
|
378 |
|
|
#define CTRL_B128 0x00000200
|
379 |
|
|
#define CTRL_B64 0x00000100
|
380 |
|
|
#define CTRL_B48 0x00000080
|
381 |
|
|
#define CTRL_B32 0x00000040
|
382 |
|
|
#define CTRL_B16 0x00000020
|
383 |
|
|
#define CTRL_B8 0x00000010
|
384 |
|
|
|
385 |
|
|
/* Bus Interface Status Register bits */
|
386 |
|
|
#define STAT_CMEMSIZ 0xc0000000
|
387 |
|
|
#define STAT_ADPARCK 0x20000000
|
388 |
|
|
#define STAT_RESVD 0x1fffff80
|
389 |
|
|
#define STAT_ERRINT 0x00000040
|
390 |
|
|
#define STAT_MARKINT 0x00000020
|
391 |
|
|
#define STAT_DLETINT 0x00000010
|
392 |
|
|
#define STAT_DLERINT 0x00000008
|
393 |
|
|
#define STAT_FEINT 0x00000004
|
394 |
|
|
#define STAT_SEGINT 0x00000002
|
395 |
|
|
#define STAT_REASSINT 0x00000001
|
396 |
|
|
|
397 |
|
|
|
398 |
|
|
/*--------------- Segmentation control registers -----------------*/
|
399 |
|
|
/* The segmentation registers are 16 bits access and the addresses
|
400 |
|
|
are defined as such so the addresses are the actual "offsets" */
|
401 |
|
|
#define IDLEHEADHI 0x00
|
402 |
|
|
#define IDLEHEADLO 0x01
|
403 |
|
|
#define MAXRATE 0x02
|
404 |
|
|
/* Values for MAXRATE register for 155Mbps and 25.6 Mbps operation */
|
405 |
|
|
#define RATE155 0x64b1 // 16 bits float format
|
406 |
|
|
#define MAX_ATM_155 352768 // Cells/second p.118
|
407 |
|
|
#define RATE25 0x5f9d
|
408 |
|
|
|
409 |
|
|
#define STPARMS 0x03
|
410 |
|
|
#define STPARMS_1K 0x008c
|
411 |
|
|
#define STPARMS_2K 0x0049
|
412 |
|
|
#define STPARMS_4K 0x0026
|
413 |
|
|
#define COMP_EN 0x4000
|
414 |
|
|
#define CBR_EN 0x2000
|
415 |
|
|
#define ABR_EN 0x0800
|
416 |
|
|
#define UBR_EN 0x0400
|
417 |
|
|
|
418 |
|
|
#define ABRUBR_ARB 0x04
|
419 |
|
|
#define RM_TYPE 0x05
|
420 |
|
|
/*Value for RM_TYPE register for ATM Forum Traffic Mangement4.0 support*/
|
421 |
|
|
#define RM_TYPE_4_0 0x0100
|
422 |
|
|
|
423 |
|
|
#define SEG_COMMAND_REG 0x17
|
424 |
|
|
/* Values for the command register */
|
425 |
|
|
#define RESET_SEG 0x0055
|
426 |
|
|
#define RESET_SEG_STATE 0x00aa
|
427 |
|
|
#define RESET_TX_CELL_CTR 0x00cc
|
428 |
|
|
|
429 |
|
|
#define CBR_PTR_BASE 0x20
|
430 |
|
|
#define ABR_SBPTR_BASE 0x22
|
431 |
|
|
#define UBR_SBPTR_BASE 0x23
|
432 |
|
|
#define ABRWQ_BASE 0x26
|
433 |
|
|
#define UBRWQ_BASE 0x27
|
434 |
|
|
#define VCT_BASE 0x28
|
435 |
|
|
#define VCTE_BASE 0x29
|
436 |
|
|
#define CBR_TAB_BEG 0x2c
|
437 |
|
|
#define CBR_TAB_END 0x2d
|
438 |
|
|
#define PRQ_ST_ADR 0x30
|
439 |
|
|
#define PRQ_ED_ADR 0x31
|
440 |
|
|
#define PRQ_RD_PTR 0x32
|
441 |
|
|
#define PRQ_WR_PTR 0x33
|
442 |
|
|
#define TCQ_ST_ADR 0x34
|
443 |
|
|
#define TCQ_ED_ADR 0x35
|
444 |
|
|
#define TCQ_RD_PTR 0x36
|
445 |
|
|
#define TCQ_WR_PTR 0x37
|
446 |
|
|
#define SEG_QUEUE_BASE 0x40
|
447 |
|
|
#define SEG_DESC_BASE 0x41
|
448 |
|
|
#define MODE_REG_0 0x45
|
449 |
|
|
#define T_ONLINE 0x0002 /* (i)chipSAR is online */
|
450 |
|
|
|
451 |
|
|
#define MODE_REG_1 0x46
|
452 |
|
|
#define MODE_REG_1_VAL 0x0400 /*for propoer device operation*/
|
453 |
|
|
|
454 |
|
|
#define SEG_INTR_STATUS_REG 0x47
|
455 |
|
|
#define SEG_MASK_REG 0x48
|
456 |
|
|
#define TRANSMIT_DONE 0x0200
|
457 |
|
|
#define TCQ_NOT_EMPTY 0x1000 /* this can be used for both the interrupt
|
458 |
|
|
status registers as well as the mask register */
|
459 |
|
|
|
460 |
|
|
#define CELL_CTR_HIGH_AUTO 0x49
|
461 |
|
|
#define CELL_CTR_HIGH_NOAUTO 0xc9
|
462 |
|
|
#define CELL_CTR_LO_AUTO 0x4a
|
463 |
|
|
#define CELL_CTR_LO_NOAUTO 0xca
|
464 |
|
|
|
465 |
|
|
/* Diagnostic registers */
|
466 |
|
|
#define NEXTDESC 0x59
|
467 |
|
|
#define NEXTVC 0x5a
|
468 |
|
|
#define PSLOTCNT 0x5d
|
469 |
|
|
#define NEWDN 0x6a
|
470 |
|
|
#define NEWVC 0x6b
|
471 |
|
|
#define SBPTR 0x6c
|
472 |
|
|
#define ABRWQ_WRPTR 0x6f
|
473 |
|
|
#define ABRWQ_RDPTR 0x70
|
474 |
|
|
#define UBRWQ_WRPTR 0x71
|
475 |
|
|
#define UBRWQ_RDPTR 0x72
|
476 |
|
|
#define CBR_VC 0x73
|
477 |
|
|
#define ABR_SBVC 0x75
|
478 |
|
|
#define UBR_SBVC 0x76
|
479 |
|
|
#define ABRNEXTLINK 0x78
|
480 |
|
|
#define UBRNEXTLINK 0x79
|
481 |
|
|
|
482 |
|
|
|
483 |
|
|
/*----------------- Reassembly control registers ---------------------*/
|
484 |
|
|
/* The reassembly registers are 16 bits access and the addresses
|
485 |
|
|
are defined as such so the addresses are the actual "offsets" */
|
486 |
|
|
#define MODE_REG 0x00
|
487 |
|
|
#define R_ONLINE 0x0002 /* (i)chip is online */
|
488 |
|
|
#define IGN_RAW_FL 0x0004
|
489 |
|
|
|
490 |
|
|
#define PROTOCOL_ID 0x01
|
491 |
|
|
#define REASS_MASK_REG 0x02
|
492 |
|
|
#define REASS_INTR_STATUS_REG 0x03
|
493 |
|
|
/* Interrupt Status register bits */
|
494 |
|
|
#define RX_PKT_CTR_OF 0x8000
|
495 |
|
|
#define RX_ERR_CTR_OF 0x4000
|
496 |
|
|
#define RX_CELL_CTR_OF 0x1000
|
497 |
|
|
#define RX_FREEQ_EMPT 0x0200
|
498 |
|
|
#define RX_EXCPQ_FL 0x0080
|
499 |
|
|
#define RX_RAWQ_FL 0x0010
|
500 |
|
|
#define RX_EXCP_RCVD 0x0008
|
501 |
|
|
#define RX_PKT_RCVD 0x0004
|
502 |
|
|
#define RX_RAW_RCVD 0x0001
|
503 |
|
|
|
504 |
|
|
#define DRP_PKT_CNTR 0x04
|
505 |
|
|
#define ERR_CNTR 0x05
|
506 |
|
|
#define RAW_BASE_ADR 0x08
|
507 |
|
|
#define CELL_CTR0 0x0c
|
508 |
|
|
#define CELL_CTR1 0x0d
|
509 |
|
|
#define REASS_COMMAND_REG 0x0f
|
510 |
|
|
/* Values for command register */
|
511 |
|
|
#define RESET_REASS 0x0055
|
512 |
|
|
#define RESET_REASS_STATE 0x00aa
|
513 |
|
|
#define RESET_DRP_PKT_CNTR 0x00f1
|
514 |
|
|
#define RESET_ERR_CNTR 0x00f2
|
515 |
|
|
#define RESET_CELL_CNTR 0x00f8
|
516 |
|
|
#define RESET_REASS_ALL_REGS 0x00ff
|
517 |
|
|
|
518 |
|
|
#define REASS_DESC_BASE 0x10
|
519 |
|
|
#define VC_LKUP_BASE 0x11
|
520 |
|
|
#define REASS_TABLE_BASE 0x12
|
521 |
|
|
#define REASS_QUEUE_BASE 0x13
|
522 |
|
|
#define PKT_TM_CNT 0x16
|
523 |
|
|
#define TMOUT_RANGE 0x17
|
524 |
|
|
#define INTRVL_CNTR 0x18
|
525 |
|
|
#define TMOUT_INDX 0x19
|
526 |
|
|
#define VP_LKUP_BASE 0x1c
|
527 |
|
|
#define VP_FILTER 0x1d
|
528 |
|
|
#define ABR_LKUP_BASE 0x1e
|
529 |
|
|
#define FREEQ_ST_ADR 0x24
|
530 |
|
|
#define FREEQ_ED_ADR 0x25
|
531 |
|
|
#define FREEQ_RD_PTR 0x26
|
532 |
|
|
#define FREEQ_WR_PTR 0x27
|
533 |
|
|
#define PCQ_ST_ADR 0x28
|
534 |
|
|
#define PCQ_ED_ADR 0x29
|
535 |
|
|
#define PCQ_RD_PTR 0x2a
|
536 |
|
|
#define PCQ_WR_PTR 0x2b
|
537 |
|
|
#define EXCP_Q_ST_ADR 0x2c
|
538 |
|
|
#define EXCP_Q_ED_ADR 0x2d
|
539 |
|
|
#define EXCP_Q_RD_PTR 0x2e
|
540 |
|
|
#define EXCP_Q_WR_PTR 0x2f
|
541 |
|
|
#define CC_FIFO_ST_ADR 0x34
|
542 |
|
|
#define CC_FIFO_ED_ADR 0x35
|
543 |
|
|
#define CC_FIFO_RD_PTR 0x36
|
544 |
|
|
#define CC_FIFO_WR_PTR 0x37
|
545 |
|
|
#define STATE_REG 0x38
|
546 |
|
|
#define BUF_SIZE 0x42
|
547 |
|
|
#define XTRA_RM_OFFSET 0x44
|
548 |
|
|
#define DRP_PKT_CNTR_NC 0x84
|
549 |
|
|
#define ERR_CNTR_NC 0x85
|
550 |
|
|
#define CELL_CNTR0_NC 0x8c
|
551 |
|
|
#define CELL_CNTR1_NC 0x8d
|
552 |
|
|
|
553 |
|
|
/* State Register bits */
|
554 |
|
|
#define EXCPQ_EMPTY 0x0040
|
555 |
|
|
#define PCQ_EMPTY 0x0010
|
556 |
|
|
#define FREEQ_EMPTY 0x0004
|
557 |
|
|
|
558 |
|
|
|
559 |
|
|
/*----------------- Front End registers/ DMA control --------------*/
|
560 |
|
|
/* There is a lot of documentation error regarding these offsets ???
|
561 |
|
|
eg:- 2 offsets given 800, a00 for rx counter
|
562 |
|
|
similarly many others
|
563 |
|
|
Remember again that the offsets are to be 4*register number, so
|
564 |
|
|
correct the #defines here
|
565 |
|
|
*/
|
566 |
|
|
#define IPHASE5575_TX_COUNTER 0x200 /* offset - 0x800 */
|
567 |
|
|
#define IPHASE5575_RX_COUNTER 0x280 /* offset - 0xa00 */
|
568 |
|
|
#define IPHASE5575_TX_LIST_ADDR 0x300 /* offset - 0xc00 */
|
569 |
|
|
#define IPHASE5575_RX_LIST_ADDR 0x380 /* offset - 0xe00 */
|
570 |
|
|
|
571 |
|
|
/*--------------------------- RAM ---------------------------*/
|
572 |
|
|
/* These memory maps are actually offsets from the segmentation and reassembly RAM base addresses */
|
573 |
|
|
|
574 |
|
|
/* Segmentation Control Memory map */
|
575 |
|
|
#define TX_DESC_BASE 0x0000 /* Buffer Decriptor Table */
|
576 |
|
|
#define TX_COMP_Q 0x1000 /* Transmit Complete Queue */
|
577 |
|
|
#define PKT_RDY_Q 0x1400 /* Packet Ready Queue */
|
578 |
|
|
#define CBR_SCHED_TABLE 0x1800 /* CBR Table */
|
579 |
|
|
#define UBR_SCHED_TABLE 0x3000 /* UBR Table */
|
580 |
|
|
#define UBR_WAIT_Q 0x4000 /* UBR Wait Queue */
|
581 |
|
|
#define ABR_SCHED_TABLE 0x5000 /* ABR Table */
|
582 |
|
|
#define ABR_WAIT_Q 0x5800 /* ABR Wait Queue */
|
583 |
|
|
#define EXT_VC_TABLE 0x6000 /* Extended VC Table */
|
584 |
|
|
#define MAIN_VC_TABLE 0x8000 /* Main VC Table */
|
585 |
|
|
#define SCHEDSZ 1024 /* ABR and UBR Scheduling Table size */
|
586 |
|
|
#define TX_DESC_TABLE_SZ 128 /* Number of entries in the Transmit
|
587 |
|
|
Buffer Descriptor Table */
|
588 |
|
|
|
589 |
|
|
/* These are used as table offsets in Descriptor Table address generation */
|
590 |
|
|
#define DESC_MODE 0x0
|
591 |
|
|
#define VC_INDEX 0x1
|
592 |
|
|
#define BYTE_CNT 0x3
|
593 |
|
|
#define PKT_START_HI 0x4
|
594 |
|
|
#define PKT_START_LO 0x5
|
595 |
|
|
|
596 |
|
|
/* Descriptor Mode Word Bits */
|
597 |
|
|
#define EOM_EN 0x0800
|
598 |
|
|
#define AAL5 0x0100
|
599 |
|
|
#define APP_CRC32 0x0400
|
600 |
|
|
#define CMPL_INT 0x1000
|
601 |
|
|
|
602 |
|
|
#define TABLE_ADDRESS(db, dn, to) \
|
603 |
|
|
(((unsigned long)(db & 0x04)) << 16) | (dn << 5) | (to << 1)
|
604 |
|
|
|
605 |
|
|
/* Reassembly Control Memory Map */
|
606 |
|
|
#define RX_DESC_BASE 0x0000 /* Buffer Descriptor Table */
|
607 |
|
|
#define VP_TABLE 0x5c00 /* VP Table */
|
608 |
|
|
#define EXCEPTION_Q 0x5e00 /* Exception Queue */
|
609 |
|
|
#define FREE_BUF_DESC_Q 0x6000 /* Free Buffer Descriptor Queue */
|
610 |
|
|
#define PKT_COMP_Q 0x6800 /* Packet Complete Queue */
|
611 |
|
|
#define REASS_TABLE 0x7000 /* Reassembly Table */
|
612 |
|
|
#define RX_VC_TABLE 0x7800 /* VC Table */
|
613 |
|
|
#define ABR_VC_TABLE 0x8000 /* ABR VC Table */
|
614 |
|
|
#define RX_DESC_TABLE_SZ 736 /* Number of entries in the Receive
|
615 |
|
|
Buffer Descriptor Table */
|
616 |
|
|
#define VP_TABLE_SZ 256 /* Number of entries in VPTable */
|
617 |
|
|
#define RX_VC_TABLE_SZ 1024 /* Number of entries in VC Table */
|
618 |
|
|
#define REASS_TABLE_SZ 1024 /* Number of entries in Reassembly Table */
|
619 |
|
|
/* Buffer Descriptor Table */
|
620 |
|
|
#define RX_ACT 0x8000
|
621 |
|
|
#define RX_VPVC 0x4000
|
622 |
|
|
#define RX_CNG 0x0040
|
623 |
|
|
#define RX_CER 0x0008
|
624 |
|
|
#define RX_PTE 0x0004
|
625 |
|
|
#define RX_OFL 0x0002
|
626 |
|
|
#define NUM_RX_EXCP 32
|
627 |
|
|
|
628 |
|
|
/* Reassembly Table */
|
629 |
|
|
#define NO_AAL5_PKT 0x0000
|
630 |
|
|
#define AAL5_PKT_REASSEMBLED 0x4000
|
631 |
|
|
#define AAL5_PKT_TERMINATED 0x8000
|
632 |
|
|
#define RAW_PKT 0xc000
|
633 |
|
|
#define REASS_ABR 0x2000
|
634 |
|
|
|
635 |
|
|
/*-------------------- Base Registers --------------------*/
|
636 |
|
|
#define REG_BASE IPHASE5575_BUS_CONTROL_REG_BASE
|
637 |
|
|
#define RAM_BASE IPHASE5575_FRAG_CONTROL_RAM_BASE
|
638 |
|
|
#define PHY_BASE IPHASE5575_FRONT_END_REG_BASE
|
639 |
|
|
#define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE
|
640 |
|
|
#define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE
|
641 |
|
|
|
642 |
|
|
typedef volatile u_int freg_t;
|
643 |
|
|
typedef u_int rreg_t;
|
644 |
|
|
|
645 |
|
|
typedef struct _ffredn_t {
|
646 |
|
|
freg_t idlehead_high; /* Idle cell header (high) */
|
647 |
|
|
freg_t idlehead_low; /* Idle cell header (low) */
|
648 |
|
|
freg_t maxrate; /* Maximum rate */
|
649 |
|
|
freg_t stparms; /* Traffic Management Parameters */
|
650 |
|
|
freg_t abrubr_abr; /* ABRUBR Priority Byte 1, TCR Byte 0 */
|
651 |
|
|
freg_t rm_type; /* */
|
652 |
|
|
u_int filler5[0x17 - 0x06];
|
653 |
|
|
freg_t cmd_reg; /* Command register */
|
654 |
|
|
u_int filler18[0x20 - 0x18];
|
655 |
|
|
freg_t cbr_base; /* CBR Pointer Base */
|
656 |
|
|
freg_t vbr_base; /* VBR Pointer Base */
|
657 |
|
|
freg_t abr_base; /* ABR Pointer Base */
|
658 |
|
|
freg_t ubr_base; /* UBR Pointer Base */
|
659 |
|
|
u_int filler24;
|
660 |
|
|
freg_t vbrwq_base; /* VBR Wait Queue Base */
|
661 |
|
|
freg_t abrwq_base; /* ABR Wait Queue Base */
|
662 |
|
|
freg_t ubrwq_base; /* UBR Wait Queue Base */
|
663 |
|
|
freg_t vct_base; /* Main VC Table Base */
|
664 |
|
|
freg_t vcte_base; /* Extended Main VC Table Base */
|
665 |
|
|
u_int filler2a[0x2C - 0x2A];
|
666 |
|
|
freg_t cbr_tab_beg; /* CBR Table Begin */
|
667 |
|
|
freg_t cbr_tab_end; /* CBR Table End */
|
668 |
|
|
freg_t cbr_pointer; /* CBR Pointer */
|
669 |
|
|
u_int filler2f[0x30 - 0x2F];
|
670 |
|
|
freg_t prq_st_adr; /* Packet Ready Queue Start Address */
|
671 |
|
|
freg_t prq_ed_adr; /* Packet Ready Queue End Address */
|
672 |
|
|
freg_t prq_rd_ptr; /* Packet Ready Queue read pointer */
|
673 |
|
|
freg_t prq_wr_ptr; /* Packet Ready Queue write pointer */
|
674 |
|
|
freg_t tcq_st_adr; /* Transmit Complete Queue Start Address*/
|
675 |
|
|
freg_t tcq_ed_adr; /* Transmit Complete Queue End Address */
|
676 |
|
|
freg_t tcq_rd_ptr; /* Transmit Complete Queue read pointer */
|
677 |
|
|
freg_t tcq_wr_ptr; /* Transmit Complete Queue write pointer*/
|
678 |
|
|
u_int filler38[0x40 - 0x38];
|
679 |
|
|
freg_t queue_base; /* Base address for PRQ and TCQ */
|
680 |
|
|
freg_t desc_base; /* Base address of descriptor table */
|
681 |
|
|
u_int filler42[0x45 - 0x42];
|
682 |
|
|
freg_t mode_reg_0; /* Mode register 0 */
|
683 |
|
|
freg_t mode_reg_1; /* Mode register 1 */
|
684 |
|
|
freg_t intr_status_reg;/* Interrupt Status register */
|
685 |
|
|
freg_t mask_reg; /* Mask Register */
|
686 |
|
|
freg_t cell_ctr_high1; /* Total cell transfer count (high) */
|
687 |
|
|
freg_t cell_ctr_lo1; /* Total cell transfer count (low) */
|
688 |
|
|
freg_t state_reg; /* Status register */
|
689 |
|
|
u_int filler4c[0x58 - 0x4c];
|
690 |
|
|
freg_t curr_desc_num; /* Contains the current descriptor num */
|
691 |
|
|
freg_t next_desc; /* Next descriptor */
|
692 |
|
|
freg_t next_vc; /* Next VC */
|
693 |
|
|
u_int filler5b[0x5d - 0x5b];
|
694 |
|
|
freg_t present_slot_cnt;/* Present slot count */
|
695 |
|
|
u_int filler5e[0x6a - 0x5e];
|
696 |
|
|
freg_t new_desc_num; /* New descriptor number */
|
697 |
|
|
freg_t new_vc; /* New VC */
|
698 |
|
|
freg_t sched_tbl_ptr; /* Schedule table pointer */
|
699 |
|
|
freg_t vbrwq_wptr; /* VBR wait queue write pointer */
|
700 |
|
|
freg_t vbrwq_rptr; /* VBR wait queue read pointer */
|
701 |
|
|
freg_t abrwq_wptr; /* ABR wait queue write pointer */
|
702 |
|
|
freg_t abrwq_rptr; /* ABR wait queue read pointer */
|
703 |
|
|
freg_t ubrwq_wptr; /* UBR wait queue write pointer */
|
704 |
|
|
freg_t ubrwq_rptr; /* UBR wait queue read pointer */
|
705 |
|
|
freg_t cbr_vc; /* CBR VC */
|
706 |
|
|
freg_t vbr_sb_vc; /* VBR SB VC */
|
707 |
|
|
freg_t abr_sb_vc; /* ABR SB VC */
|
708 |
|
|
freg_t ubr_sb_vc; /* UBR SB VC */
|
709 |
|
|
freg_t vbr_next_link; /* VBR next link */
|
710 |
|
|
freg_t abr_next_link; /* ABR next link */
|
711 |
|
|
freg_t ubr_next_link; /* UBR next link */
|
712 |
|
|
u_int filler7a[0x7c-0x7a];
|
713 |
|
|
freg_t out_rate_head; /* Out of rate head */
|
714 |
|
|
u_int filler7d[0xca-0x7d]; /* pad out to full address space */
|
715 |
|
|
freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */
|
716 |
|
|
freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */
|
717 |
|
|
u_int fillercc[0x100-0xcc]; /* pad out to full address space */
|
718 |
|
|
} ffredn_t;
|
719 |
|
|
|
720 |
|
|
typedef struct _rfredn_t {
|
721 |
|
|
rreg_t mode_reg_0; /* Mode register 0 */
|
722 |
|
|
rreg_t protocol_id; /* Protocol ID */
|
723 |
|
|
rreg_t mask_reg; /* Mask Register */
|
724 |
|
|
rreg_t intr_status_reg;/* Interrupt status register */
|
725 |
|
|
rreg_t drp_pkt_cntr; /* Dropped packet cntr (clear on read) */
|
726 |
|
|
rreg_t err_cntr; /* Error Counter (cleared on read) */
|
727 |
|
|
u_int filler6[0x08 - 0x06];
|
728 |
|
|
rreg_t raw_base_adr; /* Base addr for raw cell Q */
|
729 |
|
|
u_int filler2[0x0c - 0x09];
|
730 |
|
|
rreg_t cell_ctr0; /* Cell Counter 0 (cleared when read) */
|
731 |
|
|
rreg_t cell_ctr1; /* Cell Counter 1 (cleared when read) */
|
732 |
|
|
u_int filler3[0x0f - 0x0e];
|
733 |
|
|
rreg_t cmd_reg; /* Command register */
|
734 |
|
|
rreg_t desc_base; /* Base address for description table */
|
735 |
|
|
rreg_t vc_lkup_base; /* Base address for VC lookup table */
|
736 |
|
|
rreg_t reass_base; /* Base address for reassembler table */
|
737 |
|
|
rreg_t queue_base; /* Base address for Communication queue */
|
738 |
|
|
u_int filler14[0x16 - 0x14];
|
739 |
|
|
rreg_t pkt_tm_cnt; /* Packet Timeout and count register */
|
740 |
|
|
rreg_t tmout_range; /* Range of reassembley IDs for timeout */
|
741 |
|
|
rreg_t intrvl_cntr; /* Packet aging interval counter */
|
742 |
|
|
rreg_t tmout_indx; /* index of pkt being tested for aging */
|
743 |
|
|
u_int filler1a[0x1c - 0x1a];
|
744 |
|
|
rreg_t vp_lkup_base; /* Base address for VP lookup table */
|
745 |
|
|
rreg_t vp_filter; /* VP filter register */
|
746 |
|
|
rreg_t abr_lkup_base; /* Base address of ABR VC Table */
|
747 |
|
|
u_int filler1f[0x24 - 0x1f];
|
748 |
|
|
rreg_t fdq_st_adr; /* Free desc queue start address */
|
749 |
|
|
rreg_t fdq_ed_adr; /* Free desc queue end address */
|
750 |
|
|
rreg_t fdq_rd_ptr; /* Free desc queue read pointer */
|
751 |
|
|
rreg_t fdq_wr_ptr; /* Free desc queue write pointer */
|
752 |
|
|
rreg_t pcq_st_adr; /* Packet Complete queue start address */
|
753 |
|
|
rreg_t pcq_ed_adr; /* Packet Complete queue end address */
|
754 |
|
|
rreg_t pcq_rd_ptr; /* Packet Complete queue read pointer */
|
755 |
|
|
rreg_t pcq_wr_ptr; /* Packet Complete queue write pointer */
|
756 |
|
|
rreg_t excp_st_adr; /* Exception queue start address */
|
757 |
|
|
rreg_t excp_ed_adr; /* Exception queue end address */
|
758 |
|
|
rreg_t excp_rd_ptr; /* Exception queue read pointer */
|
759 |
|
|
rreg_t excp_wr_ptr; /* Exception queue write pointer */
|
760 |
|
|
u_int filler30[0x34 - 0x30];
|
761 |
|
|
rreg_t raw_st_adr; /* Raw Cell start address */
|
762 |
|
|
rreg_t raw_ed_adr; /* Raw Cell end address */
|
763 |
|
|
rreg_t raw_rd_ptr; /* Raw Cell read pointer */
|
764 |
|
|
rreg_t raw_wr_ptr; /* Raw Cell write pointer */
|
765 |
|
|
rreg_t state_reg; /* State Register */
|
766 |
|
|
u_int filler39[0x42 - 0x39];
|
767 |
|
|
rreg_t buf_size; /* Buffer size */
|
768 |
|
|
u_int filler43;
|
769 |
|
|
rreg_t xtra_rm_offset; /* Offset of the additional turnaround RM */
|
770 |
|
|
u_int filler45[0x84 - 0x45];
|
771 |
|
|
rreg_t drp_pkt_cntr_nc;/* Dropped Packet cntr, Not clear on rd */
|
772 |
|
|
rreg_t err_cntr_nc; /* Error Counter, Not clear on read */
|
773 |
|
|
u_int filler86[0x8c - 0x86];
|
774 |
|
|
rreg_t cell_ctr0_nc; /* Cell Counter 0, Not clear on read */
|
775 |
|
|
rreg_t cell_ctr1_nc; /* Cell Counter 1, Not clear on read */
|
776 |
|
|
u_int filler8e[0x100-0x8e]; /* pad out to full address space */
|
777 |
|
|
} rfredn_t;
|
778 |
|
|
|
779 |
|
|
typedef struct {
|
780 |
|
|
/* Atlantic */
|
781 |
|
|
ffredn_t ffredn; /* F FRED */
|
782 |
|
|
rfredn_t rfredn; /* R FRED */
|
783 |
|
|
} ia_regs_t;
|
784 |
|
|
|
785 |
|
|
typedef struct {
|
786 |
|
|
u_short f_vc_type; /* VC type */
|
787 |
|
|
u_short f_nrm; /* Nrm */
|
788 |
|
|
u_short f_nrmexp; /* Nrm Exp */
|
789 |
|
|
u_short reserved6; /* */
|
790 |
|
|
u_short f_crm; /* Crm */
|
791 |
|
|
u_short reserved10; /* Reserved */
|
792 |
|
|
u_short reserved12; /* Reserved */
|
793 |
|
|
u_short reserved14; /* Reserved */
|
794 |
|
|
u_short last_cell_slot; /* last_cell_slot_count */
|
795 |
|
|
u_short f_pcr; /* Peak Cell Rate */
|
796 |
|
|
u_short fraction; /* fraction */
|
797 |
|
|
u_short f_icr; /* Initial Cell Rate */
|
798 |
|
|
u_short f_cdf; /* */
|
799 |
|
|
u_short f_mcr; /* Minimum Cell Rate */
|
800 |
|
|
u_short f_acr; /* Allowed Cell Rate */
|
801 |
|
|
u_short f_status; /* */
|
802 |
|
|
} f_vc_abr_entry;
|
803 |
|
|
|
804 |
|
|
typedef struct {
|
805 |
|
|
u_short r_status_rdf; /* status + RDF */
|
806 |
|
|
u_short r_air; /* AIR */
|
807 |
|
|
u_short reserved4[14]; /* Reserved */
|
808 |
|
|
} r_vc_abr_entry;
|
809 |
|
|
|
810 |
|
|
#define MRM 3
|
811 |
|
|
#define MIN(x,y) ((x) < (y)) ? (x) : (y)
|
812 |
|
|
|
813 |
|
|
typedef struct srv_cls_param {
|
814 |
|
|
u32 class_type; /* CBR/VBR/ABR/UBR; use the enum above */
|
815 |
|
|
u32 pcr; /* Peak Cell Rate (24-bit) */
|
816 |
|
|
/* VBR parameters */
|
817 |
|
|
u32 scr; /* sustainable cell rate */
|
818 |
|
|
u32 max_burst_size; /* ?? cell rate or data rate */
|
819 |
|
|
|
820 |
|
|
/* ABR only UNI 4.0 Parameters */
|
821 |
|
|
u32 mcr; /* Min Cell Rate (24-bit) */
|
822 |
|
|
u32 icr; /* Initial Cell Rate (24-bit) */
|
823 |
|
|
u32 tbe; /* Transient Buffer Exposure (24-bit) */
|
824 |
|
|
u32 frtt; /* Fixed Round Trip Time (24-bit) */
|
825 |
|
|
|
826 |
|
|
#if 0 /* Additional Parameters of TM 4.0 */
|
827 |
|
|
bits 31 30 29 28 27-25 24-22 21-19 18-9
|
828 |
|
|
-----------------------------------------------------------------------------
|
829 |
|
|
| NRM present | TRM prsnt | CDF prsnt | ADTF prsnt | NRM | TRM | CDF | ADTF |
|
830 |
|
|
-----------------------------------------------------------------------------
|
831 |
|
|
#endif /* 0 */
|
832 |
|
|
|
833 |
|
|
u8 nrm; /* Max # of Cells for each forward RM
|
834 |
|
|
cell (3-bit) */
|
835 |
|
|
u8 trm; /* Time between forward RM cells (3-bit) */
|
836 |
|
|
u16 adtf; /* ACR Decrease Time Factor (10-bit) */
|
837 |
|
|
u8 cdf; /* Cutoff Decrease Factor (3-bit) */
|
838 |
|
|
u8 rif; /* Rate Increment Factor (4-bit) */
|
839 |
|
|
u8 rdf; /* Rate Decrease Factor (4-bit) */
|
840 |
|
|
u8 reserved; /* 8 bits to keep structure word aligned */
|
841 |
|
|
} srv_cls_param_t;
|
842 |
|
|
|
843 |
|
|
struct testTable_t {
|
844 |
|
|
u16 lastTime;
|
845 |
|
|
u16 fract;
|
846 |
|
|
u8 vc_status;
|
847 |
|
|
};
|
848 |
|
|
|
849 |
|
|
typedef struct {
|
850 |
|
|
u16 vci;
|
851 |
|
|
u16 error;
|
852 |
|
|
} RX_ERROR_Q;
|
853 |
|
|
|
854 |
|
|
typedef struct {
|
855 |
|
|
u8 active: 1;
|
856 |
|
|
u8 abr: 1;
|
857 |
|
|
u8 ubr: 1;
|
858 |
|
|
u8 cnt: 5;
|
859 |
|
|
#define VC_ACTIVE 0x01
|
860 |
|
|
#define VC_ABR 0x02
|
861 |
|
|
#define VC_UBR 0x04
|
862 |
|
|
} vcstatus_t;
|
863 |
|
|
|
864 |
|
|
struct ia_rfL_t {
|
865 |
|
|
u32 fdq_st; /* Free desc queue start address */
|
866 |
|
|
u32 fdq_ed; /* Free desc queue end address */
|
867 |
|
|
u32 fdq_rd; /* Free desc queue read pointer */
|
868 |
|
|
u32 fdq_wr; /* Free desc queue write pointer */
|
869 |
|
|
u32 pcq_st; /* Packet Complete queue start address */
|
870 |
|
|
u32 pcq_ed; /* Packet Complete queue end address */
|
871 |
|
|
u32 pcq_rd; /* Packet Complete queue read pointer */
|
872 |
|
|
u32 pcq_wr; /* Packet Complete queue write pointer */
|
873 |
|
|
};
|
874 |
|
|
|
875 |
|
|
struct ia_ffL_t {
|
876 |
|
|
u32 prq_st; /* Packet Ready Queue Start Address */
|
877 |
|
|
u32 prq_ed; /* Packet Ready Queue End Address */
|
878 |
|
|
u32 prq_wr; /* Packet Ready Queue write pointer */
|
879 |
|
|
u32 tcq_st; /* Transmit Complete Queue Start Address*/
|
880 |
|
|
u32 tcq_ed; /* Transmit Complete Queue End Address */
|
881 |
|
|
u32 tcq_rd; /* Transmit Complete Queue read pointer */
|
882 |
|
|
};
|
883 |
|
|
|
884 |
|
|
struct desc_tbl_t {
|
885 |
|
|
u32 timestamp;
|
886 |
|
|
struct ia_vcc *iavcc;
|
887 |
|
|
struct sk_buff *txskb;
|
888 |
|
|
};
|
889 |
|
|
|
890 |
|
|
typedef struct ia_rtn_q {
|
891 |
|
|
struct desc_tbl_t data;
|
892 |
|
|
struct ia_rtn_q *next, *tail;
|
893 |
|
|
} IARTN_Q;
|
894 |
|
|
|
895 |
|
|
#define SUNI_LOSV 0x04
|
896 |
|
|
typedef struct {
|
897 |
|
|
u32 suni_master_reset; /* SUNI Master Reset and Identity */
|
898 |
|
|
u32 suni_master_config; /* SUNI Master Configuration */
|
899 |
|
|
u32 suni_master_intr_stat; /* SUNI Master Interrupt Status */
|
900 |
|
|
u32 suni_reserved1; /* Reserved */
|
901 |
|
|
u32 suni_master_clk_monitor;/* SUNI Master Clock Monitor */
|
902 |
|
|
u32 suni_master_control; /* SUNI Master Clock Monitor */
|
903 |
|
|
u32 suni_reserved2[10]; /* Reserved */
|
904 |
|
|
|
905 |
|
|
u32 suni_rsop_control; /* RSOP Control/Interrupt Enable */
|
906 |
|
|
u32 suni_rsop_status; /* RSOP Status/Interrupt States */
|
907 |
|
|
u32 suni_rsop_section_bip8l;/* RSOP Section BIP-8 LSB */
|
908 |
|
|
u32 suni_rsop_section_bip8m;/* RSOP Section BIP-8 MSB */
|
909 |
|
|
|
910 |
|
|
u32 suni_tsop_control; /* TSOP Control */
|
911 |
|
|
u32 suni_tsop_diag; /* TSOP Disgnostics */
|
912 |
|
|
u32 suni_tsop_reserved[2]; /* TSOP Reserved */
|
913 |
|
|
|
914 |
|
|
u32 suni_rlop_cs; /* RLOP Control/Status */
|
915 |
|
|
u32 suni_rlop_intr; /* RLOP Interrupt Enable/Status */
|
916 |
|
|
u32 suni_rlop_line_bip24l; /* RLOP Line BIP-24 LSB */
|
917 |
|
|
u32 suni_rlop_line_bip24; /* RLOP Line BIP-24 */
|
918 |
|
|
u32 suni_rlop_line_bip24m; /* RLOP Line BIP-24 MSB */
|
919 |
|
|
u32 suni_rlop_line_febel; /* RLOP Line FEBE LSB */
|
920 |
|
|
u32 suni_rlop_line_febe; /* RLOP Line FEBE */
|
921 |
|
|
u32 suni_rlop_line_febem; /* RLOP Line FEBE MSB */
|
922 |
|
|
|
923 |
|
|
u32 suni_tlop_control; /* TLOP Control */
|
924 |
|
|
u32 suni_tlop_disg; /* TLOP Disgnostics */
|
925 |
|
|
u32 suni_tlop_reserved[14]; /* TLOP Reserved */
|
926 |
|
|
|
927 |
|
|
u32 suni_rpop_cs; /* RPOP Status/Control */
|
928 |
|
|
u32 suni_rpop_intr; /* RPOP Interrupt/Status */
|
929 |
|
|
u32 suni_rpop_reserved; /* RPOP Reserved */
|
930 |
|
|
u32 suni_rpop_intr_ena; /* RPOP Interrupt Enable */
|
931 |
|
|
u32 suni_rpop_reserved1[3]; /* RPOP Reserved */
|
932 |
|
|
u32 suni_rpop_path_sig; /* RPOP Path Signal Label */
|
933 |
|
|
u32 suni_rpop_bip8l; /* RPOP Path BIP-8 LSB */
|
934 |
|
|
u32 suni_rpop_bip8m; /* RPOP Path BIP-8 MSB */
|
935 |
|
|
u32 suni_rpop_febel; /* RPOP Path FEBE LSB */
|
936 |
|
|
u32 suni_rpop_febem; /* RPOP Path FEBE MSB */
|
937 |
|
|
u32 suni_rpop_reserved2[4]; /* RPOP Reserved */
|
938 |
|
|
|
939 |
|
|
u32 suni_tpop_cntrl_daig; /* TPOP Control/Disgnostics */
|
940 |
|
|
u32 suni_tpop_pointer_ctrl; /* TPOP Pointer Control */
|
941 |
|
|
u32 suni_tpop_sourcer_ctrl; /* TPOP Source Control */
|
942 |
|
|
u32 suni_tpop_reserved1[2]; /* TPOP Reserved */
|
943 |
|
|
u32 suni_tpop_arb_prtl; /* TPOP Arbitrary Pointer LSB */
|
944 |
|
|
u32 suni_tpop_arb_prtm; /* TPOP Arbitrary Pointer MSB */
|
945 |
|
|
u32 suni_tpop_reserved2; /* TPOP Reserved */
|
946 |
|
|
u32 suni_tpop_path_sig; /* TPOP Path Signal Lable */
|
947 |
|
|
u32 suni_tpop_path_status; /* TPOP Path Status */
|
948 |
|
|
u32 suni_tpop_reserved3[6]; /* TPOP Reserved */
|
949 |
|
|
|
950 |
|
|
u32 suni_racp_cs; /* RACP Control/Status */
|
951 |
|
|
u32 suni_racp_intr; /* RACP Interrupt Enable/Status */
|
952 |
|
|
u32 suni_racp_hdr_pattern; /* RACP Match Header Pattern */
|
953 |
|
|
u32 suni_racp_hdr_mask; /* RACP Match Header Mask */
|
954 |
|
|
u32 suni_racp_corr_hcs; /* RACP Correctable HCS Error Count */
|
955 |
|
|
u32 suni_racp_uncorr_hcs; /* RACP Uncorrectable HCS Error Count */
|
956 |
|
|
u32 suni_racp_reserved[10]; /* RACP Reserved */
|
957 |
|
|
|
958 |
|
|
u32 suni_tacp_control; /* TACP Control */
|
959 |
|
|
u32 suni_tacp_idle_hdr_pat; /* TACP Idle Cell Header Pattern */
|
960 |
|
|
u32 suni_tacp_idle_pay_pay; /* TACP Idle Cell Payld Octet Pattern */
|
961 |
|
|
u32 suni_tacp_reserved[5]; /* TACP Reserved */
|
962 |
|
|
|
963 |
|
|
u32 suni_reserved3[24]; /* Reserved */
|
964 |
|
|
|
965 |
|
|
u32 suni_master_test; /* SUNI Master Test */
|
966 |
|
|
u32 suni_reserved_test; /* SUNI Reserved for Test */
|
967 |
|
|
} IA_SUNI;
|
968 |
|
|
|
969 |
|
|
|
970 |
|
|
typedef struct _SUNI_STATS_
|
971 |
|
|
{
|
972 |
|
|
u32 valid; // 1 = oc3 PHY card
|
973 |
|
|
u32 carrier_detect; // GPIN input
|
974 |
|
|
// RSOP: receive section overhead processor
|
975 |
|
|
u16 rsop_oof_state; // 1 = out of frame
|
976 |
|
|
u16 rsop_lof_state; // 1 = loss of frame
|
977 |
|
|
u16 rsop_los_state; // 1 = loss of signal
|
978 |
|
|
u32 rsop_los_count; // loss of signal count
|
979 |
|
|
u32 rsop_bse_count; // section BIP-8 error count
|
980 |
|
|
// RLOP: receive line overhead processor
|
981 |
|
|
u16 rlop_ferf_state; // 1 = far end receive failure
|
982 |
|
|
u16 rlop_lais_state; // 1 = line AIS
|
983 |
|
|
u32 rlop_lbe_count; // BIP-24 count
|
984 |
|
|
u32 rlop_febe_count; // FEBE count;
|
985 |
|
|
// RPOP: receive path overhead processor
|
986 |
|
|
u16 rpop_lop_state; // 1 = LOP
|
987 |
|
|
u16 rpop_pais_state; // 1 = path AIS
|
988 |
|
|
u16 rpop_pyel_state; // 1 = path yellow alert
|
989 |
|
|
u32 rpop_bip_count; // path BIP-8 error count
|
990 |
|
|
u32 rpop_febe_count; // path FEBE error count
|
991 |
|
|
u16 rpop_psig; // path signal label value
|
992 |
|
|
// RACP: receive ATM cell processor
|
993 |
|
|
u16 racp_hp_state; // hunt/presync state
|
994 |
|
|
u32 racp_fu_count; // FIFO underrun count
|
995 |
|
|
u32 racp_fo_count; // FIFO overrun count
|
996 |
|
|
u32 racp_chcs_count; // correctable HCS error count
|
997 |
|
|
u32 racp_uchcs_count; // uncorrectable HCS error count
|
998 |
|
|
} IA_SUNI_STATS;
|
999 |
|
|
|
1000 |
|
|
typedef struct iadev_t {
|
1001 |
|
|
/*-----base pointers into (i)chipSAR+ address space */
|
1002 |
|
|
u32 *phy; /* base pointer into phy(SUNI) */
|
1003 |
|
|
u32 *dma; /* base pointer into DMA control
|
1004 |
|
|
registers */
|
1005 |
|
|
u32 *reg; /* base pointer to SAR registers
|
1006 |
|
|
- Bus Interface Control Regs */
|
1007 |
|
|
u32 *seg_reg; /* base pointer to segmentation engine
|
1008 |
|
|
internal registers */
|
1009 |
|
|
u32 *reass_reg; /* base pointer to reassemble engine
|
1010 |
|
|
internal registers */
|
1011 |
|
|
u32 *ram; /* base pointer to SAR RAM */
|
1012 |
|
|
unsigned int seg_ram;
|
1013 |
|
|
unsigned int reass_ram;
|
1014 |
|
|
struct dle_q tx_dle_q;
|
1015 |
|
|
struct free_desc_q *tx_free_desc_qhead;
|
1016 |
|
|
struct sk_buff_head tx_dma_q, tx_backlog;
|
1017 |
|
|
spinlock_t tx_lock;
|
1018 |
|
|
IARTN_Q tx_return_q;
|
1019 |
|
|
u32 close_pending;
|
1020 |
|
|
#if LINUX_VERSION_CODE >= 0x20303
|
1021 |
|
|
wait_queue_head_t close_wait;
|
1022 |
|
|
wait_queue_head_t timeout_wait;
|
1023 |
|
|
#else
|
1024 |
|
|
struct wait_queue *close_wait;
|
1025 |
|
|
struct wait_queue *timeout_wait;
|
1026 |
|
|
#endif
|
1027 |
|
|
struct cpcs_trailer_desc *tx_buf;
|
1028 |
|
|
u16 num_tx_desc, tx_buf_sz, rate_limit;
|
1029 |
|
|
u32 tx_cell_cnt, tx_pkt_cnt;
|
1030 |
|
|
u32 MAIN_VC_TABLE_ADDR, EXT_VC_TABLE_ADDR, ABR_SCHED_TABLE_ADDR;
|
1031 |
|
|
struct dle_q rx_dle_q;
|
1032 |
|
|
struct free_desc_q *rx_free_desc_qhead;
|
1033 |
|
|
struct sk_buff_head rx_dma_q;
|
1034 |
|
|
spinlock_t rx_lock, misc_lock;
|
1035 |
|
|
struct atm_vcc **rx_open; /* list of all open VCs */
|
1036 |
|
|
u16 num_rx_desc, rx_buf_sz, rxing;
|
1037 |
|
|
u32 rx_pkt_ram, rx_tmp_cnt, rx_tmp_jif;
|
1038 |
|
|
u32 RX_DESC_BASE_ADDR;
|
1039 |
|
|
u32 drop_rxpkt, drop_rxcell, rx_cell_cnt, rx_pkt_cnt;
|
1040 |
|
|
struct atm_dev *next_board; /* other iphase devices */
|
1041 |
|
|
struct pci_dev *pci;
|
1042 |
|
|
int mem;
|
1043 |
|
|
unsigned long base_diff; /* virtual - real base address */
|
1044 |
|
|
unsigned int real_base, base; /* real and virtual base address */
|
1045 |
|
|
unsigned int pci_map_size; /*pci map size of board */
|
1046 |
|
|
unsigned char irq;
|
1047 |
|
|
unsigned char bus;
|
1048 |
|
|
unsigned char dev_fn;
|
1049 |
|
|
u_short phy_type;
|
1050 |
|
|
u_short num_vc, memSize, memType;
|
1051 |
|
|
struct ia_ffL_t ffL;
|
1052 |
|
|
struct ia_rfL_t rfL;
|
1053 |
|
|
/* Suni stat */
|
1054 |
|
|
// IA_SUNI_STATS suni_stats;
|
1055 |
|
|
unsigned char carrier_detect;
|
1056 |
|
|
/* CBR related */
|
1057 |
|
|
// transmit DMA & Receive
|
1058 |
|
|
unsigned int tx_dma_cnt; // number of elements on dma queue
|
1059 |
|
|
unsigned int rx_dma_cnt; // number of elements on rx dma queue
|
1060 |
|
|
unsigned int NumEnabledCBR; // number of CBR VCI's enabled. CBR
|
1061 |
|
|
// receive MARK for Cell FIFO
|
1062 |
|
|
unsigned int rx_mark_cnt; // number of elements on mark queue
|
1063 |
|
|
unsigned int CbrTotEntries; // Total CBR Entries in Scheduling Table.
|
1064 |
|
|
unsigned int CbrRemEntries; // Remaining CBR Entries in Scheduling Table.
|
1065 |
|
|
unsigned int CbrEntryPt; // CBR Sched Table Entry Point.
|
1066 |
|
|
unsigned int Granularity; // CBR Granularity given Table Size.
|
1067 |
|
|
/* ABR related */
|
1068 |
|
|
unsigned int sum_mcr, sum_cbr, LineRate;
|
1069 |
|
|
unsigned int n_abr;
|
1070 |
|
|
struct desc_tbl_t *desc_tbl;
|
1071 |
|
|
u_short host_tcq_wr;
|
1072 |
|
|
struct testTable_t **testTable;
|
1073 |
|
|
dma_addr_t tx_dle_dma;
|
1074 |
|
|
dma_addr_t rx_dle_dma;
|
1075 |
|
|
} IADEV;
|
1076 |
|
|
|
1077 |
|
|
|
1078 |
|
|
#define INPH_IA_DEV(d) ((IADEV *) (d)->dev_data)
|
1079 |
|
|
#define INPH_IA_VCC(v) ((struct ia_vcc *) (v)->dev_data)
|
1080 |
|
|
|
1081 |
|
|
/******************* IDT77105 25MB/s PHY DEFINE *****************************/
|
1082 |
|
|
typedef struct {
|
1083 |
|
|
u_int mb25_master_ctrl; /* Master control */
|
1084 |
|
|
u_int mb25_intr_status; /* Interrupt status */
|
1085 |
|
|
u_int mb25_diag_control; /* Diagnostic control */
|
1086 |
|
|
u_int mb25_led_hec; /* LED driver and HEC status/control */
|
1087 |
|
|
u_int mb25_low_byte_counter; /* Low byte counter */
|
1088 |
|
|
u_int mb25_high_byte_counter; /* High byte counter */
|
1089 |
|
|
} ia_mb25_t;
|
1090 |
|
|
|
1091 |
|
|
/*
|
1092 |
|
|
* Master Control
|
1093 |
|
|
*/
|
1094 |
|
|
#define MB25_MC_UPLO 0x80 /* UPLO */
|
1095 |
|
|
#define MB25_MC_DREC 0x40 /* Discard receive cell errors */
|
1096 |
|
|
#define MB25_MC_ECEIO 0x20 /* Enable Cell Error Interrupts Only */
|
1097 |
|
|
#define MB25_MC_TDPC 0x10 /* Transmit data parity check */
|
1098 |
|
|
#define MB25_MC_DRIC 0x08 /* Discard receive idle cells */
|
1099 |
|
|
#define MB25_MC_HALTTX 0x04 /* Halt Tx */
|
1100 |
|
|
#define MB25_MC_UMS 0x02 /* UTOPIA mode select */
|
1101 |
|
|
#define MB25_MC_ENABLED 0x01 /* Enable interrupt */
|
1102 |
|
|
|
1103 |
|
|
/*
|
1104 |
|
|
* Interrupt Status
|
1105 |
|
|
*/
|
1106 |
|
|
#define MB25_IS_GSB 0x40 /* GOOD Symbol Bit */
|
1107 |
|
|
#define MB25_IS_HECECR 0x20 /* HEC error cell received */
|
1108 |
|
|
#define MB25_IS_SCR 0x10 /* "Short Cell" Received */
|
1109 |
|
|
#define MB25_IS_TPE 0x08 /* Trnamsit Parity Error */
|
1110 |
|
|
#define MB25_IS_RSCC 0x04 /* Receive Signal Condition change */
|
1111 |
|
|
#define MB25_IS_RCSE 0x02 /* Received Cell Symbol Error */
|
1112 |
|
|
#define MB25_IS_RFIFOO 0x01 /* Received FIFO Overrun */
|
1113 |
|
|
|
1114 |
|
|
/*
|
1115 |
|
|
* Diagnostic Control
|
1116 |
|
|
*/
|
1117 |
|
|
#define MB25_DC_FTXCD 0x80 /* Force TxClav deassert */
|
1118 |
|
|
#define MB25_DC_RXCOS 0x40 /* RxClav operation select */
|
1119 |
|
|
#define MB25_DC_ECEIO 0x20 /* Single/Multi-PHY config select */
|
1120 |
|
|
#define MB25_DC_RLFLUSH 0x10 /* Clear receive FIFO */
|
1121 |
|
|
#define MB25_DC_IXPE 0x08 /* Insert xmit payload error */
|
1122 |
|
|
#define MB25_DC_IXHECE 0x04 /* Insert Xmit HEC Error */
|
1123 |
|
|
#define MB25_DC_LB_MASK 0x03 /* Loopback control mask */
|
1124 |
|
|
|
1125 |
|
|
#define MB25_DC_LL 0x03 /* Line Loopback */
|
1126 |
|
|
#define MB25_DC_PL 0x02 /* PHY Loopback */
|
1127 |
|
|
#define MB25_DC_NM 0x00
|
1128 |
|
|
|
1129 |
|
|
#define FE_MASK 0x00F0
|
1130 |
|
|
#define FE_MULTI_MODE 0x0000
|
1131 |
|
|
#define FE_SINGLE_MODE 0x0010
|
1132 |
|
|
#define FE_UTP_OPTION 0x0020
|
1133 |
|
|
#define FE_25MBIT_PHY 0x0040
|
1134 |
|
|
#define FE_DS3_PHY 0x0080 /* DS3 */
|
1135 |
|
|
#define FE_E3_PHY 0x0090 /* E3 */
|
1136 |
|
|
|
1137 |
|
|
extern void ia_mb25_init (IADEV *);
|
1138 |
|
|
|
1139 |
|
|
/*********************** SUNI_PM7345 PHY DEFINE HERE *********************/
|
1140 |
|
|
typedef struct _suni_pm7345_t
|
1141 |
|
|
{
|
1142 |
|
|
u_int suni_config; /* SUNI Configuration */
|
1143 |
|
|
u_int suni_intr_enbl; /* SUNI Interrupt Enable */
|
1144 |
|
|
u_int suni_intr_stat; /* SUNI Interrupt Status */
|
1145 |
|
|
u_int suni_control; /* SUNI Control */
|
1146 |
|
|
u_int suni_id_reset; /* SUNI Reset and Identity */
|
1147 |
|
|
u_int suni_data_link_ctrl;
|
1148 |
|
|
u_int suni_rboc_conf_intr_enbl;
|
1149 |
|
|
u_int suni_rboc_stat;
|
1150 |
|
|
u_int suni_ds3_frm_cfg;
|
1151 |
|
|
u_int suni_ds3_frm_intr_enbl;
|
1152 |
|
|
u_int suni_ds3_frm_intr_stat;
|
1153 |
|
|
u_int suni_ds3_frm_stat;
|
1154 |
|
|
u_int suni_rfdl_cfg;
|
1155 |
|
|
u_int suni_rfdl_enbl_stat;
|
1156 |
|
|
u_int suni_rfdl_stat;
|
1157 |
|
|
u_int suni_rfdl_data;
|
1158 |
|
|
u_int suni_pmon_chng;
|
1159 |
|
|
u_int suni_pmon_intr_enbl_stat;
|
1160 |
|
|
u_int suni_reserved1[0x13-0x11];
|
1161 |
|
|
u_int suni_pmon_lcv_evt_cnt_lsb;
|
1162 |
|
|
u_int suni_pmon_lcv_evt_cnt_msb;
|
1163 |
|
|
u_int suni_pmon_fbe_evt_cnt_lsb;
|
1164 |
|
|
u_int suni_pmon_fbe_evt_cnt_msb;
|
1165 |
|
|
u_int suni_pmon_sez_det_cnt_lsb;
|
1166 |
|
|
u_int suni_pmon_sez_det_cnt_msb;
|
1167 |
|
|
u_int suni_pmon_pe_evt_cnt_lsb;
|
1168 |
|
|
u_int suni_pmon_pe_evt_cnt_msb;
|
1169 |
|
|
u_int suni_pmon_ppe_evt_cnt_lsb;
|
1170 |
|
|
u_int suni_pmon_ppe_evt_cnt_msb;
|
1171 |
|
|
u_int suni_pmon_febe_evt_cnt_lsb;
|
1172 |
|
|
u_int suni_pmon_febe_evt_cnt_msb;
|
1173 |
|
|
u_int suni_ds3_tran_cfg;
|
1174 |
|
|
u_int suni_ds3_tran_diag;
|
1175 |
|
|
u_int suni_reserved2[0x23-0x21];
|
1176 |
|
|
u_int suni_xfdl_cfg;
|
1177 |
|
|
u_int suni_xfdl_intr_st;
|
1178 |
|
|
u_int suni_xfdl_xmit_data;
|
1179 |
|
|
u_int suni_xboc_code;
|
1180 |
|
|
u_int suni_splr_cfg;
|
1181 |
|
|
u_int suni_splr_intr_en;
|
1182 |
|
|
u_int suni_splr_intr_st;
|
1183 |
|
|
u_int suni_splr_status;
|
1184 |
|
|
u_int suni_splt_cfg;
|
1185 |
|
|
u_int suni_splt_cntl;
|
1186 |
|
|
u_int suni_splt_diag_g1;
|
1187 |
|
|
u_int suni_splt_f1;
|
1188 |
|
|
u_int suni_cppm_loc_meters;
|
1189 |
|
|
u_int suni_cppm_chng_of_cppm_perf_meter;
|
1190 |
|
|
u_int suni_cppm_b1_err_cnt_lsb;
|
1191 |
|
|
u_int suni_cppm_b1_err_cnt_msb;
|
1192 |
|
|
u_int suni_cppm_framing_err_cnt_lsb;
|
1193 |
|
|
u_int suni_cppm_framing_err_cnt_msb;
|
1194 |
|
|
u_int suni_cppm_febe_cnt_lsb;
|
1195 |
|
|
u_int suni_cppm_febe_cnt_msb;
|
1196 |
|
|
u_int suni_cppm_hcs_err_cnt_lsb;
|
1197 |
|
|
u_int suni_cppm_hcs_err_cnt_msb;
|
1198 |
|
|
u_int suni_cppm_idle_un_cell_cnt_lsb;
|
1199 |
|
|
u_int suni_cppm_idle_un_cell_cnt_msb;
|
1200 |
|
|
u_int suni_cppm_rcv_cell_cnt_lsb;
|
1201 |
|
|
u_int suni_cppm_rcv_cell_cnt_msb;
|
1202 |
|
|
u_int suni_cppm_xmit_cell_cnt_lsb;
|
1203 |
|
|
u_int suni_cppm_xmit_cell_cnt_msb;
|
1204 |
|
|
u_int suni_rxcp_ctrl;
|
1205 |
|
|
u_int suni_rxcp_fctrl;
|
1206 |
|
|
u_int suni_rxcp_intr_en_sts;
|
1207 |
|
|
u_int suni_rxcp_idle_pat_h1;
|
1208 |
|
|
u_int suni_rxcp_idle_pat_h2;
|
1209 |
|
|
u_int suni_rxcp_idle_pat_h3;
|
1210 |
|
|
u_int suni_rxcp_idle_pat_h4;
|
1211 |
|
|
u_int suni_rxcp_idle_mask_h1;
|
1212 |
|
|
u_int suni_rxcp_idle_mask_h2;
|
1213 |
|
|
u_int suni_rxcp_idle_mask_h3;
|
1214 |
|
|
u_int suni_rxcp_idle_mask_h4;
|
1215 |
|
|
u_int suni_rxcp_cell_pat_h1;
|
1216 |
|
|
u_int suni_rxcp_cell_pat_h2;
|
1217 |
|
|
u_int suni_rxcp_cell_pat_h3;
|
1218 |
|
|
u_int suni_rxcp_cell_pat_h4;
|
1219 |
|
|
u_int suni_rxcp_cell_mask_h1;
|
1220 |
|
|
u_int suni_rxcp_cell_mask_h2;
|
1221 |
|
|
u_int suni_rxcp_cell_mask_h3;
|
1222 |
|
|
u_int suni_rxcp_cell_mask_h4;
|
1223 |
|
|
u_int suni_rxcp_hcs_cs;
|
1224 |
|
|
u_int suni_rxcp_lcd_cnt_threshold;
|
1225 |
|
|
u_int suni_reserved3[0x57-0x54];
|
1226 |
|
|
u_int suni_txcp_ctrl;
|
1227 |
|
|
u_int suni_txcp_intr_en_sts;
|
1228 |
|
|
u_int suni_txcp_idle_pat_h1;
|
1229 |
|
|
u_int suni_txcp_idle_pat_h2;
|
1230 |
|
|
u_int suni_txcp_idle_pat_h3;
|
1231 |
|
|
u_int suni_txcp_idle_pat_h4;
|
1232 |
|
|
u_int suni_txcp_idle_pat_h5;
|
1233 |
|
|
u_int suni_txcp_idle_payload;
|
1234 |
|
|
u_int suni_e3_frm_fram_options;
|
1235 |
|
|
u_int suni_e3_frm_maint_options;
|
1236 |
|
|
u_int suni_e3_frm_fram_intr_enbl;
|
1237 |
|
|
u_int suni_e3_frm_fram_intr_ind_stat;
|
1238 |
|
|
u_int suni_e3_frm_maint_intr_enbl;
|
1239 |
|
|
u_int suni_e3_frm_maint_intr_ind;
|
1240 |
|
|
u_int suni_e3_frm_maint_stat;
|
1241 |
|
|
u_int suni_reserved4;
|
1242 |
|
|
u_int suni_e3_tran_fram_options;
|
1243 |
|
|
u_int suni_e3_tran_stat_diag_options;
|
1244 |
|
|
u_int suni_e3_tran_bip_8_err_mask;
|
1245 |
|
|
u_int suni_e3_tran_maint_adapt_options;
|
1246 |
|
|
u_int suni_ttb_ctrl;
|
1247 |
|
|
u_int suni_ttb_trail_trace_id_stat;
|
1248 |
|
|
u_int suni_ttb_ind_addr;
|
1249 |
|
|
u_int suni_ttb_ind_data;
|
1250 |
|
|
u_int suni_ttb_exp_payload_type;
|
1251 |
|
|
u_int suni_ttb_payload_type_ctrl_stat;
|
1252 |
|
|
u_int suni_pad5[0x7f-0x71];
|
1253 |
|
|
u_int suni_master_test;
|
1254 |
|
|
u_int suni_pad6[0xff-0x80];
|
1255 |
|
|
}suni_pm7345_t;
|
1256 |
|
|
|
1257 |
|
|
#define SUNI_PM7345_T suni_pm7345_t
|
1258 |
|
|
#define SUNI_PM7345 0x20 /* Suni chip type */
|
1259 |
|
|
#define SUNI_PM5346 0x30 /* Suni chip type */
|
1260 |
|
|
/*
|
1261 |
|
|
* SUNI_PM7345 Configuration
|
1262 |
|
|
*/
|
1263 |
|
|
#define SUNI_PM7345_CLB 0x01 /* Cell loopback */
|
1264 |
|
|
#define SUNI_PM7345_PLB 0x02 /* Payload loopback */
|
1265 |
|
|
#define SUNI_PM7345_DLB 0x04 /* Diagnostic loopback */
|
1266 |
|
|
#define SUNI_PM7345_LLB 0x80 /* Line loopback */
|
1267 |
|
|
#define SUNI_PM7345_E3ENBL 0x40 /* E3 enable bit */
|
1268 |
|
|
#define SUNI_PM7345_LOOPT 0x10 /* LOOPT enable bit */
|
1269 |
|
|
#define SUNI_PM7345_FIFOBP 0x20 /* FIFO bypass */
|
1270 |
|
|
#define SUNI_PM7345_FRMRBP 0x08 /* Framer bypass */
|
1271 |
|
|
/*
|
1272 |
|
|
* DS3 FRMR Interrupt Enable
|
1273 |
|
|
*/
|
1274 |
|
|
#define SUNI_DS3_COFAE 0x80 /* Enable change of frame align */
|
1275 |
|
|
#define SUNI_DS3_REDE 0x40 /* Enable DS3 RED state intr */
|
1276 |
|
|
#define SUNI_DS3_CBITE 0x20 /* Enable Appl ID channel intr */
|
1277 |
|
|
#define SUNI_DS3_FERFE 0x10 /* Enable Far End Receive Failure intr*/
|
1278 |
|
|
#define SUNI_DS3_IDLE 0x08 /* Enable Idle signal intr */
|
1279 |
|
|
#define SUNI_DS3_AISE 0x04 /* Enable Alarm Indication signal intr*/
|
1280 |
|
|
#define SUNI_DS3_OOFE 0x02 /* Enable Out of frame intr */
|
1281 |
|
|
#define SUNI_DS3_LOSE 0x01 /* Enable Loss of signal intr */
|
1282 |
|
|
|
1283 |
|
|
/*
|
1284 |
|
|
* DS3 FRMR Status
|
1285 |
|
|
*/
|
1286 |
|
|
#define SUNI_DS3_ACE 0x80 /* Additional Configuration Reg */
|
1287 |
|
|
#define SUNI_DS3_REDV 0x40 /* DS3 RED state */
|
1288 |
|
|
#define SUNI_DS3_CBITV 0x20 /* Application ID channel state */
|
1289 |
|
|
#define SUNI_DS3_FERFV 0x10 /* Far End Receive Failure state*/
|
1290 |
|
|
#define SUNI_DS3_IDLV 0x08 /* Idle signal state */
|
1291 |
|
|
#define SUNI_DS3_AISV 0x04 /* Alarm Indication signal state*/
|
1292 |
|
|
#define SUNI_DS3_OOFV 0x02 /* Out of frame state */
|
1293 |
|
|
#define SUNI_DS3_LOSV 0x01 /* Loss of signal state */
|
1294 |
|
|
|
1295 |
|
|
/*
|
1296 |
|
|
* E3 FRMR Interrupt/Status
|
1297 |
|
|
*/
|
1298 |
|
|
#define SUNI_E3_CZDI 0x40 /* Consecutive Zeros indicator */
|
1299 |
|
|
#define SUNI_E3_LOSI 0x20 /* Loss of signal intr status */
|
1300 |
|
|
#define SUNI_E3_LCVI 0x10 /* Line code violation intr */
|
1301 |
|
|
#define SUNI_E3_COFAI 0x08 /* Change of frame align intr */
|
1302 |
|
|
#define SUNI_E3_OOFI 0x04 /* Out of frame intr status */
|
1303 |
|
|
#define SUNI_E3_LOS 0x02 /* Loss of signal state */
|
1304 |
|
|
#define SUNI_E3_OOF 0x01 /* Out of frame state */
|
1305 |
|
|
|
1306 |
|
|
/*
|
1307 |
|
|
* E3 FRMR Maintenance Status
|
1308 |
|
|
*/
|
1309 |
|
|
#define SUNI_E3_AISD 0x80 /* Alarm Indication signal state*/
|
1310 |
|
|
#define SUNI_E3_FERF_RAI 0x40 /* FERF/RAI indicator */
|
1311 |
|
|
#define SUNI_E3_FEBE 0x20 /* Far End Block Error indicator*/
|
1312 |
|
|
|
1313 |
|
|
/*
|
1314 |
|
|
* RXCP Control/Status
|
1315 |
|
|
*/
|
1316 |
|
|
#define SUNI_DS3_HCSPASS 0x80 /* Pass cell with HEC errors */
|
1317 |
|
|
#define SUNI_DS3_HCSDQDB 0x40 /* Control octets in HCS calc */
|
1318 |
|
|
#define SUNI_DS3_HCSADD 0x20 /* Add coset poly */
|
1319 |
|
|
#define SUNI_DS3_HCK 0x10 /* Control FIFO data path integ chk*/
|
1320 |
|
|
#define SUNI_DS3_BLOCK 0x08 /* Enable cell filtering */
|
1321 |
|
|
#define SUNI_DS3_DSCR 0x04 /* Disable payload descrambling */
|
1322 |
|
|
#define SUNI_DS3_OOCDV 0x02 /* Cell delineation state */
|
1323 |
|
|
#define SUNI_DS3_FIFORST 0x01 /* Cell FIFO reset */
|
1324 |
|
|
|
1325 |
|
|
/*
|
1326 |
|
|
* RXCP Interrupt Enable/Status
|
1327 |
|
|
*/
|
1328 |
|
|
#define SUNI_DS3_OOCDE 0x80 /* Intr enable, change in CDS */
|
1329 |
|
|
#define SUNI_DS3_HCSE 0x40 /* Intr enable, corr HCS errors */
|
1330 |
|
|
#define SUNI_DS3_FIFOE 0x20 /* Intr enable, unco HCS errors */
|
1331 |
|
|
#define SUNI_DS3_OOCDI 0x10 /* SYNC state */
|
1332 |
|
|
#define SUNI_DS3_UHCSI 0x08 /* Uncorr. HCS errors detected */
|
1333 |
|
|
#define SUNI_DS3_COCAI 0x04 /* Corr. HCS errors detected */
|
1334 |
|
|
#define SUNI_DS3_FOVRI 0x02 /* FIFO overrun */
|
1335 |
|
|
#define SUNI_DS3_FUDRI 0x01 /* FIFO underrun */
|
1336 |
|
|
|
1337 |
|
|
extern void ia_suni_pm7345_init (IADEV *iadev);
|
1338 |
|
|
|
1339 |
|
|
///////////////////SUNI_PM7345 PHY DEFINE END /////////////////////////////
|
1340 |
|
|
|
1341 |
|
|
/* ia_eeprom define*/
|
1342 |
|
|
#define MEM_SIZE_MASK 0x000F /* mask of 4 bits defining memory size*/
|
1343 |
|
|
#define MEM_SIZE_128K 0x0000 /* board has 128k buffer */
|
1344 |
|
|
#define MEM_SIZE_512K 0x0001 /* board has 512K of buffer */
|
1345 |
|
|
#define MEM_SIZE_1M 0x0002 /* board has 1M of buffer */
|
1346 |
|
|
/* 0x3 to 0xF are reserved for future */
|
1347 |
|
|
|
1348 |
|
|
#define FE_MASK 0x00F0 /* mask of 4 bits defining FE type */
|
1349 |
|
|
#define FE_MULTI_MODE 0x0000 /* 155 MBit multimode fiber */
|
1350 |
|
|
#define FE_SINGLE_MODE 0x0010 /* 155 MBit single mode laser */
|
1351 |
|
|
#define FE_UTP_OPTION 0x0020 /* 155 MBit UTP front end */
|
1352 |
|
|
|
1353 |
|
|
#define NOVRAM_SIZE 64
|
1354 |
|
|
#define CMD_LEN 10
|
1355 |
|
|
|
1356 |
|
|
/***********
|
1357 |
|
|
*
|
1358 |
|
|
* Switches and defines for header files.
|
1359 |
|
|
*
|
1360 |
|
|
* The following defines are used to turn on and off
|
1361 |
|
|
* various options in the header files. Primarily useful
|
1362 |
|
|
* for debugging.
|
1363 |
|
|
*
|
1364 |
|
|
***********/
|
1365 |
|
|
|
1366 |
|
|
/*
|
1367 |
|
|
* a list of the commands that can be sent to the NOVRAM
|
1368 |
|
|
*/
|
1369 |
|
|
|
1370 |
|
|
#define EXTEND 0x100
|
1371 |
|
|
#define IAWRITE 0x140
|
1372 |
|
|
#define IAREAD 0x180
|
1373 |
|
|
#define ERASE 0x1c0
|
1374 |
|
|
|
1375 |
|
|
#define EWDS 0x00
|
1376 |
|
|
#define WRAL 0x10
|
1377 |
|
|
#define ERAL 0x20
|
1378 |
|
|
#define EWEN 0x30
|
1379 |
|
|
|
1380 |
|
|
/*
|
1381 |
|
|
* these bits duplicate the hw_flip.h register settings
|
1382 |
|
|
* note: how the data in / out bits are defined in the flipper specification
|
1383 |
|
|
*/
|
1384 |
|
|
|
1385 |
|
|
#define NVCE 0x02
|
1386 |
|
|
#define NVSK 0x01
|
1387 |
|
|
#define NVDO 0x08
|
1388 |
|
|
#define NVDI 0x04
|
1389 |
|
|
/***********************
|
1390 |
|
|
*
|
1391 |
|
|
* This define ands the value and the current config register and puts
|
1392 |
|
|
* the result in the config register
|
1393 |
|
|
*
|
1394 |
|
|
***********************/
|
1395 |
|
|
|
1396 |
|
|
#define CFG_AND(val) { \
|
1397 |
|
|
u32 t; \
|
1398 |
|
|
t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
|
1399 |
|
|
t &= (val); \
|
1400 |
|
|
writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
|
1401 |
|
|
}
|
1402 |
|
|
|
1403 |
|
|
/***********************
|
1404 |
|
|
*
|
1405 |
|
|
* This define ors the value and the current config register and puts
|
1406 |
|
|
* the result in the config register
|
1407 |
|
|
*
|
1408 |
|
|
***********************/
|
1409 |
|
|
|
1410 |
|
|
#define CFG_OR(val) { \
|
1411 |
|
|
u32 t; \
|
1412 |
|
|
t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
|
1413 |
|
|
t |= (val); \
|
1414 |
|
|
writel(t, iadev->reg+IPHASE5575_EEPROM_ACCESS); \
|
1415 |
|
|
}
|
1416 |
|
|
|
1417 |
|
|
/***********************
|
1418 |
|
|
*
|
1419 |
|
|
* Send a command to the NOVRAM, the command is in cmd.
|
1420 |
|
|
*
|
1421 |
|
|
* clear CE and SK. Then assert CE.
|
1422 |
|
|
* Clock each of the command bits out in the correct order with SK
|
1423 |
|
|
* exit with CE still asserted
|
1424 |
|
|
*
|
1425 |
|
|
***********************/
|
1426 |
|
|
|
1427 |
|
|
#define NVRAM_CMD(cmd) { \
|
1428 |
|
|
int i; \
|
1429 |
|
|
u_short c = cmd; \
|
1430 |
|
|
CFG_AND(~(NVCE|NVSK)); \
|
1431 |
|
|
CFG_OR(NVCE); \
|
1432 |
|
|
for (i=0; i<CMD_LEN; i++) { \
|
1433 |
|
|
NVRAM_CLKOUT((c & (1 << (CMD_LEN - 1))) ? 1 : 0); \
|
1434 |
|
|
c <<= 1; \
|
1435 |
|
|
} \
|
1436 |
|
|
}
|
1437 |
|
|
|
1438 |
|
|
/***********************
|
1439 |
|
|
*
|
1440 |
|
|
* clear the CE, this must be used after each command is complete
|
1441 |
|
|
*
|
1442 |
|
|
***********************/
|
1443 |
|
|
|
1444 |
|
|
#define NVRAM_CLR_CE {CFG_AND(~NVCE)}
|
1445 |
|
|
|
1446 |
|
|
/***********************
|
1447 |
|
|
*
|
1448 |
|
|
* clock the data bit in bitval out to the NOVRAM. The bitval must be
|
1449 |
|
|
* a 1 or 0, or the clockout operation is undefined
|
1450 |
|
|
*
|
1451 |
|
|
***********************/
|
1452 |
|
|
|
1453 |
|
|
#define NVRAM_CLKOUT(bitval) { \
|
1454 |
|
|
CFG_AND(~NVDI); \
|
1455 |
|
|
CFG_OR((bitval) ? NVDI : 0); \
|
1456 |
|
|
CFG_OR(NVSK); \
|
1457 |
|
|
CFG_AND( ~NVSK); \
|
1458 |
|
|
}
|
1459 |
|
|
|
1460 |
|
|
/***********************
|
1461 |
|
|
*
|
1462 |
|
|
* clock the data bit in and return a 1 or 0, depending on the value
|
1463 |
|
|
* that was received from the NOVRAM
|
1464 |
|
|
*
|
1465 |
|
|
***********************/
|
1466 |
|
|
|
1467 |
|
|
#define NVRAM_CLKIN(value) { \
|
1468 |
|
|
u32 _t; \
|
1469 |
|
|
CFG_OR(NVSK); \
|
1470 |
|
|
CFG_AND(~NVSK); \
|
1471 |
|
|
_t = readl(iadev->reg+IPHASE5575_EEPROM_ACCESS); \
|
1472 |
|
|
value = (_t & NVDO) ? 1 : 0; \
|
1473 |
|
|
}
|
1474 |
|
|
|
1475 |
|
|
|
1476 |
|
|
#endif /* IPHASE_H */
|