31#ifndef _MV88E1512_DRIVER_H
32#define _MV88E1512_DRIVER_H
38#ifndef MV88E1512_PHY_ADDR
39 #define MV88E1512_PHY_ADDR 0
40#elif (MV88E1512_PHY_ADDR < 0 || MV88E1512_PHY_ADDR > 31)
41 #error MV88E1512_PHY_ADDR parameter is not valid
45#define MV88E1512_COPPER_CTRL 0x00
46#define MV88E1512_COPPER_STAT 0x01
47#define MV88E1512_COPPER_PHYID1 0x02
48#define MV88E1512_COPPER_PHYID2 0x03
49#define MV88E1512_COPPER_ANAR 0x04
50#define MV88E1512_COPPER_ANLPAR 0x05
51#define MV88E1512_COPPER_ANER 0x06
52#define MV88E1512_COPPER_ANNPR 0x07
53#define MV88E1512_COPPER_ANLPNPR 0x08
54#define MV88E1512_GBCR 0x09
55#define MV88E1512_GBSR 0x0A
56#define MV88E1512_GBESR 0x0F
57#define MV88E1512_COPPER_CTRL1 0x10
58#define MV88E1512_COPPER_STAT1 0x11
59#define MV88E1512_COPPER_INT_EN 0x12
60#define MV88E1512_COPPER_INT_STAT 0x13
61#define MV88E1512_COPPER_CTRL2 0x14
62#define MV88E1512_COPPER_RX_ERR_COUNTER 0x15
63#define MV88E1512_PAGSR 0x16
64#define MV88E1512_GISR 0x17
67#define MV88E1512_FIBER_CTRL 0x00
68#define MV88E1512_FIBER_STAT 0x01
69#define MV88E1512_FIBER_PHYID1 0x02
70#define MV88E1512_FIBER_PHYID2 0x03
71#define MV88E1512_FIBER_ANAR 0x04
72#define MV88E1512_FIBER_ANLPAR 0x05
73#define MV88E1512_FIBER_ANER 0x06
74#define MV88E1512_FIBER_ANNPR 0x07
75#define MV88E1512_FIBER_ANLPNPR 0x08
76#define MV88E1512_EXTENDED_STATUS 0x0F
77#define MV88E1512_FIBER_CTRL1 0x10
78#define MV88E1512_FIBER_STAT1 0x11
79#define MV88E1512_FIBER_INT_EN 0x12
80#define MV88E1512_FIBER_INT_STAT 0x13
81#define MV88E1512_PRBS_CTRL 0x17
82#define MV88E1512_PRBS_ERR_COUNTER_LSB 0x18
83#define MV88E1512_PRBS_ERR_COUNTER_MSB 0x19
84#define MV88E1512_FIBER_CTRL2 0x1A
87#define MV88E1512_MAC_CTRL1 0x10
88#define MV88E1512_MAC_INT_EN 0x12
89#define MV88E1512_MAC_INT_STAT 0x13
90#define MV88E1512_MAC_CTRL2 0x15
91#define MV88E1512_RGMII_OUT_IMP_CAL 0x18
94#define MV88E1512_LED_FUNC_CTRL 0x10
95#define MV88E1512_LED_POL_CTRL 0x11
96#define MV88E1512_LED_TIMER_CTRL 0x12
99#define MV88E1512_1000BT_PAIR_SKEW 0x14
100#define MV88E1512_1000BT_PAIR_SWAP_POL 0x15
103#define MV88E1512_COPPER_PKT_GEN 0x10
104#define MV88E1512_COPPER_CRC_COUNTERS 0x11
105#define MV88E1512_CHECKER_CTRL 0x12
106#define MV88E1512_COPPER_PKT_GEN_IPG_CTRL 0x13
107#define MV88E1512_LATE_COL_COUNTERS_1_2 0x17
108#define MV88E1512_LATE_COL_COUNTERS_3_4 0x18
109#define MV88E1512_LATE_COL_WIN_ADJ_LINK_DISCONNECT 0x19
110#define MV88E1512_MISC_TEST 0x1A
111#define MV88E1512_TEMP_SENSOR 0x1B
114#define MV88E1512_COPPER_CTRL_RESET 0x8000
115#define MV88E1512_COPPER_CTRL_LOOPBACK 0x4000
116#define MV88E1512_COPPER_CTRL_SPEED_SEL_LSB 0x2000
117#define MV88E1512_COPPER_CTRL_AN_EN 0x1000
118#define MV88E1512_COPPER_CTRL_POWER_DOWN 0x0800
119#define MV88E1512_COPPER_CTRL_ISOLATE 0x0400
120#define MV88E1512_COPPER_CTRL_RESTART_AN 0x0200
121#define MV88E1512_COPPER_CTRL_DUPLEX_MODE 0x0100
122#define MV88E1512_COPPER_CTRL_COL_TEST 0x0080
123#define MV88E1512_COPPER_CTRL_SPEED_SEL_MSB 0x0040
126#define MV88E1512_COPPER_STAT_100BT4 0x8000
127#define MV88E1512_COPPER_STAT_100BTX_FD 0x4000
128#define MV88E1512_COPPER_STAT_100BTX_HD 0x2000
129#define MV88E1512_COPPER_STAT_10BT_FD 0x1000
130#define MV88E1512_COPPER_STAT_10BT_HD 0x0800
131#define MV88E1512_COPPER_STAT_100BT2_FD 0x0400
132#define MV88E1512_COPPER_STAT_100BT2_HD 0x0200
133#define MV88E1512_COPPER_STAT_EXTENDED_STATUS 0x0100
134#define MV88E1512_COPPER_STAT_MF_PREAMBLE_SUPPR 0x0040
135#define MV88E1512_COPPER_STAT_AN_COMPLETE 0x0020
136#define MV88E1512_COPPER_STAT_REMOTE_FAULT 0x0010
137#define MV88E1512_COPPER_STAT_AN_CAPABLE 0x0008
138#define MV88E1512_COPPER_STAT_LINK_STATUS 0x0004
139#define MV88E1512_COPPER_STAT_JABBER_DETECT 0x0002
140#define MV88E1512_COPPER_STAT_EXTENDED_CAPABLE 0x0001
143#define MV88E1512_COPPER_PHYID1_OUI_MSB 0xFFFF
144#define MV88E1512_COPPER_PHYID1_OUI_MSB_DEFAULT 0x0141
147#define MV88E1512_COPPER_PHYID2_OUI_LSB 0xFC00
148#define MV88E1512_COPPER_PHYID2_OUI_LSB_DEFAULT 0x0C00
149#define MV88E1512_COPPER_PHYID2_MODEL_NUM 0x03F0
150#define MV88E1512_COPPER_PHYID2_MODEL_NUM_DEFAULT 0x01D0
151#define MV88E1512_COPPER_PHYID2_REVISION_NUM 0x000F
154#define MV88E1512_COPPER_ANAR_NEXT_PAGE 0x8000
155#define MV88E1512_COPPER_ANAR_ACK 0x4000
156#define MV88E1512_COPPER_ANAR_REMOTE_FAULT 0x2000
157#define MV88E1512_COPPER_ANAR_ASYM_PAUSE 0x0800
158#define MV88E1512_COPPER_ANAR_PAUSE 0x0400
159#define MV88E1512_COPPER_ANAR_100BT4 0x0200
160#define MV88E1512_COPPER_ANAR_100BTX_FD 0x0100
161#define MV88E1512_COPPER_ANAR_100BTX_HD 0x0080
162#define MV88E1512_COPPER_ANAR_10BT_FD 0x0040
163#define MV88E1512_COPPER_ANAR_10BT_HD 0x0020
164#define MV88E1512_COPPER_ANAR_SELECTOR 0x001F
165#define MV88E1512_COPPER_ANAR_SELECTOR_DEFAULT 0x0001
168#define MV88E1512_COPPER_ANLPAR_NEXT_PAGE 0x8000
169#define MV88E1512_COPPER_ANLPAR_ACK 0x4000
170#define MV88E1512_COPPER_ANLPAR_REMOTE_FAULT 0x2000
171#define MV88E1512_COPPER_ANLPAR_TECH_ABLE 0x1000
172#define MV88E1512_COPPER_ANLPAR_ASYM_PAUSE 0x0800
173#define MV88E1512_COPPER_ANLPAR_PAUSE 0x0400
174#define MV88E1512_COPPER_ANLPAR_100BT4 0x0200
175#define MV88E1512_COPPER_ANLPAR_100BTX_FD 0x0100
176#define MV88E1512_COPPER_ANLPAR_100BTX_HD 0x0080
177#define MV88E1512_COPPER_ANLPAR_10BT_FD 0x0040
178#define MV88E1512_COPPER_ANLPAR_10BT_HD 0x0020
179#define MV88E1512_COPPER_ANLPAR_SELECTOR 0x001F
180#define MV88E1512_COPPER_ANLPAR_SELECTOR_DEFAULT 0x0001
183#define MV88E1512_COPPER_ANER_PAR_DETECT_FAULT 0x0010
184#define MV88E1512_COPPER_ANER_LP_NEXT_PAGE_ABLE 0x0008
185#define MV88E1512_COPPER_ANER_NEXT_PAGE_ABLE 0x0004
186#define MV88E1512_COPPER_ANER_PAGE_RECEIVED 0x0002
187#define MV88E1512_COPPER_ANER_LP_AN_ABLE 0x0001
190#define MV88E1512_COPPER_ANNPR_NEXT_PAGE 0x8000
191#define MV88E1512_COPPER_ANNPR_MSG_PAGE 0x2000
192#define MV88E1512_COPPER_ANNPR_ACK2 0x1000
193#define MV88E1512_COPPER_ANNPR_TOGGLE 0x0800
194#define MV88E1512_COPPER_ANNPR_MESSAGE 0x07FF
197#define MV88E1512_COPPER_ANLPNPR_NEXT_PAGE 0x8000
198#define MV88E1512_COPPER_ANLPNPR_ACK 0x4000
199#define MV88E1512_COPPER_ANLPNPR_MSG_PAGE 0x2000
200#define MV88E1512_COPPER_ANLPNPR_ACK2 0x1000
201#define MV88E1512_COPPER_ANLPNPR_TOGGLE 0x0800
202#define MV88E1512_COPPER_ANLPNPR_MESSAGE 0x07FF
205#define MV88E1512_GBCR_TEST_MODE 0xE000
206#define MV88E1512_GBCR_MS_MAN_CONF_EN 0x1000
207#define MV88E1512_GBCR_MS_MAN_CONF_VAL 0x0800
208#define MV88E1512_GBCR_PORT_TYPE 0x0400
209#define MV88E1512_GBCR_1000BT_FD 0x0200
210#define MV88E1512_GBCR_1000BT_HD 0x0100
213#define MV88E1512_GBSR_MS_CONF_FAULT 0x8000
214#define MV88E1512_GBSR_MS_CONF_RES 0x4000
215#define MV88E1512_GBSR_LOCAL_RECEIVER_STATUS 0x2000
216#define MV88E1512_GBSR_REMOTE_RECEIVER_STATUS 0x1000
217#define MV88E1512_GBSR_LP_1000BT_FD 0x0800
218#define MV88E1512_GBSR_LP_1000BT_HD 0x0400
219#define MV88E1512_GBSR_IDLE_ERR_COUNT 0x00FF
222#define MV88E1512_GBESR_1000BX_FD 0x8000
223#define MV88E1512_GBESR_1000BX_HD 0x4000
224#define MV88E1512_GBESR_1000BT_FD 0x2000
225#define MV88E1512_GBESR_1000BT_HD 0x1000
228#define MV88E1512_COPPER_CTRL1_LINK_PULSE_DIS 0x8000
229#define MV88E1512_COPPER_CTRL1_FORCE_LINK_GOOD 0x0400
230#define MV88E1512_COPPER_CTRL1_ENERGY_DETECT 0x0300
231#define MV88E1512_COPPER_CTRL1_MDI_CROSSOVER_MODE 0x0060
232#define MV88E1512_COPPER_CTRL1_MDI_CROSSOVER_MODE_MANUAL_MDI 0x0000
233#define MV88E1512_COPPER_CTRL1_MDI_CROSSOVER_MODE_MANUAL_MDIX 0x0020
234#define MV88E1512_COPPER_CTRL1_MDI_CROSSOVER_MODE_AUTO 0x0060
235#define MV88E1512_COPPER_CTRL1_TX_DIS 0x0008
236#define MV88E1512_COPPER_CTRL1_POWER_DOWN 0x0004
237#define MV88E1512_COPPER_CTRL1_POLARITY_REVERSAL_DIS 0x0002
238#define MV88E1512_COPPER_CTRL1_JABBER_DIS 0x0001
241#define MV88E1512_COPPER_STAT1_SPEED 0xC000
242#define MV88E1512_COPPER_STAT1_SPEED_10MBPS 0x0000
243#define MV88E1512_COPPER_STAT1_SPEED_100MBPS 0x4000
244#define MV88E1512_COPPER_STAT1_SPEED_1000MBPS 0x8000
245#define MV88E1512_COPPER_STAT1_DUPLEX 0x2000
246#define MV88E1512_COPPER_STAT1_PAGE_RECEIVED 0x1000
247#define MV88E1512_COPPER_STAT1_SPEED_DUPLEX_RESOLVED 0x0800
248#define MV88E1512_COPPER_STAT1_LINK 0x0400
249#define MV88E1512_COPPER_STAT1_TX_PAUSE_EN 0x0200
250#define MV88E1512_COPPER_STAT1_RX_PAUSE_EN 0x0100
251#define MV88E1512_COPPER_STAT1_MDI_CROSSOVER_STATUS 0x0040
252#define MV88E1512_COPPER_STAT1_ENERGY_DETECT_STATUS 0x0010
253#define MV88E1512_COPPER_STAT1_GLOBAL_LINK_STATUS 0x0008
254#define MV88E1512_COPPER_STAT1_POLARITY 0x0002
255#define MV88E1512_COPPER_STAT1_JABBER 0x0001
258#define MV88E1512_COPPER_INT_EN_AN_ERROR 0x8000
259#define MV88E1512_COPPER_INT_EN_SPEED_CHANGED 0x4000
260#define MV88E1512_COPPER_INT_EN_DUPLEX_CHANGED 0x2000
261#define MV88E1512_COPPER_INT_EN_PAGE_RECEIVED 0x1000
262#define MV88E1512_COPPER_INT_EN_AN_COMPLETE 0x0800
263#define MV88E1512_COPPER_INT_EN_LINK_STATUS_CHANGED 0x0400
264#define MV88E1512_COPPER_INT_EN_SYMBOL_ERROR 0x0200
265#define MV88E1512_COPPER_INT_EN_FALSE_CARRIER 0x0100
266#define MV88E1512_COPPER_INT_EN_MDI_CROSSOVER_CHANGED 0x0040
267#define MV88E1512_COPPER_INT_EN_ENERGY_DETECT 0x0010
268#define MV88E1512_COPPER_INT_EN_FLP_COMPLETE 0x0008
269#define MV88E1512_COPPER_INT_EN_POLARITY_CHANGED 0x0002
270#define MV88E1512_COPPER_INT_EN_JABBER 0x0001
273#define MV88E1512_COPPER_INT_STAT_AN_ERROR 0x8000
274#define MV88E1512_COPPER_INT_STAT_SPEED_CHANGED 0x4000
275#define MV88E1512_COPPER_INT_STAT_DUPLEX_CHANGED 0x2000
276#define MV88E1512_COPPER_INT_STAT_PAGE_RECEIVED 0x1000
277#define MV88E1512_COPPER_INT_STAT_AN_COMPLETE 0x0800
278#define MV88E1512_COPPER_INT_STAT_LINK_STATUS_CHANGED 0x0400
279#define MV88E1512_COPPER_INT_STAT_SYMBOL_ERROR 0x0200
280#define MV88E1512_COPPER_INT_STAT_FALSE_CARRIER 0x0100
281#define MV88E1512_COPPER_INT_STAT_MDI_CROSSOVER_CHANGED 0x0040
282#define MV88E1512_COPPER_INT_STAT_ENERGY_DETECT 0x0010
283#define MV88E1512_COPPER_INT_STAT_FLP_COMPLETE 0x0008
284#define MV88E1512_COPPER_INT_STAT_POLARITY_CHANGED 0x0002
285#define MV88E1512_COPPER_INT_STAT_JABBER 0x0001
288#define MV88E1512_COPPER_CTRL2_BREAK_LINK_ON_INSUF_IPG 0x0040
289#define MV88E1512_COPPER_CTRL2_REVERSE_MDIPN3_TX_POL 0x0008
290#define MV88E1512_COPPER_CTRL2_REVERSE_MDIPN2_TX_POL 0x0004
291#define MV88E1512_COPPER_CTRL2_REVERSE_MDIPN1_TX_POL 0x0002
292#define MV88E1512_COPPER_CTRL2_REVERSE_MDIPN0_TX_POL 0x0001
295#define MV88E1512_PAGSR_PAGE_SEL 0x00FF
298#define MV88E1512_GISR_INTERRUPT 0x0001
301#define MV88E1512_FIBER_CTRL_RESET 0x8000
302#define MV88E1512_FIBER_CTRL_LOOPBACK 0x4000
303#define MV88E1512_FIBER_CTRL_SPEED_SEL_LSB 0x2000
304#define MV88E1512_FIBER_CTRL_AN_EN 0x1000
305#define MV88E1512_FIBER_CTRL_POWER_DOWN 0x0800
306#define MV88E1512_FIBER_CTRL_ISOLATE 0x0400
307#define MV88E1512_FIBER_CTRL_RESTART_AN 0x0200
308#define MV88E1512_FIBER_CTRL_DUPLEX_MODE 0x0100
309#define MV88E1512_FIBER_CTRL_COL_TEST 0x0080
310#define MV88E1512_FIBER_CTRL_SPEED_SEL_MSB 0x0040
313#define MV88E1512_FIBER_STAT_100BT4 0x8000
314#define MV88E1512_FIBER_STAT_100BTX_FD 0x4000
315#define MV88E1512_FIBER_STAT_100BTX_HD 0x2000
316#define MV88E1512_FIBER_STAT_10BT_FD 0x1000
317#define MV88E1512_FIBER_STAT_10BT_HD 0x0800
318#define MV88E1512_FIBER_STAT_100BT2_FD 0x0400
319#define MV88E1512_FIBER_STAT_100BT2_HD 0x0200
320#define MV88E1512_FIBER_STAT_EXTENDED_STATUS 0x0100
321#define MV88E1512_FIBER_STAT_MF_PREAMBLE_SUPPR 0x0040
322#define MV88E1512_FIBER_STAT_AN_COMPLETE 0x0020
323#define MV88E1512_FIBER_STAT_REMOTE_FAULT 0x0010
324#define MV88E1512_FIBER_STAT_AN_CAPABLE 0x0008
325#define MV88E1512_FIBER_STAT_LINK_STATUS 0x0004
326#define MV88E1512_FIBER_STAT_EXTENDED_CAPABLE 0x0001
329#define MV88E1512_FIBER_PHYID1_OUI_MSB 0xFFFF
330#define MV88E1512_FIBER_PHYID1_OUI_MSB_DEFAULT 0x0141
333#define MV88E1512_FIBER_PHYID2_OUI_LSB 0xFC00
334#define MV88E1512_FIBER_PHYID2_OUI_LSB_DEFAULT 0x0C00
335#define MV88E1512_FIBER_PHYID2_MODEL_NUM 0x03F0
336#define MV88E1512_FIBER_PHYID2_MODEL_NUM_DEFAULT 0x01D0
337#define MV88E1512_FIBER_PHYID2_REVISION_NUM 0x000F
340#define MV88E1512_FIBER_ANAR_NEXT_PAGE 0x8000
341#define MV88E1512_FIBER_ANAR_REMOTE_FAULT 0x3000
342#define MV88E1512_FIBER_ANAR_REMOTE_FAULT_NO_ERROR 0x0000
343#define MV88E1512_FIBER_ANAR_REMOTE_FAULT_LINK_FAILURE 0x1000
344#define MV88E1512_FIBER_ANAR_REMOTE_FAULT_OFFLINE 0x2000
345#define MV88E1512_FIBER_ANAR_REMOTE_FAULT_AN_ERROR 0x3000
346#define MV88E1512_FIBER_ANAR_PAUSE 0x0180
347#define MV88E1512_FIBER_ANAR_1000BX_HD 0x0040
348#define MV88E1512_FIBER_ANAR_1000BX_FD 0x0020
351#define MV88E1512_FIBER_ANLPAR_NEXT_PAGE 0x8000
352#define MV88E1512_FIBER_ANLPAR_ACK 0x4000
353#define MV88E1512_FIBER_ANLPAR_REMOTE_FAULT 0x3000
354#define MV88E1512_FIBER_ANLPAR_REMOTE_FAULT_NO_ERROR 0x0000
355#define MV88E1512_FIBER_ANLPAR_REMOTE_FAULT_LINK_FAILURE 0x1000
356#define MV88E1512_FIBER_ANLPAR_REMOTE_FAULT_OFFLINE 0x2000
357#define MV88E1512_FIBER_ANLPAR_REMOTE_FAULT_AN_ERROR 0x3000
358#define MV88E1512_FIBER_ANLPAR_ASYM_PAUSE 0x0180
359#define MV88E1512_FIBER_ANLPAR_1000BX_HD 0x0040
360#define MV88E1512_FIBER_ANLPAR_1000BX_FD 0x0020
363#define MV88E1512_FIBER_ANER_LP_NEXT_PAGE_ABLE 0x0008
364#define MV88E1512_FIBER_ANER_NEXT_PAGE_ABLE 0x0004
365#define MV88E1512_FIBER_ANER_PAGE_RECEIVED 0x0002
366#define MV88E1512_FIBER_ANER_LP_AN_ABLE 0x0001
369#define MV88E1512_FIBER_ANNPR_NEXT_PAGE 0x8000
370#define MV88E1512_FIBER_ANNPR_MSG_PAGE 0x2000
371#define MV88E1512_FIBER_ANNPR_ACK2 0x1000
372#define MV88E1512_FIBER_ANNPR_TOGGLE 0x0800
373#define MV88E1512_FIBER_ANNPR_MESSAGE 0x07FF
376#define MV88E1512_FIBER_ANLPNPR_NEXT_PAGE 0x8000
377#define MV88E1512_FIBER_ANLPNPR_ACK 0x4000
378#define MV88E1512_FIBER_ANLPNPR_MSG_PAGE 0x2000
379#define MV88E1512_FIBER_ANLPNPR_ACK2 0x1000
380#define MV88E1512_FIBER_ANLPNPR_TOGGLE 0x0800
381#define MV88E1512_FIBER_ANLPNPR_MESSAGE 0x07FF
384#define MV88E1512_EXTENDED_STATUS_1000BX_FD 0x8000
385#define MV88E1512_EXTENDED_STATUS_1000BX_HD 0x4000
386#define MV88E1512_EXTENDED_STATUS_1000BT_FD 0x2000
387#define MV88E1512_EXTENDED_STATUS_1000BT_HD 0x1000
390#define MV88E1512_FIBER_CTRL1_BLOCK_CARRIER_EXTENSION 0x2000
391#define MV88E1512_FIBER_CTRL1_ASSERT_CRS_TX 0x0800
392#define MV88E1512_FIBER_CTRL1_FORCE_LINK_GOOD 0x0400
393#define MV88E1512_FIBER_CTRL1_SERDES_LOOPBACK_TYPE 0x0100
394#define MV88E1512_FIBER_CTRL1_MARVELL_REMOTE_FAULT_IND 0x0020
395#define MV88E1512_FIBER_CTRL1_IEEE_REMOTE_FAULT_IND 0x0010
396#define MV88E1512_FIBER_CTRL1_INT_POLARITY 0x0004
397#define MV88E1512_FIBER_CTRL1_MODE 0x0003
400#define MV88E1512_FIBER_STAT1_SPEED 0xC000
401#define MV88E1512_FIBER_STAT1_SPEED_10MBPS 0x0000
402#define MV88E1512_FIBER_STAT1_SPEED_100MBPS 0x4000
403#define MV88E1512_FIBER_STAT1_SPEED_1000MBPS 0x8000
404#define MV88E1512_FIBER_STAT1_DUPLEX 0x2000
405#define MV88E1512_FIBER_STAT1_PAGE_RECEIVED 0x1000
406#define MV88E1512_FIBER_STAT1_SPEED_DUPLEX_RESOLVED 0x0800
407#define MV88E1512_FIBER_STAT1_LINK 0x0400
408#define MV88E1512_FIBER_STAT1_REMOTE_FAULT_RECEIVED 0x00C0
409#define MV88E1512_FIBER_STAT1_SYNC_STATUS 0x0020
410#define MV88E1512_FIBER_STAT1_ENERGY_DETECT_STATUS 0x0010
411#define MV88E1512_FIBER_STAT1_TX_PAUSE_EN 0x0008
412#define MV88E1512_FIBER_STAT1_RX_PAUSE_EN 0x0004
415#define MV88E1512_FIBER_INT_EN_SPEED_CHANGED 0x4000
416#define MV88E1512_FIBER_INT_EN_DUPLEX_CHANGED 0x2000
417#define MV88E1512_FIBER_INT_EN_PAGE_RECEIVED 0x1000
418#define MV88E1512_FIBER_INT_EN_AN_COMPLETE 0x0800
419#define MV88E1512_FIBER_INT_EN_LINK_STATUS_CHANGED 0x0400
420#define MV88E1512_FIBER_INT_EN_SYMBOL_ERROR 0x0200
421#define MV88E1512_FIBER_INT_EN_FALSE_CARRIER 0x0100
422#define MV88E1512_FIBER_INT_EN_FIFO_OVER_UNDERFLOW 0x0080
423#define MV88E1512_FIBER_INT_EN_REMOTE_FAULT_RECEIVE 0x0020
424#define MV88E1512_FIBER_INT_EN_ENERGY_DETECT 0x0010
427#define MV88E1512_FIBER_INT_STAT_SPEED_CHANGED 0x4000
428#define MV88E1512_FIBER_INT_STAT_DUPLEX_CHANGED 0x2000
429#define MV88E1512_FIBER_INT_STAT_PAGE_RECEIVED 0x1000
430#define MV88E1512_FIBER_INT_STAT_AN_COMPLETE 0x0800
431#define MV88E1512_FIBER_INT_STAT_LINK_STATUS_CHANGED 0x0400
432#define MV88E1512_FIBER_INT_STAT_SYMBOL_ERROR 0x0200
433#define MV88E1512_FIBER_INT_STAT_FALSE_CARRIER 0x0100
434#define MV88E1512_FIBER_INT_STAT_FIFO_OVER_UNDERFLOW 0x0080
435#define MV88E1512_FIBER_INT_STAT_REMOTE_FAULT_RECEIVE 0x0020
436#define MV88E1512_FIBER_INT_STAT_ENERGY_DETECT 0x0010
439#define MV88E1512_PRBS_CTRL_INVERT_CHECK_POL 0x0080
440#define MV88E1512_PRBS_CTRL_INVERT_GEN_POL 0x0040
441#define MV88E1512_PRBS_CTRL_PRBS_LOCK 0x0020
442#define MV88E1512_PRBS_CTRL_CLEAR_COUNTER 0x0010
443#define MV88E1512_PRBS_CTRL_PATTERN_SEL 0x000C
444#define MV88E1512_PRBS_CTRL_PRBS_CHECK_EN 0x0002
445#define MV88E1512_PRBS_CTRL_PRBS_GEN_EN 0x0001
448#define MV88E1512_FIBER_CTRL2_FORCE_INT 0x8000
449#define MV88E1512_FIBER_CTRL2_1000BX_NOISE_FILT 0x4000
450#define MV88E1512_FIBER_CTRL2_FEFI_EN 0x0200
451#define MV88E1512_FIBER_CTRL2_SERIAL_IF_AN_BYPASS_EN 0x0040
452#define MV88E1512_FIBER_CTRL2_SERIAL_IF_AN_BYPASS_STATUS 0x0020
453#define MV88E1512_FIBER_CTRL2_FIBER_TX_DIS 0x0008
454#define MV88E1512_FIBER_CTRL2_SGMII_FIBER_OUT_AMPL 0x0007
457#define MV88E1512_MAC_CTRL1_PASS_ODD_NIBBLE_PREAMBLES 0x0040
458#define MV88E1512_MAC_CTRL1_RGMII_IF_POWER_DOWN 0x0008
461#define MV88E1512_MAC_INT_EN_FIFO_OVER_UNDERFLOW 0x0080
462#define MV88E1512_MAC_INT_EN_FIFO_IDLE_INSERTED 0x0008
463#define MV88E1512_MAC_INT_EN_FIFO_IDLE_DELETED 0x0004
466#define MV88E1512_MAC_INT_STAT_FIFO_OVER_UNDERFLOW 0x0080
467#define MV88E1512_MAC_INT_STAT_FIFO_IDLE_INSERTED 0x0008
468#define MV88E1512_MAC_INT_STAT_FIFO_IDLE_DELETED 0x0004
471#define MV88E1512_MAC_CTRL2_COPPER_LINE_LOOPBACK 0x4000
472#define MV88E1512_MAC_CTRL2_DEFAULT_MAC_IF_SPEED_LSB 0x2000
473#define MV88E1512_MAC_CTRL2_DEFAULT_MAC_IF_SPEED_MSB 0x0040
474#define MV88E1512_MAC_CTRL2_RGMII_RX_TIMING_CTRL 0x0020
475#define MV88E1512_MAC_CTRL2_RGMII_TX_TIMING_CTRL 0x0010
476#define MV88E1512_MAC_CTRL2_BLOCK_CARRIER_EXTENSION 0x0008
479#define MV88E1512_RGMII_OUT_IMP_CAL_VDDO_LEVEL 0x2000
480#define MV88E1512_RGMII_OUT_IMP_CAL_1V8_VDDO_USED 0x1000
483#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL 0x0F00
484#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_LINK 0x0000
485#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_LINK_ACT 0x0100
486#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_DUPLEX_COL 0x0200
487#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_ACT 0x0300
488#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_ACT_BLINK 0x0400
489#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_TX 0x0500
490#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_SPEED_10_1000 0x0600
491#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_SPEED_10 0x0700
492#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_FORCE_OFF 0x0800
493#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_FORCE_ON 0x0900
494#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_FORCE_HIZ 0x0A00
495#define MV88E1512_LED_FUNC_CTRL_LED2_CTRL_FORCE_BLINK 0x0B00
496#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL 0x00F0
497#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_LINK 0x0000
498#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_LINK_ACT 0x0010
499#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_DUPLEX_COL 0x0020
500#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_ACT 0x0030
501#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_ACT_BLINK 0x0040
502#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_TX 0x0050
503#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_SPEED_10_1000 0x0060
504#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_SPEED_10 0x0070
505#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_FORCE_OFF 0x0080
506#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_FORCE_ON 0x0090
507#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_FORCE_HIZ 0x00A0
508#define MV88E1512_LED_FUNC_CTRL_LED1_CTRL_FORCE_BLINK 0x00B0
509#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL 0x000F
510#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_LINK 0x0000
511#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_LINK_ACT 0x0001
512#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_DUPLEX_COL 0x0002
513#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_ACT 0x0003
514#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_ACT_BLINK 0x0004
515#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_TX 0x0005
516#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_SPEED_10_1000 0x0006
517#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_SPEED_10 0x0007
518#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_FORCE_OFF 0x0008
519#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_FORCE_ON 0x0009
520#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_FORCE_HIZ 0x000A
521#define MV88E1512_LED_FUNC_CTRL_LED0_CTRL_FORCE_BLINK 0x000B
524#define MV88E1512_LED_POL_CTRL_LED1_MIX_PERCENT 0xF000
525#define MV88E1512_LED_POL_CTRL_LED0_MIX_PERCENT 0x0F00
526#define MV88E1512_LED_POL_CTRL_LED2_POL 0x0030
527#define MV88E1512_LED_POL_CTRL_LED2_POL_ON_LOW_OFF_HIGH 0x0000
528#define MV88E1512_LED_POL_CTRL_LED2_POL_ON_HIGH_OFF_LOW 0x0010
529#define MV88E1512_LED_POL_CTRL_LED2_POL_ON_LOW_OFF_TRISTATE 0x0020
530#define MV88E1512_LED_POL_CTRL_LED2_POL_ON_HIGH_OFF_TRISTATE 0x0030
531#define MV88E1512_LED_POL_CTRL_LED1_POL 0x000C
532#define MV88E1512_LED_POL_CTRL_LED1_POL_ON_LOW_OFF_HIGH 0x0000
533#define MV88E1512_LED_POL_CTRL_LED1_POL_ON_HIGH_OFF_LOW 0x0004
534#define MV88E1512_LED_POL_CTRL_LED1_POL_ON_LOW_OFF_TRISTATE 0x0008
535#define MV88E1512_LED_POL_CTRL_LED1_POL_ON_HIGH_OFF_TRISTATE 0x000C
536#define MV88E1512_LED_POL_CTRL_LED0_POL 0x0003
537#define MV88E1512_LED_POL_CTRL_LED0_POL_ON_LOW_OFF_HIGH 0x0000
538#define MV88E1512_LED_POL_CTRL_LED0_POL_ON_HIGH_OFF_LOW 0x0001
539#define MV88E1512_LED_POL_CTRL_LED0_POL_ON_LOW_OFF_TRISTATE 0x0002
540#define MV88E1512_LED_POL_CTRL_LED0_POL_ON_HIGH_OFF_TRISTATE 0x0003
543#define MV88E1512_LED_TIMER_CTRL_FORCE_INT 0x8000
544#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH 0x7000
545#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_NO 0x0000
546#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_21MS_TO_42MS 0x1000
547#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_42MS_TO_84MS 0x2000
548#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_84MS_TO_170MS 0x3000
549#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_170MS_TO_340MS 0x4000
550#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_340MS_TO_670MS 0x5000
551#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_670MS_TO_1_3S 0x6000
552#define MV88E1512_LED_TIMER_CTRL_PULSE_STRETCH_1_3S_TO_2_7S 0x7000
553#define MV88E1512_LED_TIMER_CTRL_INT_POL 0x0800
554#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE 0x0700
555#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE_42MS 0x0000
556#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE_84MS 0x0100
557#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE_170MS 0x0200
558#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE_340MS 0x0300
559#define MV88E1512_LED_TIMER_CTRL_BLINK_RATE_670MS 0x0400
560#define MV88E1512_LED_TIMER_CTRL_INT_EN 0x0080
561#define MV88E1512_LED_TIMER_CTRL_SPEED_OFF_PULSE 0x000C
562#define MV88E1512_LED_TIMER_CTRL_SPEED_OFF_PULSE_84MS 0x0000
563#define MV88E1512_LED_TIMER_CTRL_SPEED_OFF_PULSE_170MS 0x0004
564#define MV88E1512_LED_TIMER_CTRL_SPEED_OFF_PULSE_340MS 0x0008
565#define MV88E1512_LED_TIMER_CTRL_SPEED_OFF_PULSE_670MS 0x000C
566#define MV88E1512_LED_TIMER_CTRL_SPEED_ON_PULSE 0x0003
567#define MV88E1512_LED_TIMER_CTRL_SPEED_ON_PULSE_84MS 0x0000
568#define MV88E1512_LED_TIMER_CTRL_SPEED_ON_PULSE_170MS 0x0001
569#define MV88E1512_LED_TIMER_CTRL_SPEED_ON_PULSE_340MS 0x0002
570#define MV88E1512_LED_TIMER_CTRL_SPEED_ON_PULSE_670MS 0x0003
573#define MV88E1512_1000BT_PAIR_SKEW_PAIR_7_8_MDI3 0xF000
574#define MV88E1512_1000BT_PAIR_SKEW_PAIR_4_5_MDI2 0x0F00
575#define MV88E1512_1000BT_PAIR_SKEW_PAIR_3_6_MDI1 0x00F0
576#define MV88E1512_1000BT_PAIR_SKEW_PAIR_1_2_MDI0 0x000F
579#define MV88E1512_1000BT_PAIR_SWAP_POL_REG_20_5_21_5_VALID 0x0040
580#define MV88E1512_1000BT_PAIR_SWAP_POL_C_D_CROSSOVER 0x0020
581#define MV88E1512_1000BT_PAIR_SWAP_POL_A_B_CROSSOVER 0x0010
582#define MV88E1512_1000BT_PAIR_SWAP_POL_PAIR_7_8_POL 0x0008
583#define MV88E1512_1000BT_PAIR_SWAP_POL_PAIR_4_5_POL 0x0004
584#define MV88E1512_1000BT_PAIR_SWAP_POL_PAIR_3_6_POL 0x0002
585#define MV88E1512_1000BT_PAIR_SWAP_POL_PAIR_1_2_POL 0x0001
593extern const PhyDriver mv88e1512PhyDriver;
596error_t mv88e1512Init(NetInterface *interface);
597void mv88e1512InitHook(NetInterface *interface);
599void mv88e1512Tick(NetInterface *interface);
601void mv88e1512EnableIrq(NetInterface *interface);
602void mv88e1512DisableIrq(NetInterface *interface);
604void mv88e1512EventHandler(NetInterface *interface);
606void mv88e1512WritePhyReg(NetInterface *interface, uint8_t address,
609uint16_t mv88e1512ReadPhyReg(NetInterface *interface, uint8_t address);
611void mv88e1512DumpPhyReg(NetInterface *interface);
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
Ethernet PHY driver.
Definition nic.h:308