slichw.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. /**************************************************************************
  2. *
  3. * Copyright (c) 2000-2002 Alacritech, Inc. All rights reserved.
  4. *
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following
  14. * disclaimer in the documentation and/or other materials provided
  15. * with the distribution.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY ALACRITECH, INC. ``AS IS'' AND ANY
  18. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALACRITECH, INC. OR
  21. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  22. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  23. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  24. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  27. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * The views and conclusions contained in the software and documentation
  31. * are those of the authors and should not be interpreted as representing
  32. * official policies, either expressed or implied, of Alacritech, Inc.
  33. *
  34. **************************************************************************/
  35. /*
  36. * FILENAME: slichw.h
  37. *
  38. * This header file contains definitions that are common to our hardware.
  39. */
  40. #ifndef __SLICHW_H__
  41. #define __SLICHW_H__
  42. #define PCI_VENDOR_ID_ALACRITECH 0x139A
  43. #define SLIC_1GB_DEVICE_ID 0x0005
  44. #define SLIC_2GB_DEVICE_ID 0x0007 /* Oasis Device ID */
  45. #define SLIC_1GB_CICADA_SUBSYS_ID 0x0008
  46. #define SLIC_NBR_MACS 4
  47. #define SLIC_RCVBUF_SIZE 2048
  48. #define SLIC_RCVBUF_HEADSIZE 34
  49. #define SLIC_RCVBUF_TAILSIZE 0
  50. #define SLIC_RCVBUF_DATASIZE (SLIC_RCVBUF_SIZE - \
  51. (SLIC_RCVBUF_HEADSIZE + \
  52. SLIC_RCVBUF_TAILSIZE))
  53. #define VGBSTAT_XPERR 0x40000000
  54. #define VGBSTAT_XERRSHFT 25
  55. #define VGBSTAT_XCSERR 0x23
  56. #define VGBSTAT_XUFLOW 0x22
  57. #define VGBSTAT_XHLEN 0x20
  58. #define VGBSTAT_NETERR 0x01000000
  59. #define VGBSTAT_NERRSHFT 16
  60. #define VGBSTAT_NERRMSK 0x1ff
  61. #define VGBSTAT_NCSERR 0x103
  62. #define VGBSTAT_NUFLOW 0x102
  63. #define VGBSTAT_NHLEN 0x100
  64. #define VGBSTAT_LNKERR 0x00000080
  65. #define VGBSTAT_LERRMSK 0xff
  66. #define VGBSTAT_LDEARLY 0x86
  67. #define VGBSTAT_LBOFLO 0x85
  68. #define VGBSTAT_LCODERR 0x84
  69. #define VGBSTAT_LDBLNBL 0x83
  70. #define VGBSTAT_LCRCERR 0x82
  71. #define VGBSTAT_LOFLO 0x81
  72. #define VGBSTAT_LUFLO 0x80
  73. #define IRHDDR_FLEN_MSK 0x0000ffff
  74. #define IRHDDR_SVALID 0x80000000
  75. #define IRHDDR_ERR 0x10000000
  76. #define VRHSTAT_802OE 0x80000000
  77. #define VRHSTAT_TPOFLO 0x10000000
  78. #define VRHSTATB_802UE 0x80000000
  79. #define VRHSTATB_RCVE 0x40000000
  80. #define VRHSTATB_BUFF 0x20000000
  81. #define VRHSTATB_CARRE 0x08000000
  82. #define VRHSTATB_LONGE 0x02000000
  83. #define VRHSTATB_PREA 0x01000000
  84. #define VRHSTATB_CRC 0x00800000
  85. #define VRHSTATB_DRBL 0x00400000
  86. #define VRHSTATB_CODE 0x00200000
  87. #define VRHSTATB_TPCSUM 0x00100000
  88. #define VRHSTATB_TPHLEN 0x00080000
  89. #define VRHSTATB_IPCSUM 0x00040000
  90. #define VRHSTATB_IPLERR 0x00020000
  91. #define VRHSTATB_IPHERR 0x00010000
  92. #define SLIC_MAX64_BCNT 23
  93. #define SLIC_MAX32_BCNT 26
  94. #define IHCMD_XMT_REQ 0x01
  95. #define IHFLG_IFSHFT 2
  96. #define SLIC_RSPBUF_SIZE 32
  97. #define SLIC_RESET_MAGIC 0xDEAD
  98. #define ICR_INT_OFF 0
  99. #define ICR_INT_ON 1
  100. #define ICR_INT_MASK 2
  101. #define ISR_ERR 0x80000000
  102. #define ISR_RCV 0x40000000
  103. #define ISR_CMD 0x20000000
  104. #define ISR_IO 0x60000000
  105. #define ISR_UPC 0x10000000
  106. #define ISR_LEVENT 0x08000000
  107. #define ISR_RMISS 0x02000000
  108. #define ISR_UPCERR 0x01000000
  109. #define ISR_XDROP 0x00800000
  110. #define ISR_UPCBSY 0x00020000
  111. #define ISR_EVMSK 0xffff0000
  112. #define ISR_PINGMASK 0x00700000
  113. #define ISR_PINGDSMASK 0x00710000
  114. #define ISR_UPCMASK 0x11000000
  115. #define SLIC_WCS_START 0x80000000
  116. #define SLIC_WCS_COMPARE 0x40000000
  117. #define SLIC_RCVWCS_BEGIN 0x40000000
  118. #define SLIC_RCVWCS_FINISH 0x80000000
  119. #define SLIC_PM_MAXPATTERNS 6
  120. #define SLIC_PM_PATTERNSIZE 128
  121. #define SLIC_PMCAPS_WAKEONLAN 0x00000001
  122. #define MIICR_REG_PCR 0x00000000
  123. #define MIICR_REG_4 0x00040000
  124. #define MIICR_REG_9 0x00090000
  125. #define MIICR_REG_16 0x00100000
  126. #define PCR_RESET 0x8000
  127. #define PCR_POWERDOWN 0x0800
  128. #define PCR_SPEED_100 0x2000
  129. #define PCR_SPEED_1000 0x0040
  130. #define PCR_AUTONEG 0x1000
  131. #define PCR_AUTONEG_RST 0x0200
  132. #define PCR_DUPLEX_FULL 0x0100
  133. #define PSR_LINKUP 0x0004
  134. #define PAR_ADV100FD 0x0100
  135. #define PAR_ADV100HD 0x0080
  136. #define PAR_ADV10FD 0x0040
  137. #define PAR_ADV10HD 0x0020
  138. #define PAR_ASYMPAUSE 0x0C00
  139. #define PAR_802_3 0x0001
  140. #define PAR_ADV1000XFD 0x0020
  141. #define PAR_ADV1000XHD 0x0040
  142. #define PAR_ASYMPAUSE_FIBER 0x0180
  143. #define PGC_ADV1000FD 0x0200
  144. #define PGC_ADV1000HD 0x0100
  145. #define SEEQ_LINKFAIL 0x4000
  146. #define SEEQ_SPEED 0x0080
  147. #define SEEQ_DUPLEX 0x0040
  148. #define TDK_DUPLEX 0x0800
  149. #define TDK_SPEED 0x0400
  150. #define MRV_REG16_XOVERON 0x0068
  151. #define MRV_REG16_XOVEROFF 0x0008
  152. #define MRV_SPEED_1000 0x8000
  153. #define MRV_SPEED_100 0x4000
  154. #define MRV_SPEED_10 0x0000
  155. #define MRV_FULLDUPLEX 0x2000
  156. #define MRV_LINKUP 0x0400
  157. #define GIG_LINKUP 0x0001
  158. #define GIG_FULLDUPLEX 0x0002
  159. #define GIG_SPEED_MASK 0x000C
  160. #define GIG_SPEED_1000 0x0008
  161. #define GIG_SPEED_100 0x0004
  162. #define GIG_SPEED_10 0x0000
  163. #define MCR_RESET 0x80000000
  164. #define MCR_CRCEN 0x40000000
  165. #define MCR_FULLD 0x10000000
  166. #define MCR_PAD 0x02000000
  167. #define MCR_RETRYLATE 0x01000000
  168. #define MCR_BOL_SHIFT 21
  169. #define MCR_IPG1_SHIFT 14
  170. #define MCR_IPG2_SHIFT 7
  171. #define MCR_IPG3_SHIFT 0
  172. #define GMCR_RESET 0x80000000
  173. #define GMCR_GBIT 0x20000000
  174. #define GMCR_FULLD 0x10000000
  175. #define GMCR_GAPBB_SHIFT 14
  176. #define GMCR_GAPR1_SHIFT 7
  177. #define GMCR_GAPR2_SHIFT 0
  178. #define GMCR_GAPBB_1000 0x60
  179. #define GMCR_GAPR1_1000 0x2C
  180. #define GMCR_GAPR2_1000 0x40
  181. #define GMCR_GAPBB_100 0x70
  182. #define GMCR_GAPR1_100 0x2C
  183. #define GMCR_GAPR2_100 0x40
  184. #define XCR_RESET 0x80000000
  185. #define XCR_XMTEN 0x40000000
  186. #define XCR_PAUSEEN 0x20000000
  187. #define XCR_LOADRNG 0x10000000
  188. #define RCR_RESET 0x80000000
  189. #define RCR_RCVEN 0x40000000
  190. #define RCR_RCVALL 0x20000000
  191. #define RCR_RCVBAD 0x10000000
  192. #define RCR_CTLEN 0x08000000
  193. #define RCR_ADDRAEN 0x02000000
  194. #define GXCR_RESET 0x80000000
  195. #define GXCR_XMTEN 0x40000000
  196. #define GXCR_PAUSEEN 0x20000000
  197. #define GRCR_RESET 0x80000000
  198. #define GRCR_RCVEN 0x40000000
  199. #define GRCR_RCVALL 0x20000000
  200. #define GRCR_RCVBAD 0x10000000
  201. #define GRCR_CTLEN 0x08000000
  202. #define GRCR_ADDRAEN 0x02000000
  203. #define GRCR_HASHSIZE_SHIFT 17
  204. #define GRCR_HASHSIZE 14
  205. #define SLIC_EEPROM_ID 0xA5A5
  206. #define SLIC_SRAM_SIZE2GB (64 * 1024)
  207. #define SLIC_SRAM_SIZE1GB (32 * 1024)
  208. #define SLIC_HOSTID_DEFAULT 0xFFFF /* uninitialized hostid */
  209. #define SLIC_NBR_MACS 4
  210. struct slic_rcvbuf {
  211. u8 pad1[6];
  212. u16 pad2;
  213. u32 pad3;
  214. u32 pad4;
  215. u32 buffer;
  216. u32 length;
  217. u32 status;
  218. u32 pad5;
  219. u16 pad6;
  220. u8 data[SLIC_RCVBUF_DATASIZE];
  221. };
  222. struct slic_hddr_wds {
  223. union {
  224. struct {
  225. u32 frame_status;
  226. u32 frame_status_b;
  227. u32 time_stamp;
  228. u32 checksum;
  229. } hdrs_14port;
  230. struct {
  231. u32 frame_status;
  232. u16 ByteCnt;
  233. u16 TpChksum;
  234. u16 CtxHash;
  235. u16 MacHash;
  236. u32 BufLnk;
  237. } hdrs_gbit;
  238. } u0;
  239. };
  240. #define frame_status14 u0.hdrs_14port.frame_status
  241. #define frame_status_b14 u0.hdrs_14port.frame_status_b
  242. #define frame_statusGB u0.hdrs_gbit.frame_status
  243. struct slic_host64sg {
  244. u32 paddrl;
  245. u32 paddrh;
  246. u32 length;
  247. };
  248. struct slic_host64_cmd {
  249. u32 hosthandle;
  250. u32 RSVD;
  251. u8 command;
  252. u8 flags;
  253. union {
  254. u16 rsv1;
  255. u16 rsv2;
  256. } u0;
  257. union {
  258. struct {
  259. u32 totlen;
  260. struct slic_host64sg bufs[SLIC_MAX64_BCNT];
  261. } slic_buffers;
  262. } u;
  263. };
  264. struct slic_rspbuf {
  265. u32 hosthandle;
  266. u32 pad0;
  267. u32 pad1;
  268. u32 status;
  269. u32 pad2[4];
  270. };
  271. /* Reset Register */
  272. #define SLIC_REG_RESET 0x0000
  273. /* Interrupt Control Register */
  274. #define SLIC_REG_ICR 0x0008
  275. /* Interrupt status pointer */
  276. #define SLIC_REG_ISP 0x0010
  277. /* Interrupt status */
  278. #define SLIC_REG_ISR 0x0018
  279. /*
  280. * Header buffer address reg
  281. * 31-8 - phy addr of set of contiguous hdr buffers
  282. * 7-0 - number of buffers passed
  283. * Buffers are 256 bytes long on 256-byte boundaries.
  284. */
  285. #define SLIC_REG_HBAR 0x0020
  286. /*
  287. * Data buffer handle & address reg
  288. * 4 sets of registers; Buffers are 2K bytes long 2 per 4K page.
  289. */
  290. #define SLIC_REG_DBAR 0x0028
  291. /*
  292. * Xmt Cmd buf addr regs.
  293. * 1 per XMT interface
  294. * 31-5 - phy addr of host command buffer
  295. * 4-0 - length of cmd in multiples of 32 bytes
  296. * Buffers are 32 bytes up to 512 bytes long
  297. */
  298. #define SLIC_REG_CBAR 0x0030
  299. /* Write control store */
  300. #define SLIC_REG_WCS 0x0034
  301. /*
  302. * Response buffer address reg.
  303. * 31-8 - phy addr of set of contiguous response buffers
  304. * 7-0 - number of buffers passed
  305. * Buffers are 32 bytes long on 32-byte boundaries.
  306. */
  307. #define SLIC_REG_RBAR 0x0038
  308. /* Read statistics (UPR) */
  309. #define SLIC_REG_RSTAT 0x0040
  310. /* Read link status */
  311. #define SLIC_REG_LSTAT 0x0048
  312. /* Write Mac Config */
  313. #define SLIC_REG_WMCFG 0x0050
  314. /* Write phy register */
  315. #define SLIC_REG_WPHY 0x0058
  316. /* Rcv Cmd buf addr reg */
  317. #define SLIC_REG_RCBAR 0x0060
  318. /* Read SLIC Config*/
  319. #define SLIC_REG_RCONFIG 0x0068
  320. /* Interrupt aggregation time */
  321. #define SLIC_REG_INTAGG 0x0070
  322. /* Write XMIT config reg */
  323. #define SLIC_REG_WXCFG 0x0078
  324. /* Write RCV config reg */
  325. #define SLIC_REG_WRCFG 0x0080
  326. /* Write rcv addr a low */
  327. #define SLIC_REG_WRADDRAL 0x0088
  328. /* Write rcv addr a high */
  329. #define SLIC_REG_WRADDRAH 0x0090
  330. /* Write rcv addr b low */
  331. #define SLIC_REG_WRADDRBL 0x0098
  332. /* Write rcv addr b high */
  333. #define SLIC_REG_WRADDRBH 0x00a0
  334. /* Low bits of mcast mask */
  335. #define SLIC_REG_MCASTLOW 0x00a8
  336. /* High bits of mcast mask */
  337. #define SLIC_REG_MCASTHIGH 0x00b0
  338. /* Ping the card */
  339. #define SLIC_REG_PING 0x00b8
  340. /* Dump command */
  341. #define SLIC_REG_DUMP_CMD 0x00c0
  342. /* Dump data pointer */
  343. #define SLIC_REG_DUMP_DATA 0x00c8
  344. /* Read card's pci_status register */
  345. #define SLIC_REG_PCISTATUS 0x00d0
  346. /* Write hostid field */
  347. #define SLIC_REG_WRHOSTID 0x00d8
  348. /* Put card in a low power state */
  349. #define SLIC_REG_LOW_POWER 0x00e0
  350. /* Force slic into quiescent state before soft reset */
  351. #define SLIC_REG_QUIESCE 0x00e8
  352. /* Reset interface queues */
  353. #define SLIC_REG_RESET_IFACE 0x00f0
  354. /*
  355. * Register is only written when it has changed.
  356. * Bits 63-32 for host i/f addrs.
  357. */
  358. #define SLIC_REG_ADDR_UPPER 0x00f8
  359. /* 64 bit Header buffer address reg */
  360. #define SLIC_REG_HBAR64 0x0100
  361. /* 64 bit Data buffer handle & address reg */
  362. #define SLIC_REG_DBAR64 0x0108
  363. /* 64 bit Xmt Cmd buf addr regs. */
  364. #define SLIC_REG_CBAR64 0x0110
  365. /* 64 bit Response buffer address reg.*/
  366. #define SLIC_REG_RBAR64 0x0118
  367. /* 64 bit Rcv Cmd buf addr reg*/
  368. #define SLIC_REG_RCBAR64 0x0120
  369. /* Read statistics (64 bit UPR) */
  370. #define SLIC_REG_RSTAT64 0x0128
  371. /* Download Gigabit RCV sequencer ucode */
  372. #define SLIC_REG_RCV_WCS 0x0130
  373. /* Write VlanId field */
  374. #define SLIC_REG_WRVLANID 0x0138
  375. /* Read Transformer info */
  376. #define SLIC_REG_READ_XF_INFO 0x0140
  377. /* Write Transformer info */
  378. #define SLIC_REG_WRITE_XF_INFO 0x0148
  379. /* Write card ticks per second */
  380. #define SLIC_REG_TICKS_PER_SEC 0x0170
  381. #define SLIC_REG_HOSTID 0x1554
  382. enum UPR_REQUEST {
  383. SLIC_UPR_STATS,
  384. SLIC_UPR_RLSR,
  385. SLIC_UPR_WCFG,
  386. SLIC_UPR_RCONFIG,
  387. SLIC_UPR_RPHY,
  388. SLIC_UPR_ENLB,
  389. SLIC_UPR_ENCT,
  390. SLIC_UPR_PDWN,
  391. SLIC_UPR_PING,
  392. SLIC_UPR_DUMP,
  393. };
  394. struct inicpm_wakepattern {
  395. u32 patternlength;
  396. u8 pattern[SLIC_PM_PATTERNSIZE];
  397. u8 mask[SLIC_PM_PATTERNSIZE];
  398. };
  399. struct inicpm_state {
  400. u32 powercaps;
  401. u32 powerstate;
  402. u32 wake_linkstatus;
  403. u32 wake_magicpacket;
  404. u32 wake_framepattern;
  405. struct inicpm_wakepattern wakepattern[SLIC_PM_MAXPATTERNS];
  406. };
  407. struct slicpm_packet_pattern {
  408. u32 priority;
  409. u32 reserved;
  410. u32 masksize;
  411. u32 patternoffset;
  412. u32 patternsize;
  413. u32 patternflags;
  414. };
  415. enum slicpm_power_state {
  416. slicpm_state_unspecified = 0,
  417. slicpm_state_d0,
  418. slicpm_state_d1,
  419. slicpm_state_d2,
  420. slicpm_state_d3,
  421. slicpm_state_maximum
  422. };
  423. struct slicpm_wakeup_capabilities {
  424. enum slicpm_power_state min_magic_packet_wakeup;
  425. enum slicpm_power_state min_pattern_wakeup;
  426. enum slicpm_power_state min_link_change_wakeup;
  427. };
  428. struct slic_pnp_capabilities {
  429. u32 flags;
  430. struct slicpm_wakeup_capabilities wakeup_capabilities;
  431. };
  432. struct slic_config_mac {
  433. u8 macaddrA[6];
  434. };
  435. #define ATK_FRU_FORMAT 0x00
  436. #define VENDOR1_FRU_FORMAT 0x01
  437. #define VENDOR2_FRU_FORMAT 0x02
  438. #define VENDOR3_FRU_FORMAT 0x03
  439. #define VENDOR4_FRU_FORMAT 0x04
  440. #define NO_FRU_FORMAT 0xFF
  441. struct atk_fru {
  442. u8 assembly[6];
  443. u8 revision[2];
  444. u8 serial[14];
  445. u8 pad[3];
  446. };
  447. struct vendor1_fru {
  448. u8 commodity;
  449. u8 assembly[4];
  450. u8 revision[2];
  451. u8 supplier[2];
  452. u8 date[2];
  453. u8 sequence[3];
  454. u8 pad[13];
  455. };
  456. struct vendor2_fru {
  457. u8 part[8];
  458. u8 supplier[5];
  459. u8 date[3];
  460. u8 sequence[4];
  461. u8 pad[7];
  462. };
  463. struct vendor3_fru {
  464. u8 assembly[6];
  465. u8 revision[2];
  466. u8 serial[14];
  467. u8 pad[3];
  468. };
  469. struct vendor4_fru {
  470. u8 number[8];
  471. u8 part[8];
  472. u8 version[8];
  473. u8 pad[3];
  474. };
  475. union oemfru {
  476. struct vendor1_fru vendor1_fru;
  477. struct vendor2_fru vendor2_fru;
  478. struct vendor3_fru vendor3_fru;
  479. struct vendor4_fru vendor4_fru;
  480. };
  481. /*
  482. * SLIC EEPROM structure for Mojave
  483. */
  484. struct slic_eeprom {
  485. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
  486. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  487. u16 FlashSize; /* 02 Flash size */
  488. u16 EepromSize; /* 03 EEPROM Size */
  489. u16 VendorId; /* 04 Vendor ID */
  490. u16 DeviceId; /* 05 Device ID */
  491. u8 RevisionId; /* 06 Revision ID */
  492. u8 ClassCode[3]; /* 07 Class Code */
  493. u8 DbgIntPin; /* 08 Debug Interrupt pin */
  494. u8 NetIntPin0; /* Network Interrupt Pin */
  495. u8 MinGrant; /* 09 Minimum grant */
  496. u8 MaxLat; /* Maximum Latency */
  497. u16 PciStatus; /* 10 PCI Status */
  498. u16 SubSysVId; /* 11 Subsystem Vendor Id */
  499. u16 SubSysId; /* 12 Subsystem ID */
  500. u16 DbgDevId; /* 13 Debug Device Id */
  501. u16 DramRomFn; /* 14 Dram/Rom function */
  502. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes * 64K) */
  503. u16 RSize2Pci; /* 16 ROM extension size to PCI (bytes * 4k) */
  504. u8 NetIntPin1; /* 17 Network Interface Pin 1
  505. * (simba/leone only)
  506. */
  507. u8 NetIntPin2; /* Network Interface Pin 2 (simba/leone only)*/
  508. union {
  509. u8 NetIntPin3; /* 18 Network Interface Pin 3 (simba only) */
  510. u8 FreeTime; /* FreeTime setting (leone/mojave only) */
  511. } u1;
  512. u8 TBIctl; /* 10-bit interface control (Mojave only) */
  513. u16 DramSize; /* 19 DRAM size (bytes * 64k) */
  514. union {
  515. struct {
  516. /* Mac Interface Specific portions */
  517. struct slic_config_mac MacInfo[SLIC_NBR_MACS];
  518. } mac; /* MAC access for all boards */
  519. struct {
  520. /* use above struct for MAC access */
  521. struct slic_config_mac pad[SLIC_NBR_MACS - 1];
  522. u16 DeviceId2; /* Device ID for 2nd PCI function */
  523. u8 IntPin2; /* Interrupt pin for 2nd PCI function */
  524. u8 ClassCode2[3]; /* Class Code for 2nd PCI function */
  525. } mojave; /* 2nd function access for gigabit board */
  526. } u2;
  527. u16 CfgByte6; /* Config Byte 6 */
  528. u16 PMECapab; /* Power Mgment capabilities */
  529. u16 NwClkCtrls; /* NetworkClockControls */
  530. u8 FruFormat; /* Alacritech FRU format type */
  531. struct atk_fru AtkFru; /* Alacritech FRU information */
  532. u8 OemFruFormat; /* optional OEM FRU format type */
  533. union oemfru OemFru; /* optional OEM FRU information */
  534. u8 Pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes
  535. * (if OEM FRU info exists) and two unusable
  536. * bytes at the end
  537. */
  538. };
  539. /* SLIC EEPROM structure for Oasis */
  540. struct oslic_eeprom {
  541. u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5' */
  542. u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
  543. u16 FlashConfig0; /* 02 Flash Config for SPI device 0 */
  544. u16 FlashConfig1; /* 03 Flash Config for SPI device 1 */
  545. u16 VendorId; /* 04 Vendor ID */
  546. u16 DeviceId; /* 05 Device ID (function 0) */
  547. u8 RevisionId; /* 06 Revision ID */
  548. u8 ClassCode[3]; /* 07 Class Code for PCI function 0 */
  549. u8 IntPin1; /* 08 Interrupt pin for PCI function 1*/
  550. u8 ClassCode2[3]; /* 09 Class Code for PCI function 1 */
  551. u8 IntPin2; /* 10 Interrupt pin for PCI function 2*/
  552. u8 IntPin0; /* Interrupt pin for PCI function 0*/
  553. u8 MinGrant; /* 11 Minimum grant */
  554. u8 MaxLat; /* Maximum Latency */
  555. u16 SubSysVId; /* 12 Subsystem Vendor Id */
  556. u16 SubSysId; /* 13 Subsystem ID */
  557. u16 FlashSize; /* 14 Flash size (bytes / 4K) */
  558. u16 DSize2Pci; /* 15 DRAM size to PCI (bytes / 64K) */
  559. u16 RSize2Pci; /* 16 Flash (ROM extension) size to PCI
  560. * (bytes / 4K)
  561. */
  562. u16 DeviceId1; /* 17 Device Id (function 1) */
  563. u16 DeviceId2; /* 18 Device Id (function 2) */
  564. u16 CfgByte6; /* 19 Device Status Config Bytes 6-7 */
  565. u16 PMECapab; /* 20 Power Mgment capabilities */
  566. u8 MSICapab; /* 21 MSI capabilities */
  567. u8 ClockDivider; /* Clock divider */
  568. u16 PciStatusLow; /* 22 PCI Status bits 15:0 */
  569. u16 PciStatusHigh; /* 23 PCI Status bits 31:16 */
  570. u16 DramConfigLow; /* 24 DRAM Configuration bits 15:0 */
  571. u16 DramConfigHigh; /* 25 DRAM Configuration bits 31:16 */
  572. u16 DramSize; /* 26 DRAM size (bytes / 64K) */
  573. u16 GpioTbiCtl; /* 27 GPIO/TBI controls for functions 1/0 */
  574. u16 EepromSize; /* 28 EEPROM Size */
  575. struct slic_config_mac MacInfo[2]; /* 29 MAC addresses (2 ports) */
  576. u8 FruFormat; /* 35 Alacritech FRU format type */
  577. struct atk_fru AtkFru; /* Alacritech FRU information */
  578. u8 OemFruFormat; /* optional OEM FRU format type */
  579. union oemfru OemFru; /* optional OEM FRU information */
  580. u8 Pad[4]; /* Pad to 128 bytes - includes 2 checksum bytes
  581. * (if OEM FRU info exists) and two unusable
  582. * bytes at the end
  583. */
  584. };
  585. #define MAX_EECODE_SIZE sizeof(struct slic_eeprom)
  586. #define MIN_EECODE_SIZE 0x62 /* code size without optional OEM FRU stuff */
  587. /*
  588. * SLIC CONFIG structure
  589. *
  590. * This structure lives in the CARD structure and is valid for all board types.
  591. * It is filled in from the appropriate EEPROM structure by
  592. * SlicGetConfigData()
  593. */
  594. struct slic_config {
  595. bool EepromValid; /* Valid EEPROM flag (checksum good?) */
  596. u16 DramSize; /* DRAM size (bytes / 64K) */
  597. struct slic_config_mac MacInfo[SLIC_NBR_MACS]; /* MAC addresses */
  598. u8 FruFormat; /* Alacritech FRU format type */
  599. struct atk_fru AtkFru; /* Alacritech FRU information */
  600. u8 OemFruFormat; /* optional OEM FRU format type */
  601. union {
  602. struct vendor1_fru vendor1_fru;
  603. struct vendor2_fru vendor2_fru;
  604. struct vendor3_fru vendor3_fru;
  605. struct vendor4_fru vendor4_fru;
  606. } OemFru;
  607. };
  608. #pragma pack()
  609. #endif