31#ifndef _LAN9354_DRIVER_H
32#define _LAN9354_DRIVER_H
38#define LAN9354_PORT0 3
39#define LAN9354_PORT1 1
40#define LAN9354_PORT2 2
43#define LAN9354_PORT_MASK 0x07
44#define LAN9354_PORT0_MASK 0x04
45#define LAN9354_PORT1_MASK 0x01
46#define LAN9354_PORT2_MASK 0x02
47#define LAN9354_PORT0_1_MASK 0x05
48#define LAN9354_PORT0_2_MASK 0x06
49#define LAN9354_PORT1_2_MASK 0x03
50#define LAN9354_PORT0_1_2_MASK 0x07
53#define LAN9354_ALR_TABLE_SIZE 512
56#define LAN9354_VID_VLAN_RULES 0x0040
57#define LAN9354_VID_CALC_PRIORITY 0x0020
58#define LAN9354_VID_STP_OVERRIDE 0x0010
59#define LAN9354_VID_ALR_LOOKUP 0x0008
60#define LAN9354_VID_BROADCAST 0x0003
61#define LAN9354_VID_DEST_PORT2 0x0002
62#define LAN9354_VID_DEST_PORT1 0x0001
63#define LAN9354_VID_DEST_PORT0 0x0000
66#define LAN9354_VID_PRIORITY 0x0380
67#define LAN9354_VID_PRIORITY_EN 0x0040
68#define LAN9354_VID_STATIC 0x0020
69#define LAN9354_VID_STP_OVERRIDE 0x0010
70#define LAN9354_VID_IGMP_PACKET 0x0008
71#define LAN9354_VID_SRC_PORT 0x0003
74#define LAN9354_BMCR 0x00
75#define LAN9354_BMSR 0x01
76#define LAN9354_PHYID1 0x02
77#define LAN9354_PHYID2 0x03
78#define LAN9354_ANAR 0x04
79#define LAN9354_ANLPAR 0x05
80#define LAN9354_ANER 0x06
81#define LAN9354_PMCSR 0x11
82#define LAN9354_PSMR 0x12
83#define LAN9354_PSCSIR 0x1B
84#define LAN9354_PISR 0x1D
85#define LAN9354_PIMR 0x1E
86#define LAN9354_PSCSR 0x1F
89#define LAN9354_ID_REV 0x0050
90#define LAN9354_IRQ_CFG 0x0054
91#define LAN9354_INT_STS 0x0058
92#define LAN9354_INT_EN 0x005C
93#define LAN9354_BYTE_TEST 0x0064
94#define LAN9354_HW_CFG 0x0074
95#define LAN9354_PMT_CTRL 0x0084
96#define LAN9354_GPT_CFG 0x008C
97#define LAN9354_GPT_CNT 0x0090
98#define LAN9354_FREE_RUN 0x009C
99#define LAN9354_PMI_DATA 0x00A4
100#define LAN9354_PMI_ACCESS 0x00A8
101#define LAN9354_1588_CMD_CTL 0x0100
102#define LAN9354_1588_GENERAL_CONFIG 0x0104
103#define LAN9354_1588_INT_STS 0x0108
104#define LAN9354_1588_INT_EN 0x010C
105#define LAN9354_1588_CLOCK_SEC 0x0110
106#define LAN9354_1588_CLOCK_NS 0x0114
107#define LAN9354_1588_CLOCK_SUBNS 0x0118
108#define LAN9354_1588_CLOCK_RATE_ADJ 0x011C
109#define LAN9354_1588_CLOCK_TEMP_RATE_ADJ 0x0120
110#define LAN9354_1588_CLOCK_TEMP_RATE_DURATION 0x0124
111#define LAN9354_1588_CLOCK_STEP_ADJ 0x0128
112#define LAN9354_1588_CLOCK_TARGET_SEC_A 0x012C
113#define LAN9354_1588_CLOCK_TARGET_NS_A 0x0130
114#define LAN9354_1588_CLOCK_TARGET_RELOAD_SEC_A 0x0134
115#define LAN9354_1588_CLOCK_TARGET_RELOAD_NS_A 0x0138
116#define LAN9354_1588_CLOCK_TARGET_SEC_B 0x013C
117#define LAN9354_1588_CLOCK_TARGET_NS_B 0x0140
118#define LAN9354_1588_CLOCK_TARGET_RELOAD_SEC_B 0x0144
119#define LAN9354_1588_CLOCK_TARGET_RELOAD_NS_B 0x0148
120#define LAN9354_1588_USER_MAC_HI 0x014C
121#define LAN9354_1588_USER_MAC_LO 0x0150
122#define LAN9354_1588_BANK_PORT_GPIO_SEL 0x0154
123#define LAN9354_1588_LATENCY 0x0158
124#define LAN9354_1588_RX_PARSE_CONFIG 0x0158
125#define LAN9354_1588_TX_PARSE_CONFIG 0x0158
126#define LAN9354_1588_ASYM_PEERDLY 0x015C
127#define LAN9354_1588_RX_TIMESTAMP_CONFIG 0x015C
128#define LAN9354_1588_TX_TIMESTAMP_CONFIG 0x015C
129#define LAN9354_1588_GPIO_CAP_CONFIG 0x015C
130#define LAN9354_1588_CAP_INFO 0x0160
131#define LAN9354_1588_RX_TS_INSERT_CONFIG 0x0160
132#define LAN9354_1588_RX_CF_MOD 0x0164
133#define LAN9354_1588_TX_MOD 0x0164
134#define LAN9354_1588_RX_FILTER_CONFIG 0x0168
135#define LAN9354_1588_TX_MOD2 0x0168
136#define LAN9354_1588_RX_INGRESS_SEC 0x016C
137#define LAN9354_1588_TX_EGRESS_SEC 0x016C
138#define LAN9354_1588_GPIO_RE_CLOCK_SEC_CAP 0x016C
139#define LAN9354_1588_RX_INGRESS_NS 0x0170
140#define LAN9354_1588_TX_EGRESS_NS 0x0170
141#define LAN9354_1588_GPIO_RE_CLOCK_NS_CAP 0x0170
142#define LAN9354_1588_RX_MSG_HEADER 0x0174
143#define LAN9354_1588_TX_MSG_HEADER 0x0174
144#define LAN9354_1588_RX_PDREQ_SEC 0x0178
145#define LAN9354_1588_TX_DREQ_SEC 0x0178
146#define LAN9354_1588_GPIO_FE_CLOCK_SEC_CAP 0x0178
147#define LAN9354_1588_RX_PDREQ_NS 0x017C
148#define LAN9354_1588_TX_DREQ_NS 0x017C
149#define LAN9354_1588_GPIO_FE_CLOCK_NS_CAP 0x017C
150#define LAN9354_1588_RX_PDREQ_CF_HI 0x0180
151#define LAN9354_1588_TX_ONE_STEP_SYNC_SEC 0x0180
152#define LAN9354_1588_RX_PDREQ_CF_LOW 0x0184
153#define LAN9354_1588_RX_CHKSUM_DROPPED_CNT 0x0188
154#define LAN9354_1588_RX_FILTERED_CNT 0x018C
155#define LAN9354_MANUAL_FC_1 0x01A0
156#define LAN9354_MANUAL_FC_2 0x01A4
157#define LAN9354_MANUAL_FC_0 0x01A8
158#define LAN9354_SWITCH_CSR_DATA 0x01AC
159#define LAN9354_SWITCH_CSR_CMD 0x01B0
160#define LAN9354_E2P_CMD 0x01B4
161#define LAN9354_E2P_DATA 0x01B8
162#define LAN9354_LED_CFG 0x01BC
163#define LAN9354_VPHY_BASIC_CTRL 0x01C0
164#define LAN9354_VPHY_BASIC_STATUS 0x01C4
165#define LAN9354_VPHY_ID_MSB 0x01C8
166#define LAN9354_VPHY_ID_LSB 0x01CC
167#define LAN9354_VPHY_AN_ADV 0x01D0
168#define LAN9354_VPHY_AN_LP_BASE_ABILITY 0x01D4
169#define LAN9354_VPHY_AN_EXP 0x01D8
170#define LAN9354_VPHY_SPECIAL_CTRL_STATUS 0x01DC
171#define LAN9354_GPIO_CFG 0x01E0
172#define LAN9354_GPIO_DATA_DIR 0x01E4
173#define LAN9354_GPIO_INT_STS_EN 0x01E8
174#define LAN9354_SWITCH_MAC_ADDRH 0x01F0
175#define LAN9354_SWITCH_MAC_ADDRL 0x01F4
176#define LAN9354_RESET_CTL 0x01F8
177#define LAN9354_SWITCH_CSR_DIRECT_DATA 0x0200
180#define LAN9354_SW_DEV_ID 0x0000
181#define LAN9354_SW_RESET 0x0001
182#define LAN9354_SW_IMR 0x0004
183#define LAN9354_SW_IPR 0x0005
184#define LAN9354_MAC_VER_ID_0 0x0400
185#define LAN9354_MAC_RX_CFG_0 0x0401
186#define LAN9354_MAC_RX_UNDSZE_CNT_0 0x0410
187#define LAN9354_MAC_RX_64_CNT_0 0x0411
188#define LAN9354_MAC_RX_65_TO_127_CNT_0 0x0412
189#define LAN9354_MAC_RX_128_TO_255_CNT_0 0x0413
190#define LAN9354_MAC_RX_256_TO_511_CNT_0 0x0414
191#define LAN9354_MAC_RX_512_TO_1023_CNT_0 0x0415
192#define LAN9354_MAC_RX_1024_TO_MAX_CNT_0 0x0416
193#define LAN9354_MAC_RX_OVRSZE_CNT_0 0x0417
194#define LAN9354_MAC_RX_PKTOK_CNT_0 0x0418
195#define LAN9354_MAC_RX_CRCERR_CNT_0 0x0419
196#define LAN9354_MAC_RX_MULCST_CNT_0 0x041A
197#define LAN9354_MAC_RX_BRDCST_CNT_0 0x041B
198#define LAN9354_MAC_RX_PAUSE_CNT_0 0x041C
199#define LAN9354_MAC_RX_FRAG_CNT_0 0x041D
200#define LAN9354_MAC_RX_JABB_CNT_0 0x041E
201#define LAN9354_MAC_RX_ALIGN_CNT_0 0x041F
202#define LAN9354_MAC_RX_PKTLEN_CNT_0 0x0420
203#define LAN9354_MAC_RX_GOODPKTLEN_CNT_0 0x0421
204#define LAN9354_MAC_RX_SYMBOL_CNT_0 0x0422
205#define LAN9354_MAC_RX_CTLFRM_CNT_0 0x0423
206#define LAN9354_MAC_TX_CFG_0 0x0440
207#define LAN9354_MAC_TX_FC_SETTINGS_0 0x0441
208#define LAN9354_MAC_TX_DEFER_CNT_0 0x0451
209#define LAN9354_MAC_TX_PAUSE_CNT_0 0x0452
210#define LAN9354_MAC_TX_PKTOK_CNT_0 0x0453
211#define LAN9354_MAC_TX_64_CNT_0 0x0454
212#define LAN9354_MAC_TX_65_TO_127_CNT_0 0x0455
213#define LAN9354_MAC_TX_128_TO_255_CNT_0 0x0456
214#define LAN9354_MAC_TX_256_TO_511_CNT_0 0x0457
215#define LAN9354_MAC_TX_512_TO_1023_CNT_0 0x0458
216#define LAN9354_MAC_TX_1024_TO_MAX_CNT_0 0x0459
217#define LAN9354_MAC_TX_UNDSZE_CNT_0 0x045A
218#define LAN9354_MAC_TX_PKTLEN_CNT_0 0x045C
219#define LAN9354_MAC_TX_BRDCST_CNT_0 0x045D
220#define LAN9354_MAC_TX_MULCST_CNT_0 0x045E
221#define LAN9354_MAC_TX_LATECOL_CNT_0 0x045F
222#define LAN9354_MAC_TX_EXCCOL_CNT_0 0x0460
223#define LAN9354_MAC_TX_SNGLECOL_CNT_0 0x0461
224#define LAN9354_MAC_TX_MULTICOL_CNT_0 0x0462
225#define LAN9354_MAC_TX_TOTALCOL_CNT_0 0x0463
226#define LAN9354_MAC_IMR_0 0x0480
227#define LAN9354_MAC_IPR_0 0x0481
228#define LAN9354_MAC_VER_ID_1 0x0800
229#define LAN9354_MAC_RX_CFG_1 0x0801
230#define LAN9354_MAC_RX_UNDSZE_CNT_1 0x0810
231#define LAN9354_MAC_RX_64_CNT_1 0x0811
232#define LAN9354_MAC_RX_65_TO_127_CNT_1 0x0812
233#define LAN9354_MAC_RX_128_TO_255_CNT_1 0x0813
234#define LAN9354_MAC_RX_256_TO_511_CNT_1 0x0814
235#define LAN9354_MAC_RX_512_TO_1023_CNT_1 0x0815
236#define LAN9354_MAC_RX_1024_TO_MAX_CNT_1 0x0816
237#define LAN9354_MAC_RX_OVRSZE_CNT_1 0x0817
238#define LAN9354_MAC_RX_PKTOK_CNT_1 0x0818
239#define LAN9354_MAC_RX_CRCERR_CNT_1 0x0819
240#define LAN9354_MAC_RX_MULCST_CNT_1 0x081A
241#define LAN9354_MAC_RX_BRDCST_CNT_1 0x081B
242#define LAN9354_MAC_RX_PAUSE_CNT_1 0x081C
243#define LAN9354_MAC_RX_FRAG_CNT_1 0x081D
244#define LAN9354_MAC_RX_JABB_CNT_1 0x081E
245#define LAN9354_MAC_RX_ALIGN_CNT_1 0x081F
246#define LAN9354_MAC_RX_PKTLEN_CNT_1 0x0820
247#define LAN9354_MAC_RX_GOODPKTLEN_CNT_1 0x0821
248#define LAN9354_MAC_RX_SYMBOL_CNT_1 0x0822
249#define LAN9354_MAC_RX_CTLFRM_CNT_1 0x0823
250#define LAN9354_RX_LPI_TRANSITION_1 0x0824
251#define LAN9354_RX_LPI_TIME_1 0x0825
252#define LAN9354_MAC_TX_CFG_1 0x0840
253#define LAN9354_MAC_TX_FC_SETTINGS_1 0x0841
254#define LAN9354_EEE_TW_TX_SYS_1 0x0842
255#define LAN9354_EEE_TX_LPI_REQ_DELAY_1 0x0843
256#define LAN9354_MAC_TX_DEFER_CNT_1 0x0851
257#define LAN9354_MAC_TX_PAUSE_CNT_1 0x0852
258#define LAN9354_MAC_TX_PKTOK_CNT_1 0x0853
259#define LAN9354_MAC_TX_64_CNT_1 0x0854
260#define LAN9354_MAC_TX_65_TO_127_CNT_1 0x0855
261#define LAN9354_MAC_TX_128_TO_255_CNT_1 0x0856
262#define LAN9354_MAC_TX_256_TO_511_CNT_1 0x0857
263#define LAN9354_MAC_TX_512_TO_1023_CNT_1 0x0858
264#define LAN9354_MAC_TX_1024_TO_MAX_CNT_1 0x0859
265#define LAN9354_MAC_TX_UNDSZE_CNT_1 0x085A
266#define LAN9354_MAC_TX_PKTLEN_CNT_1 0x085C
267#define LAN9354_MAC_TX_BRDCST_CNT_1 0x085D
268#define LAN9354_MAC_TX_MULCST_CNT_1 0x085E
269#define LAN9354_MAC_TX_LATECOL_CNT_1 0x085F
270#define LAN9354_MAC_TX_EXCCOL_CNT_1 0x0860
271#define LAN9354_MAC_TX_SNGLECOL_CNT_1 0x0861
272#define LAN9354_MAC_TX_MULTICOL_CNT_1 0x0862
273#define LAN9354_MAC_TX_TOTALCOL_CNT_1 0x0863
274#define LAN9354_TX_LPI_TRANSITION_1 0x0864
275#define LAN9354_TX_LPI_TIME_1 0x0865
276#define LAN9354_MAC_IMR_1 0x0880
277#define LAN9354_MAC_IPR_1 0x0881
278#define LAN9354_MAC_VER_ID_2 0x0C00
279#define LAN9354_MAC_RX_CFG_2 0x0C01
280#define LAN9354_MAC_RX_UNDSZE_CNT_2 0x0C10
281#define LAN9354_MAC_RX_64_CNT_2 0x0C11
282#define LAN9354_MAC_RX_65_TO_127_CNT_2 0x0C12
283#define LAN9354_MAC_RX_128_TO_255_CNT_2 0x0C13
284#define LAN9354_MAC_RX_256_TO_511_CNT_2 0x0C14
285#define LAN9354_MAC_RX_512_TO_1023_CNT_2 0x0C15
286#define LAN9354_MAC_RX_1024_TO_MAX_CNT_2 0x0C16
287#define LAN9354_MAC_RX_OVRSZE_CNT_2 0x0C17
288#define LAN9354_MAC_RX_PKTOK_CNT_2 0x0C18
289#define LAN9354_MAC_RX_CRCERR_CNT_2 0x0C19
290#define LAN9354_MAC_RX_MULCST_CNT_2 0x0C1A
291#define LAN9354_MAC_RX_BRDCST_CNT_2 0x0C1B
292#define LAN9354_MAC_RX_PAUSE_CNT_2 0x0C1C
293#define LAN9354_MAC_RX_FRAG_CNT_2 0x0C1D
294#define LAN9354_MAC_RX_JABB_CNT_2 0x0C1E
295#define LAN9354_MAC_RX_ALIGN_CNT_2 0x0C1F
296#define LAN9354_MAC_RX_PKTLEN_CNT_2 0x0C20
297#define LAN9354_MAC_RX_GOODPKTLEN_CNT_2 0x0C21
298#define LAN9354_MAC_RX_SYMBOL_CNT_2 0x0C22
299#define LAN9354_MAC_RX_CTLFRM_CNT_2 0x0C23
300#define LAN9354_RX_LPI_TRANSITION_2 0x0C24
301#define LAN9354_RX_LPI_TIME_2 0x0C25
302#define LAN9354_MAC_TX_CFG_2 0x0C40
303#define LAN9354_MAC_TX_FC_SETTINGS_2 0x0C41
304#define LAN9354_EEE_TW_TX_SYS_2 0x0C42
305#define LAN9354_EEE_TX_LPI_REQ_DELAY_2 0x0C43
306#define LAN9354_MAC_TX_DEFER_CNT_2 0x0C51
307#define LAN9354_MAC_TX_PAUSE_CNT_2 0x0C52
308#define LAN9354_MAC_TX_PKTOK_CNT_2 0x0C53
309#define LAN9354_MAC_TX_64_CNT_2 0x0C54
310#define LAN9354_MAC_TX_65_TO_127_CNT_2 0x0C55
311#define LAN9354_MAC_TX_128_TO_255_CNT_2 0x0C56
312#define LAN9354_MAC_TX_256_TO_511_CNT_2 0x0C57
313#define LAN9354_MAC_TX_512_TO_1023_CNT_2 0x0C58
314#define LAN9354_MAC_TX_1024_TO_MAX_CNT_2 0x0C59
315#define LAN9354_MAC_TX_UNDSZE_CNT_2 0x0C5A
316#define LAN9354_MAC_TX_PKTLEN_CNT_2 0x0C5C
317#define LAN9354_MAC_TX_BRDCST_CNT_2 0x0C5D
318#define LAN9354_MAC_TX_MULCST_CNT_2 0x0C5E
319#define LAN9354_MAC_TX_LATECOL_CNT_2 0x0C5F
320#define LAN9354_MAC_TX_EXCCOL_CNT_2 0x0C60
321#define LAN9354_MAC_TX_SNGLECOL_CNT_2 0x0C61
322#define LAN9354_MAC_TX_MULTICOL_CNT_2 0x0C62
323#define LAN9354_MAC_TX_TOTALCOL_CNT_2 0x0C63
324#define LAN9354_TX_LPI_TRANSITION_2 0x0C64
325#define LAN9354_TX_LPI_TIME_2 0x0C65
326#define LAN9354_MAC_IMR_2 0x0C80
327#define LAN9354_MAC_IPR_2 0x0C81
328#define LAN9354_SWE_ALR_CMD 0x1800
329#define LAN9354_SWE_ALR_WR_DAT_0 0x1801
330#define LAN9354_SWE_ALR_WR_DAT_1 0x1802
331#define LAN9354_SWE_ALR_RD_DAT_0 0x1805
332#define LAN9354_SWE_ALR_RD_DAT_1 0x1806
333#define LAN9354_SWE_ALR_CMD_STS 0x1808
334#define LAN9354_SWE_ALR_CFG 0x1809
335#define LAN9354_SWE_ALR_OVERRIDE 0x180A
336#define LAN9354_SWE_VLAN_CMD 0x180B
337#define LAN9354_SWE_VLAN_WR_DATA 0x180C
338#define LAN9354_SWE_VLAN_RD_DATA 0x180E
339#define LAN9354_SWE_VLAN_CMD_STS 0x1810
340#define LAN9354_SWE_DIFFSERV_TBL_CFG 0x1811
341#define LAN9354_SWE_DIFFSERV_TBL_WR_DATA 0x1812
342#define LAN9354_SWE_DIFFSERV_TBL_RD_DATA 0x1813
343#define LAN9354_SWE_DIFFSERV_TBL_CMD_STS 0x1814
344#define LAN9354_SWE_GLOBAL_INGRSS_CFG 0x1840
345#define LAN9354_SWE_PORT_INGRSS_CFG 0x1841
346#define LAN9354_SWE_ADMT_ONLY_VLAN 0x1842
347#define LAN9354_SWE_PORT_STATE 0x1843
348#define LAN9354_SWE_PRI_TO_QUE 0x1845
349#define LAN9354_SWE_PORT_MIRROR 0x1846
350#define LAN9354_SWE_INGRSS_PORT_TYP 0x1847
351#define LAN9354_SWE_BCST_THROT 0x1848
352#define LAN9354_SWE_ADMT_N_MEMBER 0x1849
353#define LAN9354_SWE_INGRSS_RATE_CFG 0x184A
354#define LAN9354_SWE_INGRSS_RATE_CMD 0x184B
355#define LAN9354_SWE_INGRSS_RATE_CMD_STS 0x184C
356#define LAN9354_SWE_INGRSS_RATE_WR_DATA 0x184D
357#define LAN9354_SWE_INGRSS_RATE_RD_DATA 0x184E
358#define LAN9354_SWE_FILTERED_CNT_0 0x1850
359#define LAN9354_SWE_FILTERED_CNT_1 0x1851
360#define LAN9354_SWE_FILTERED_CNT_2 0x1852
361#define LAN9354_SWE_INGRSS_REGEN_TBL_0 0x1855
362#define LAN9354_SWE_INGRSS_REGEN_TBL_1 0x1856
363#define LAN9354_SWE_INGRSS_REGEN_TBL_2 0x1857
364#define LAN9354_SWE_LRN_DISCRD_CNT_0 0x1858
365#define LAN9354_SWE_LRN_DISCRD_CNT_1 0x1859
366#define LAN9354_SWE_LRN_DISCRD_CNT_2 0x185A
367#define LAN9354_SWE_IMR 0x1880
368#define LAN9354_SWE_IPR 0x1881
369#define LAN9354_BM_CFG 0x1C00
370#define LAN9354_BM_DROP_LVL 0x1C01
371#define LAN9354_BM_FC_PAUSE_LVL 0x1C02
372#define LAN9354_BM_FC_RESUME_LVL 0x1C03
373#define LAN9354_BM_BCST_LVL 0x1C04
374#define LAN9354_BM_DRP_CNT_SRC_0 0x1C05
375#define LAN9354_BM_DRP_CNT_SRC_1 0x1C06
376#define LAN9354_BM_DRP_CNT_SRC_2 0x1C07
377#define LAN9354_BM_RST_STS 0x1C08
378#define LAN9354_BM_RNDM_DSCRD_TBL_CMD 0x1C09
379#define LAN9354_BM_RNDM_DSCRD_TBL_WDATA 0x1C0A
380#define LAN9354_BM_RNDM_DSCRD_TBL_RDATA 0x1C0B
381#define LAN9354_BM_EGRSS_PORT_TYPE 0x1C0C
382#define LAN9354_BM_EGRSS_RATE_00_01 0x1C0D
383#define LAN9354_BM_EGRSS_RATE_02_03 0x1C0E
384#define LAN9354_BM_EGRSS_RATE_10_11 0x1C0F
385#define LAN9354_BM_EGRSS_RATE_12_13 0x1C10
386#define LAN9354_BM_EGRSS_RATE_20_21 0x1C11
387#define LAN9354_BM_EGRSS_RATE_22_23 0x1C12
388#define LAN9354_BM_VLAN_0 0x1C13
389#define LAN9354_BM_VLAN_1 0x1C14
390#define LAN9354_BM_VLAN_2 0x1C15
391#define LAN9354_BM_RATE_DRP_CNT_SRC_0 0x1C16
392#define LAN9354_BM_RATE_DRP_CNT_SRC_1 0x1C17
393#define LAN9354_BM_RATE_DRP_CNT_SRC_2 0x1C18
394#define LAN9354_BM_IMR 0x1C20
395#define LAN9354_BM_IPR 0x1C21
398#define LAN9354_MAC_VER_ID(port) (0x0400 + ((port) * 0x0400))
399#define LAN9354_MAC_RX_CFG(port) (0x0401 + ((port) * 0x0400))
400#define LAN9354_MAC_RX_UNDSZE_CNT(port) (0x0410 + ((port) * 0x0400))
401#define LAN9354_MAC_RX_64_CNT(port) (0x0411 + ((port) * 0x0400))
402#define LAN9354_MAC_RX_65_TO_127_CNT(port) (0x0412 + ((port) * 0x0400))
403#define LAN9354_MAC_RX_128_TO_255_CNT(port) (0x0413 + ((port) * 0x0400))
404#define LAN9354_MAC_RX_256_TO_511_CNT(port) (0x0414 + ((port) * 0x0400))
405#define LAN9354_MAC_RX_512_TO_1023_CNT(port) (0x0415 + ((port) * 0x0400))
406#define LAN9354_MAC_RX_1024_TO_MAX_CNT(port) (0x0416 + ((port) * 0x0400))
407#define LAN9354_MAC_RX_OVRSZE_CNT(port) (0x0417 + ((port) * 0x0400))
408#define LAN9354_MAC_RX_PKTOK_CNT(port) (0x0418 + ((port) * 0x0400))
409#define LAN9354_MAC_RX_CRCERR_CNT(port) (0x0419 + ((port) * 0x0400))
410#define LAN9354_MAC_RX_MULCST_CNT(port) (0x041A + ((port) * 0x0400))
411#define LAN9354_MAC_RX_BRDCST_CNT(port) (0x041B + ((port) * 0x0400))
412#define LAN9354_MAC_RX_PAUSE_CNT(port) (0x041C + ((port) * 0x0400))
413#define LAN9354_MAC_RX_FRAG_CNT(port) (0x041D + ((port) * 0x0400))
414#define LAN9354_MAC_RX_JABB_CNT(port) (0x041E + ((port) * 0x0400))
415#define LAN9354_MAC_RX_ALIGN_CNT(port) (0x041F + ((port) * 0x0400))
416#define LAN9354_MAC_RX_PKTLEN_CNT(port) (0x0420 + ((port) * 0x0400))
417#define LAN9354_MAC_RX_GOODPKTLEN_CNT(port) (0x0421 + ((port) * 0x0400))
418#define LAN9354_MAC_RX_SYMBOL_CNT(port) (0x0422 + ((port) * 0x0400))
419#define LAN9354_MAC_RX_CTLFRM_CNT(port) (0x0423 + ((port) * 0x0400))
420#define LAN9354_RX_LPI_TRANSITION(port) (0x0424 + ((port) * 0x0400))
421#define LAN9354_RX_LPI_TIME(port) (0x0425 + ((port) * 0x0400))
422#define LAN9354_MAC_TX_CFG(port) (0x0440 + ((port) * 0x0400))
423#define LAN9354_MAC_TX_FC_SETTINGS(port) (0x0441 + ((port) * 0x0400))
424#define LAN9354_EEE_TW_TX_SYS(port) (0x0442 + ((port) * 0x0400))
425#define LAN9354_EEE_TX_LPI_REQ_DELAY(port) (0x0443 + ((port) * 0x0400))
426#define LAN9354_MAC_TX_DEFER_CNT(port) (0x0451 + ((port) * 0x0400))
427#define LAN9354_MAC_TX_PAUSE_CNT(port) (0x0452 + ((port) * 0x0400))
428#define LAN9354_MAC_TX_PKTOK_CNT(port) (0x0453 + ((port) * 0x0400))
429#define LAN9354_MAC_TX_64_CNT(port) (0x0454 + ((port) * 0x0400))
430#define LAN9354_MAC_TX_65_TO_127_CNT(port) (0x0455 + ((port) * 0x0400))
431#define LAN9354_MAC_TX_128_TO_255_CNT(port) (0x0456 + ((port) * 0x0400))
432#define LAN9354_MAC_TX_256_TO_511_CNT(port) (0x0457 + ((port) * 0x0400))
433#define LAN9354_MAC_TX_512_TO_1023_CNT(port) (0x0458 + ((port) * 0x0400))
434#define LAN9354_MAC_TX_1024_TO_MAX_CNT(port) (0x0459 + ((port) * 0x0400))
435#define LAN9354_MAC_TX_UNDSZE_CNT(port) (0x045A + ((port) * 0x0400))
436#define LAN9354_MAC_TX_PKTLEN_CNT(port) (0x045C + ((port) * 0x0400))
437#define LAN9354_MAC_TX_BRDCST_CNT(port) (0x045D + ((port) * 0x0400))
438#define LAN9354_MAC_TX_MULCST_CNT(port) (0x045E + ((port) * 0x0400))
439#define LAN9354_MAC_TX_LATECOL_CNT(port) (0x045F + ((port) * 0x0400))
440#define LAN9354_MAC_TX_EXCCOL_CNT(port) (0x0460 + ((port) * 0x0400))
441#define LAN9354_MAC_TX_SNGLECOL_CNT(port) (0x0461 + ((port) * 0x0400))
442#define LAN9354_MAC_TX_MULTICOL_CNT(port) (0x0462 + ((port) * 0x0400))
443#define LAN9354_MAC_TX_TOTALCOL_CNT(port) (0x0463 + ((port) * 0x0400))
444#define LAN9354_TX_LPI_TRANSITION(port) (0x0464 + ((port) * 0x0400))
445#define LAN9354_TX_LPI_TIME(port) (0x0465 + ((port) * 0x0400))
446#define LAN9354_MAC_IMR(port) (0x0480 + ((port) * 0x0400))
447#define LAN9354_MAC_IPR(port) (0x0481 + ((port) * 0x0400))
450#define LAN9354_BMCR_RESET 0x8000
451#define LAN9354_BMCR_LOOPBACK 0x4000
452#define LAN9354_BMCR_SPEED_SEL 0x2000
453#define LAN9354_BMCR_AN_EN 0x1000
454#define LAN9354_BMCR_POWER_DOWN 0x0800
455#define LAN9354_BMCR_RESTART_AN 0x0200
456#define LAN9354_BMCR_DUPLEX_MODE 0x0100
457#define LAN9354_BMCR_COL_TEST 0x0080
460#define LAN9354_BMSR_100BT4 0x8000
461#define LAN9354_BMSR_100BTX_FD 0x4000
462#define LAN9354_BMSR_100BTX_HD 0x2000
463#define LAN9354_BMSR_10BT_FD 0x1000
464#define LAN9354_BMSR_10BT_HD 0x0800
465#define LAN9354_BMSR_100BT2_FD 0x0400
466#define LAN9354_BMSR_100BT2_HD 0x0200
467#define LAN9354_BMSR_EXTENDED_STATUS 0x0100
468#define LAN9354_BMSR_UNIDIRECTIONAL_ABLE 0x0080
469#define LAN9354_BMSR_MF_PREAMBLE_SUPPR 0x0040
470#define LAN9354_BMSR_AN_COMPLETE 0x0020
471#define LAN9354_BMSR_REMOTE_FAULT 0x0010
472#define LAN9354_BMSR_AN_CAPABLE 0x0008
473#define LAN9354_BMSR_LINK_STATUS 0x0004
474#define LAN9354_BMSR_JABBER_DETECT 0x0002
475#define LAN9354_BMSR_EXTENDED_CAPABLE 0x0001
478#define LAN9354_PHYID1_PHY_ID_MSB 0xFFFF
479#define LAN9354_PHYID1_PHY_ID_MSB_DEFAULT 0x0007
482#define LAN9354_PHYID2_PHY_ID_LSB 0xFC00
483#define LAN9354_PHYID2_PHY_ID_LSB_DEFAULT 0xC000
484#define LAN9354_PHYID2_MODEL_NUM 0x03F0
485#define LAN9354_PHYID2_MODEL_NUM_DEFAULT 0x0140
486#define LAN9354_PHYID2_REVISION_NUM 0x000F
489#define LAN9354_ANAR_REMOTE_FAULT 0x2000
490#define LAN9354_ANAR_ASYM_PAUSE 0x0800
491#define LAN9354_ANAR_SYM_PAUSE 0x0400
492#define LAN9354_ANAR_100BTX_FD 0x0100
493#define LAN9354_ANAR_100BTX_HD 0x0080
494#define LAN9354_ANAR_10BT_FD 0x0040
495#define LAN9354_ANAR_10BT_HD 0x0020
496#define LAN9354_ANAR_SELECTOR 0x001F
497#define LAN9354_ANAR_SELECTOR_DEFAULT 0x0001
500#define LAN9354_ANLPAR_NEXT_PAGE 0x8000
501#define LAN9354_ANLPAR_ACK 0x4000
502#define LAN9354_ANLPAR_REMOTE_FAULT 0x2000
503#define LAN9354_ANLPAR_ASYM_PAUSE 0x0800
504#define LAN9354_ANLPAR_SYM_PAUSE 0x0400
505#define LAN9354_ANLPAR_100BT4 0x0200
506#define LAN9354_ANLPAR_100BTX_FD 0x0100
507#define LAN9354_ANLPAR_100BTX_HD 0x0080
508#define LAN9354_ANLPAR_10BT_FD 0x0040
509#define LAN9354_ANLPAR_10BT_HD 0x0020
510#define LAN9354_ANLPAR_SELECTOR 0x001F
511#define LAN9354_ANLPAR_SELECTOR_DEFAULT 0x0001
514#define LAN9354_ANER_PAR_DETECT_FAULT 0x0010
515#define LAN9354_ANER_LP_NEXT_PAGE_ABLE 0x0008
516#define LAN9354_ANER_NEXT_PAGE_ABLE 0x0004
517#define LAN9354_ANER_PAGE_RECEIVED 0x0002
518#define LAN9354_ANER_LP_AN_ABLE 0x0001
521#define LAN9354_PMCSR_EDPWRDOWN 0x2000
522#define LAN9354_PMCSR_ENERGYON 0x0002
525#define LAN9354_PSMR_MODE 0x00E0
526#define LAN9354_PSMR_MODE_10BT_HD 0x0000
527#define LAN9354_PSMR_MODE_10BT_FD 0x0020
528#define LAN9354_PSMR_MODE_100BTX_HD 0x0040
529#define LAN9354_PSMR_MODE_100BTX_FD 0x0060
530#define LAN9354_PSMR_MODE_POWER_DOWN 0x00C0
531#define LAN9354_PSMR_MODE_AN 0x00E0
532#define LAN9354_PSMR_PHYAD 0x001F
535#define LAN9354_PSCSIR_AMDIXCTRL 0x8000
536#define LAN9354_PSCSIR_AMDIXEN 0x4000
537#define LAN9354_PSCSIR_AMDIXSTATE 0x2000
538#define LAN9354_PSCSIR_SQEOFF 0x0800
539#define LAN9354_PSCSIR_VCOOFF_LP 0x0400
540#define LAN9354_PSCSIR_XPOL 0x0010
543#define LAN9354_PISR_ENERGYON 0x0080
544#define LAN9354_PISR_AN_COMPLETE 0x0040
545#define LAN9354_PISR_REMOTE_FAULT 0x0020
546#define LAN9354_PISR_LINK_DOWN 0x0010
547#define LAN9354_PISR_AN_LP_ACK 0x0008
548#define LAN9354_PISR_PAR_DETECT_FAULT 0x0004
549#define LAN9354_PISR_AN_PAGE_RECEIVED 0x0002
552#define LAN9354_PIMR_ENERGYON 0x0080
553#define LAN9354_PIMR_AN_COMPLETE 0x0040
554#define LAN9354_PIMR_REMOTE_FAULT 0x0020
555#define LAN9354_PIMR_LINK_DOWN 0x0010
556#define LAN9354_PIMR_AN_LP_ACK 0x0008
557#define LAN9354_PIMR_PAR_DETECT_FAULT 0x0004
558#define LAN9354_PIMR_AN_PAGE_RECEIVED 0x0002
561#define LAN9354_PSCSR_AUTODONE 0x1000
562#define LAN9354_PSCSR_SPEED 0x001C
563#define LAN9354_PSCSR_SPEED_10BT_HD 0x0004
564#define LAN9354_PSCSR_SPEED_100BTX_HD 0x0008
565#define LAN9354_PSCSR_SPEED_10BT_FD 0x0014
566#define LAN9354_PSCSR_SPEED_100BTX_FD 0x0018
569#define LAN9354_ID_REV_CHIP_ID 0xFFFF0000
570#define LAN9354_ID_REV_CHIP_ID_DEFAULT 0x93540000
571#define LAN9354_ID_REV_CHIP_REV 0x0000FFFF
574#define LAN9354_IRQ_CFG_INT_DEAS 0xFF000000
575#define LAN9354_IRQ_CFG_INT_DEAS_CLR 0x00004000
576#define LAN9354_IRQ_CFG_INT_DEAS_STS 0x00002000
577#define LAN9354_IRQ_CFG_IRQ_INT 0x00001000
578#define LAN9354_IRQ_CFG_IRQ_EN 0x00000100
579#define LAN9354_IRQ_CFG_IRQ_POL 0x00000010
580#define LAN9354_IRQ_CFG_IRQ_CLK_SELECT 0x00000002
581#define LAN9354_IRQ_CFG_IRQ_TYPE 0x00000001
584#define LAN9354_INT_STS_SW_INT 0x80000000
585#define LAN9354_INT_STS_READY 0x40000000
586#define LAN9354_INT_STS_1588_EVNT 0x20000000
587#define LAN9354_INT_STS_SWITCH_INT 0x10000000
588#define LAN9354_INT_STS_PHY_INT_B 0x08000000
589#define LAN9354_INT_STS_PHY_INT_A 0x04000000
590#define LAN9354_INT_STS_GPT_INT 0x00080000
591#define LAN9354_INT_STS_PME_INT 0x00020000
592#define LAN9354_INT_STS_GPIO 0x00001000
595#define LAN9354_INT_EN_SW_INT_EN 0x80000000
596#define LAN9354_INT_EN_READY_EN 0x40000000
597#define LAN9354_INT_EN_1588_EVNT_EN 0x20000000
598#define LAN9354_INT_EN_SWITCH_INT_EN 0x10000000
599#define LAN9354_INT_EN_PHY_INT_B_EN 0x08000000
600#define LAN9354_INT_EN_PHY_INT_A_EN 0x04000000
601#define LAN9354_INT_EN_GPT_INT_EN 0x00080000
602#define LAN9354_INT_EN_GPIO_EN 0x00001000
605#define LAN9354_BYTE_TEST_DEFAULT 0x87654321
608#define LAN9354_HW_CFG_DEVICE_READY 0x08000000
609#define LAN9354_HW_CFG_AMDIX_EN_STRAP_STATE_PORT_B 0x04000000
610#define LAN9354_HW_CFG_AMDIX_EN_STRAP_STATE_PORT_A 0x02000000
613#define LAN9354_GPT_CFG_TIMER_EN 0x20000000
614#define LAN9354_GPT_CFG_GPT_LOAD 0x0000FFFF
617#define LAN9354_GPT_CNT_GPT_CNT 0x0000FFFF
620#define LAN9354_FREE_RUN_FR_CNT 0xFFFFFFFF
623#define LAN9354_PMI_DATA_MII_DATA 0x0000FFFF
626#define LAN9354_PMI_ACCESS_PHY_ADDR 0x0000F800
627#define LAN9354_PMI_ACCESS_MIIRINDA 0x000007C0
628#define LAN9354_PMI_ACCESS_MIIW_R 0x00000002
629#define LAN9354_PMI_ACCESS_MIIBZY 0x00000001
632#define LAN9354_MANUAL_FC_1_BP_EN_1 0x00000040
633#define LAN9354_MANUAL_FC_1_CUR_DUP_1 0x00000020
634#define LAN9354_MANUAL_FC_1_CUR_RX_FC_1 0x00000010
635#define LAN9354_MANUAL_FC_1_CUR_TX_FC_1 0x00000008
636#define LAN9354_MANUAL_FC_1_RX_FC_1 0x00000004
637#define LAN9354_MANUAL_FC_1_TX_FC_1 0x00000002
638#define LAN9354_MANUAL_FC_1_MANUAL_FC_1 0x00000001
641#define LAN9354_MANUAL_FC_2_BP_EN_2 0x00000040
642#define LAN9354_MANUAL_FC_2_CUR_DUP_2 0x00000020
643#define LAN9354_MANUAL_FC_2_CUR_RX_FC_2 0x00000010
644#define LAN9354_MANUAL_FC_2_CUR_TX_FC_2 0x00000008
645#define LAN9354_MANUAL_FC_2_RX_FC_2 0x00000004
646#define LAN9354_MANUAL_FC_2_TX_FC_2 0x00000002
647#define LAN9354_MANUAL_FC_2_MANUAL_FC_2 0x00000001
650#define LAN9354_MANUAL_FC_0_BP_EN_0 0x00000040
651#define LAN9354_MANUAL_FC_0_CUR_DUP_0 0x00000020
652#define LAN9354_MANUAL_FC_0_CUR_RX_FC_0 0x00000010
653#define LAN9354_MANUAL_FC_0_CUR_TX_FC_0 0x00000008
654#define LAN9354_MANUAL_FC_0_RX_FC_0 0x00000004
655#define LAN9354_MANUAL_FC_0_TX_FC_0 0x00000002
656#define LAN9354_MANUAL_FC_0_MANUAL_FC_0 0x00000001
659#define LAN9354_SWITCH_CSR_CMD_BUSY 0x80000000
660#define LAN9354_SWITCH_CSR_CMD_WRITE 0x00000000
661#define LAN9354_SWITCH_CSR_CMD_READ 0x40000000
662#define LAN9354_SWITCH_CSR_CMD_AUTO_INC 0x20000000
663#define LAN9354_SWITCH_CSR_CMD_AUTO_DEC 0x10000000
664#define LAN9354_SWITCH_CSR_CMD_BE 0x000F0000
665#define LAN9354_SWITCH_CSR_CMD_BE_0 0x00010000
666#define LAN9354_SWITCH_CSR_CMD_BE_1 0x00020000
667#define LAN9354_SWITCH_CSR_CMD_BE_2 0x00040000
668#define LAN9354_SWITCH_CSR_CMD_BE_3 0x00080000
669#define LAN9354_SWITCH_CSR_CMD_ADDR 0x0000FFFF
672#define LAN9354_E2P_CMD_EPC_BUSY 0x80000000
673#define LAN9354_E2P_CMD_EPC_COMMAND 0x70000000
674#define LAN9354_E2P_CMD_EPC_COMMAND_READ 0x00000000
675#define LAN9354_E2P_CMD_EPC_COMMAND_WRITE 0x30000000
676#define LAN9354_E2P_CMD_EPC_COMMAND_RELOAD 0x70000000
677#define LAN9354_E2P_CMD_LOADER_OVERFLOW 0x00040000
678#define LAN9354_E2P_CMD_EPC_TIMEOUT 0x00020000
679#define LAN9354_E2P_CMD_CFG_LOADED 0x00010000
680#define LAN9354_E2P_CMD_EPC_ADDR 0x0000FFFF
683#define LAN9354_E2P_DATA_EEPROM_DATA 0x000000FF
686#define LAN9354_LED_CFG_LED_FUN 0x00000700
687#define LAN9354_LED_CFG_LED_FUN_0 0x00000000
688#define LAN9354_LED_CFG_LED_FUN_1 0x00000100
689#define LAN9354_LED_CFG_LED_FUN_2 0x00000200
690#define LAN9354_LED_CFG_LED_FUN_3 0x00000300
691#define LAN9354_LED_CFG_LED_FUN_4 0x00000400
692#define LAN9354_LED_CFG_LED_FUN_5 0x00000500
693#define LAN9354_LED_CFG_LED_FUN_RESERVED 0x00000600
694#define LAN9354_LED_CFG_LED_FUN_7 0x00000700
695#define LAN9354_LED_CFG_LED_EN 0x0000003F
696#define LAN9354_LED_CFG_LED_EN_0 0x00000001
697#define LAN9354_LED_CFG_LED_EN_1 0x00000002
698#define LAN9354_LED_CFG_LED_EN_2 0x00000004
699#define LAN9354_LED_CFG_LED_EN_3 0x00000008
700#define LAN9354_LED_CFG_LED_EN_4 0x00000010
701#define LAN9354_LED_CFG_LED_EN_5 0x00000020
704#define LAN9354_VPHY_BASIC_CTRL_VPHY_RST 0x00008000
705#define LAN9354_VPHY_BASIC_CTRL_VPHY_LOOPBACK 0x00004000
706#define LAN9354_VPHY_BASIC_CTRL_VPHY_SPEED_SEL_LSB 0x00002000
707#define LAN9354_VPHY_BASIC_CTRL_VPHY_AN 0x00001000
708#define LAN9354_VPHY_BASIC_CTRL_VPHY_PWR_DWN 0x00000800
709#define LAN9354_VPHY_BASIC_CTRL_VPHY_ISO 0x00000400
710#define LAN9354_VPHY_BASIC_CTRL_VPHY_RST_AN 0x00000200
711#define LAN9354_VPHY_BASIC_CTRL_VPHY_DUPLEX 0x00000100
712#define LAN9354_VPHY_BASIC_CTRL_VPHY_COL_TEST 0x00000080
713#define LAN9354_VPHY_BASIC_CTRL_VPHY_SPEED_SEL_MSB 0x00000040
716#define LAN9354_VPHY_BASIC_STATUS_100BT4 0x00008000
717#define LAN9354_VPHY_BASIC_STATUS_100BTX_FD 0x00004000
718#define LAN9354_VPHY_BASIC_STATUS_100BTX_HD 0x00002000
719#define LAN9354_VPHY_BASIC_STATUS_10BT_FD 0x00001000
720#define LAN9354_VPHY_BASIC_STATUS_10BT_HD 0x00000800
721#define LAN9354_VPHY_BASIC_STATUS_100BT2_FD 0x00000400
722#define LAN9354_VPHY_BASIC_STATUS_100BT2_HD 0x00000200
723#define LAN9354_VPHY_BASIC_STATUS_EXTENDED_STATUS 0x00000100
724#define LAN9354_VPHY_BASIC_STATUS_MF_PREAMBLE_SUPPR 0x00000040
725#define LAN9354_VPHY_BASIC_STATUS_AN_COMPLETE 0x00000020
726#define LAN9354_VPHY_BASIC_STATUS_REMOTE_FAULT 0x00000010
727#define LAN9354_VPHY_BASIC_STATUS_AN_CAPABLE 0x00000008
728#define LAN9354_VPHY_BASIC_STATUS_LINK_STATUS 0x00000004
729#define LAN9354_VPHY_BASIC_STATUS_JABBER_DETECT 0x00000002
730#define LAN9354_VPHY_BASIC_STATUS_EXTENDED_CAPABLE 0x00000001
733#define LAN9354_VPHY_ID_MSB_PHY_ID_MSB 0x0000FFFF
736#define LAN9354_VPHY_ID_LSB_PHY_ID_LSB 0x0000FC00
737#define LAN9354_VPHY_ID_LSB_MODEL_NUM 0x000003F0
738#define LAN9354_VPHY_ID_LSB_REVISION_NUM 0x0000000F
741#define LAN9354_VPHY_AN_ADV_NEXT_PAGE 0x00008000
742#define LAN9354_VPHY_AN_ADV_REMOTE_FAULT 0x00002000
743#define LAN9354_VPHY_AN_ADV_ASYM_PAUSE 0x00000800
744#define LAN9354_VPHY_AN_ADV_SYM_PAUSE 0x00000400
745#define LAN9354_VPHY_AN_ADV_100BTX_FD 0x00000100
746#define LAN9354_VPHY_AN_ADV_100BTX_HD 0x00000080
747#define LAN9354_VPHY_AN_ADV_10BT_FD 0x00000040
748#define LAN9354_VPHY_AN_ADV_10BT_HD 0x00000020
749#define LAN9354_VPHY_AN_ADV_SELECTOR 0x0000001F
750#define LAN9354_VPHY_AN_ADV_SELECTOR_DEFAULT 0x00000001
753#define LAN9354_VPHY_AN_LP_BASE_ABILITY_NEXT_PAGE 0x00008000
754#define LAN9354_VPHY_AN_LP_BASE_ABILITY_ACK 0x00004000
755#define LAN9354_VPHY_AN_LP_BASE_ABILITY_REMOTE_FAULT 0x00002000
756#define LAN9354_VPHY_AN_LP_BASE_ABILITY_ASYM_PAUSE 0x00000800
757#define LAN9354_VPHY_AN_LP_BASE_ABILITY_SYM_PAUSE 0x00000400
758#define LAN9354_VPHY_AN_LP_BASE_ABILITY_100BT4 0x00000200
759#define LAN9354_VPHY_AN_LP_BASE_ABILITY_100BTX_FD 0x00000100
760#define LAN9354_VPHY_AN_LP_BASE_ABILITY_100BTX_HD 0x00000080
761#define LAN9354_VPHY_AN_LP_BASE_ABILITY_10BT_FD 0x00000040
762#define LAN9354_VPHY_AN_LP_BASE_ABILITY_10BT_HD 0x00000020
763#define LAN9354_VPHY_AN_LP_BASE_ABILITY_SELECTOR 0x0000001F
764#define LAN9354_VPHY_AN_LP_BASE_ABILITY_SELECTOR_DEFAULT 0x00000001
767#define LAN9354_VPHY_AN_EXP_PAR_DETECT_FAULT 0x00000010
768#define LAN9354_VPHY_AN_EXP_LP_NEXT_PAGE_ABLE 0x00000008
769#define LAN9354_VPHY_AN_EXP_NEXT_PAGE_ABLE 0x00000004
770#define LAN9354_VPHY_AN_EXP_PAGE_RECEIVED 0x00000002
771#define LAN9354_VPHY_AN_EXP_LP_AN_ABLE 0x00000001
774#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE2 0x00008000
775#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_SW_LOOPBACK 0x00004000
776#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_TURBO_MODE_EN 0x00000400
777#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE 0x00000300
778#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE_MII_MAC 0x00000000
779#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE_MII_PHY 0x00000100
780#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE_RMII_MAC 0x00000200
781#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_MODE_RMII_PHY 0x00000300
782#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_SW_COL_TEST 0x00000080
783#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_RMII_CLK_DIR 0x00000040
784#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_RMII_CLK_DIR_IN 0x00000000
785#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_RMII_CLK_DIR_OUT 0x00000040
786#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_RMII_CLK_STRENGTH 0x00000020
787#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_IND 0x0000001C
788#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_IND_10_HD 0x00000004
789#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_IND_100_200_HD 0x00000008
790#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_IND_10_FD 0x00000014
791#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_IND_100_200_FD 0x00000018
792#define LAN9354_VPHY_SPECIAL_CTRL_STATUS_SQEOFF 0x00000001
795#define LAN9354_GPIO_CFG_GPIO_CH_SEL 0xFF000000
796#define LAN9354_GPIO_CFG_GPIO_CH_SEL_0 0x01000000
797#define LAN9354_GPIO_CFG_GPIO_CH_SEL_1 0x02000000
798#define LAN9354_GPIO_CFG_GPIO_CH_SEL_2 0x04000000
799#define LAN9354_GPIO_CFG_GPIO_CH_SEL_3 0x08000000
800#define LAN9354_GPIO_CFG_GPIO_CH_SEL_4 0x10000000
801#define LAN9354_GPIO_CFG_GPIO_CH_SEL_5 0x20000000
802#define LAN9354_GPIO_CFG_GPIO_CH_SEL_6 0x40000000
803#define LAN9354_GPIO_CFG_GPIO_CH_SEL_7 0x80000000
804#define LAN9354_GPIO_CFG_GPIO_INT_POL 0x00FF0000
805#define LAN9354_GPIO_CFG_GPIO_INT_POL_0 0x00010000
806#define LAN9354_GPIO_CFG_GPIO_INT_POL_1 0x00020000
807#define LAN9354_GPIO_CFG_GPIO_INT_POL_2 0x00040000
808#define LAN9354_GPIO_CFG_GPIO_INT_POL_3 0x00080000
809#define LAN9354_GPIO_CFG_GPIO_INT_POL_4 0x00100000
810#define LAN9354_GPIO_CFG_GPIO_INT_POL_5 0x00200000
811#define LAN9354_GPIO_CFG_GPIO_INT_POL_6 0x00400000
812#define LAN9354_GPIO_CFG_GPIO_INT_POL_7 0x00800000
813#define LAN9354_GPIO_CFG_1588_GPIO_OE 0x0000FF00
814#define LAN9354_GPIO_CFG_1588_GPIO_OE_0 0x00000100
815#define LAN9354_GPIO_CFG_1588_GPIO_OE_1 0x00000200
816#define LAN9354_GPIO_CFG_1588_GPIO_OE_2 0x00000400
817#define LAN9354_GPIO_CFG_1588_GPIO_OE_3 0x00000800
818#define LAN9354_GPIO_CFG_1588_GPIO_OE_4 0x00001000
819#define LAN9354_GPIO_CFG_1588_GPIO_OE_5 0x00002000
820#define LAN9354_GPIO_CFG_1588_GPIO_OE_6 0x00004000
821#define LAN9354_GPIO_CFG_1588_GPIO_OE_7 0x00008000
822#define LAN9354_GPIO_CFG_GPIOBUF 0x000000FF
823#define LAN9354_GPIO_CFG_GPIOBUF_0 0x00000001
824#define LAN9354_GPIO_CFG_GPIOBUF_1 0x00000002
825#define LAN9354_GPIO_CFG_GPIOBUF_2 0x00000004
826#define LAN9354_GPIO_CFG_GPIOBUF_3 0x00000008
827#define LAN9354_GPIO_CFG_GPIOBUF_4 0x00000010
828#define LAN9354_GPIO_CFG_GPIOBUF_5 0x00000020
829#define LAN9354_GPIO_CFG_GPIOBUF_6 0x00000040
830#define LAN9354_GPIO_CFG_GPIOBUF_7 0x00000080
833#define LAN9354_GPIO_DATA_DIR_GPDIR 0x00FF0000
834#define LAN9354_GPIO_DATA_DIR_GPDIR_0 0x00010000
835#define LAN9354_GPIO_DATA_DIR_GPDIR_1 0x00020000
836#define LAN9354_GPIO_DATA_DIR_GPDIR_2 0x00040000
837#define LAN9354_GPIO_DATA_DIR_GPDIR_3 0x00080000
838#define LAN9354_GPIO_DATA_DIR_GPDIR_4 0x00100000
839#define LAN9354_GPIO_DATA_DIR_GPDIR_5 0x00200000
840#define LAN9354_GPIO_DATA_DIR_GPDIR_6 0x00400000
841#define LAN9354_GPIO_DATA_DIR_GPDIR_7 0x00800000
842#define LAN9354_GPIO_DATA_DIR_GPIOD 0x000000FF
843#define LAN9354_GPIO_DATA_DIR_GPIOD_0 0x00000001
844#define LAN9354_GPIO_DATA_DIR_GPIOD_1 0x00000002
845#define LAN9354_GPIO_DATA_DIR_GPIOD_2 0x00000004
846#define LAN9354_GPIO_DATA_DIR_GPIOD_3 0x00000008
847#define LAN9354_GPIO_DATA_DIR_GPIOD_4 0x00000010
848#define LAN9354_GPIO_DATA_DIR_GPIOD_5 0x00000020
849#define LAN9354_GPIO_DATA_DIR_GPIOD_6 0x00000040
850#define LAN9354_GPIO_DATA_DIR_GPIOD_7 0x00000080
853#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN 0x00FF0000
854#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_0 0x00010000
855#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_1 0x00020000
856#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_2 0x00040000
857#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_3 0x00080000
858#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_4 0x00100000
859#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_5 0x00200000
860#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_6 0x00400000
861#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_EN_7 0x00800000
862#define LAN9354_GPIO_INT_STS_EN_GPIO_INT 0x000000FF
863#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_0 0x00000001
864#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_1 0x00000002
865#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_2 0x00000004
866#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_3 0x00000008
867#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_4 0x00000010
868#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_5 0x00000020
869#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_6 0x00000040
870#define LAN9354_GPIO_INT_STS_EN_GPIO_INT_7 0x00000080
873#define LAN9354_SWITCH_MAC_ADDRH_DIFF_PAUSE_ADDR 0x00400000
874#define LAN9354_SWITCH_MAC_ADDRH_PORT2_PHY_ADDR_41_40 0x00300000
875#define LAN9354_SWITCH_MAC_ADDRH_PORT1_PHY_ADDR_41_40 0x000C0000
876#define LAN9354_SWITCH_MAC_ADDRH_PORT0_PHY_ADDR_41_40 0x00030000
877#define LAN9354_SWITCH_MAC_ADDRH_PHY_ADDR_47_32 0x0000FFFF
880#define LAN9354_SWITCH_MAC_ADDRL_PHY_ADDR_31_0 0xFFFFFFFF
883#define LAN9354_RESET_CTL_VPHY_RST 0x00000008
884#define LAN9354_RESET_CTL_PHY_B_RST 0x00000004
885#define LAN9354_RESET_CTL_PHY_A_RST 0x00000002
886#define LAN9354_RESET_CTL_DIGITAL_RST 0x00000001
889#define LAN9354_SW_DEV_ID_DEVICE_TYPE 0x00FF0000
890#define LAN9354_SW_DEV_ID_DEVICE_TYPE_DEFAULT 0x00030000
891#define LAN9354_SW_DEV_ID_CHIP_VERSION 0x0000FF00
892#define LAN9354_SW_DEV_ID_CHIP_VERSION_DEFAULT 0x00000600
893#define LAN9354_SW_DEV_ID_REVISION 0x000000FF
894#define LAN9354_SW_DEV_ID_REVISION_DEFAULT 0x00000007
897#define LAN9354_SW_RESET_SW_RESET 0x00000001
900#define LAN9354_SW_IMR_BM 0x00000040
901#define LAN9354_SW_IMR_SWE 0x00000020
902#define LAN9354_SW_IMR_MAC2 0x00000004
903#define LAN9354_SW_IMR_MAC1 0x00000002
904#define LAN9354_SW_IMR_MAC0 0x00000001
907#define LAN9354_SW_IPR_BM 0x00000040
908#define LAN9354_SW_IPR_SWE 0x00000020
909#define LAN9354_SW_IPR_MAC2 0x00000004
910#define LAN9354_SW_IPR_MAC1 0x00000002
911#define LAN9354_SW_IPR_MAC0 0x00000001
914#define LAN9354_MAC_VER_ID_DEVICE_TYPE 0x00000F00
915#define LAN9354_MAC_VER_ID_DEVICE_TYPE_DEFAULT 0x00000500
916#define LAN9354_MAC_VER_ID_CHIP_VERSION 0x000000F0
917#define LAN9354_MAC_VER_ID_CHIP_VERSION_DEFAULT 0x00000090
918#define LAN9354_MAC_VER_ID_REVISION 0x0000000F
919#define LAN9354_MAC_VER_ID_REVISION_DEFAULT 0x00000003
922#define LAN9354_MAC_RX_CFG_RECEIVE_OWN_TRANSMIT_EN 0x00000020
923#define LAN9354_MAC_RX_CFG_JUMBO_2K 0x00000008
924#define LAN9354_MAC_RX_CFG_REJECT_MAC_TYPES 0x00000002
925#define LAN9354_MAC_RX_CFG_RX_EN 0x00000001
928#define LAN9354_MAC_TX_CFG_EEE_EN 0x00000100
929#define LAN9354_MAC_TX_CFG_MAC_COUNTER_TEST 0x00000080
930#define LAN9354_MAC_TX_CFG_IFG_CONFIG 0x0000007C
931#define LAN9354_MAC_TX_CFG_IFG_CONFIG_DEFAULT 0x00000054
932#define LAN9354_MAC_TX_CFG_TX_PAD_EN 0x00000002
933#define LAN9354_MAC_TX_CFG_TX_EN 0x00000001
936#define LAN9354_SWE_ALR_CMD_MAKE_ENTRY 0x00000004
937#define LAN9354_SWE_ALR_CMD_GET_FIRST_ENTRY 0x00000002
938#define LAN9354_SWE_ALR_CMD_GET_NEXT_ENTRY 0x00000001
941#define LAN9354_SWE_ALR_WR_DAT_0_MAC_ADDR 0xFFFFFFFF
944#define LAN9354_SWE_ALR_WR_DAT_1_VALID 0x04000000
945#define LAN9354_SWE_ALR_WR_DAT_1_AGE1_OVERRIDE 0x02000000
946#define LAN9354_SWE_ALR_WR_DAT_1_STATIC 0x01000000
947#define LAN9354_SWE_ALR_WR_DAT_1_AGE0_FILTER 0x00800000
948#define LAN9354_SWE_ALR_WR_DAT_1_PRIORITY_EN 0x00400000
949#define LAN9354_SWE_ALR_WR_DAT_1_PRIORITY 0x00380000
950#define LAN9354_SWE_ALR_WR_DAT_1_PORT 0x00070000
951#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0 0x00000000
952#define LAN9354_SWE_ALR_WR_DAT_1_PORT_1 0x00010000
953#define LAN9354_SWE_ALR_WR_DAT_1_PORT_2 0x00020000
954#define LAN9354_SWE_ALR_WR_DAT_1_PORT_RESERVED 0x00030000
955#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_1 0x00040000
956#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_2 0x00050000
957#define LAN9354_SWE_ALR_WR_DAT_1_PORT_1_2 0x00060000
958#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_1_2 0x00070000
959#define LAN9354_SWE_ALR_WR_DAT_1_MAC_ADDR 0x0000FFFF
962#define LAN9354_SWE_ALR_RD_DAT_0_MAC_ADDR 0xFFFFFFFF
965#define LAN9354_SWE_ALR_RD_DAT_1_END_OF_TABLE 0x08000000
966#define LAN9354_SWE_ALR_RD_DAT_1_VALID 0x04000000
967#define LAN9354_SWE_ALR_RD_DAT_1_AGE1_OVERRIDE 0x02000000
968#define LAN9354_SWE_ALR_RD_DAT_1_STATIC 0x01000000
969#define LAN9354_SWE_ALR_RD_DAT_1_AGE0_FILTER 0x00800000
970#define LAN9354_SWE_ALR_RD_DAT_1_PRIORITY_EN 0x00400000
971#define LAN9354_SWE_ALR_RD_DAT_1_PRIORITY 0x00380000
972#define LAN9354_SWE_ALR_RD_DAT_1_PORT 0x00070000
973#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0 0x00000000
974#define LAN9354_SWE_ALR_RD_DAT_1_PORT_1 0x00010000
975#define LAN9354_SWE_ALR_RD_DAT_1_PORT_2 0x00020000
976#define LAN9354_SWE_ALR_RD_DAT_1_PORT_RESERVED 0x00030000
977#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_1 0x00040000
978#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_2 0x00050000
979#define LAN9354_SWE_ALR_RD_DAT_1_PORT_1_2 0x00060000
980#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_1_2 0x00070000
981#define LAN9354_SWE_ALR_RD_DAT_1_MAC_ADDR 0x0000FFFF
984#define LAN9354_SWE_ALR_CMD_STS_ALR_INIT_DONE 0x00000002
985#define LAN9354_SWE_ALR_CMD_STS_OPERATION_PENDING 0x00000001
988#define LAN9354_SWE_ALR_CFG_AGING_TIME 0x0FFF0000
989#define LAN9354_SWE_ALR_CFG_AGING_TIME_DEFAULT 0x01290000
990#define LAN9354_SWE_ALR_CFG_ALLOW_BROADCAST 0x00000004
991#define LAN9354_SWE_ALR_CFG_ALR_AGE_EN 0x00000002
992#define LAN9354_SWE_ALR_CFG_ALR_AGE_TEST 0x00000001
995#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT2 0x00000600
996#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT2_PORT0 0x00000000
997#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT2_PORT1 0x00000200
998#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT2_EN 0x00000100
999#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT1 0x00000060
1000#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT1_PORT0 0x00000000
1001#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT1_PORT2 0x00000040
1002#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT1_EN 0x00000010
1003#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT0 0x00000006
1004#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT0_PORT1 0x00000002
1005#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT0_PORT2 0x00000004
1006#define LAN9354_SWE_ALR_OVERRIDE_ALR_OVERRIDE_PORT0_EN 0x00000001
1009#define LAN9354_SWE_VLAN_CMD_WRITE 0x00000000
1010#define LAN9354_SWE_VLAN_CMD_READ 0x00000020
1011#define LAN9354_SWE_VLAN_CMD_VLAN 0x00000000
1012#define LAN9354_SWE_VLAN_CMD_PVID 0x00000010
1013#define LAN9354_SWE_VLAN_CMD_VLAN_PORT 0x0000000F
1016#define LAN9354_SWE_GLOBAL_INGRSS_CFG_OTHER_MLD_NEXT_HDR_EN 0x00020000
1017#define LAN9354_SWE_GLOBAL_INGRSS_CFG_ANY_HOP_BY_HOP_NEXT_HDR 0x00010000
1018#define LAN9354_SWE_GLOBAL_INGRSS_CFG_802_1Q_VLAN_DIS 0x00008000
1019#define LAN9354_SWE_GLOBAL_INGRSS_CFG_USE_TAG 0x00004000
1020#define LAN9354_SWE_GLOBAL_INGRSS_CFG_ALLOW_MONITOR_ECHO 0x00002000
1021#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT 0x00001C00
1022#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_0 0x00000400
1023#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_1 0x00000800
1024#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_2 0x00001000
1025#define LAN9354_SWE_GLOBAL_INGRSS_CFG_USE_IP 0x00000200
1026#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_MONITORING_EN 0x00000100
1027#define LAN9354_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITORING_EN 0x00000080
1028#define LAN9354_SWE_GLOBAL_INGRSS_CFG_SWE_COUNTER_TEST 0x00000040
1029#define LAN9354_SWE_GLOBAL_INGRSS_CFG_DA_HIGHEST_PRIORITY 0x00000020
1030#define LAN9354_SWE_GLOBAL_INGRSS_CFG_FILTER_MULTICAST 0x00000010
1031#define LAN9354_SWE_GLOBAL_INGRSS_CFG_DROP_UNKNOWN 0x00000008
1032#define LAN9354_SWE_GLOBAL_INGRSS_CFG_USE_PRECEDENCE 0x00000004
1033#define LAN9354_SWE_GLOBAL_INGRSS_CFG_VL_HIGHER_PRIORITY 0x00000002
1034#define LAN9354_SWE_GLOBAL_INGRSS_CFG_VLAN_EN 0x00000001
1037#define LAN9354_SWE_PORT_INGRSS_CFG_LEARN_ON_INGRESS 0x00000038
1038#define LAN9354_SWE_PORT_INGRSS_CFG_LEARN_ON_INGRESS_PORT0 0x00000000
1039#define LAN9354_SWE_PORT_INGRSS_CFG_LEARN_ON_INGRESS_PORT1 0x00000008
1040#define LAN9354_SWE_PORT_INGRSS_CFG_LEARN_ON_INGRESS_PORT2 0x00000010
1041#define LAN9354_SWE_PORT_INGRSS_CFG_MEMBERSHIP_CHECK 0x00000007
1042#define LAN9354_SWE_PORT_INGRSS_CFG_MEMBERSHIP_CHECK_PORT0 0x00000000
1043#define LAN9354_SWE_PORT_INGRSS_CFG_MEMBERSHIP_CHECK_PORT1 0x00000001
1044#define LAN9354_SWE_PORT_INGRSS_CFG_MEMBERSHIP_CHECK_PORT2 0x00000002
1047#define LAN9354_SWE_ADMT_ONLY_VLAN_ADMIT_ONLY_VLAN 0x00000007
1048#define LAN9354_SWE_ADMT_ONLY_VLAN_ADMIT_ONLY_VLAN_PORT0 0x00000001
1049#define LAN9354_SWE_ADMT_ONLY_VLAN_ADMIT_ONLY_VLAN_PORT1 0x00000002
1050#define LAN9354_SWE_ADMT_ONLY_VLAN_ADMIT_ONLY_VLAN_PORT2 0x00000004
1053#define LAN9354_SWE_PORT_STATE_PORT2 0x00000030
1054#define LAN9354_SWE_PORT_STATE_PORT2_FORWARDING 0x00000000
1055#define LAN9354_SWE_PORT_STATE_PORT2_LISTENING 0x00000010
1056#define LAN9354_SWE_PORT_STATE_PORT2_LEARNING 0x00000020
1057#define LAN9354_SWE_PORT_STATE_PORT2_DISABLED 0x00000030
1058#define LAN9354_SWE_PORT_STATE_PORT1 0x0000000C
1059#define LAN9354_SWE_PORT_STATE_PORT1_FORWARDING 0x00000000
1060#define LAN9354_SWE_PORT_STATE_PORT1_LISTENING 0x00000004
1061#define LAN9354_SWE_PORT_STATE_PORT1_LEARNING 0x00000008
1062#define LAN9354_SWE_PORT_STATE_PORT1_DISABLED 0x0000000C
1063#define LAN9354_SWE_PORT_STATE_PORT0 0x00000003
1064#define LAN9354_SWE_PORT_STATE_PORT0_FORWARDING 0x00000000
1065#define LAN9354_SWE_PORT_STATE_PORT0_LISTENING 0x00000001
1066#define LAN9354_SWE_PORT_STATE_PORT0_LEARNING 0x00000002
1067#define LAN9354_SWE_PORT_STATE_PORT0_DISABLED 0x00000003
1070#define LAN9354_SWE_PRI_TO_QUE_PRIO_7_TRAFFIC_CLASS 0x0000C000
1071#define LAN9354_SWE_PRI_TO_QUE_PRIO_6_TRAFFIC_CLASS 0x00003000
1072#define LAN9354_SWE_PRI_TO_QUE_PRIO_5_TRAFFIC_CLASS 0x00000C00
1073#define LAN9354_SWE_PRI_TO_QUE_PRIO_4_TRAFFIC_CLASS 0x00000300
1074#define LAN9354_SWE_PRI_TO_QUE_PRIO_3_TRAFFIC_CLASS 0x000000C0
1075#define LAN9354_SWE_PRI_TO_QUE_PRIO_2_TRAFFIC_CLASS 0x00000030
1076#define LAN9354_SWE_PRI_TO_QUE_PRIO_1_TRAFFIC_CLASS 0x0000000C
1077#define LAN9354_SWE_PRI_TO_QUE_PRIO_0_TRAFFIC_CLASS 0x00000003
1080#define LAN9354_SWE_PORT_MIRROR_RX_MIRRORING_FILT_EN 0x00000100
1081#define LAN9354_SWE_PORT_MIRROR_SNIFFER_PORT 0x000000E0
1082#define LAN9354_SWE_PORT_MIRROR_SNIFFER_PORT_0 0x00000020
1083#define LAN9354_SWE_PORT_MIRROR_SNIFFER_PORT_1 0x00000040
1084#define LAN9354_SWE_PORT_MIRROR_SNIFFER_PORT_2 0x00000080
1085#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT 0x0000001C
1086#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT_0 0x00000004
1087#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT_1 0x00000008
1088#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT_2 0x00000010
1089#define LAN9354_SWE_PORT_MIRROR_RX_MIRRORING_EN 0x00000002
1090#define LAN9354_SWE_PORT_MIRROR_TX_MIRRORING_EN 0x00000001
1093#define LAN9354_SWE_INGRSS_PORT_TYP_PORT2 0x00000030
1094#define LAN9354_SWE_INGRSS_PORT_TYP_PORT2_DIS 0x00000000
1095#define LAN9354_SWE_INGRSS_PORT_TYP_PORT2_EN 0x00000030
1096#define LAN9354_SWE_INGRSS_PORT_TYP_PORT1 0x0000000C
1097#define LAN9354_SWE_INGRSS_PORT_TYP_PORT1_DIS 0x00000000
1098#define LAN9354_SWE_INGRSS_PORT_TYP_PORT1_EN 0x0000000C
1099#define LAN9354_SWE_INGRSS_PORT_TYP_PORT0 0x00000003
1100#define LAN9354_SWE_INGRSS_PORT_TYP_PORT0_DIS 0x00000000
1101#define LAN9354_SWE_INGRSS_PORT_TYP_PORT0_EN 0x00000003
1104#define LAN9354_BM_EGRSS_PORT_TYPE_VID_SEL_PORT2 0x00400000
1105#define LAN9354_BM_EGRSS_PORT_TYPE_INSERT_TAG_PORT2 0x00200000
1106#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_VID_PORT2 0x00100000
1107#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_PRIO_PORT2 0x00080000
1108#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_TAG_PORT2 0x00040000
1109#define LAN9354_BM_EGRSS_PORT_TYPE_PORT2_TYPE 0x00030000
1110#define LAN9354_BM_EGRSS_PORT_TYPE_PORT2_TYPE_DUMB 0x00000000
1111#define LAN9354_BM_EGRSS_PORT_TYPE_PORT2_TYPE_ACCESS 0x00010000
1112#define LAN9354_BM_EGRSS_PORT_TYPE_PORT2_TYPE_HYBRID 0x00020000
1113#define LAN9354_BM_EGRSS_PORT_TYPE_PORT2_TYPE_CPU 0x00030000
1114#define LAN9354_BM_EGRSS_PORT_TYPE_VID_SEL_PORT1 0x00004000
1115#define LAN9354_BM_EGRSS_PORT_TYPE_INSERT_TAG_PORT1 0x00002000
1116#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_VID_PORT1 0x00001000
1117#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_PRIO_PORT1 0x00000800
1118#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_TAG_PORT1 0x00000400
1119#define LAN9354_BM_EGRSS_PORT_TYPE_PORT1_TYPE 0x00000300
1120#define LAN9354_BM_EGRSS_PORT_TYPE_PORT1_TYPE_DUMB 0x00000000
1121#define LAN9354_BM_EGRSS_PORT_TYPE_PORT1_TYPE_ACCESS 0x00000100
1122#define LAN9354_BM_EGRSS_PORT_TYPE_PORT1_TYPE_HYBRID 0x00000200
1123#define LAN9354_BM_EGRSS_PORT_TYPE_PORT1_TYPE_CPU 0x00000300
1124#define LAN9354_BM_EGRSS_PORT_TYPE_VID_SEL_PORT0 0x00000040
1125#define LAN9354_BM_EGRSS_PORT_TYPE_INSERT_TAG_PORT0 0x00000020
1126#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_VID_PORT0 0x00000010
1127#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_PRIO_PORT0 0x00000008
1128#define LAN9354_BM_EGRSS_PORT_TYPE_CHANGE_TAG_PORT0 0x00000004
1129#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE 0x00000003
1130#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE_DUMB 0x00000000
1131#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE_ACCESS 0x00000001
1132#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE_HYBRID 0x00000002
1133#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE_CPU 0x00000003
1144error_t lan9354Init(NetInterface *interface);
1145void lan9354InitHook(NetInterface *interface);
1147void lan9354Tick(NetInterface *interface);
1149void lan9354EnableIrq(NetInterface *interface);
1150void lan9354DisableIrq(NetInterface *interface);
1152void lan9354EventHandler(NetInterface *interface);
1155 size_t *offset, NetTxAncillary *ancillary);
1157error_t lan9354UntagFrame(NetInterface *interface, uint8_t **frame,
1158 size_t *length, NetRxAncillary *ancillary);
1160bool_t lan9354GetLinkState(NetInterface *interface, uint8_t port);
1161uint32_t lan9354GetLinkSpeed(NetInterface *interface, uint8_t port);
1162NicDuplexMode lan9354GetDuplexMode(NetInterface *interface, uint8_t port);
1164void lan9354SetPortState(NetInterface *interface, uint8_t port,
1167SwitchPortState lan9354GetPortState(NetInterface *interface, uint8_t port);
1169void lan9354SetAgingTime(NetInterface *interface, uint32_t agingTime);
1171void lan9354EnableIgmpSnooping(NetInterface *interface, bool_t enable);
1172void lan9354EnableMldSnooping(NetInterface *interface, bool_t enable);
1173void lan9354EnableRsvdMcastTable(NetInterface *interface, bool_t enable);
1175error_t lan9354AddStaticFdbEntry(NetInterface *interface,
1178error_t lan9354DeleteStaticFdbEntry(NetInterface *interface,
1181error_t lan9354GetStaticFdbEntry(NetInterface *interface, uint_t index,
1184void lan9354FlushStaticFdbTable(NetInterface *interface);
1186error_t lan9354GetDynamicFdbEntry(NetInterface *interface, uint_t index,
1189void lan9354FlushDynamicFdbTable(NetInterface *interface, uint8_t port);
1191void lan9354SetUnknownMcastFwdPorts(NetInterface *interface,
1192 bool_t enable, uint32_t forwardPorts);
1194void lan9354WritePhyReg(NetInterface *interface, uint8_t port,
1195 uint8_t address, uint16_t data);
1197uint16_t lan9354ReadPhyReg(NetInterface *interface, uint8_t port,
1200void lan9354DumpPhyReg(NetInterface *interface, uint8_t port);
1202void lan9354WriteSysReg(NetInterface *interface, uint16_t address,
1205uint32_t lan9354ReadSysReg(NetInterface *interface, uint16_t address);
1207void lan9354DumpSysReg(NetInterface *interface);
1209void lan9354WriteSwitchReg(NetInterface *interface, uint16_t address,
1212uint32_t lan9354ReadSwitchReg(NetInterface *interface, uint16_t address);
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
NicDuplexMode
Duplex mode.
Definition nic.h:122
SwitchPortState
Switch port state.
Definition nic.h:134
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
Ethernet switch driver.
Definition nic.h:322
Forwarding database entry.
Definition nic.h:149