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#ifndef __SLICHW_H__
42#define __SLICHW_H__
43
44#define PCI_VENDOR_ID_ALACRITECH 0x139A
45#define SLIC_1GB_DEVICE_ID 0x0005
46#define SLIC_2GB_DEVICE_ID 0x0007
47
48#define SLIC_1GB_CICADA_SUBSYS_ID 0x0008
49
50#define SLIC_NBR_MACS 4
51
52#define SLIC_RCVBUF_SIZE 2048
53#define SLIC_RCVBUF_HEADSIZE 34
54#define SLIC_RCVBUF_TAILSIZE 0
55#define SLIC_RCVBUF_DATASIZE (SLIC_RCVBUF_SIZE - \
56 (SLIC_RCVBUF_HEADSIZE + \
57 SLIC_RCVBUF_TAILSIZE))
58
59#define VGBSTAT_XPERR 0x40000000
60#define VGBSTAT_XERRSHFT 25
61#define VGBSTAT_XCSERR 0x23
62#define VGBSTAT_XUFLOW 0x22
63#define VGBSTAT_XHLEN 0x20
64#define VGBSTAT_NETERR 0x01000000
65#define VGBSTAT_NERRSHFT 16
66#define VGBSTAT_NERRMSK 0x1ff
67#define VGBSTAT_NCSERR 0x103
68#define VGBSTAT_NUFLOW 0x102
69#define VGBSTAT_NHLEN 0x100
70#define VGBSTAT_LNKERR 0x00000080
71#define VGBSTAT_LERRMSK 0xff
72#define VGBSTAT_LDEARLY 0x86
73#define VGBSTAT_LBOFLO 0x85
74#define VGBSTAT_LCODERR 0x84
75#define VGBSTAT_LDBLNBL 0x83
76#define VGBSTAT_LCRCERR 0x82
77#define VGBSTAT_LOFLO 0x81
78#define VGBSTAT_LUFLO 0x80
79#define IRHDDR_FLEN_MSK 0x0000ffff
80#define IRHDDR_SVALID 0x80000000
81#define IRHDDR_ERR 0x10000000
82#define VRHSTAT_802OE 0x80000000
83#define VRHSTAT_TPOFLO 0x10000000
84#define VRHSTATB_802UE 0x80000000
85#define VRHSTATB_RCVE 0x40000000
86#define VRHSTATB_BUFF 0x20000000
87#define VRHSTATB_CARRE 0x08000000
88#define VRHSTATB_LONGE 0x02000000
89#define VRHSTATB_PREA 0x01000000
90#define VRHSTATB_CRC 0x00800000
91#define VRHSTATB_DRBL 0x00400000
92#define VRHSTATB_CODE 0x00200000
93#define VRHSTATB_TPCSUM 0x00100000
94#define VRHSTATB_TPHLEN 0x00080000
95#define VRHSTATB_IPCSUM 0x00040000
96#define VRHSTATB_IPLERR 0x00020000
97#define VRHSTATB_IPHERR 0x00010000
98#define SLIC_MAX64_BCNT 23
99#define SLIC_MAX32_BCNT 26
100#define IHCMD_XMT_REQ 0x01
101#define IHFLG_IFSHFT 2
102#define SLIC_RSPBUF_SIZE 32
103
104#define SLIC_RESET_MAGIC 0xDEAD
105#define ICR_INT_OFF 0
106#define ICR_INT_ON 1
107#define ICR_INT_MASK 2
108
109#define ISR_ERR 0x80000000
110#define ISR_RCV 0x40000000
111#define ISR_CMD 0x20000000
112#define ISR_IO 0x60000000
113#define ISR_UPC 0x10000000
114#define ISR_LEVENT 0x08000000
115#define ISR_RMISS 0x02000000
116#define ISR_UPCERR 0x01000000
117#define ISR_XDROP 0x00800000
118#define ISR_UPCBSY 0x00020000
119#define ISR_EVMSK 0xffff0000
120#define ISR_PINGMASK 0x00700000
121#define ISR_PINGDSMASK 0x00710000
122#define ISR_UPCMASK 0x11000000
123#define SLIC_WCS_START 0x80000000
124#define SLIC_WCS_COMPARE 0x40000000
125#define SLIC_RCVWCS_BEGIN 0x40000000
126#define SLIC_RCVWCS_FINISH 0x80000000
127#define SLIC_PM_MAXPATTERNS 6
128#define SLIC_PM_PATTERNSIZE 128
129#define SLIC_PMCAPS_WAKEONLAN 0x00000001
130#define MIICR_REG_PCR 0x00000000
131#define MIICR_REG_4 0x00040000
132#define MIICR_REG_9 0x00090000
133#define MIICR_REG_16 0x00100000
134#define PCR_RESET 0x8000
135#define PCR_POWERDOWN 0x0800
136#define PCR_SPEED_100 0x2000
137#define PCR_SPEED_1000 0x0040
138#define PCR_AUTONEG 0x1000
139#define PCR_AUTONEG_RST 0x0200
140#define PCR_DUPLEX_FULL 0x0100
141#define PSR_LINKUP 0x0004
142
143#define PAR_ADV100FD 0x0100
144#define PAR_ADV100HD 0x0080
145#define PAR_ADV10FD 0x0040
146#define PAR_ADV10HD 0x0020
147#define PAR_ASYMPAUSE 0x0C00
148#define PAR_802_3 0x0001
149
150#define PAR_ADV1000XFD 0x0020
151#define PAR_ADV1000XHD 0x0040
152#define PAR_ASYMPAUSE_FIBER 0x0180
153
154#define PGC_ADV1000FD 0x0200
155#define PGC_ADV1000HD 0x0100
156#define SEEQ_LINKFAIL 0x4000
157#define SEEQ_SPEED 0x0080
158#define SEEQ_DUPLEX 0x0040
159#define TDK_DUPLEX 0x0800
160#define TDK_SPEED 0x0400
161#define MRV_REG16_XOVERON 0x0068
162#define MRV_REG16_XOVEROFF 0x0008
163#define MRV_SPEED_1000 0x8000
164#define MRV_SPEED_100 0x4000
165#define MRV_SPEED_10 0x0000
166#define MRV_FULLDUPLEX 0x2000
167#define MRV_LINKUP 0x0400
168
169#define GIG_LINKUP 0x0001
170#define GIG_FULLDUPLEX 0x0002
171#define GIG_SPEED_MASK 0x000C
172#define GIG_SPEED_1000 0x0008
173#define GIG_SPEED_100 0x0004
174#define GIG_SPEED_10 0x0000
175
176#define MCR_RESET 0x80000000
177#define MCR_CRCEN 0x40000000
178#define MCR_FULLD 0x10000000
179#define MCR_PAD 0x02000000
180#define MCR_RETRYLATE 0x01000000
181#define MCR_BOL_SHIFT 21
182#define MCR_IPG1_SHIFT 14
183#define MCR_IPG2_SHIFT 7
184#define MCR_IPG3_SHIFT 0
185#define GMCR_RESET 0x80000000
186#define GMCR_GBIT 0x20000000
187#define GMCR_FULLD 0x10000000
188#define GMCR_GAPBB_SHIFT 14
189#define GMCR_GAPR1_SHIFT 7
190#define GMCR_GAPR2_SHIFT 0
191#define GMCR_GAPBB_1000 0x60
192#define GMCR_GAPR1_1000 0x2C
193#define GMCR_GAPR2_1000 0x40
194#define GMCR_GAPBB_100 0x70
195#define GMCR_GAPR1_100 0x2C
196#define GMCR_GAPR2_100 0x40
197#define XCR_RESET 0x80000000
198#define XCR_XMTEN 0x40000000
199#define XCR_PAUSEEN 0x20000000
200#define XCR_LOADRNG 0x10000000
201#define RCR_RESET 0x80000000
202#define RCR_RCVEN 0x40000000
203#define RCR_RCVALL 0x20000000
204#define RCR_RCVBAD 0x10000000
205#define RCR_CTLEN 0x08000000
206#define RCR_ADDRAEN 0x02000000
207#define GXCR_RESET 0x80000000
208#define GXCR_XMTEN 0x40000000
209#define GXCR_PAUSEEN 0x20000000
210#define GRCR_RESET 0x80000000
211#define GRCR_RCVEN 0x40000000
212#define GRCR_RCVALL 0x20000000
213#define GRCR_RCVBAD 0x10000000
214#define GRCR_CTLEN 0x08000000
215#define GRCR_ADDRAEN 0x02000000
216#define GRCR_HASHSIZE_SHIFT 17
217#define GRCR_HASHSIZE 14
218
219#define SLIC_EEPROM_ID 0xA5A5
220#define SLIC_SRAM_SIZE2GB (64 * 1024)
221#define SLIC_SRAM_SIZE1GB (32 * 1024)
222#define SLIC_HOSTID_DEFAULT 0xFFFF
223#define SLIC_NBR_MACS 4
224
225struct slic_rcvbuf {
226 u8 pad1[6];
227 u16 pad2;
228 u32 pad3;
229 u32 pad4;
230 u32 buffer;
231 u32 length;
232 u32 status;
233 u32 pad5;
234 u16 pad6;
235 u8 data[SLIC_RCVBUF_DATASIZE];
236};
237
238struct slic_hddr_wds {
239 union {
240 struct {
241 u32 frame_status;
242 u32 frame_status_b;
243 u32 time_stamp;
244 u32 checksum;
245 } hdrs_14port;
246 struct {
247 u32 frame_status;
248 u16 ByteCnt;
249 u16 TpChksum;
250 u16 CtxHash;
251 u16 MacHash;
252 u32 BufLnk;
253 } hdrs_gbit;
254 } u0;
255};
256
257#define frame_status14 u0.hdrs_14port.frame_status
258#define frame_status_b14 u0.hdrs_14port.frame_status_b
259#define frame_statusGB u0.hdrs_gbit.frame_status
260
261struct slic_host64sg {
262 u32 paddrl;
263 u32 paddrh;
264 u32 length;
265};
266
267struct slic_host64_cmd {
268 u32 hosthandle;
269 u32 RSVD;
270 u8 command;
271 u8 flags;
272 union {
273 u16 rsv1;
274 u16 rsv2;
275 } u0;
276 union {
277 struct {
278 u32 totlen;
279 struct slic_host64sg bufs[SLIC_MAX64_BCNT];
280 } slic_buffers;
281 } u;
282};
283
284struct slic_rspbuf {
285 u32 hosthandle;
286 u32 pad0;
287 u32 pad1;
288 u32 status;
289 u32 pad2[4];
290};
291
292
293#define SLIC_REG_RESET 0x0000
294
295#define SLIC_REG_ICR 0x0008
296
297#define SLIC_REG_ISP 0x0010
298
299#define SLIC_REG_ISR 0x0018
300
301
302
303
304
305
306#define SLIC_REG_HBAR 0x0020
307
308
309
310
311#define SLIC_REG_DBAR 0x0028
312
313
314
315
316
317
318
319#define SLIC_REG_CBAR 0x0030
320
321#define SLIC_REG_WCS 0x0034
322
323
324
325
326
327
328#define SLIC_REG_RBAR 0x0038
329
330#define SLIC_REG_RSTAT 0x0040
331
332#define SLIC_REG_LSTAT 0x0048
333
334#define SLIC_REG_WMCFG 0x0050
335
336#define SLIC_REG_WPHY 0x0058
337
338#define SLIC_REG_RCBAR 0x0060
339
340#define SLIC_REG_RCONFIG 0x0068
341
342#define SLIC_REG_INTAGG 0x0070
343
344#define SLIC_REG_WXCFG 0x0078
345
346#define SLIC_REG_WRCFG 0x0080
347
348#define SLIC_REG_WRADDRAL 0x0088
349
350#define SLIC_REG_WRADDRAH 0x0090
351
352#define SLIC_REG_WRADDRBL 0x0098
353
354#define SLIC_REG_WRADDRBH 0x00a0
355
356#define SLIC_REG_MCASTLOW 0x00a8
357
358#define SLIC_REG_MCASTHIGH 0x00b0
359
360#define SLIC_REG_PING 0x00b8
361
362#define SLIC_REG_DUMP_CMD 0x00c0
363
364#define SLIC_REG_DUMP_DATA 0x00c8
365
366#define SLIC_REG_PCISTATUS 0x00d0
367
368#define SLIC_REG_WRHOSTID 0x00d8
369
370#define SLIC_REG_LOW_POWER 0x00e0
371
372#define SLIC_REG_QUIESCE 0x00e8
373
374#define SLIC_REG_RESET_IFACE 0x00f0
375
376
377
378
379#define SLIC_REG_ADDR_UPPER 0x00f8
380
381#define SLIC_REG_HBAR64 0x0100
382
383#define SLIC_REG_DBAR64 0x0108
384
385#define SLIC_REG_CBAR64 0x0110
386
387#define SLIC_REG_RBAR64 0x0118
388
389#define SLIC_REG_RCBAR64 0x0120
390
391#define SLIC_REG_RSTAT64 0x0128
392
393#define SLIC_REG_RCV_WCS 0x0130
394
395#define SLIC_REG_WRVLANID 0x0138
396
397#define SLIC_REG_READ_XF_INFO 0x0140
398
399#define SLIC_REG_WRITE_XF_INFO 0x0148
400
401#define SLIC_REG_TICKS_PER_SEC 0x0170
402
403#define SLIC_REG_HOSTID 0x1554
404
405enum UPR_REQUEST {
406 SLIC_UPR_STATS,
407 SLIC_UPR_RLSR,
408 SLIC_UPR_WCFG,
409 SLIC_UPR_RCONFIG,
410 SLIC_UPR_RPHY,
411 SLIC_UPR_ENLB,
412 SLIC_UPR_ENCT,
413 SLIC_UPR_PDWN,
414 SLIC_UPR_PING,
415 SLIC_UPR_DUMP,
416};
417
418struct inicpm_wakepattern {
419 u32 patternlength;
420 u8 pattern[SLIC_PM_PATTERNSIZE];
421 u8 mask[SLIC_PM_PATTERNSIZE];
422};
423
424struct inicpm_state {
425 u32 powercaps;
426 u32 powerstate;
427 u32 wake_linkstatus;
428 u32 wake_magicpacket;
429 u32 wake_framepattern;
430 struct inicpm_wakepattern wakepattern[SLIC_PM_MAXPATTERNS];
431};
432
433struct slicpm_packet_pattern {
434 u32 priority;
435 u32 reserved;
436 u32 masksize;
437 u32 patternoffset;
438 u32 patternsize;
439 u32 patternflags;
440};
441
442enum slicpm_power_state {
443 slicpm_state_unspecified = 0,
444 slicpm_state_d0,
445 slicpm_state_d1,
446 slicpm_state_d2,
447 slicpm_state_d3,
448 slicpm_state_maximum
449};
450
451struct slicpm_wakeup_capabilities {
452 enum slicpm_power_state min_magic_packet_wakeup;
453 enum slicpm_power_state min_pattern_wakeup;
454 enum slicpm_power_state min_link_change_wakeup;
455};
456
457struct slic_pnp_capabilities {
458 u32 flags;
459 struct slicpm_wakeup_capabilities wakeup_capabilities;
460};
461
462struct slic_config_mac {
463 u8 macaddrA[6];
464};
465
466#define ATK_FRU_FORMAT 0x00
467#define VENDOR1_FRU_FORMAT 0x01
468#define VENDOR2_FRU_FORMAT 0x02
469#define VENDOR3_FRU_FORMAT 0x03
470#define VENDOR4_FRU_FORMAT 0x04
471#define NO_FRU_FORMAT 0xFF
472
473struct atk_fru {
474 u8 assembly[6];
475 u8 revision[2];
476 u8 serial[14];
477 u8 pad[3];
478};
479
480struct vendor1_fru {
481 u8 commodity;
482 u8 assembly[4];
483 u8 revision[2];
484 u8 supplier[2];
485 u8 date[2];
486 u8 sequence[3];
487 u8 pad[13];
488};
489
490struct vendor2_fru {
491 u8 part[8];
492 u8 supplier[5];
493 u8 date[3];
494 u8 sequence[4];
495 u8 pad[7];
496};
497
498struct vendor3_fru {
499 u8 assembly[6];
500 u8 revision[2];
501 u8 serial[14];
502 u8 pad[3];
503};
504
505struct vendor4_fru {
506 u8 number[8];
507 u8 part[8];
508 u8 version[8];
509 u8 pad[3];
510};
511
512union oemfru {
513 struct vendor1_fru vendor1_fru;
514 struct vendor2_fru vendor2_fru;
515 struct vendor3_fru vendor3_fru;
516 struct vendor4_fru vendor4_fru;
517};
518
519
520
521
522struct slic_eeprom {
523 u16 Id;
524 u16 EecodeSize;
525 u16 FlashSize;
526 u16 EepromSize;
527 u16 VendorId;
528 u16 DeviceId;
529 u8 RevisionId;
530 u8 ClassCode[3];
531 u8 DbgIntPin;
532 u8 NetIntPin0;
533 u8 MinGrant;
534 u8 MaxLat;
535 u16 PciStatus;
536 u16 SubSysVId;
537 u16 SubSysId;
538 u16 DbgDevId;
539 u16 DramRomFn;
540 u16 DSize2Pci;
541 u16 RSize2Pci;
542 u8 NetIntPin1;
543
544
545 u8 NetIntPin2;
546 union {
547 u8 NetIntPin3;
548 u8 FreeTime;
549 } u1;
550 u8 TBIctl;
551 u16 DramSize;
552 union {
553 struct {
554
555 struct slic_config_mac MacInfo[SLIC_NBR_MACS];
556 } mac;
557 struct {
558
559 struct slic_config_mac pad[SLIC_NBR_MACS - 1];
560 u16 DeviceId2;
561 u8 IntPin2;
562 u8 ClassCode2[3];
563 } mojave;
564 } u2;
565 u16 CfgByte6;
566 u16 PMECapab;
567 u16 NwClkCtrls;
568 u8 FruFormat;
569 struct atk_fru AtkFru;
570 u8 OemFruFormat;
571 union oemfru OemFru;
572 u8 Pad[4];
573
574
575
576};
577
578
579struct oslic_eeprom {
580 u16 Id;
581 u16 EecodeSize;
582 u16 FlashConfig0;
583 u16 FlashConfig1;
584 u16 VendorId;
585 u16 DeviceId;
586 u8 RevisionId;
587 u8 ClassCode[3];
588 u8 IntPin1;
589 u8 ClassCode2[3];
590 u8 IntPin2;
591 u8 IntPin0;
592 u8 MinGrant;
593 u8 MaxLat;
594 u16 SubSysVId;
595 u16 SubSysId;
596 u16 FlashSize;
597 u16 DSize2Pci;
598 u16 RSize2Pci;
599
600
601 u16 DeviceId1;
602 u16 DeviceId2;
603 u16 CfgByte6;
604 u16 PMECapab;
605 u8 MSICapab;
606 u8 ClockDivider;
607 u16 PciStatusLow;
608 u16 PciStatusHigh;
609 u16 DramConfigLow;
610 u16 DramConfigHigh;
611 u16 DramSize;
612 u16 GpioTbiCtl;
613 u16 EepromSize;
614 struct slic_config_mac MacInfo[2];
615 u8 FruFormat;
616 struct atk_fru AtkFru;
617 u8 OemFruFormat;
618 union oemfru OemFru;
619 u8 Pad[4];
620
621
622
623};
624
625#define MAX_EECODE_SIZE sizeof(struct slic_eeprom)
626#define MIN_EECODE_SIZE 0x62
627
628
629
630
631
632
633
634
635struct slic_config {
636 bool EepromValid;
637 u16 DramSize;
638 struct slic_config_mac MacInfo[SLIC_NBR_MACS];
639 u8 FruFormat;
640 struct atk_fru AtkFru;
641 u8 OemFruFormat;
642 union {
643 struct vendor1_fru vendor1_fru;
644 struct vendor2_fru vendor2_fru;
645 struct vendor3_fru vendor3_fru;
646 struct vendor4_fru vendor4_fru;
647 } OemFru;
648};
649
650#pragma pack()
651
652#endif
653