1
2
3
4
5
6
7
8 #ifndef _SMSC95XX_H
9 #define _SMSC95XX_H
10
11
12 #define TX_CMD_A_DATA_OFFSET_ (0x001F0000)
13 #define TX_CMD_A_FIRST_SEG_ (0x00002000)
14 #define TX_CMD_A_LAST_SEG_ (0x00001000)
15 #define TX_CMD_A_BUF_SIZE_ (0x000007FF)
16
17 #define TX_CMD_B_CSUM_ENABLE (0x00004000)
18 #define TX_CMD_B_ADD_CRC_DIS_ (0x00002000)
19 #define TX_CMD_B_DIS_PADDING_ (0x00001000)
20 #define TX_CMD_B_FRAME_LENGTH_ (0x000007FF)
21
22
23 #define RX_STS_FF_ (0x40000000)
24 #define RX_STS_FL_ (0x3FFF0000)
25 #define RX_STS_ES_ (0x00008000)
26 #define RX_STS_BF_ (0x00002000)
27 #define RX_STS_LE_ (0x00001000)
28 #define RX_STS_RF_ (0x00000800)
29 #define RX_STS_MF_ (0x00000400)
30 #define RX_STS_TL_ (0x00000080)
31 #define RX_STS_CS_ (0x00000040)
32 #define RX_STS_FT_ (0x00000020)
33 #define RX_STS_RW_ (0x00000010)
34 #define RX_STS_ME_ (0x00000008)
35 #define RX_STS_DB_ (0x00000004)
36 #define RX_STS_CRC_ (0x00000002)
37
38
39
40 #define ID_REV (0x00)
41 #define ID_REV_CHIP_ID_MASK_ (0xFFFF0000)
42 #define ID_REV_CHIP_REV_MASK_ (0x0000FFFF)
43 #define ID_REV_CHIP_ID_9500_ (0x9500)
44 #define ID_REV_CHIP_ID_9500A_ (0x9E00)
45 #define ID_REV_CHIP_ID_9512_ (0xEC00)
46 #define ID_REV_CHIP_ID_9530_ (0x9530)
47 #define ID_REV_CHIP_ID_89530_ (0x9E08)
48 #define ID_REV_CHIP_ID_9730_ (0x9730)
49
50
51 #define INT_STS (0x08)
52 #define INT_STS_MAC_RTO_ (0x00040000)
53 #define INT_STS_TX_STOP_ (0x00020000)
54 #define INT_STS_RX_STOP_ (0x00010000)
55 #define INT_STS_PHY_INT_ (0x00008000)
56 #define INT_STS_TXE_ (0x00004000)
57 #define INT_STS_TDFU_ (0x00002000)
58 #define INT_STS_TDFO_ (0x00001000)
59 #define INT_STS_RXDF_ (0x00000800)
60 #define INT_STS_GPIOS_ (0x000007FF)
61 #define INT_STS_CLEAR_ALL_ (0xFFFFFFFF)
62
63
64 #define RX_CFG (0x0C)
65 #define RX_FIFO_FLUSH_ (0x00000001)
66
67
68 #define TX_CFG (0x10)
69 #define TX_CFG_ON_ (0x00000004)
70 #define TX_CFG_STOP_ (0x00000002)
71 #define TX_CFG_FIFO_FLUSH_ (0x00000001)
72
73
74 #define HW_CFG (0x14)
75 #define HW_CFG_BIR_ (0x00001000)
76 #define HW_CFG_LEDB_ (0x00000800)
77 #define HW_CFG_RXDOFF_ (0x00000600)
78 #define HW_CFG_SBP_ (0x00000100)
79 #define HW_CFG_IME_ (0x00000080)
80 #define HW_CFG_DRP_ (0x00000040)
81 #define HW_CFG_MEF_ (0x00000020)
82 #define HW_CFG_ETC_ (0x00000010)
83 #define HW_CFG_LRST_ (0x00000008)
84 #define HW_CFG_PSEL_ (0x00000004)
85 #define HW_CFG_BCE_ (0x00000002)
86 #define HW_CFG_SRST_ (0x00000001)
87
88
89 #define RX_FIFO_INF (0x18)
90 #define RX_FIFO_INF_USED_ (0x0000FFFF)
91
92
93 #define TX_FIFO_INF (0x1C)
94 #define TX_FIFO_INF_FREE_ (0x0000FFFF)
95
96
97 #define PM_CTRL (0x20)
98 #define PM_CTL_RES_CLR_WKP_STS (0x00000200)
99 #define PM_CTL_RES_CLR_WKP_EN (0x00000100)
100 #define PM_CTL_DEV_RDY_ (0x00000080)
101 #define PM_CTL_SUS_MODE_ (0x00000060)
102 #define PM_CTL_SUS_MODE_0 (0x00000000)
103 #define PM_CTL_SUS_MODE_1 (0x00000020)
104 #define PM_CTL_SUS_MODE_2 (0x00000040)
105 #define PM_CTL_SUS_MODE_3 (0x00000060)
106 #define PM_CTL_PHY_RST_ (0x00000010)
107 #define PM_CTL_WOL_EN_ (0x00000008)
108 #define PM_CTL_ED_EN_ (0x00000004)
109 #define PM_CTL_WUPS_ (0x00000003)
110 #define PM_CTL_WUPS_NO_ (0x00000000)
111 #define PM_CTL_WUPS_ED_ (0x00000001)
112 #define PM_CTL_WUPS_WOL_ (0x00000002)
113 #define PM_CTL_WUPS_MULTI_ (0x00000003)
114
115
116 #define LED_GPIO_CFG (0x24)
117 #define LED_GPIO_CFG_SPD_LED (0x01000000)
118 #define LED_GPIO_CFG_LNK_LED (0x00100000)
119 #define LED_GPIO_CFG_FDX_LED (0x00010000)
120
121
122 #define GPIO_CFG (0x28)
123
124
125 #define AFC_CFG (0x2C)
126 #define AFC_CFG_HI_ (0x00FF0000)
127 #define AFC_CFG_LO_ (0x0000FF00)
128 #define AFC_CFG_BACK_DUR_ (0x000000F0)
129 #define AFC_CFG_FC_MULT_ (0x00000008)
130 #define AFC_CFG_FC_BRD_ (0x00000004)
131 #define AFC_CFG_FC_ADD_ (0x00000002)
132 #define AFC_CFG_FC_ANY_ (0x00000001)
133
134
135
136
137 #define AFC_CFG_DEFAULT (0x00F830A1)
138
139
140 #define E2P_CMD (0x30)
141 #define E2P_CMD_BUSY_ (0x80000000)
142 #define E2P_CMD_MASK_ (0x70000000)
143 #define E2P_CMD_READ_ (0x00000000)
144 #define E2P_CMD_EWDS_ (0x10000000)
145 #define E2P_CMD_EWEN_ (0x20000000)
146 #define E2P_CMD_WRITE_ (0x30000000)
147 #define E2P_CMD_WRAL_ (0x40000000)
148 #define E2P_CMD_ERASE_ (0x50000000)
149 #define E2P_CMD_ERAL_ (0x60000000)
150 #define E2P_CMD_RELOAD_ (0x70000000)
151 #define E2P_CMD_TIMEOUT_ (0x00000400)
152 #define E2P_CMD_LOADED_ (0x00000200)
153 #define E2P_CMD_ADDR_ (0x000001FF)
154
155 #define MAX_EEPROM_SIZE (512)
156
157
158 #define E2P_DATA (0x34)
159 #define E2P_DATA_MASK_ (0x000000FF)
160
161
162 #define BURST_CAP (0x38)
163 #define BURST_CAP_MASK_ (0x000000FF)
164
165
166 #define STRAP_STATUS (0x3C)
167 #define STRAP_STATUS_PWR_SEL_ (0x00000020)
168 #define STRAP_STATUS_AMDIX_EN_ (0x00000010)
169 #define STRAP_STATUS_PORT_SWAP_ (0x00000008)
170 #define STRAP_STATUS_EEP_SIZE_ (0x00000004)
171 #define STRAP_STATUS_RMT_WKP_ (0x00000002)
172 #define STRAP_STATUS_EEP_DISABLE_ (0x00000001)
173
174
175 #define DP_SEL (0x40)
176
177
178 #define DP_CMD (0x44)
179
180
181 #define DP_ADDR (0x48)
182
183
184 #define DP_DATA0 (0x4C)
185
186
187 #define DP_DATA1 (0x50)
188
189
190 #define GPIO_WAKE (0x64)
191
192
193 #define INT_EP_CTL (0x68)
194 #define INT_EP_CTL_INTEP_ (0x80000000)
195 #define INT_EP_CTL_MAC_RTO_ (0x00080000)
196 #define INT_EP_CTL_RX_FIFO_ (0x00040000)
197 #define INT_EP_CTL_TX_STOP_ (0x00020000)
198 #define INT_EP_CTL_RX_STOP_ (0x00010000)
199 #define INT_EP_CTL_PHY_INT_ (0x00008000)
200 #define INT_EP_CTL_TXE_ (0x00004000)
201 #define INT_EP_CTL_TDFU_ (0x00002000)
202 #define INT_EP_CTL_TDFO_ (0x00001000)
203 #define INT_EP_CTL_RXDF_ (0x00000800)
204 #define INT_EP_CTL_GPIOS_ (0x000007FF)
205
206
207 #define BULK_IN_DLY (0x6C)
208
209
210
211 #define MAC_CR (0x100)
212 #define MAC_CR_RXALL_ (0x80000000)
213 #define MAC_CR_RCVOWN_ (0x00800000)
214 #define MAC_CR_LOOPBK_ (0x00200000)
215 #define MAC_CR_FDPX_ (0x00100000)
216 #define MAC_CR_MCPAS_ (0x00080000)
217 #define MAC_CR_PRMS_ (0x00040000)
218 #define MAC_CR_INVFILT_ (0x00020000)
219 #define MAC_CR_PASSBAD_ (0x00010000)
220 #define MAC_CR_HFILT_ (0x00008000)
221 #define MAC_CR_HPFILT_ (0x00002000)
222 #define MAC_CR_LCOLL_ (0x00001000)
223 #define MAC_CR_BCAST_ (0x00000800)
224 #define MAC_CR_DISRTY_ (0x00000400)
225 #define MAC_CR_PADSTR_ (0x00000100)
226 #define MAC_CR_BOLMT_MASK (0x000000C0)
227 #define MAC_CR_DFCHK_ (0x00000020)
228 #define MAC_CR_TXEN_ (0x00000008)
229 #define MAC_CR_RXEN_ (0x00000004)
230
231
232 #define ADDRH (0x104)
233
234
235 #define ADDRL (0x108)
236
237
238 #define HASHH (0x10C)
239
240
241 #define HASHL (0x110)
242
243
244 #define MII_ADDR (0x114)
245 #define MII_WRITE_ (0x02)
246 #define MII_BUSY_ (0x01)
247 #define MII_READ_ (0x00)
248
249
250 #define MII_DATA (0x118)
251
252
253 #define FLOW (0x11C)
254 #define FLOW_FCPT_ (0xFFFF0000)
255 #define FLOW_FCPASS_ (0x00000004)
256 #define FLOW_FCEN_ (0x00000002)
257 #define FLOW_FCBSY_ (0x00000001)
258
259
260 #define VLAN1 (0x120)
261
262
263 #define VLAN2 (0x124)
264
265
266 #define WUFF (0x128)
267 #define LAN9500_WUFF_NUM (4)
268 #define LAN9500A_WUFF_NUM (8)
269
270
271 #define WUCSR (0x12C)
272 #define WUCSR_WFF_PTR_RST_ (0x80000000)
273 #define WUCSR_GUE_ (0x00000200)
274 #define WUCSR_WUFR_ (0x00000040)
275 #define WUCSR_MPR_ (0x00000020)
276 #define WUCSR_WAKE_EN_ (0x00000004)
277 #define WUCSR_MPEN_ (0x00000002)
278
279
280 #define COE_CR (0x130)
281 #define Tx_COE_EN_ (0x00010000)
282 #define Rx_COE_MODE_ (0x00000002)
283 #define Rx_COE_EN_ (0x00000001)
284
285
286
287 #define PHY_EDPD_CONFIG (16)
288 #define PHY_EDPD_CONFIG_TX_NLP_EN_ ((u16)0x8000)
289 #define PHY_EDPD_CONFIG_TX_NLP_1000_ ((u16)0x0000)
290 #define PHY_EDPD_CONFIG_TX_NLP_768_ ((u16)0x2000)
291 #define PHY_EDPD_CONFIG_TX_NLP_512_ ((u16)0x4000)
292 #define PHY_EDPD_CONFIG_TX_NLP_256_ ((u16)0x6000)
293 #define PHY_EDPD_CONFIG_RX_1_NLP_ ((u16)0x1000)
294 #define PHY_EDPD_CONFIG_RX_NLP_64_ ((u16)0x0000)
295 #define PHY_EDPD_CONFIG_RX_NLP_256_ ((u16)0x0400)
296 #define PHY_EDPD_CONFIG_RX_NLP_512_ ((u16)0x0800)
297 #define PHY_EDPD_CONFIG_RX_NLP_1000_ ((u16)0x0C00)
298 #define PHY_EDPD_CONFIG_EXT_CROSSOVER_ ((u16)0x0001)
299 #define PHY_EDPD_CONFIG_DEFAULT (PHY_EDPD_CONFIG_TX_NLP_EN_ | \
300 PHY_EDPD_CONFIG_TX_NLP_768_ | \
301 PHY_EDPD_CONFIG_RX_1_NLP_)
302
303
304 #define PHY_MODE_CTRL_STS (17)
305 #define MODE_CTRL_STS_EDPWRDOWN_ ((u16)0x2000)
306 #define MODE_CTRL_STS_ENERGYON_ ((u16)0x0002)
307
308
309 #define SPECIAL_CTRL_STS (27)
310 #define SPECIAL_CTRL_STS_OVRRD_AMDIX_ ((u16)0x8000)
311 #define SPECIAL_CTRL_STS_AMDIX_ENABLE_ ((u16)0x4000)
312 #define SPECIAL_CTRL_STS_AMDIX_STATE_ ((u16)0x2000)
313
314
315 #define PHY_INT_SRC (29)
316 #define PHY_INT_SRC_ENERGY_ON_ ((u16)0x0080)
317 #define PHY_INT_SRC_ANEG_COMP_ ((u16)0x0040)
318 #define PHY_INT_SRC_REMOTE_FAULT_ ((u16)0x0020)
319 #define PHY_INT_SRC_LINK_DOWN_ ((u16)0x0010)
320
321
322 #define PHY_INT_MASK (30)
323 #define PHY_INT_MASK_ENERGY_ON_ ((u16)0x0080)
324 #define PHY_INT_MASK_ANEG_COMP_ ((u16)0x0040)
325 #define PHY_INT_MASK_REMOTE_FAULT_ ((u16)0x0020)
326 #define PHY_INT_MASK_LINK_DOWN_ ((u16)0x0010)
327 #define PHY_INT_MASK_DEFAULT_ (PHY_INT_MASK_ANEG_COMP_ | \
328 PHY_INT_MASK_LINK_DOWN_)
329
330 #define PHY_SPECIAL (31)
331 #define PHY_SPECIAL_SPD_ ((u16)0x001C)
332 #define PHY_SPECIAL_SPD_10HALF_ ((u16)0x0004)
333 #define PHY_SPECIAL_SPD_10FULL_ ((u16)0x0014)
334 #define PHY_SPECIAL_SPD_100HALF_ ((u16)0x0008)
335 #define PHY_SPECIAL_SPD_100FULL_ ((u16)0x0018)
336
337
338 #define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0
339 #define USB_VENDOR_REQUEST_READ_REGISTER 0xA1
340 #define USB_VENDOR_REQUEST_GET_STATS 0xA2
341
342
343 #define INT_ENP_MAC_RTO_ ((u32)BIT(18))
344 #define INT_ENP_TX_STOP_ ((u32)BIT(17))
345 #define INT_ENP_RX_STOP_ ((u32)BIT(16))
346 #define INT_ENP_PHY_INT_ ((u32)BIT(15))
347 #define INT_ENP_TXE_ ((u32)BIT(14))
348 #define INT_ENP_TDFU_ ((u32)BIT(13))
349 #define INT_ENP_TDFO_ ((u32)BIT(12))
350 #define INT_ENP_RXDF_ ((u32)BIT(11))
351
352 #endif