if_wmvar.h revision 1.45 1 1.45 msaitoh /* $NetBSD: if_wmvar.h,v 1.45 2019/12/11 10:28:19 msaitoh Exp $ */
2 1.3 msaitoh
3 1.3 msaitoh /*
4 1.3 msaitoh * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 1.3 msaitoh * All rights reserved.
6 1.3 msaitoh *
7 1.3 msaitoh * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 1.3 msaitoh *
9 1.3 msaitoh * Redistribution and use in source and binary forms, with or without
10 1.3 msaitoh * modification, are permitted provided that the following conditions
11 1.3 msaitoh * are met:
12 1.3 msaitoh * 1. Redistributions of source code must retain the above copyright
13 1.3 msaitoh * notice, this list of conditions and the following disclaimer.
14 1.3 msaitoh * 2. Redistributions in binary form must reproduce the above copyright
15 1.3 msaitoh * notice, this list of conditions and the following disclaimer in the
16 1.3 msaitoh * documentation and/or other materials provided with the distribution.
17 1.3 msaitoh * 3. All advertising materials mentioning features or use of this software
18 1.3 msaitoh * must display the following acknowledgement:
19 1.3 msaitoh * This product includes software developed for the NetBSD Project by
20 1.3 msaitoh * Wasabi Systems, Inc.
21 1.3 msaitoh * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.3 msaitoh * or promote products derived from this software without specific prior
23 1.3 msaitoh * written permission.
24 1.3 msaitoh *
25 1.3 msaitoh * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.3 msaitoh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.3 msaitoh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.3 msaitoh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.3 msaitoh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.3 msaitoh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.3 msaitoh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.3 msaitoh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.3 msaitoh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.3 msaitoh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.3 msaitoh * POSSIBILITY OF SUCH DAMAGE.
36 1.3 msaitoh */
37 1.3 msaitoh
38 1.3 msaitoh /*******************************************************************************
39 1.3 msaitoh
40 1.3 msaitoh Copyright (c) 2001-2005, Intel Corporation
41 1.3 msaitoh All rights reserved.
42 1.3 msaitoh
43 1.3 msaitoh Redistribution and use in source and binary forms, with or without
44 1.3 msaitoh modification, are permitted provided that the following conditions are met:
45 1.3 msaitoh
46 1.3 msaitoh 1. Redistributions of source code must retain the above copyright notice,
47 1.3 msaitoh this list of conditions and the following disclaimer.
48 1.3 msaitoh
49 1.3 msaitoh 2. Redistributions in binary form must reproduce the above copyright
50 1.3 msaitoh notice, this list of conditions and the following disclaimer in the
51 1.3 msaitoh documentation and/or other materials provided with the distribution.
52 1.3 msaitoh
53 1.3 msaitoh 3. Neither the name of the Intel Corporation nor the names of its
54 1.3 msaitoh contributors may be used to endorse or promote products derived from
55 1.3 msaitoh this software without specific prior written permission.
56 1.3 msaitoh
57 1.3 msaitoh THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
58 1.3 msaitoh AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
59 1.3 msaitoh IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
60 1.3 msaitoh ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
61 1.3 msaitoh LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
62 1.3 msaitoh CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
63 1.3 msaitoh SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
64 1.3 msaitoh INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
65 1.3 msaitoh CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
66 1.3 msaitoh ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
67 1.3 msaitoh POSSIBILITY OF SUCH DAMAGE.
68 1.3 msaitoh
69 1.3 msaitoh *******************************************************************************/
70 1.1 gavan
71 1.1 gavan #ifndef _DEV_PCI_IF_WMVAR_H_
72 1.1 gavan #define _DEV_PCI_IF_WMVAR_H_
73 1.1 gavan
74 1.4 msaitoh /* sc_flags */
75 1.19 msaitoh #define WM_F_HAS_MII 0x00000001 /* has MII */
76 1.19 msaitoh #define WM_F_LOCK_EECD 0x00000002 /* Lock using with EECD register */
77 1.35 msaitoh #define WM_F_EEPROM_INVM 0x00000020 /* NVM is iNVM */
78 1.19 msaitoh #define WM_F_EEPROM_SPI 0x00000040 /* EEPROM is SPI */
79 1.19 msaitoh #define WM_F_EEPROM_FLASH 0x00000080 /* EEPROM is FLASH */
80 1.19 msaitoh #define WM_F_EEPROM_FLASH_HW 0x00000100 /* EEPROM is FLASH */
81 1.19 msaitoh #define WM_F_EEPROM_INVALID 0x00000200 /* EEPROM not present (bad cksum) */
82 1.19 msaitoh #define WM_F_IOH_VALID 0x00000400 /* I/O handle is valid */
83 1.19 msaitoh #define WM_F_BUS64 0x00000800 /* bus is 64-bit */
84 1.19 msaitoh #define WM_F_PCIX 0x00001000 /* bus is PCI-X */
85 1.19 msaitoh #define WM_F_CSA 0x00002000 /* bus is CSA */
86 1.19 msaitoh #define WM_F_PCIE 0x00004000 /* bus is PCI-Express */
87 1.19 msaitoh #define WM_F_SGMII 0x00008000 /* use SGMII */
88 1.19 msaitoh #define WM_F_NEWQUEUE 0x00010000 /* use new queue system */
89 1.18 msaitoh #define WM_F_ASF_FIRMWARE_PRES 0x00020000
90 1.18 msaitoh #define WM_F_ARC_SUBSYS_VALID 0x00040000
91 1.18 msaitoh #define WM_F_HAS_AMT 0x00080000
92 1.18 msaitoh #define WM_F_HAS_MANAGE 0x00100000
93 1.18 msaitoh #define WM_F_WOL 0x00200000
94 1.19 msaitoh #define WM_F_EEE 0x00400000 /* Energy Efficiency Ethernet */
95 1.23 msaitoh #define WM_F_ATTACHED 0x00800000 /* attach() finished successfully */
96 1.36 msaitoh #define WM_F_80003_MDIC_WA 0x01000000 /* 80003 MDIC workaround */
97 1.25 msaitoh #define WM_F_PCS_DIS_AUTONEGO 0x02000000 /* PCS Disable Autonego */
98 1.29 msaitoh #define WM_F_PLL_WA_I210 0x04000000 /* I21[01] PLL workaround */
99 1.37 msaitoh #define WM_F_WA_I210_CLSEM 0x08000000 /* I21[01] Semaphore workaround */
100 1.45 msaitoh #define WM_F_SFP 0x10000000 /* SFP */
101 1.45 msaitoh #define WM_F_MAS 0x20000000 /* Media Auto Sense */
102 1.22 msaitoh
103 1.34 msaitoh #define WM_FLAGS "\20" \
104 1.35 msaitoh "\1" "HAS_MII" "\2" "LOCK_EECD" "\3" "_B02" "\4" "_B03" \
105 1.35 msaitoh "\5" "_B04" "\6" "INVM" "\7" "SPI" "\10" "FLASH" \
106 1.34 msaitoh "\11" "FLASH_HW" "\12" "INVALID" "\13" "IOH_VALID" "\14" "BUS64" \
107 1.34 msaitoh "\15" "PCIX" "\16" "CSA" "\17" "PCIE" "\20" "SGMII" \
108 1.34 msaitoh "\21" "NEWQUEUE" "\22" "ASF_FIRM" "\23" "ARC_SUBSYS" "\24" "AMT" \
109 1.34 msaitoh "\25" "MANAGE" "\26" "WOL" "\27" "EEE" "\30" "ATTACHED" \
110 1.45 msaitoh "\31" "MDIC_WA" "\32" "PCS_DIS_AUTONEGO" "\33" "PLLWA" "\34" "CLSEMWA" \
111 1.45 msaitoh "\35" "SFP" "\36" "MAS"
112 1.34 msaitoh
113 1.22 msaitoh /*
114 1.22 msaitoh * Variations of Intel gigabit Ethernet controller:
115 1.22 msaitoh *
116 1.22 msaitoh * +-- 82542
117 1.22 msaitoh * | +-- 82543 - 82544
118 1.22 msaitoh * | | +-- 82540 - 82545 - 82546
119 1.22 msaitoh * | | | +-- 82541 - 82547
120 1.22 msaitoh * | | | | +---------- 82571 - 82572 - 82573 - 82574 - 82583
121 1.22 msaitoh * | | | | | +--------- 82575 - 82576 - 82580 - I350 - I354 - I210 - I211
122 1.22 msaitoh * | | | | | | +-- 80003
123 1.38 msaitoh * | | | | | | | +-- ICH8 - 9 - 10 - PCH - 2 - LPT - SPT - CNP
124 1.22 msaitoh * | | | | | | | |
125 1.22 msaitoh * -+--+--+--+--+--+--+--+----------------------------------------------->
126 1.22 msaitoh */
127 1.22 msaitoh
128 1.3 msaitoh typedef enum {
129 1.3 msaitoh WM_T_unknown = 0,
130 1.3 msaitoh WM_T_82542_2_0, /* i82542 2.0 (really old) */
131 1.3 msaitoh WM_T_82542_2_1, /* i82542 2.1+ (old) */
132 1.3 msaitoh WM_T_82543, /* i82543 */
133 1.3 msaitoh WM_T_82544, /* i82544 */
134 1.3 msaitoh WM_T_82540, /* i82540 */
135 1.3 msaitoh WM_T_82545, /* i82545 */
136 1.3 msaitoh WM_T_82545_3, /* i82545 3.0+ */
137 1.3 msaitoh WM_T_82546, /* i82546 */
138 1.3 msaitoh WM_T_82546_3, /* i82546 3.0+ */
139 1.3 msaitoh WM_T_82541, /* i82541 */
140 1.3 msaitoh WM_T_82541_2, /* i82541 2.0+ */
141 1.3 msaitoh WM_T_82547, /* i82547 */
142 1.3 msaitoh WM_T_82547_2, /* i82547 2.0+ */
143 1.3 msaitoh WM_T_82571, /* i82571 */
144 1.3 msaitoh WM_T_82572, /* i82572 */
145 1.3 msaitoh WM_T_82573, /* i82573 */
146 1.3 msaitoh WM_T_82574, /* i82574 */
147 1.5 msaitoh WM_T_82583, /* i82583 */
148 1.9 msaitoh WM_T_82575, /* i82575 */
149 1.9 msaitoh WM_T_82576, /* i82576 */
150 1.9 msaitoh WM_T_82580, /* i82580 */
151 1.13 msaitoh WM_T_I350, /* I350 */
152 1.17 msaitoh WM_T_I354, /* I354 */
153 1.15 msaitoh WM_T_I210, /* I210 */
154 1.15 msaitoh WM_T_I211, /* I211 */
155 1.3 msaitoh WM_T_80003, /* i80003 */
156 1.30 msaitoh WM_T_ICH8, /* ICH8 (I/O Controller Hub) LAN */
157 1.3 msaitoh WM_T_ICH9, /* ICH9 LAN */
158 1.3 msaitoh WM_T_ICH10, /* ICH10 LAN */
159 1.30 msaitoh WM_T_PCH, /* PCH (Platform Controller Hub) LAN */
160 1.12 msaitoh WM_T_PCH2, /* PCH2 LAN */
161 1.30 msaitoh WM_T_PCH_LPT, /* PCH "Lynx Point" LAN (I217, I218) */
162 1.31 msaitoh WM_T_PCH_SPT, /* PCH "Sunrise Point" LAN (I219) */
163 1.38 msaitoh WM_T_PCH_CNP, /* (I219) */
164 1.3 msaitoh } wm_chip_type;
165 1.1 gavan
166 1.43 msaitoh /*
167 1.43 msaitoh * Variations of internal or external PHYs
168 1.43 msaitoh *
169 1.43 msaitoh * +- 82562 - 8254[17] - 8257[12] - 82566
170 1.43 msaitoh * |
171 1.43 msaitoh * -+------------------------------------->
172 1.43 msaitoh *
173 1.44 msaitoh *
174 1.44 msaitoh * +---------------------------- I347 ----- E1512 ---- E1543
175 1.44 msaitoh * | |
176 1.44 msaitoh * | +--------------------------- I210 - I211
177 1.44 msaitoh * | |
178 1.44 msaitoh * | | +-------------+--- 82580 - I350
179 1.44 msaitoh * | | | |
180 1.44 msaitoh * | | +- 578 - 577 - 579 - I217 - I218 - I219
181 1.44 msaitoh * | | |
182 1.44 msaitoh * +- 56[34] -- 567 -- 573
183 1.44 msaitoh * | (E1149) (E1111)
184 1.43 msaitoh * |
185 1.44 msaitoh * -+----------------------------------------------------------------------->
186 1.43 msaitoh */
187 1.43 msaitoh
188 1.8 msaitoh typedef enum {
189 1.8 msaitoh WMPHY_UNKNOWN = 0,
190 1.8 msaitoh WMPHY_NONE,
191 1.43 msaitoh WMPHY_M88, /* 88E1000: 8254[34], E1011: 8254[056], E1111: 82573 */
192 1.43 msaitoh WMPHY_IGP, /* 8254[17] */
193 1.43 msaitoh WMPHY_IGP_2, /* 8257[12] */
194 1.43 msaitoh WMPHY_GG82563, /* 8256[34]: 80003 */
195 1.42 msaitoh WMPHY_IGP_3, /* 82566: 82575, 82576, ICH8, ICH9 */
196 1.43 msaitoh WMPHY_IFE, /* 82562: ICH8 ICH9 */
197 1.42 msaitoh WMPHY_BM, /* 82567: ICH8 ICH9 ICH10 */
198 1.42 msaitoh WMPHY_82578, /* 82578: PCH */
199 1.43 msaitoh WMPHY_82577, /* 82577: PCH (NOTE: functionality newer than 82578) */
200 1.43 msaitoh WMPHY_82579, /* 82579 : PCH2 */
201 1.42 msaitoh WMPHY_I217, /* I217: _LPT, I218: _LPT, I219: _SPT _CNP */
202 1.42 msaitoh WMPHY_82580, /* 82580: 82580 or I350 */
203 1.32 msaitoh WMPHY_VF,
204 1.42 msaitoh WMPHY_I210 /* I210: I210 I211 */
205 1.8 msaitoh } wm_phy_type;
206 1.8 msaitoh
207 1.8 msaitoh
208 1.10 msaitoh #define WM_GEN_POLL_TIMEOUT 640
209 1.6 msaitoh #define WM_PHY_CFG_TIMEOUT 100
210 1.6 msaitoh #define WM_ICH8_LAN_INIT_TIMEOUT 1500
211 1.6 msaitoh #define WM_MDIO_OWNERSHIP_TIMEOUT 10
212 1.28 msaitoh #define WM_MAX_PLL_TRIES 5
213 1.6 msaitoh
214 1.1 gavan #endif /* _DEV_PCI_IF_WMVAR_H_ */
215