Go to the documentation of this file.
31 #ifndef _KSZ8775_DRIVER_H
32 #define _KSZ8775_DRIVER_H
38 #define KSZ8775_PORT1 1
39 #define KSZ8775_PORT2 2
40 #define KSZ8775_PORT3 3
41 #define KSZ8775_PORT4 4
42 #define KSZ8775_PORT5 5
45 #define KSZ8775_PORT_MASK 0x1F
46 #define KSZ8775_PORT1_MASK 0x01
47 #define KSZ8775_PORT2_MASK 0x02
48 #define KSZ8775_PORT3_MASK 0x04
49 #define KSZ8775_PORT4_MASK 0x08
50 #define KSZ8775_PORT5_MASK 0x10
53 #define KSZ8775_SPI_CMD_WRITE 0x4000
54 #define KSZ8775_SPI_CMD_READ 0x6000
55 #define KSZ8775_SPI_CMD_ADDR 0x1FFE
58 #define KSZ8775_STATIC_MAC_TABLE_SIZE 32
59 #define KSZ8775_DYNAMIC_MAC_TABLE_SIZE 1024
60 #define KSZ8775_VLAN_TABLE_SIZE 4096
63 #define KSZ8775_TAIL_TAG_NORMAL_ADDR_LOOKUP 0x80
64 #define KSZ8775_TAIL_TAG_PORT_SEL 0x40
65 #define KSZ8775_TAIL_TAG_DEST_QUEUE 0x30
66 #define KSZ8775_TAIL_TAG_DEST_PORT4 0x08
67 #define KSZ8775_TAIL_TAG_DEST_PORT3 0x04
68 #define KSZ8775_TAIL_TAG_DEST_PORT2 0x02
69 #define KSZ8775_TAIL_TAG_DEST_PORT1 0x01
72 #define KSZ8775_TAIL_TAG_SRC_PORT 0x03
75 #define KSZ8775_BMCR 0x00
76 #define KSZ8775_BMSR 0x01
77 #define KSZ8775_PHYID1 0x02
78 #define KSZ8775_PHYID2 0x03
79 #define KSZ8775_ANAR 0x04
80 #define KSZ8775_ANLPAR 0x05
81 #define KSZ8775_LINKMD 0x1D
82 #define KSZ8775_PHYSCS 0x1F
85 #define KSZ8775_CHIP_ID0 0x00
86 #define KSZ8775_CHIP_ID1 0x01
87 #define KSZ8775_GLOBAL_CTRL0 0x02
88 #define KSZ8775_GLOBAL_CTRL1 0x03
89 #define KSZ8775_GLOBAL_CTRL2 0x04
90 #define KSZ8775_GLOBAL_CTRL3 0x05
91 #define KSZ8775_GLOBAL_CTRL4 0x06
92 #define KSZ8775_GLOBAL_CTRL5 0x07
93 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL 0x08
94 #define KSZ8775_GLOBAL_CTRL7 0x09
95 #define KSZ8775_GLOBAL_CTRL8 0x0A
96 #define KSZ8775_GLOBAL_CTRL9 0x0B
97 #define KSZ8775_GLOBAL_CTRL10 0x0C
98 #define KSZ8775_GLOBAL_CTRL11 0x0D
99 #define KSZ8775_PD_MGMT_CTRL1 0x0E
100 #define KSZ8775_PD_MGMT_CTRL2 0x0F
101 #define KSZ8775_PORT1_CTRL0 0x10
102 #define KSZ8775_PORT1_CTRL1 0x11
103 #define KSZ8775_PORT1_CTRL2 0x12
104 #define KSZ8775_PORT1_CTRL3 0x13
105 #define KSZ8775_PORT1_CTRL4 0x14
106 #define KSZ8775_PORT1_CTRL5 0x15
107 #define KSZ8775_PORT1_CTRL7 0x17
108 #define KSZ8775_PORT1_STAT0 0x18
109 #define KSZ8775_PORT1_STAT1 0x19
110 #define KSZ8775_PORT1_PHY_CTRL8 0x1A
111 #define KSZ8775_PORT1_LINKMD 0x1B
112 #define KSZ8775_PORT1_CTRL9 0x1C
113 #define KSZ8775_PORT1_CTRL10 0x1D
114 #define KSZ8775_PORT1_STAT2 0x1E
115 #define KSZ8775_PORT1_CTRL11_STAT3 0x1F
116 #define KSZ8775_PORT2_CTRL0 0x20
117 #define KSZ8775_PORT2_CTRL1 0x21
118 #define KSZ8775_PORT2_CTRL2 0x22
119 #define KSZ8775_PORT2_CTRL3 0x23
120 #define KSZ8775_PORT2_CTRL4 0x24
121 #define KSZ8775_PORT2_CTRL5 0x25
122 #define KSZ8775_PORT2_CTRL7 0x27
123 #define KSZ8775_PORT2_STAT0 0x28
124 #define KSZ8775_PORT2_STAT1 0x29
125 #define KSZ8775_PORT2_PHY_CTRL8 0x2A
126 #define KSZ8775_PORT2_LINKMD 0x2B
127 #define KSZ8775_PORT2_CTRL9 0x2C
128 #define KSZ8775_PORT2_CTRL10 0x2D
129 #define KSZ8775_PORT2_STAT2 0x2E
130 #define KSZ8775_PORT2_CTRL11_STAT3 0x2F
131 #define KSZ8775_PORT3_CTRL0 0x30
132 #define KSZ8775_PORT3_CTRL1 0x31
133 #define KSZ8775_PORT3_CTRL2 0x32
134 #define KSZ8775_PORT3_CTRL3 0x33
135 #define KSZ8775_PORT3_CTRL4 0x34
136 #define KSZ8775_PORT3_CTRL5 0x35
137 #define KSZ8775_PORT3_CTRL7 0x37
138 #define KSZ8775_PORT3_STAT0 0x38
139 #define KSZ8775_PORT3_STAT1 0x39
140 #define KSZ8775_PORT3_PHY_CTRL8 0x3A
141 #define KSZ8775_PORT3_LINKMD 0x3B
142 #define KSZ8775_PORT3_CTRL9 0x3C
143 #define KSZ8775_PORT3_CTRL10 0x3D
144 #define KSZ8775_PORT3_STAT2 0x3E
145 #define KSZ8775_PORT3_CTRL11_STAT3 0x3F
146 #define KSZ8775_PORT4_CTRL0 0x40
147 #define KSZ8775_PORT4_CTRL1 0x41
148 #define KSZ8775_PORT4_CTRL2 0x42
149 #define KSZ8775_PORT4_CTRL3 0x43
150 #define KSZ8775_PORT4_CTRL4 0x44
151 #define KSZ8775_PORT4_CTRL5 0x45
152 #define KSZ8775_PORT4_IF_CTRL6 0x46
153 #define KSZ8775_PORT4_CTRL9 0x4C
154 #define KSZ8775_PORT5_CTRL0 0x50
155 #define KSZ8775_PORT5_CTRL1 0x51
156 #define KSZ8775_PORT5_CTRL2 0x52
157 #define KSZ8775_PORT5_CTRL3 0x53
158 #define KSZ8775_PORT5_CTRL4 0x54
159 #define KSZ8775_PORT5_CTRL5 0x55
160 #define KSZ8775_PORT5_IF_CTRL6 0x56
161 #define KSZ8775_MAC_ADDR0 0x68
162 #define KSZ8775_MAC_ADDR1 0x69
163 #define KSZ8775_MAC_ADDR2 0x6A
164 #define KSZ8775_MAC_ADDR3 0x6B
165 #define KSZ8775_MAC_ADDR4 0x6C
166 #define KSZ8775_MAC_ADDR5 0x6D
167 #define KSZ8775_INDIRECT_CTRL0 0x6E
168 #define KSZ8775_INDIRECT_CTRL1 0x6F
169 #define KSZ8775_INDIRECT_DATA8 0x70
170 #define KSZ8775_INDIRECT_DATA7 0x71
171 #define KSZ8775_INDIRECT_DATA6 0x72
172 #define KSZ8775_INDIRECT_DATA5 0x73
173 #define KSZ8775_INDIRECT_DATA4 0x74
174 #define KSZ8775_INDIRECT_DATA3 0x75
175 #define KSZ8775_INDIRECT_DATA2 0x76
176 #define KSZ8775_INDIRECT_DATA1 0x77
177 #define KSZ8775_INDIRECT_DATA0 0x78
178 #define KSZ8775_INT_STAT 0x7C
179 #define KSZ8775_INT_MASK 0x7D
180 #define KSZ8775_ACL_INT_STAT 0x7E
181 #define KSZ8775_ACL_INT_CTRL 0x7F
182 #define KSZ8775_GLOBAL_CTRL12 0x80
183 #define KSZ8775_GLOBAL_CTRL13 0x81
184 #define KSZ8775_GLOBAL_CTRL14 0x82
185 #define KSZ8775_GLOBAL_CTRL15 0x83
186 #define KSZ8775_GLOBAL_CTRL16 0x84
187 #define KSZ8775_GLOBAL_CTRL17 0x85
188 #define KSZ8775_GLOBAL_CTRL18 0x86
189 #define KSZ8775_GLOBAL_CTRL19 0x87
190 #define KSZ8775_TOS_PRIO_CTRL0 0x90
191 #define KSZ8775_TOS_PRIO_CTRL1 0x91
192 #define KSZ8775_TOS_PRIO_CTRL2 0x92
193 #define KSZ8775_TOS_PRIO_CTRL3 0x93
194 #define KSZ8775_TOS_PRIO_CTRL4 0x94
195 #define KSZ8775_TOS_PRIO_CTRL5 0x95
196 #define KSZ8775_TOS_PRIO_CTRL6 0x96
197 #define KSZ8775_TOS_PRIO_CTRL7 0x97
198 #define KSZ8775_TOS_PRIO_CTRL8 0x98
199 #define KSZ8775_TOS_PRIO_CTRL9 0x99
200 #define KSZ8775_TOS_PRIO_CTRL10 0x9A
201 #define KSZ8775_TOS_PRIO_CTRL11 0x9B
202 #define KSZ8775_TOS_PRIO_CTRL12 0x9C
203 #define KSZ8775_TOS_PRIO_CTRL13 0x9D
204 #define KSZ8775_TOS_PRIO_CTRL14 0x9E
205 #define KSZ8775_TOS_PRIO_CTRL15 0x9F
206 #define KSZ8775_INDIRECT_BYTE 0xA0
207 #define KSZ8775_GLOBAL_CTRL20 0xA3
208 #define KSZ8775_GLOBAL_CTRL21 0xA4
209 #define KSZ8775_PORT1_CTRL12 0xB0
210 #define KSZ8775_PORT1_CTRL13 0xB1
211 #define KSZ8775_PORT1_CTRL14 0xB2
212 #define KSZ8775_PORT1_CTRL15 0xB3
213 #define KSZ8775_PORT1_CTRL16 0xB4
214 #define KSZ8775_PORT1_CTRL17 0xB5
215 #define KSZ8775_PORT1_RATE_LIMIT_CTRL 0xB6
216 #define KSZ8775_PORT1_PRIO0_IG_LIMIT_CTRL1 0xB7
217 #define KSZ8775_PORT1_PRIO1_IG_LIMIT_CTRL2 0xB8
218 #define KSZ8775_PORT1_PRIO2_IG_LIMIT_CTRL3 0xB9
219 #define KSZ8775_PORT1_PRIO3_IG_LIMIT_CTRL4 0xBA
220 #define KSZ8775_PORT1_QUEUE0_EG_LIMIT_CTRL1 0xBB
221 #define KSZ8775_PORT1_QUEUE1_EG_LIMIT_CTRL2 0xBC
222 #define KSZ8775_PORT1_QUEUE2_EG_LIMIT_CTRL3 0xBD
223 #define KSZ8775_PORT1_QUEUE3_EG_LIMIT_CTRL4 0xBE
224 #define KSZ8775_TEST 0xBF
225 #define KSZ8775_PORT2_CTRL12 0xC0
226 #define KSZ8775_PORT2_CTRL13 0xC1
227 #define KSZ8775_PORT2_CTRL14 0xC2
228 #define KSZ8775_PORT2_CTRL15 0xC3
229 #define KSZ8775_PORT2_CTRL16 0xC4
230 #define KSZ8775_PORT2_CTRL17 0xC5
231 #define KSZ8775_PORT2_RATE_LIMIT_CTRL 0xC6
232 #define KSZ8775_PORT2_PRIO0_IG_LIMIT_CTRL1 0xC7
233 #define KSZ8775_PORT2_PRIO1_IG_LIMIT_CTRL2 0xC8
234 #define KSZ8775_PORT2_PRIO2_IG_LIMIT_CTRL3 0xC9
235 #define KSZ8775_PORT2_PRIO3_IG_LIMIT_CTRL4 0xCA
236 #define KSZ8775_PORT2_QUEUE0_EG_LIMIT_CTRL1 0xCB
237 #define KSZ8775_PORT2_QUEUE1_EG_LIMIT_CTRL2 0xCC
238 #define KSZ8775_PORT2_QUEUE2_EG_LIMIT_CTRL3 0xCD
239 #define KSZ8775_PORT2_QUEUE3_EG_LIMIT_CTRL4 0xCE
240 #define KSZ8775_PORT3_CTRL12 0xD0
241 #define KSZ8775_PORT3_CTRL13 0xD1
242 #define KSZ8775_PORT3_CTRL14 0xD2
243 #define KSZ8775_PORT3_CTRL15 0xD3
244 #define KSZ8775_PORT3_CTRL16 0xD4
245 #define KSZ8775_PORT3_CTRL17 0xD5
246 #define KSZ8775_PORT3_RATE_LIMIT_CTRL 0xD6
247 #define KSZ8775_PORT3_PRIO0_IG_LIMIT_CTRL1 0xD7
248 #define KSZ8775_PORT3_PRIO1_IG_LIMIT_CTRL2 0xD8
249 #define KSZ8775_PORT3_PRIO2_IG_LIMIT_CTRL3 0xD9
250 #define KSZ8775_PORT3_PRIO3_IG_LIMIT_CTRL4 0xDA
251 #define KSZ8775_PORT3_QUEUE0_EG_LIMIT_CTRL1 0xDB
252 #define KSZ8775_PORT3_QUEUE1_EG_LIMIT_CTRL2 0xDC
253 #define KSZ8775_PORT3_QUEUE2_EG_LIMIT_CTRL3 0xDD
254 #define KSZ8775_PORT3_QUEUE3_EG_LIMIT_CTRL4 0xDE
255 #define KSZ8775_TEST2 0xDF
256 #define KSZ8775_PORT4_CTRL12 0xE0
257 #define KSZ8775_PORT4_CTRL13 0xE1
258 #define KSZ8775_PORT4_CTRL14 0xE2
259 #define KSZ8775_PORT4_CTRL15 0xE3
260 #define KSZ8775_PORT4_CTRL16 0xE4
261 #define KSZ8775_PORT4_CTRL17 0xE5
262 #define KSZ8775_PORT4_RATE_LIMIT_CTRL 0xE6
263 #define KSZ8775_PORT4_PRIO0_IG_LIMIT_CTRL1 0xE7
264 #define KSZ8775_PORT4_PRIO1_IG_LIMIT_CTRL2 0xE8
265 #define KSZ8775_PORT4_PRIO2_IG_LIMIT_CTRL3 0xE9
266 #define KSZ8775_PORT4_PRIO3_IG_LIMIT_CTRL4 0xEA
267 #define KSZ8775_PORT4_QUEUE0_EG_LIMIT_CTRL1 0xEB
268 #define KSZ8775_PORT4_QUEUE1_EG_LIMIT_CTRL2 0xEC
269 #define KSZ8775_PORT4_QUEUE2_EG_LIMIT_CTRL3 0xED
270 #define KSZ8775_PORT4_QUEUE3_EG_LIMIT_CTRL4 0xEE
271 #define KSZ8775_TEST3 0xEF
272 #define KSZ8775_PORT5_CTRL13 0xF1
273 #define KSZ8775_PORT5_CTRL14 0xF2
274 #define KSZ8775_PORT5_CTRL15 0xF3
275 #define KSZ8775_PORT5_CTRL16 0xF4
276 #define KSZ8775_PORT5_CTRL17 0xF5
277 #define KSZ8775_PORT5_RATE_LIMIT_CTRL 0xF6
278 #define KSZ8775_PORT5_PRIO0_IG_LIMIT_CTRL1 0xF7
279 #define KSZ8775_PORT5_PRIO1_IG_LIMIT_CTRL2 0xF8
280 #define KSZ8775_PORT5_PRIO2_IG_LIMIT_CTRL3 0xF9
281 #define KSZ8775_PORT5_PRIO3_IG_LIMIT_CTRL4 0xFA
282 #define KSZ8775_PORT5_QUEUE0_EG_LIMIT_CTRL1 0xFB
283 #define KSZ8775_PORT5_QUEUE1_EG_LIMIT_CTRL2 0xFC
284 #define KSZ8775_PORT5_QUEUE2_EG_LIMIT_CTRL3 0xFD
285 #define KSZ8775_PORT5_QUEUE3_EG_LIMIT_CTRL4 0xFE
286 #define KSZ8775_TEST4 0xFF
289 #define KSZ8775_PORTn_CTRL0(port) (0x00 + ((port) * 0x10))
290 #define KSZ8775_PORTn_CTRL1(port) (0x01 + ((port) * 0x10))
291 #define KSZ8775_PORTn_CTRL2(port) (0x02 + ((port) * 0x10))
292 #define KSZ8775_PORTn_CTRL3(port) (0x03 + ((port) * 0x10))
293 #define KSZ8775_PORTn_CTRL4(port) (0x04 + ((port) * 0x10))
294 #define KSZ8775_PORTn_CTRL5(port) (0x05 + ((port) * 0x10))
295 #define KSZ8775_PORTn_IF_CTRL6(port) (0x06 + ((port) * 0x10))
296 #define KSZ8775_PORTn_CTRL7(port) (0x07 + ((port) * 0x10))
297 #define KSZ8775_PORTn_STAT0(port) (0x08 + ((port) * 0x10))
298 #define KSZ8775_PORTn_STAT1(port) (0x09 + ((port) * 0x10))
299 #define KSZ8775_PORTn_PHY_CTRL8(port) (0x0A + ((port) * 0x10))
300 #define KSZ8775_PORTn_LINKMD(port) (0x0B + ((port) * 0x10))
301 #define KSZ8775_PORTn_CTRL9(port) (0x0C + ((port) * 0x10))
302 #define KSZ8775_PORTn_CTRL10(port) (0x0D + ((port) * 0x10))
303 #define KSZ8775_PORTn_STAT2(port) (0x0E + ((port) * 0x10))
304 #define KSZ8775_PORTn_CTRL11_STAT3(port) (0x0F + ((port) * 0x10))
305 #define KSZ8775_PORTn_CTRL12(port) (0xA0 + ((port) * 0x10))
306 #define KSZ8775_PORTn_CTRL13(port) (0xA1 + ((port) * 0x10))
307 #define KSZ8775_PORTn_CTRL14(port) (0xA2 + ((port) * 0x10))
308 #define KSZ8775_PORTn_CTRL15(port) (0xA3 + ((port) * 0x10))
309 #define KSZ8775_PORTn_CTRL16(port) (0xA4 + ((port) * 0x10))
310 #define KSZ8775_PORTn_CTRL17(port) (0xA5 + ((port) * 0x10))
311 #define KSZ8775_PORTn_RATE_LIMIT_CTRL(port) (0xA6 + ((port) * 0x10))
312 #define KSZ8775_PORTn_PRIO0_IG_LIMIT_CTRL1(port) (0xA7 + ((port) * 0x10))
313 #define KSZ8775_PORTn_PRIO1_IG_LIMIT_CTRL2(port) (0xA8 + ((port) * 0x10))
314 #define KSZ8775_PORTn_PRIO2_IG_LIMIT_CTRL3(port) (0xA9 + ((port) * 0x10))
315 #define KSZ8775_PORTn_PRIO3_IG_LIMIT_CTRL4(port) (0xAA + ((port) * 0x10))
316 #define KSZ8775_PORTn_QUEUE0_EG_LIMIT_CTRL1(port) (0xAB + ((port) * 0x10))
317 #define KSZ8775_PORTn_QUEUE1_EG_LIMIT_CTRL2(port) (0xAC + ((port) * 0x10))
318 #define KSZ8775_PORTn_QUEUE2_EG_LIMIT_CTRL3(port) (0xAD + ((port) * 0x10))
319 #define KSZ8775_PORTn_QUEUE3_EG_LIMIT_CTRL4(port) (0xAE + ((port) * 0x10))
322 #define KSZ8775_BMCR_RESET 0x8000
323 #define KSZ8775_BMCR_LOOPBACK 0x4000
324 #define KSZ8775_BMCR_FORCE_100 0x2000
325 #define KSZ8775_BMCR_AN_EN 0x1000
326 #define KSZ8775_BMCR_POWER_DOWN 0x0800
327 #define KSZ8775_BMCR_ISOLATE 0x0400
328 #define KSZ8775_BMCR_RESTART_AN 0x0200
329 #define KSZ8775_BMCR_FORCE_FULL_DUPLEX 0x0100
330 #define KSZ8775_BMCR_HP_MDIX 0x0020
331 #define KSZ8775_BMCR_FORCE_MDI 0x0010
332 #define KSZ8775_BMCR_AUTO_MDIX_DIS 0x0008
333 #define KSZ8775_BMCR_FAR_END_FAULT_DIS 0x0004
334 #define KSZ8775_BMCR_TRANSMIT_DIS 0x0002
335 #define KSZ8775_BMCR_LED_DIS 0x0001
338 #define KSZ8775_BMSR_100BT4 0x8000
339 #define KSZ8775_BMSR_100BTX_FD 0x4000
340 #define KSZ8775_BMSR_100BTX_HD 0x2000
341 #define KSZ8775_BMSR_10BT_FD 0x1000
342 #define KSZ8775_BMSR_10BT_HD 0x0800
343 #define KSZ8775_BMSR_AN_COMPLETE 0x0020
344 #define KSZ8775_BMSR_FAR_END_FAULT 0x0010
345 #define KSZ8775_BMSR_AN_CAPABLE 0x0008
346 #define KSZ8775_BMSR_LINK_STATUS 0x0004
347 #define KSZ8775_BMSR_EXTENDED_CAPABLE 0x0001
350 #define KSZ8775_PHYID1_DEFAULT 0x0022
353 #define KSZ8775_PHYID2_DEFAULT 0x1550
356 #define KSZ8775_ANAR_PAUSE 0x0400
357 #define KSZ8775_ANAR_100BTX_FD 0x0100
358 #define KSZ8775_ANAR_100BTX_HD 0x0080
359 #define KSZ8775_ANAR_10BT_FD 0x0040
360 #define KSZ8775_ANAR_10BT_HD 0x0020
361 #define KSZ8775_ANAR_SELECTOR 0x001F
362 #define KSZ8775_ANAR_SELECTOR_DEFAULT 0x0001
365 #define KSZ8775_ANLPAR_PAUSE 0x0400
366 #define KSZ8775_ANLPAR_100BTX_FD 0x0100
367 #define KSZ8775_ANLPAR_100BTX_HD 0x0080
368 #define KSZ8775_ANLPAR_10BT_FD 0x0040
369 #define KSZ8775_ANLPAR_10BT_HD 0x0020
372 #define KSZ8775_LINKMD_TEST_EN 0x8000
373 #define KSZ8775_LINKMD_RESULT 0x6000
374 #define KSZ8775_LINKMD_RESULT_NORMAL 0x0000
375 #define KSZ8775_LINKMD_RESULT_OPEN 0x2000
376 #define KSZ8775_LINKMD_RESULT_SHORT 0x4000
377 #define KSZ8775_LINKMD_RESULT_FAIL 0x6000
378 #define KSZ8775_LINKMD_SHORT 0x1000
379 #define KSZ8775_LINKMD_FAULT_COUNT 0x01FF
382 #define KSZ8775_PHYSCS_OP_MODE 0x0700
383 #define KSZ8775_PHYSCS_OP_MODE_AN 0x0100
384 #define KSZ8775_PHYSCS_OP_MODE_10BT_HD 0x0200
385 #define KSZ8775_PHYSCS_OP_MODE_100BTX_HD 0x0300
386 #define KSZ8775_PHYSCS_OP_MODE_10BT_FD 0x0500
387 #define KSZ8775_PHYSCS_OP_MODE_100BTX_FD 0x0600
388 #define KSZ8775_PHYSCS_OP_MODE_ISOLATE 0x0700
389 #define KSZ8775_PHYSCS_POLRVS 0x0020
390 #define KSZ8775_PHYSCS_MDIX_STATUS 0x0010
391 #define KSZ8775_PHYSCS_FORCE_LINK 0x0008
392 #define KSZ8775_PHYSCS_PWRSAVE 0x0004
393 #define KSZ8775_PHYSCS_REMOTE_LOOPBACK 0x0002
396 #define KSZ8775_CHIP_ID0_FAMILY_ID 0xFF
397 #define KSZ8775_CHIP_ID0_FAMILY_ID_DEFAULT 0x87
400 #define KSZ8775_CHIP_ID1_CHIP_ID 0xF0
401 #define KSZ8775_CHIP_ID1_CHIP_ID_DEFAULT 0x70
402 #define KSZ8775_CHIP_ID1_REVISION_ID 0x0E
403 #define KSZ8775_CHIP_ID1_START_SWITCH 0x01
406 #define KSZ8775_GLOBAL_CTRL0_NEW_BACK_OFF_EN 0x80
407 #define KSZ8775_GLOBAL_CTRL0_GLOBAL_SOFT_RESET_EN 0x40
408 #define KSZ8775_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE 0x20
409 #define KSZ8775_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE 0x10
410 #define KSZ8775_GLOBAL_CTRL0_UNH_MODE 0x02
411 #define KSZ8775_GLOBAL_CTRL0_LINK_CHANGE_AGE 0x01
414 #define KSZ8775_GLOBAL_CTRL1_2KB_PKT_SUPPORT 0x40
415 #define KSZ8775_GLOBAL_CTRL1_TX_FLOW_CTRL_DIS 0x20
416 #define KSZ8775_GLOBAL_CTRL1_RX_FLOW_CTRL_DIS 0x10
417 #define KSZ8775_GLOBAL_CTRL1_FRAME_LEN_CHECK_EN 0x08
418 #define KSZ8775_GLOBAL_CTRL1_AGING_EN 0x04
419 #define KSZ8775_GLOBAL_CTRL1_FAST_AGE_EN 0x02
420 #define KSZ8775_GLOBAL_CTRL1_AGGRESSIVE_BACK_OFF_EN 0x01
423 #define KSZ8775_GLOBAL_CTRL2_UNI_VLAN_MISMATCH_DISCARD 0x80
424 #define KSZ8775_GLOBAL_CTRL2_MCAST_STORM_PROTECT_DIS 0x40
425 #define KSZ8775_GLOBAL_CTRL2_BACK_PRESSURE_MODE 0x20
426 #define KSZ8775_GLOBAL_CTRL2_FLOW_CTRL_FAIR_MODE 0x10
427 #define KSZ8775_GLOBAL_CTRL2_NO_EXCESSIVE_COL_DROP 0x08
428 #define KSZ8775_GLOBAL_CTRL2_MAX_PKT_SIZE_CHECK_DIS 0x02
431 #define KSZ8775_GLOBAL_CTRL3_VLAN_EN 0x80
432 #define KSZ8775_GLOBAL_CTRL3_SW5_IGMP_SNOOP_EN 0x40
433 #define KSZ8775_GLOBAL_CTRL3_SNIFF_MODE_SEL 0x01
436 #define KSZ8775_GLOBAL_CTRL4_SW5_BACK_PRESSURE_EN 0x80
437 #define KSZ8775_GLOBAL_CTRL4_SW5_HALF_DUPLEX_MODE 0x40
438 #define KSZ8775_GLOBAL_CTRL4_SW5_FLOW_CTRL_EN 0x20
439 #define KSZ8775_GLOBAL_CTRL4_SW5_SPEED 0x10
440 #define KSZ8775_GLOBAL_CTRL4_NULL_VID_REPLACEMENT 0x08
441 #define KSZ8775_GLOBAL_CTRL4_BCAST_STORM_PROTECT_RATE_MSB 0x07
444 #define KSZ8775_GLOBAL_CTRL5_BCAST_STORM_PROTECT_RATE_LSB 0xFF
447 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_FLUSH_COUNTER 0x80
448 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_FREEZE_COUNTER 0x40
449 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN 0x1F
450 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN_PORT1 0x01
451 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN_PORT2 0x02
452 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN_PORT3 0x04
453 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN_PORT4 0x08
454 #define KSZ8775_GLOBAL_CTRL6_MIB_CTRL_CONTROL_EN_PORT5 0x10
457 #define KSZ8775_GLOBAL_CTRL7_FACTORY_TESTING 0xFF
460 #define KSZ8775_GLOBAL_CTRL8_FACTORY_TESTING 0xFF
463 #define KSZ8775_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL 0x40
464 #define KSZ8775_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL_RISING 0x00
465 #define KSZ8775_GLOBAL_CTRL9_SW5_REFCLK_EDGE_SEL_FALLING 0x40
466 #define KSZ8775_GLOBAL_CTRL9_LED_MODE 0x30
467 #define KSZ8775_GLOBAL_CTRL9_LED_MODE_LED0_LNK_ACT_LED1_SPD 0x00
468 #define KSZ8775_GLOBAL_CTRL9_LED_MODE_LED0_LNK_LED1_ACT 0x10
469 #define KSZ8775_GLOBAL_CTRL9_LED_MODE_LED0_LNK_ACT_LED1_DPLX 0x20
470 #define KSZ8775_GLOBAL_CTRL9_LED_MODE_LED0_LNK_LED1_ACT_DPLX 0x30
471 #define KSZ8775_GLOBAL_CTRL9_REFCLKO_ENABLE 0x02
472 #define KSZ8775_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL 0x01
473 #define KSZ8775_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL_FALLING 0x00
474 #define KSZ8775_GLOBAL_CTRL9_SPI_READ_CLK_EDGE_SEL_RISING 0x01
477 #define KSZ8775_GLOBAL_CTRL10_TAIL_TAG_EN 0x02
480 #define KSZ8775_GLOBAL_CTRL11_FACTORY_TESTING 0xFF
483 #define KSZ8775_PD_MGMT_CTRL1_PLL_PWR_DOWN 0x20
484 #define KSZ8775_PD_MGMT_CTRL1_PWR_MGMT_MODE 0x18
485 #define KSZ8775_PD_MGMT_CTRL1_PWR_MGMT_MODE_NORMAL 0x00
486 #define KSZ8775_PD_MGMT_CTRL1_PWR_MGMT_MODE_ENERGY_DETECT 0x08
487 #define KSZ8775_PD_MGMT_CTRL1_PWR_MGMT_MODE_SOFT_PWR_DOWN 0x10
490 #define KSZ8775_PD_MGMT_CTRL2_GO_SLEEP_TIME 0xFF
493 #define KSZ8775_PORTn_CTRL0_BCAST_STORM_PROTECT_EN 0x80
494 #define KSZ8775_PORTn_CTRL0_DIFFSERV_PRIO_CLASS_EN 0x40
495 #define KSZ8775_PORTn_CTRL0_802_1P_PRIO_CLASS_EN 0x20
496 #define KSZ8775_PORTn_CTRL0_PORT_PRIO_CLASS_EN 0x18
497 #define KSZ8775_PORTn_CTRL0_TAG_INSERTION 0x04
498 #define KSZ8775_PORTn_CTRL0_TAG_REMOVAL 0x02
499 #define KSZ8775_PORTn_CTRL0_TWO_QUEUE_SPLIT_EN 0x01
502 #define KSZ8775_PORTn_CTRL1_SNIFFER_PORT 0x80
503 #define KSZ8775_PORTn_CTRL1_RECEIVE_SNIFF 0x40
504 #define KSZ8775_PORTn_CTRL1_TRANSMIT_SNIFF 0x20
505 #define KSZ8775_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP 0x1F
508 #define KSZ8775_PORTn_CTRL2_USER_PRIO_CEILING 0x80
509 #define KSZ8775_PORTn_CTRL2_INGRESS_VLAN_FILT 0x40
510 #define KSZ8775_PORTn_CTRL2_DISCARD_NON_PVID_PKT 0x20
511 #define KSZ8775_PORTn_CTRL2_FORCE_FLOW_CTRL 0x10
512 #define KSZ8775_PORTn_CTRL2_BACK_PRESSURE_EN 0x08
513 #define KSZ8775_PORTn_CTRL2_TRANSMIT_EN 0x04
514 #define KSZ8775_PORTn_CTRL2_RECEIVE_EN 0x02
515 #define KSZ8775_PORTn_CTRL2_LEARNING_DIS 0x01
518 #define KSZ8775_PORTn_CTRL3_DEFAULT_USER_PRIO 0xE0
519 #define KSZ8775_PORTn_CTRL3_DEFAULT_CFI 0x10
520 #define KSZ8775_PORTn_CTRL3_DEFAULT_VID_MSB 0x0F
523 #define KSZ8775_PORTn_CTRL4_DEFAULT_VID_LSB 0xFF
526 #define KSZ8775_PORTn_CTRL5_ACL_EN 0x04
527 #define KSZ8775_PORTn_CTRL5_AUTH_MODE 0x03
530 #define KSZ8775_PORTn_IF_CTRL6_RMII_CLK_SEL 0x80
531 #define KSZ8775_PORTn_IF_CTRL6_IS_1GBPS 0x40
532 #define KSZ8775_PORTn_IF_CTRL6_RGMII_ID_IG_EN 0x10
533 #define KSZ8775_PORTn_IF_CTRL6_RGMII_ID_EG_EN 0x08
534 #define KSZ8775_PORTn_IF_CTRL6_MII_MODE_SEL 0x04
535 #define KSZ8775_PORTn_IF_CTRL6_MII_MODE_SEL_PHY 0x00
536 #define KSZ8775_PORTn_IF_CTRL6_MII_MODE_SEL_MAC 0x04
537 #define KSZ8775_PORTn_IF_CTRL6_IF_MODE_SEL 0x03
538 #define KSZ8775_PORTn_IF_CTRL6_IF_MODE_SEL_MII 0x00
539 #define KSZ8775_PORTn_IF_CTRL6_IF_MODE_SEL_RMII 0x01
540 #define KSZ8775_PORTn_IF_CTRL6_IF_MODE_SEL_RGMII 0x03
543 #define KSZ8775_PORTn_CTRL7_ADV_FLOW_CTRL_CAP 0x30
544 #define KSZ8775_PORTn_CTRL7_ADV_FLOW_CTRL_CAP_NO 0x00
545 #define KSZ8775_PORTn_CTRL7_ADV_FLOW_CTRL_CAP_SYMMETRIC 0x10
546 #define KSZ8775_PORTn_CTRL7_ADV_FLOW_CTRL_CAP_ASYMMETRIC 0x20
547 #define KSZ8775_PORTn_CTRL7_ADV_FLOW_CTRL_CAP_BOTH 0x30
548 #define KSZ8775_PORTn_CTRL7_ADV_100BT_FD 0x08
549 #define KSZ8775_PORTn_CTRL7_ADV_100BT_HD 0x04
550 #define KSZ8775_PORTn_CTRL7_ADV_10BT_FD 0x02
551 #define KSZ8775_PORTn_CTRL7_ADV_10BT_HD 0x01
554 #define KSZ8775_PORTn_STAT0_LP_FLOW_CTRL_CAPABLE 0x30
555 #define KSZ8775_PORTn_STAT0_LP_100BTX_FD_CAPABLE 0x08
556 #define KSZ8775_PORTn_STAT0_LP_100BTX_HF_CAPABLE 0x04
557 #define KSZ8775_PORTn_STAT0_LP_10BT_FD_CAPABLE 0x02
558 #define KSZ8775_PORTn_STAT0_LP_10BT_HD_CAPABLE 0x01
561 #define KSZ8775_PORTn_STAT1_HP_MDIX 0x80
562 #define KSZ8775_PORTn_STAT1_FACTORY_TESTING 0x40
563 #define KSZ8775_PORTn_STAT1_POLRVS 0x20
564 #define KSZ8775_PORTn_STAT1_TX_FLOW_CTRL_EN 0x10
565 #define KSZ8775_PORTn_STAT1_RX_FLOW_CTRL_EN 0x08
566 #define KSZ8775_PORTn_STAT1_OP_SPEED 0x04
567 #define KSZ8775_PORTn_STAT1_OP_DUPLEX 0x02
570 #define KSZ8775_PORTn_PHY_CTRL8_CDT_10M_SHORT 0x80
571 #define KSZ8775_PORTn_PHY_CTRL8_CDT_RESULT 0x60
572 #define KSZ8775_PORTn_PHY_CTRL8_CDT_EN 0x10
573 #define KSZ8775_PORTn_PHY_CTRL8_FORCE_LINK 0x08
574 #define KSZ8775_PORTn_PHY_CTRL8_PWRSAVE 0x04
575 #define KSZ8775_PORTn_PHY_CTRL8_REMOTE_LOOPBACK 0x02
576 #define KSZ8775_PORTn_PHY_CTRL8_VCT_FAULT_COUNT_MSB 0x01
579 #define KSZ8775_PORTn_LINKMD_VCT_FAULT_COUNT_LSB 0xFF
582 #define KSZ8775_PORTn_CTRL9_AN_DIS 0x80
583 #define KSZ8775_PORTn_CTRL9_FORCED_SPEED 0x40
584 #define KSZ8775_PORTn_CTRL9_FORCED_DUPLEX 0x20
587 #define KSZ8775_PORTn_CTRL10_LED_OFF 0x80
588 #define KSZ8775_PORTn_CTRL10_TX_DIS 0x40
589 #define KSZ8775_PORTn_CTRL10_RESTART_AN 0x20
590 #define KSZ8775_PORTn_CTRL10_POWER_DOWN 0x08
591 #define KSZ8775_PORTn_CTRL10_AUTO_MDIX_DIS 0x04
592 #define KSZ8775_PORTn_CTRL10_FORCED_MDI 0x02
593 #define KSZ8775_PORTn_CTRL10_MAC_LOOPBACK 0x01
596 #define KSZ8775_PORTn_STAT2_MDIX_STATUS 0x80
597 #define KSZ8775_PORTn_STAT2_AN_DONE 0x40
598 #define KSZ8775_PORTn_STAT2_LINK_GOOD 0x20
601 #define KSZ8775_PORTn_CTRL11_STAT3_PHY_LOOPBACK 0x80
602 #define KSZ8775_PORTn_CTRL11_STAT3_PHY_ISOLATE 0x20
603 #define KSZ8775_PORTn_CTRL11_STAT3_SOFT_RESET 0x10
604 #define KSZ8775_PORTn_CTRL11_STAT3_FORCE_LINK 0x08
605 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE 0x07
606 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE_AN 0x01
607 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE_10BT_HD 0x02
608 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE_100BTX_HD 0x03
609 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE_10BT_FD 0x05
610 #define KSZ8775_PORTn_CTRL11_STAT3_OP_MODE_100BTX_FD 0x06
613 #define KSZ8775_MAC_ADDR0_MACA_47_40 0xFF
616 #define KSZ8775_MAC_ADDR1_MACA_39_32 0xFF
619 #define KSZ8775_MAC_ADDR2_MACA_31_24 0xFF
622 #define KSZ8775_MAC_ADDR3_MACA_23_16 0xFF
625 #define KSZ8775_MAC_ADDR4_MACA_15_8 0xFF
628 #define KSZ8775_MAC_ADDR5_MACA_7_0 0xFF
631 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL 0xE0
632 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL_INDIRECT_MODE 0x00
633 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL_EEE 0x20
634 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL_ACL 0x40
635 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL_PME 0x80
636 #define KSZ8775_INDIRECT_CTRL0_FUNC_SEL_LINKMD 0xA0
637 #define KSZ8775_INDIRECT_CTRL0_WRITE 0x00
638 #define KSZ8775_INDIRECT_CTRL0_READ 0x10
639 #define KSZ8775_INDIRECT_CTRL0_TABLE_SEL 0x0C
640 #define KSZ8775_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC 0x00
641 #define KSZ8775_INDIRECT_CTRL0_TABLE_SEL_VLAN 0x04
642 #define KSZ8775_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC 0x08
643 #define KSZ8775_INDIRECT_CTRL0_TABLE_SEL_MIB_COUNTER 0x0C
644 #define KSZ8775_INDIRECT_CTRL0_ADDR_11_8 0x0F
645 #define KSZ8775_INDIRECT_CTRL0_ADDR_9_8 0x03
648 #define KSZ8775_INDIRECT_CTRL1_ADDR_7_0 0xFF
651 #define KSZ8775_INT_STAT_PME 0x10
652 #define KSZ8775_INT_STAT_PORT4 0x08
653 #define KSZ8775_INT_STAT_PORT3 0x04
654 #define KSZ8775_INT_STAT_PORT2 0x02
655 #define KSZ8775_INT_STAT_PORT1 0x01
658 #define KSZ8775_INT_MASK_PME 0x10
659 #define KSZ8775_INT_MASK_PORT4 0x08
660 #define KSZ8775_INT_MASK_PORT3 0x04
661 #define KSZ8775_INT_MASK_PORT2 0x02
662 #define KSZ8775_INT_MASK_PORT1 0x01
665 #define KSZ8775_ACL_INT_STAT_PORT5 0x10
666 #define KSZ8775_ACL_INT_STAT_PORT4 0x08
667 #define KSZ8775_ACL_INT_STAT_PORT3 0x04
668 #define KSZ8775_ACL_INT_STAT_PORT2 0x02
669 #define KSZ8775_ACL_INT_STAT_PORT1 0x01
672 #define KSZ8775_ACL_INT_CTRL_PORT5 0x10
673 #define KSZ8775_ACL_INT_CTRL_PORT4 0x08
674 #define KSZ8775_ACL_INT_CTRL_PORT3 0x04
675 #define KSZ8775_ACL_INT_CTRL_PORT2 0x02
676 #define KSZ8775_ACL_INT_CTRL_PORT1 0x01
679 #define KSZ8775_GLOBAL_CTRL12_TAG3 0xC0
680 #define KSZ8775_GLOBAL_CTRL12_TAG2 0x30
681 #define KSZ8775_GLOBAL_CTRL12_TAG1 0x0C
682 #define KSZ8775_GLOBAL_CTRL12_TAG0 0x03
685 #define KSZ8775_GLOBAL_CTRL13_TAG7 0xC0
686 #define KSZ8775_GLOBAL_CTRL13_TAG6 0x30
687 #define KSZ8775_GLOBAL_CTRL13_TAG5 0x0C
688 #define KSZ8775_GLOBAL_CTRL13_TAG4 0x03
691 #define KSZ8775_GLOBAL_CTRL14_PRI_2Q 0xC0
694 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD 0x20
695 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP 0x1F
696 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_FILT 0x00
697 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT1 0x01
698 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT2 0x02
699 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT3 0x04
700 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT4 0x08
701 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_PORT5 0x10
702 #define KSZ8775_GLOBAL_CTRL15_UNKNOWN_UNICAST_FWD_MAP_ALL 0x1F
705 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD 0x20
706 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP 0x1F
707 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_FILT 0x00
708 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT1 0x01
709 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT2 0x02
710 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT3 0x04
711 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT4 0x08
712 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT5 0x10
713 #define KSZ8775_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL 0x1F
716 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD 0x20
717 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP 0x1F
718 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_FILT 0x00
719 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT1 0x01
720 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT2 0x02
721 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT3 0x04
722 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT4 0x08
723 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_PORT5 0x10
724 #define KSZ8775_GLOBAL_CTRL17_UNKNOWN_VID_FWD_MAP_ALL 0x1F
727 #define KSZ8775_GLOBAL_CTRL18_SELF_ADDR_FILTER_EN 0x40
728 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD 0x20
729 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP 0x1F
730 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_FILT 0x00
731 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT1 0x01
732 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT2 0x02
733 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT3 0x04
734 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT4 0x08
735 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_PORT5 0x10
736 #define KSZ8775_GLOBAL_CTRL18_UNKNOWN_IP_MCAST_FWD_MAP_ALL 0x1F
739 #define KSZ8775_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD 0x30
740 #define KSZ8775_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_16MS 0x00
741 #define KSZ8775_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_64MS 0x10
742 #define KSZ8775_GLOBAL_CTRL19_IG_RATE_LIMIT_PERIOD_256MS 0x20
743 #define KSZ8775_GLOBAL_CTRL19_QUEUE_BASED_EG_RATE_LIMITE_EN 0x08
744 #define KSZ8775_GLOBAL_CTRL19_INSERT_SRC_PORT_PVID_TAG_EN 0x04
747 #define KSZ8775_TOS_PRIO_CTRL0_DSCP_7_6 0xC0
748 #define KSZ8775_TOS_PRIO_CTRL0_DSCP_5_4 0x30
749 #define KSZ8775_TOS_PRIO_CTRL0_DSCP_3_2 0x0C
750 #define KSZ8775_TOS_PRIO_CTRL0_DSCP_1_0 0x03
753 #define KSZ8775_TOS_PRIO_CTRL1_DSCP_15_14 0xC0
754 #define KSZ8775_TOS_PRIO_CTRL1_DSCP_13_12 0x30
755 #define KSZ8775_TOS_PRIO_CTRL1_DSCP_11_10 0x0C
756 #define KSZ8775_TOS_PRIO_CTRL1_DSCP_9_8 0x03
759 #define KSZ8775_TOS_PRIO_CTRL2_DSCP_23_22 0xC0
760 #define KSZ8775_TOS_PRIO_CTRL2_DSCP_21_20 0x30
761 #define KSZ8775_TOS_PRIO_CTRL2_DSCP_19_18 0x0C
762 #define KSZ8775_TOS_PRIO_CTRL2_DSCP_17_16 0x03
765 #define KSZ8775_TOS_PRIO_CTRL3_DSCP_31_30 0xC0
766 #define KSZ8775_TOS_PRIO_CTRL3_DSCP_29_28 0x30
767 #define KSZ8775_TOS_PRIO_CTRL3_DSCP_27_26 0x0C
768 #define KSZ8775_TOS_PRIO_CTRL3_DSCP_25_24 0x03
771 #define KSZ8775_TOS_PRIO_CTRL4_DSCP_39_38 0xC0
772 #define KSZ8775_TOS_PRIO_CTRL4_DSCP_37_36 0x30
773 #define KSZ8775_TOS_PRIO_CTRL4_DSCP_35_34 0x0C
774 #define KSZ8775_TOS_PRIO_CTRL4_DSCP_33_32 0x03
777 #define KSZ8775_TOS_PRIO_CTRL5_DSCP_47_46 0xC0
778 #define KSZ8775_TOS_PRIO_CTRL5_DSCP_45_44 0x30
779 #define KSZ8775_TOS_PRIO_CTRL5_DSCP_43_42 0x0C
780 #define KSZ8775_TOS_PRIO_CTRL5_DSCP_41_40 0x03
783 #define KSZ8775_TOS_PRIO_CTRL6_DSCP_55_54 0xC0
784 #define KSZ8775_TOS_PRIO_CTRL6_DSCP_53_52 0x30
785 #define KSZ8775_TOS_PRIO_CTRL6_DSCP_51_50 0x0C
786 #define KSZ8775_TOS_PRIO_CTRL6_DSCP_49_48 0x03
789 #define KSZ8775_TOS_PRIO_CTRL7_DSCP_63_62 0xC0
790 #define KSZ8775_TOS_PRIO_CTRL7_DSCP_61_60 0x30
791 #define KSZ8775_TOS_PRIO_CTRL7_DSCP_59_58 0x0C
792 #define KSZ8775_TOS_PRIO_CTRL7_DSCP_57_56 0x03
795 #define KSZ8775_TOS_PRIO_CTRL8_DSCP_71_70 0xC0
796 #define KSZ8775_TOS_PRIO_CTRL8_DSCP_69_68 0x30
797 #define KSZ8775_TOS_PRIO_CTRL8_DSCP_67_66 0x0C
798 #define KSZ8775_TOS_PRIO_CTRL8_DSCP_65_64 0x03
801 #define KSZ8775_TOS_PRIO_CTRL9_DSCP_79_78 0xC0
802 #define KSZ8775_TOS_PRIO_CTRL9_DSCP_77_76 0x30
803 #define KSZ8775_TOS_PRIO_CTRL9_DSCP_75_74 0x0C
804 #define KSZ8775_TOS_PRIO_CTRL9_DSCP_73_72 0x03
807 #define KSZ8775_TOS_PRIO_CTRL10_DSCP_87_86 0xC0
808 #define KSZ8775_TOS_PRIO_CTRL10_DSCP_85_84 0x30
809 #define KSZ8775_TOS_PRIO_CTRL10_DSCP_83_82 0x0C
810 #define KSZ8775_TOS_PRIO_CTRL10_DSCP_81_80 0x03
813 #define KSZ8775_TOS_PRIO_CTRL11_DSCP_95_94 0xC0
814 #define KSZ8775_TOS_PRIO_CTRL11_DSCP_93_92 0x30
815 #define KSZ8775_TOS_PRIO_CTRL11_DSCP_91_90 0x0C
816 #define KSZ8775_TOS_PRIO_CTRL11_DSCP_89_88 0x03
819 #define KSZ8775_TOS_PRIO_CTRL12_DSCP_103_102 0xC0
820 #define KSZ8775_TOS_PRIO_CTRL12_DSCP_101_100 0x30
821 #define KSZ8775_TOS_PRIO_CTRL12_DSCP_99_98 0x0C
822 #define KSZ8775_TOS_PRIO_CTRL12_DSCP_97_96 0x03
825 #define KSZ8775_TOS_PRIO_CTRL13_DSCP_111_110 0xC0
826 #define KSZ8775_TOS_PRIO_CTRL13_DSCP_109_108 0x30
827 #define KSZ8775_TOS_PRIO_CTRL13_DSCP_107_106 0x0C
828 #define KSZ8775_TOS_PRIO_CTRL13_DSCP_105_104 0x03
831 #define KSZ8775_TOS_PRIO_CTRL14_DSCP_119_118 0xC0
832 #define KSZ8775_TOS_PRIO_CTRL14_DSCP_117_116 0x30
833 #define KSZ8775_TOS_PRIO_CTRL14_DSCP_115_114 0x0C
834 #define KSZ8775_TOS_PRIO_CTRL14_DSCP_113_112 0x03
837 #define KSZ8775_TOS_PRIO_CTRL15_DSCP_127_126 0xC0
838 #define KSZ8775_TOS_PRIO_CTRL15_DSCP_125_124 0x30
839 #define KSZ8775_TOS_PRIO_CTRL15_DSCP_123_122 0x0C
840 #define KSZ8775_TOS_PRIO_CTRL15_DSCP_121_120 0x03
843 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH 0x70
844 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_2MA 0x00
845 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_4MA 0x10
846 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_8MA 0x20
847 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_12MA 0x30
848 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_16MA 0x40
849 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_20MA 0x50
850 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_24MA 0x60
851 #define KSZ8775_GLOBAL_CTRL20_HIGH_SPEED_DRIVE_STRENGTH_28MA 0x70
852 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH 0x07
853 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_2MA 0x00
854 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_4MA 0x01
855 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_8MA 0x02
856 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_12MA 0x03
857 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_16MA 0x04
858 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_20MA 0x05
859 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_24MA 0x06
860 #define KSZ8775_GLOBAL_CTRL20_LOW_SPEED_DRIVE_STRENGTH_28MA 0x07
863 #define KSZ8775_GLOBAL_CTRL21_MLD_SNOOP_OPT 0x08
864 #define KSZ8775_GLOBAL_CTRL21_MLD_SNOOP_EN 0x04
867 #define KSZ8775_PORTn_CTRL12_PASS_ALL_FRAMES 0x40
868 #define KSZ8775_PORTn_CTRL12_INSERT_SRC_PORT_PVID_H 0x08
869 #define KSZ8775_PORTn_CTRL12_INSERT_SRC_PORT_PVID_H2 0x04
870 #define KSZ8775_PORTn_CTRL12_INSERT_SRC_PORT_PVID_L2 0x02
871 #define KSZ8775_PORTn_CTRL12_INSERT_SRC_PORT_PVID_L 0x01
874 #define KSZ8775_PORTn_CTRL13_4_QUEUE_SPLIT_EN 0x02
875 #define KSZ8775_PORTn_CTRL13_DROPPING_TAG_EN 0x01
878 #define KSZ8775_PORTn_CTRL14_PORT_TX_QUEUE3_RATIO_EN 0x80
879 #define KSZ8775_PORTn_CTRL14_PORT_TX_QUEUE3_RATIO 0x7F
882 #define KSZ8775_PORTn_CTRL15_PORT_TX_QUEUE2_RATIO_EN 0x80
883 #define KSZ8775_PORTn_CTRL15_PORT_TX_QUEUE2_RATIO 0x7F
886 #define KSZ8775_PORTn_CTRL16_PORT_TX_QUEUE1_RATIO_EN 0x80
887 #define KSZ8775_PORTn_CTRL16_PORT_TX_QUEUE1_RATIO 0x7F
890 #define KSZ8775_PORTn_CTRL17_PORT_TX_QUEUE0_RATIO_EN 0x80
891 #define KSZ8775_PORTn_CTRL17_PORT_TX_QUEUE0_RATIO 0x7F
894 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_IG_LIMIT_PORT_PRIO_SEL 0x40
895 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_IG_LIMIT_BIT_PKT_MODE_SEL 0x20
896 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_IG_RATE_LIMIT_FLOW_CTRL_EN 0x10
897 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_LIMIT_MODE 0x0C
898 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_COUNT_IFG 0x02
899 #define KSZ8775_PORTn_RATE_LIMIT_CTRL_COUNT_PRE 0x01
907 #if defined(__CCRX__)
909 #elif defined(__CWCC__) || defined(_WIN32)
910 #pragma pack(push, 1)
920 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
924 uint8_t override : 1;
926 uint8_t forwardPorts : 5;
946 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
948 uint8_t override : 1;
950 uint8_t forwardPorts : 5;
967 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
968 uint8_t macEmpty : 1;
969 uint8_t numValidEntriesH : 7;
970 uint8_t numValidEntriesL : 3;
971 uint8_t timestamp : 2;
972 uint8_t sourcePort : 3;
973 uint8_t dataNotReady : 1;
994 #if defined(_CPU_BIG_ENDIAN) && !defined(__IAR_SYSTEMS_ICC__)
995 uint8_t reserved3 : 3;
996 uint8_t entry3Valid : 1;
997 uint8_t entry3MembershipH : 4;
998 uint8_t entry3MembershipL : 1;
999 uint8_t entry3Fid : 7;
1001 uint8_t entry2Valid : 1;
1002 uint8_t entry2MembershipH : 4;
1003 uint8_t entry2MembershipL : 1;
1004 uint8_t entry2Fid : 7;
1006 uint8_t entry1Valid : 1;
1007 uint8_t entry1MembershipH : 4;
1008 uint8_t entry1MembershipL : 1;
1009 uint8_t entry1Fid : 7;
1010 uint8_t reserved0 : 3;
1011 uint8_t entry0Valid : 1;
1012 uint8_t entry0MembershipH : 4;
1013 uint8_t entry0MembershipL : 1;
1014 uint8_t entry0Fid : 7;
1041 #if defined(__CCRX__)
1043 #elif defined(__CWCC__) || defined(_WIN32)
1099 bool_t enable, uint32_t forwardPorts);
uint8_t entry3MembershipH
void ksz8775EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Structure describing a buffer that spans multiple chunks.
uint8_t entry3MembershipL
void ksz8775EnableIrq(NetInterface *interface)
Enable interrupts.
NicDuplexMode ksz8775GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
uint8_t entry2MembershipL
void ksz8775FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
const SwitchDriver ksz8775SwitchDriver
KSZ8775 Ethernet switch driver.
void ksz8775WriteSwitchReg(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register.
void ksz8775FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
error_t ksz8775UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
void ksz8775EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
uint16_t ksz8775ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
void ksz8775InitHook(NetInterface *interface)
KSZ8775 custom configuration.
error_t ksz8775GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
error_t ksz8775WriteVlanEntry(NetInterface *interface, const SwitchVlanEntry *entry)
Write VLAN entry.
void ksz8775SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
SwitchPortState
Switch port state.
bool_t ksz8775GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
uint8_t entry0MembershipL
uint8_t entry1MembershipL
void ksz8775SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
void ksz8775SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
error_t ksz8775GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
void ksz8775DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
error_t ksz8775Init(NetInterface *interface)
KSZ8775 Ethernet switch initialization.
void ksz8775EventHandler(NetInterface *interface)
KSZ8775 event handler.
uint8_t entry2MembershipH
Static MAC table entry (read operation)
uint8_t ksz8775ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch register.
NicDuplexMode
Duplex mode.
Network interface controller abstraction layer.
Static MAC table entry (write operation)
void ksz8775Tick(NetInterface *interface)
KSZ8775 timer handler.
void ksz8775DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
error_t ksz8775TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
uint8_t entry1MembershipH
void ksz8775WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
void ksz8775EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
void ksz8775DisableIrq(NetInterface *interface)
Disable interrupts.
uint32_t ksz8775GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
SwitchPortState ksz8775GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Forwarding database entry.
uint8_t entry0MembershipH
error_t ksz8775DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
error_t ksz8775AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.