dp83867_driver.h
Go to the documentation of this file.
1 /**
2  * @file dp83867_driver.h
3  * @brief DP83867 Gigabit Ethernet PHY driver
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _DP83867_DRIVER_H
32 #define _DP83867_DRIVER_H
33 
34 //Dependencies
35 #include "core/nic.h"
36 
37 //PHY address
38 #ifndef DP83867_PHY_ADDR
39  #define DP83867_PHY_ADDR 0
40 #elif (DP83867_PHY_ADDR < 0 || DP83867_PHY_ADDR > 31)
41  #error DP83867_PHY_ADDR parameter is not valid
42 #endif
43 
44 //DP83867 PHY registers
45 #define DP83867_BMCR 0x00
46 #define DP83867_BMSR 0x01
47 #define DP83867_PHYIDR1 0x02
48 #define DP83867_PHYIDR2 0x03
49 #define DP83867_ANAR 0x04
50 #define DP83867_ANLPAR 0x05
51 #define DP83867_ANER 0x06
52 #define DP83867_ANNPTR 0x07
53 #define DP83867_ANNPRR 0x08
54 #define DP83867_CFG1 0x09
55 #define DP83867_STS1 0x0A
56 #define DP83867_REGCR 0x0D
57 #define DP83867_ADDAR 0x0E
58 #define DP83867_1KSCR 0x0F
59 #define DP83867_PHYCR 0x10
60 #define DP83867_PHYSTS 0x11
61 #define DP83867_MICR 0x12
62 #define DP83867_MISR 0x13
63 #define DP83867_CFG2 0x14
64 #define DP83867_RECR 0x15
65 #define DP83867_BISCR 0x16
66 #define DP83867_STS2 0x17
67 #define DP83867_LEDCR1 0x18
68 #define DP83867_LEDCR2 0x19
69 #define DP83867_LEDCR3 0x1A
70 #define DP83867_CFG3 0x1E
71 #define DP83867_CTRL 0x1F
72 
73 //DP83867 MMD registers
74 #define DP83867_TMCH_CTRL 0x1F, 0x0025
75 #define DP83867_AMDIX_TMR_CFG 0x1F, 0x002C
76 #define DP83867_FLD_CFG 0x1F, 0x002D
77 #define DP83867_FLD_THR_CFG 0x1F, 0x002E
78 #define DP83867_CFG4 0x1F, 0x0031
79 #define DP83867_RGMIICTL 0x1F, 0x0032
80 #define DP83867_RGMIICTL2 0x1F, 0x0033
81 #define DP83867_100CR 0x1F, 0x0043
82 #define DP83867_VTM_CFG 0x1F, 0x0053
83 #define DP83867_SKEW_FIFO 0x1F, 0x0055
84 #define DP83867_STRAP_STS1 0x1F, 0x006E
85 #define DP83867_STRAP_STS2 0x1F, 0x006F
86 #define DP83867_BICSR1 0x1F, 0x0071
87 #define DP83867_BICSR2 0x1F, 0x0072
88 #define DP83867_BICSR3 0x1F, 0x007B
89 #define DP83867_BICSR4 0x1F, 0x007C
90 #define DP83867_RGMIIDCTL 0x1F, 0x0086
91 #define DP83867_PLLCTL 0x1F, 0x00C6
92 #define DP83867_SYNC_FIFO_CTRL 0x1F, 0x00E9
93 #define DP83867_LOOPCR 0x1F, 0x00FE
94 #define DP83867_DSP_FFE_CFG 0x1F, 0x012C
95 #define DP83867_RXFCFG 0x1F, 0x0134
96 #define DP83867_RXFSTS 0x1F, 0x0135
97 #define DP83867_RXFPMD1 0x1F, 0x0136
98 #define DP83867_RXFPMD2 0x1F, 0x0137
99 #define DP83867_RXFPMD3 0x1F, 0x0138
100 #define DP83867_RXFSOP1 0x1F, 0x0139
101 #define DP83867_RXFSOP2 0x1F, 0x013A
102 #define DP83867_RXFSOP3 0x1F, 0x013B
103 #define DP83867_RXFPAT1 0x1F, 0x013C
104 #define DP83867_RXFPAT2 0x1F, 0x013D
105 #define DP83867_RXFPAT3 0x1F, 0x013E
106 #define DP83867_RXFPAT4 0x1F, 0x013F
107 #define DP83867_RXFPAT5 0x1F, 0x0140
108 #define DP83867_RXFPAT6 0x1F, 0x0141
109 #define DP83867_RXFPAT7 0x1F, 0x0142
110 #define DP83867_RXFPAT8 0x1F, 0x0143
111 #define DP83867_RXFPAT9 0x1F, 0x0144
112 #define DP83867_RXFPAT10 0x1F, 0x0145
113 #define DP83867_RXFPAT11 0x1F, 0x0146
114 #define DP83867_RXFPAT12 0x1F, 0x0147
115 #define DP83867_RXFPAT13 0x1F, 0x0148
116 #define DP83867_RXFPAT14 0x1F, 0x0149
117 #define DP83867_RXFPAT15 0x1F, 0x014A
118 #define DP83867_RXFPAT16 0x1F, 0x014B
119 #define DP83867_RXFPAT17 0x1F, 0x014C
120 #define DP83867_RXFPAT18 0x1F, 0x014D
121 #define DP83867_RXFPAT19 0x1F, 0x014E
122 #define DP83867_RXFPAT20 0x1F, 0x014F
123 #define DP83867_RXFPAT21 0x1F, 0x0150
124 #define DP83867_RXFPAT22 0x1F, 0x0151
125 #define DP83867_RXFPAT23 0x1F, 0x0152
126 #define DP83867_RXFPAT24 0x1F, 0x0153
127 #define DP83867_RXFPAT25 0x1F, 0x0154
128 #define DP83867_RXFPAT26 0x1F, 0x0155
129 #define DP83867_RXFPAT27 0x1F, 0x0156
130 #define DP83867_RXFPAT28 0x1F, 0x0157
131 #define DP83867_RXFPAT29 0x1F, 0x0158
132 #define DP83867_RXFPAT30 0x1F, 0x0159
133 #define DP83867_RXFPAT31 0x1F, 0x015A
134 #define DP83867_RXFPAT32 0x1F, 0x015B
135 #define DP83867_RXFPBM1 0x1F, 0x015C
136 #define DP83867_RXFPBM2 0x1F, 0x015D
137 #define DP83867_RXFPBM3 0x1F, 0x015E
138 #define DP83867_RXFPBM4 0x1F, 0x015F
139 #define DP83867_RXFPATC 0x1F, 0x0161
140 #define DP83867_IO_MUX_CFG 0x1F, 0x0170
141 #define DP83867_GPIO_MUX_CTRL1 0x1F, 0x0171
142 #define DP83867_GPIO_MUX_CTRL2 0x1F, 0x0172
143 #define DP83867_GPIO_MUX_CTRL 0x1F, 0x0172
144 #define DP83867_TDR_GEN_CFG1 0x1F, 0x0180
145 #define DP83867_TDR_PEAKS_LOC_1 0x1F, 0x0190
146 #define DP83867_TDR_PEAKS_LOC_2 0x1F, 0x0191
147 #define DP83867_TDR_PEAKS_LOC_3 0x1F, 0x0192
148 #define DP83867_TDR_PEAKS_LOC_4 0x1F, 0x0193
149 #define DP83867_TDR_PEAKS_LOC_5 0x1F, 0x0194
150 #define DP83867_TDR_PEAKS_LOC_6 0x1F, 0x0195
151 #define DP83867_TDR_PEAKS_LOC_7 0x1F, 0x0196
152 #define DP83867_TDR_PEAKS_LOC_8 0x1F, 0x0197
153 #define DP83867_TDR_PEAKS_LOC_9 0x1F, 0x0198
154 #define DP83867_TDR_PEAKS_LOC_10 0x1F, 0x0199
155 #define DP83867_TDR_PEAKS_AMP_1 0x1F, 0x019A
156 #define DP83867_TDR_PEAKS_AMP_2 0x1F, 0x019B
157 #define DP83867_TDR_PEAKS_AMP_3 0x1F, 0x019C
158 #define DP83867_TDR_PEAKS_AMP_4 0x1F, 0x019D
159 #define DP83867_TDR_PEAKS_AMP_5 0x1F, 0x019E
160 #define DP83867_TDR_PEAKS_AMP_6 0x1F, 0x019F
161 #define DP83867_TDR_PEAKS_AMP_7 0x1F, 0x01A0
162 #define DP83867_TDR_PEAKS_AMP_8 0x1F, 0x01A1
163 #define DP83867_TDR_PEAKS_AMP_9 0x1F, 0x01A2
164 #define DP83867_TDR_PEAKS_AMP_10 0x1F, 0x01A3
165 #define DP83867_PROG_GAIN 0x1F, 0x01D5
166 
167 //Basic Mode Control register
168 #define DP83867_BMCR_RESET 0x8000
169 #define DP83867_BMCR_LOOPBACK 0x4000
170 #define DP83867_BMCR_SPEED_SEL_LSB 0x2000
171 #define DP83867_BMCR_AN_EN 0x1000
172 #define DP83867_BMCR_POWER_DOWN 0x0800
173 #define DP83867_BMCR_ISOLATE 0x0400
174 #define DP83867_BMCR_RESTART_AN 0x0200
175 #define DP83867_BMCR_DUPLEX_MODE 0x0100
176 #define DP83867_BMCR_COL_TEST 0x0080
177 #define DP83867_BMCR_SPEED_SEL_MSB 0x0040
178 
179 //Basic Mode Status register
180 #define DP83867_BMSR_100BT4 0x8000
181 #define DP83867_BMSR_100BTX_FD 0x4000
182 #define DP83867_BMSR_100BTX_HD 0x2000
183 #define DP83867_BMSR_10BT_FD 0x1000
184 #define DP83867_BMSR_10BT_HD 0x0800
185 #define DP83867_BMSR_100BT2_FD 0x0400
186 #define DP83867_BMSR_100BT2_HD 0x0200
187 #define DP83867_BMSR_EXTENDED_STATUS 0x0100
188 #define DP83867_BMSR_MF_PREAMBLE_SUPPR 0x0040
189 #define DP83867_BMSR_AN_COMPLETE 0x0020
190 #define DP83867_BMSR_REMOTE_FAULT 0x0010
191 #define DP83867_BMSR_AN_CAPABLE 0x0008
192 #define DP83867_BMSR_LINK_STATUS 0x0004
193 #define DP83867_BMSR_JABBER_DETECT 0x0002
194 #define DP83867_BMSR_EXTENDED_CAPABLE 0x0001
195 
196 //PHY Identifier 1 register
197 #define DP83867_PHYIDR1_OUI_MSB 0xFFFF
198 #define DP83867_PHYIDR1_OUI_MSB_DEFAULT 0x2000
199 
200 //PHY Identifier 2 register
201 #define DP83867_PHYIDR2_OUI_LSB 0xFC00
202 #define DP83867_PHYIDR2_OUI_LSB_DEFAULT 0xA000
203 #define DP83867_PHYIDR2_VNDR_MDL 0x03F0
204 #define DP83867_PHYIDR2_VNDR_MDL_DEFAULT 0x0230
205 #define DP83867_PHYIDR2_MDL_REV 0x000F
206 
207 //Auto-Negotiation Advertisement register
208 #define DP83867_ANAR_NEXT_PAGE 0x8000
209 #define DP83867_ANAR_REMOTE_FAULT 0x2000
210 #define DP83867_ANAR_ASM_DIR 0x0800
211 #define DP83867_ANAR_PAUSE 0x0400
212 #define DP83867_ANAR_100BT4 0x0200
213 #define DP83867_ANAR_100BTX_FD 0x0100
214 #define DP83867_ANAR_100BTX_HD 0x0080
215 #define DP83867_ANAR_10BT_FD 0x0040
216 #define DP83867_ANAR_10BT_HD 0x0020
217 #define DP83867_ANAR_SELECTOR 0x001F
218 #define DP83867_ANAR_SELECTOR_DEFAULT 0x0001
219 
220 //Auto-Negotiation Link Partner Ability register
221 #define DP83867_ANLPAR_NEXT_PAGE 0x8000
222 #define DP83867_ANLPAR_ACK 0x4000
223 #define DP83867_ANLPAR_REMOTE_FAULT 0x2000
224 #define DP83867_ANLPAR_ASM_DIR 0x0800
225 #define DP83867_ANLPAR_PAUSE 0x0400
226 #define DP83867_ANLPAR_100BT4 0x0200
227 #define DP83867_ANLPAR_100BTX_FD 0x0100
228 #define DP83867_ANLPAR_100BTX_HD 0x0080
229 #define DP83867_ANLPAR_10BT_FD 0x0040
230 #define DP83867_ANLPAR_10BT_HD 0x0020
231 #define DP83867_ANLPAR_SELECTOR 0x001F
232 
233 //Auto-Negotiation Expansion register
234 #define DP83867_ANER_RX_NEXT_PAGE_LOC_ABLE 0x0040
235 #define DP83867_ANER_RX_NEXT_PAGE_STOR_LOC 0x0020
236 #define DP83867_ANER_PAR_DETECT_FAULT 0x0010
237 #define DP83867_ANER_LP_NP_ABLE 0x0008
238 #define DP83867_ANER_NP_ABLE 0x0004
239 #define DP83867_ANER_PAGE_RX 0x0002
240 #define DP83867_ANER_LP_AN_ABLE 0x0001
241 
242 //Auto-Negotiation Next Page Transmit register
243 #define DP83867_ANNPTR_NEXT_PAGE 0x8000
244 #define DP83867_ANNPTR_ACK 0x4000
245 #define DP83867_ANNPTR_MSG_PAGE 0x2000
246 #define DP83867_ANNPTR_ACK2 0x1000
247 #define DP83867_ANNPTR_TOGGLE 0x0800
248 #define DP83867_ANNPTR_CODE 0x07FF
249 
250 //Auto-Negotiation Next Page Receive register
251 #define DP83867_ANNPRR_NEXT_PAGE 0x8000
252 #define DP83867_ANNPRR_ACK 0x4000
253 #define DP83867_ANNPRR_MSG_PAGE 0x2000
254 #define DP83867_ANNPRR_ACK2 0x1000
255 #define DP83867_ANNPRR_TOGGLE 0x0800
256 #define DP83867_ANNPRR_CODE 0x07FF
257 
258 //1000BASE-T Configuration register
259 #define DP83867_CFG1_TEST_MODE 0xE000
260 #define DP83867_CFG1_MS_MAN_CONF_EN 0x1000
261 #define DP83867_CFG1_MS_MAN_CONF_VAL 0x0800
262 #define DP83867_CFG1_PORT_TYPE 0x0400
263 #define DP83867_CFG1_1000BT_FD 0x0200
264 #define DP83867_CFG1_1000BT_HD 0x0100
265 #define DP83867_CFG1_TDR_AUTO_RUN 0x0080
266 
267 //Status 1 register
268 #define DP83867_STS1_MS_CONF_FAULT 0x8000
269 #define DP83867_STS1_MS_CONF_RES 0x4000
270 #define DP83867_STS1_LOCAL_RECEIVER_STATUS 0x2000
271 #define DP83867_STS1_REMOTE_RECEIVER_STATUS 0x1000
272 #define DP83867_STS1_LP_1000BT_FD 0x0800
273 #define DP83867_STS1_LP_1000BT_HD 0x0400
274 #define DP83867_STS1_IDLE_ERR_COUNT 0x00FF
275 
276 //Register Control register
277 #define DP83867_REGCR_FUNC 0xC000
278 #define DP83867_REGCR_FUNC_ADDR 0x0000
279 #define DP83867_REGCR_FUNC_DATA_NO_POST_INC 0x4000
280 #define DP83867_REGCR_FUNC_DATA_POST_INC_RW 0x8000
281 #define DP83867_REGCR_FUNC_DATA_POST_INC_W 0xC000
282 #define DP83867_REGCR_DEVAD 0x001F
283 
284 //1000BASE-T Status register
285 #define DP83867_1KSCR_1000BX_FD 0x8000
286 #define DP83867_1KSCR_1000BX_HD 0x4000
287 #define DP83867_1KSCR_1000BT_FD 0x2000
288 #define DP83867_1KSCR_1000BT_HD 0x1000
289 
290 //PHY Control register
291 #define DP83867_PHYCR_TX_FIFO_DEPTH 0xC000
292 #define DP83867_PHYCR_FORCE_LINK_GOOD 0x0400
293 #define DP83867_PHYCR_POWER_SAVE_MODE 0x0300
294 #define DP83867_PHYCR_DEEP_POWER_DOWN_EN 0x0080
295 #define DP83867_PHYCR_MDI_CROSSOVER 0x0060
296 #define DP83867_PHYCR_DISABLE_CLK_125 0x0010
297 #define DP83867_PHYCR_STANDBY_MODE 0x0004
298 #define DP83867_PHYCR_LINE_DRIVER_INV_EN 0x0002
299 #define DP83867_PHYCR_DISABLE_JABBER 0x0001
300 
301 //PHY Status register
302 #define DP83867_PHYSTS_SPEED_SEL 0xC000
303 #define DP83867_PHYSTS_SPEED_SEL_10MBPS 0x0000
304 #define DP83867_PHYSTS_SPEED_SEL_100MBPS 0x4000
305 #define DP83867_PHYSTS_SPEED_SEL_1000MBPS 0x8000
306 #define DP83867_PHYSTS_DUPLEX_MODE 0x2000
307 #define DP83867_PHYSTS_PAGE_RECEIVED 0x1000
308 #define DP83867_PHYSTS_SPEED_DUPLEX_RESOLVED 0x0800
309 #define DP83867_PHYSTS_LINK_STATUS 0x0400
310 #define DP83867_PHYSTS_MDI_X_MODE_CD 0x0200
311 #define DP83867_PHYSTS_MDI_X_MODE_AB 0x0100
312 #define DP83867_PHYSTS_SPEED_OPT_STATUS 0x0080
313 #define DP83867_PHYSTS_SLEEP_MODE 0x0040
314 #define DP83867_PHYSTS_WIRE_CROSS 0x003C
315 #define DP83867_PHYSTS_POLARITY_STATUS 0x0002
316 #define DP83867_PHYSTS_JABBER_DETECT 0x0001
317 
318 //MII Interrupt Control register
319 #define DP83867_MICR_AUTONEG_ERR_INT_EN 0x8000
320 #define DP83867_MICR_SPEED_CHNG_INT_EN 0x4000
321 #define DP83867_MICR_DUPLEX_MODE_CHNG_INT_EN 0x2000
322 #define DP83867_MICR_PAGE_RECEIVED_INT_EN 0x1000
323 #define DP83867_MICR_AUTONEG_COMP_INT_EN 0x0800
324 #define DP83867_MICR_LINK_STATUS_CHNG_INT_EN 0x0400
325 #define DP83867_MICR_FALSE_CARRIER_INT_EN 0x0100
326 #define DP83867_MICR_MDI_CROSSOVER_CHNG_INT_EN 0x0040
327 #define DP83867_MICR_SPEED_OPT_EVENT_INT_EN 0x0020
328 #define DP83867_MICR_SLEEP_MODE_CHNG_INT_EN 0x0010
329 #define DP83867_MICR_WOL_INT_EN 0x0008
330 #define DP83867_MICR_XGMII_ERR_INT_EN 0x0004
331 #define DP83867_MICR_POLARITY_CHNG_INT_EN 0x0002
332 #define DP83867_MICR_JABBER_INT_EN 0x0001
333 
334 //MII Interrupt Status register
335 #define DP83867_MISR_AUTONEG_ERR_INT 0x8000
336 #define DP83867_MISR_SPEED_CHNG_INT 0x4000
337 #define DP83867_MISR_DUPLEX_MODE_CHNG_INT 0x2000
338 #define DP83867_MISR_PAGE_RECEIVED_INT 0x1000
339 #define DP83867_MISR_AUTONEG_COMP_INT 0x0800
340 #define DP83867_MISR_LINK_STATUS_CHNG_INT 0x0400
341 #define DP83867_MISR_FALSE_CARRIER_INT 0x0100
342 #define DP83867_MISR_MDI_CROSSOVER_CHNG_INT 0x0040
343 #define DP83867_MISR_SPEED_OPT_EVENT_INT 0x0020
344 #define DP83867_MISR_SLEEP_MODE_CHNG_INT 0x0010
345 #define DP83867_MISR_WOL_INT 0x0008
346 #define DP83867_MISR_XGMII_ERR_INT 0x0004
347 #define DP83867_MISR_POLARITY_CHNG_INT 0x0002
348 #define DP83867_MISR_JABBER_INT 0x0001
349 
350 //Configuration 2 register
351 #define DP83867_CFG2_INTERRUPT_POLARITY 0x2000
352 #define DP83867_CFG2_SPEED_OPT_ATTEMPT_CNT 0x0C00
353 #define DP83867_CFG2_SPEED_OPT_EN 0x0200
354 #define DP83867_CFG2_SPEED_OPT_ENHANCED_EN 0x0100
355 #define DP83867_CFG2_SPEED_OPT_10M_EN 0x0040
356 
357 //Receive Error Counter register
358 #define DP83867_RECR_RXERCNT 0xFFFF
359 
360 //BIST Control register
361 #define DP83867_BISCR_PRBS_COUNT_MODE 0x8000
362 #define DP83867_BISCR_GEN_PRBS_PACKET 0x4000
363 #define DP83867_BISCR_PACKET_GEN_64BIT_MODE 0x2000
364 #define DP83867_BISCR_PACKET_GEN_EN 0x1000
365 #define DP83867_BISCR_REV_LOOP_RX_DATA_CTRL 0x0080
366 #define DP83867_BISCR_MII_LOOP_TX_DATA_CTRL 0x0040
367 #define DP83867_BISCR_LOOPBACK_MODE 0x003C
368 #define DP83867_BISCR_PCS_LOOPBACK 0x0003
369 #define DP83867_BISCR_PCS_LOOPBACK_BEFORE_SCRAMBLER 0x0001
370 #define DP83867_BISCR_PCS_LOOPBACK_AFTER_SCRAMBLER 0x0002
371 #define DP83867_BISCR_PCS_LOOPBACK_AFTER_MLT3_ENCODER 0x0003
372 
373 //Status 2 register
374 #define DP83867_STS2_PRBS_LOCK 0x0800
375 #define DP83867_STS2_PRBS_LOCK_LOST 0x0400
376 #define DP83867_STS2_PKT_GEN_BUSY 0x0200
377 #define DP83867_STS2_SCR_MODE_MASTER_1G 0x0100
378 #define DP83867_STS2_SCR_MODE_SLAVE_1G 0x0080
379 #define DP83867_STS2_CORE_PWR_MODE 0x0040
380 
381 //LED Configuration 1 register
382 #define DP83867_LEDCR1_LED_GPIO_SEL 0xF000
383 #define DP83867_LEDCR1_LED_GPIO_SEL_LINK 0x0000
384 #define DP83867_LEDCR1_LED_GPIO_SEL_ACT 0x1000
385 #define DP83867_LEDCR1_LED_GPIO_SEL_TX_ACT 0x2000
386 #define DP83867_LEDCR1_LED_GPIO_SEL_RX_ACT 0x3000
387 #define DP83867_LEDCR1_LED_GPIO_SEL_COL 0x4000
388 #define DP83867_LEDCR1_LED_GPIO_SEL_1000 0x5000
389 #define DP83867_LEDCR1_LED_GPIO_SEL_100 0x6000
390 #define DP83867_LEDCR1_LED_GPIO_SEL_10 0x7000
391 #define DP83867_LEDCR1_LED_GPIO_SEL_10_100 0x8000
392 #define DP83867_LEDCR1_LED_GPIO_SEL_100_1000 0x9000
393 #define DP83867_LEDCR1_LED_GPIO_SEL_FD 0xA000
394 #define DP83867_LEDCR1_LED_GPIO_SEL_LINK_ACT 0xB000
395 #define DP83867_LEDCR1_LED_GPIO_SEL_ERR 0xD000
396 #define DP83867_LEDCR1_LED_GPIO_SEL_RX_ERR 0xE000
397 #define DP83867_LEDCR1_LED_2_SEL 0x1F00
398 #define DP83867_LEDCR1_LED_2_SEL_LINK 0x0000
399 #define DP83867_LEDCR1_LED_2_SEL_ACT 0x0100
400 #define DP83867_LEDCR1_LED_2_SEL_TX_ACT 0x0200
401 #define DP83867_LEDCR1_LED_2_SEL_RX_ACT 0x0300
402 #define DP83867_LEDCR1_LED_2_SEL_COL 0x0400
403 #define DP83867_LEDCR1_LED_2_SEL_1000 0x0500
404 #define DP83867_LEDCR1_LED_2_SEL_100 0x0600
405 #define DP83867_LEDCR1_LED_2_SEL_10 0x0700
406 #define DP83867_LEDCR1_LED_2_SEL_10_100 0x0800
407 #define DP83867_LEDCR1_LED_2_SEL_100_1000 0x0900
408 #define DP83867_LEDCR1_LED_2_SEL_FD 0x0A00
409 #define DP83867_LEDCR1_LED_2_SEL_LINK_ACT 0x0B00
410 #define DP83867_LEDCR1_LED_2_SEL_ERR 0x0D00
411 #define DP83867_LEDCR1_LED_2_SEL_RX_ERR 0x0E00
412 #define DP83867_LEDCR1_LED_1_SEL 0x00F0
413 #define DP83867_LEDCR1_LED_1_SEL_LINK 0x0000
414 #define DP83867_LEDCR1_LED_1_SEL_ACT 0x0010
415 #define DP83867_LEDCR1_LED_1_SEL_TX_ACT 0x0020
416 #define DP83867_LEDCR1_LED_1_SEL_RX_ACT 0x0030
417 #define DP83867_LEDCR1_LED_1_SEL_COL 0x0040
418 #define DP83867_LEDCR1_LED_1_SEL_1000 0x0050
419 #define DP83867_LEDCR1_LED_1_SEL_100 0x0060
420 #define DP83867_LEDCR1_LED_1_SEL_10 0x0070
421 #define DP83867_LEDCR1_LED_1_SEL_10_100 0x0080
422 #define DP83867_LEDCR1_LED_1_SEL_100_1000 0x0090
423 #define DP83867_LEDCR1_LED_1_SEL_FD 0x00A0
424 #define DP83867_LEDCR1_LED_1_SEL_LINK_ACT 0x00B0
425 #define DP83867_LEDCR1_LED_1_SEL_ERR 0x00D0
426 #define DP83867_LEDCR1_LED_1_SEL_RX_ERR 0x00E0
427 #define DP83867_LEDCR1_LED_0_SEL 0x000F
428 #define DP83867_LEDCR1_LED_0_SEL_LINK 0x0000
429 #define DP83867_LEDCR1_LED_0_SEL_ACT 0x0001
430 #define DP83867_LEDCR1_LED_0_SEL_TX_ACT 0x0002
431 #define DP83867_LEDCR1_LED_0_SEL_RX_ACT 0x0003
432 #define DP83867_LEDCR1_LED_0_SEL_COL 0x0004
433 #define DP83867_LEDCR1_LED_0_SEL_1000 0x0005
434 #define DP83867_LEDCR1_LED_0_SEL_100 0x0006
435 #define DP83867_LEDCR1_LED_0_SEL_10 0x0007
436 #define DP83867_LEDCR1_LED_0_SEL_10_100 0x0008
437 #define DP83867_LEDCR1_LED_0_SEL_100_1000 0x0009
438 #define DP83867_LEDCR1_LED_0_SEL_FD 0x000A
439 #define DP83867_LEDCR1_LED_0_SEL_LINK_ACT 0x000B
440 #define DP83867_LEDCR1_LED_0_SEL_ERR 0x000D
441 #define DP83867_LEDCR1_LED_0_SEL_RX_ERR 0x000E
442 
443 //LED Configuration 2 register
444 #define DP83867_LEDCR2_LED_GPIO_POLARITY 0x4000
445 #define DP83867_LEDCR2_LED_GPIO_DRV_VAL 0x2000
446 #define DP83867_LEDCR2_LED_GPIO_DRV_EN 0x1000
447 #define DP83867_LEDCR2_LED_2_POLARITY 0x0400
448 #define DP83867_LEDCR2_LED_2_DRV_VAL 0x0200
449 #define DP83867_LEDCR2_LED_2_DRV_EN 0x0100
450 #define DP83867_LEDCR2_LED_1_POLARITY 0x0040
451 #define DP83867_LEDCR2_LED_1_DRV_VAL 0x0020
452 #define DP83867_LEDCR2_LED_1_DRV_EN 0x0010
453 #define DP83867_LEDCR2_LED_0_POLARITY 0x0004
454 #define DP83867_LEDCR2_LED_0_DRV_VAL 0x0002
455 #define DP83867_LEDCR2_LED_0_DRV_EN 0x0001
456 
457 //LED Configuration 3 register
458 #define DP83867_LEDCR3_LEDS_BYPASS_STRETCHING 0x0004
459 #define DP83867_LEDCR3_LEDS_BLINK_RATE 0x0003
460 #define DP83867_LEDCR3_LEDS_BLINK_RATE_20HZ 0x0000
461 #define DP83867_LEDCR3_LEDS_BLINK_RATE_10HZ 0x0001
462 #define DP83867_LEDCR3_LEDS_BLINK_RATE_5HZ 0x0002
463 #define DP83867_LEDCR3_LEDS_BLINK_RATE_2HZ 0x0003
464 
465 //Configuration 3 register
466 #define DP83867_CFG3_FAST_LINK_UP_PAR_DETECT 0x8000
467 #define DP83867_CFG3_FAST_AN_EN 0x4000
468 #define DP83867_CFG3_FAST_AN_SEL 0x3000
469 #define DP83867_CFG3_EXTENDED_FD_ABLE 0x0800
470 #define DP83867_CFG3_ROBUST_AUTO_MDIX 0x0200
471 #define DP83867_CFG3_FAST_AUTO_MDIX 0x0100
472 #define DP83867_CFG3_INT_OE 0x0080
473 #define DP83867_CFG3_FORCE_INTERRUPT 0x0040
474 #define DP83867_CFG3_TDR_FAIL 0x0004
475 #define DP83867_CFG3_TDR_DONE 0x0002
476 #define DP83867_CFG3_TDR_START 0x0001
477 
478 //Control register
479 #define DP83867_CTRL_SW_RESET 0x8000
480 #define DP83867_CTRL_SW_RESTART 0x4000
481 
482 //Testmode Channel Control register
483 #define DP83867_TMCH_CTRL_TM_CH_SEL 0x00E0
484 
485 //Robust Auto MDIX Timer Configuration register
486 #define DP83867_AMDIX_TMR_CFG_RAMDIX_TMR 0x000F
487 
488 //Fast Link Drop Configuration register
489 #define DP83867_FLD_CFG_FORCE_DROP 0x8000
490 #define DP83867_FLD_CFG_FLD_EN 0x4000
491 #define DP83867_FLD_CFG_FLD_STS 0x1F00
492 #define DP83867_FLD_CFG_FLD_SRC_CFG 0x001F
493 
494 //Fast Link Drop Threshold Configuration register
495 #define DP83867_FLD_THR_CFG_ENERGY_LOST_FLD_THR 0x0007
496 
497 //Configuration 4 register
498 #define DP83867_CFG4_INT_TST_MODE_1 0x0080
499 #define DP83867_CFG4_PORT_MIRROR_EN 0x0001
500 
501 //RGMII Control register
502 #define DP83867_RGMIICTL_RGMII_EN 0x0080
503 #define DP83867_RGMIICTL_RGMII_RX_HALF_FULL_THR 0x0060
504 #define DP83867_RGMIICTL_RGMII_TX_HALF_FULL_THR 0x0018
505 #define DP83867_RGMIICTL_RGMII_TX_CLK_DELAY 0x0002
506 #define DP83867_RGMIICTL_RGMII_RX_CLK_DELAY 0x0001
507 
508 //RGMII Control 2 register
509 #define DP83867_RGMIICTL2_RGMII_AF_BYPASS_EN 0x0010
510 
511 //100BASE-TX Configuration register
512 #define DP83867_100CR_DESCRAM_TIMEOUT_DIS 0x0800
513 #define DP83867_100CR_DESCRAM_TIMEOUT 0x0780
514 #define DP83867_100CR_FORCE_100_OK 0x0040
515 #define DP83867_100CR_ENH_MLT3_DET_EN 0x0020
516 #define DP83867_100CR_ENH_IPG_DET_EN 0x0010
517 #define DP83867_100CR_BYPASS_4B5B_RX 0x0008
518 #define DP83867_100CR_SCR_DIS 0x0004
519 #define DP83867_100CR_ODD_NIBBLE_DETECT 0x0002
520 #define DP83867_100CR_FAST_RX_DV 0x0001
521 
522 //Viterbi Module Configuration register
523 #define DP83867_VTM_CFG_VTM_IDLE_CHECK_CNT_THR 0x000F
524 
525 //Skew FIFO Status register
526 #define DP83867_SKEW_FIFO_CH_B_SKEW 0x00F0
527 #define DP83867_SKEW_FIFO_CH_A_SKEW 0x000F
528 
529 //Strap Configuration Status 1 register
530 #define DP83867_STRAP_STS1_STRAP_MIRROR_EN 0x8000
531 #define DP83867_STRAP_STS1_STRAP_LINK_DOWNSHIFT_EN 0x4000
532 #define DP83867_STRAP_STS1_STRAP_CLK_OUT_DIS_PAP 0x2000
533 #define DP83867_STRAP_STS1_STRAP_RGMII_DIS 0x1000
534 #define DP83867_STRAP_STS1_STRAP_AMDIX_DIS 0x0400
535 #define DP83867_STRAP_STS1_STRAP_FORCE_MDI_X 0x0200
536 #define DP83867_STRAP_STS1_STRAP_HD_EN 0x0100
537 #define DP83867_STRAP_STS1_STRAP_ANEG_DIS 0x0080
538 #define DP83867_STRAP_STS1_STRAP_ANEG_SEL_PAP 0x0060
539 #define DP83867_STRAP_STS1_STRAP_PHY_ADD_PAP 0x001F
540 #define DP83867_STRAP_STS1_STRAP_SPEED_SEL_RGZ 0x0020
541 #define DP83867_STRAP_STS1_STRAP_PHY_ADD_RGZ 0x000F
542 
543 //Strap Configuration Status 2 register
544 #define DP83867_STRAP_STS2_STRAP_RGMII_CLK_SKEW_TX_RGZ 0x0070
545 #define DP83867_STRAP_STS2_STRAP_RGMII_CLK_SKEW_RX_RGZ 0x0007
546 
547 //BIST Control and Status 1 register
548 #define DP83867_BICSR1_PRBS_BYTE_CNT 0xFFFF
549 
550 //BIST Control and Status 2 register
551 #define DP83867_BICSR2_PRBS_PKT_CNT_OVF 0x0400
552 #define DP83867_BICSR2_PRBS_BYTE_CNT_OVF 0x0200
553 #define DP83867_BICSR2_PRBS_ERR_CNT 0x00FF
554 
555 //BIST Control and Status 3 register
556 #define DP83867_BICSR3_PKT_LEN_PRBS 0xFFFF
557 
558 //BIST Control and Status 4 register
559 #define DP83867_BICSR4_IPG_LEN 0x00FF
560 
561 //RGMII Delay Control register
562 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL 0x00F0
563 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_0_25NS 0x0000
564 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_0_50NS 0x0010
565 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_0_75NS 0x0020
566 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_1_00NS 0x0030
567 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_1_25NS 0x0040
568 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_1_50NS 0x0050
569 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_1_75NS 0x0060
570 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_2_00NS 0x0070
571 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_2_25NS 0x0080
572 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_2_50NS 0x0090
573 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_2_75NS 0x00A0
574 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_3_00NS 0x00B0
575 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_3_25NS 0x00C0
576 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_3_50NS 0x00D0
577 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_3_75NS 0x00E0
578 #define DP83867_RGMIIDCTL_RGMII_TX_DELAY_CTRL_4_00NS 0x00F0
579 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL 0x000F
580 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_0_25NS 0x0000
581 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_0_50NS 0x0001
582 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_0_75NS 0x0002
583 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_1_00NS 0x0003
584 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_1_25NS 0x0004
585 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_1_50NS 0x0005
586 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_1_75NS 0x0006
587 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_2_00NS 0x0007
588 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_2_25NS 0x0008
589 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_2_50NS 0x0009
590 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_2_75NS 0x000A
591 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_3_00NS 0x000B
592 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_3_25NS 0x000C
593 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_3_50NS 0x000D
594 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_3_75NS 0x000E
595 #define DP83867_RGMIIDCTL_RGMII_RX_DELAY_CTRL_4_00NS 0x000F
596 
597 //PLL Clock-out Control register
598 #define DP83867_PLLCTL_CLK_MUX 0x0010
599 
600 //Loopback Configuration register
601 #define DP83867_LOOPCR_LOOP_CFG_VAL 0xFFFF
602 
603 //DSP Feedforward Equalizer Configuration register
604 #define DP83867_DSP_FFE_CFG_FFE_EQ 0x03FF
605 
606 //Receive Configuration register
607 #define DP83867_RXFCFG_WOL_OUT_CLEAR 0x0800
608 #define DP83867_RXFCFG_WOL_OUT_STRETCH 0x0600
609 #define DP83867_RXFCFG_WOL_OUT_MODE 0x0100
610 #define DP83867_RXFCFG_ENHANCED_MAC_SUPPORT 0x0080
611 #define DP83867_RXFCFG_SCRON_EN 0x0020
612 #define DP83867_RXFCFG_WAKE_ON_UCAST 0x0010
613 #define DP83867_RXFCFG_WAKE_ON_BCAST 0x0004
614 #define DP83867_RXFCFG_WAKE_ON_PATTERN 0x0002
615 #define DP83867_RXFCFG_WAKE_ON_MAGIC 0x0001
616 
617 //Receive Status register
618 #define DP83867_RXFSTS_SFD_ERR 0x0080
619 #define DP83867_RXFSTS_BAD_CRC 0x0040
620 #define DP83867_RXFSTS_SCRON_HACK 0x0020
621 #define DP83867_RXFSTS_UCAST_RCVD 0x0010
622 #define DP83867_RXFSTS_BCAST_RCVD 0x0004
623 #define DP83867_RXFSTS_PATTERN_RCVD 0x0002
624 #define DP83867_RXFSTS_MAGIC_RCVD 0x0001
625 
626 //Pattern Match Data 1 register
627 #define DP83867_RXFPMD1_PMATCH_DATA_15_0 0xFFFF
628 
629 //Pattern Match Data 2 register
630 #define DP83867_RXFPMD2_PMATCH_DATA_31_16 0xFFFF
631 
632 //Pattern Match Data 3 register
633 #define DP83867_RXFPMD3_PMATCH_DATA_47_32 0xFFFF
634 
635 //SecureOn Pass 1 register
636 #define DP83867_RXFSOP1_SCRON_PASSWORD_15_0 0xFFFF
637 
638 //SecureOn Pass 2 register
639 #define DP83867_RXFSOP2_SCRON_PASSWORD_31_16 0xFFFF
640 
641 //SecureOn Pass 3 register
642 #define DP83867_RXFSOP3_SCRON_PASSWORD_47_32 0xFFFF
643 
644 //Receive Pattern 1 register
645 #define DP83867_RXFPAT1_PATTERN_BYTES_0_1 0xFFFF
646 
647 //Receive Pattern 2 register
648 #define DP83867_RXFPAT2_PATTERN_BYTES_2_3 0xFFFF
649 
650 //Receive Pattern 3 register
651 #define DP83867_RXFPAT3_PATTERN_BYTES_4_5 0xFFFF
652 
653 //Receive Pattern 4 register
654 #define DP83867_RXFPAT4_PATTERN_BYTES_6_7 0xFFFF
655 
656 //Receive Pattern 5 register
657 #define DP83867_RXFPAT5_PATTERN_BYTES_8_9 0xFFFF
658 
659 //Receive Pattern 6 register
660 #define DP83867_RXFPAT6_PATTERN_BYTES_10_11 0xFFFF
661 
662 //Receive Pattern 7 register
663 #define DP83867_RXFPAT7_PATTERN_BYTES_12_13 0xFFFF
664 
665 //Receive Pattern 8 register
666 #define DP83867_RXFPAT8_PATTERN_BYTES_14_15 0xFFFF
667 
668 //Receive Pattern 9 register
669 #define DP83867_RXFPAT9_PATTERN_BYTES_16_17 0xFFFF
670 
671 //Receive Pattern 10 register
672 #define DP83867_RXFPAT10_PATTERN_BYTES_18_19 0xFFFF
673 
674 //Receive Pattern 11 register
675 #define DP83867_RXFPAT11_PATTERN_BYTES_20_21 0xFFFF
676 
677 //Receive Pattern 12 register
678 #define DP83867_RXFPAT12_PATTERN_BYTES_22_23 0xFFFF
679 
680 //Receive Pattern 13 register
681 #define DP83867_RXFPAT13_PATTERN_BYTES_24_25 0xFFFF
682 
683 //Receive Pattern 14 register
684 #define DP83867_RXFPAT14_PATTERN_BYTES_26_27 0xFFFF
685 
686 //Receive Pattern 15 register
687 #define DP83867_RXFPAT15_PATTERN_BYTES_28_29 0xFFFF
688 
689 //Receive Pattern 16 register
690 #define DP83867_RXFPAT16_PATTERN_BYTES_30_31 0xFFFF
691 
692 //Receive Pattern 17 register
693 #define DP83867_RXFPAT17_PATTERN_BYTES_32_33 0xFFFF
694 
695 //Receive Pattern 18 register
696 #define DP83867_RXFPAT18_PATTERN_BYTES_34_35 0xFFFF
697 
698 //Receive Pattern 19 register
699 #define DP83867_RXFPAT19_PATTERN_BYTES_36_37 0xFFFF
700 
701 //Receive Pattern 20 register
702 #define DP83867_RXFPAT20_PATTERN_BYTES_38_39 0xFFFF
703 
704 //Receive Pattern 21 register
705 #define DP83867_RXFPAT21_PATTERN_BYTES_40_41 0xFFFF
706 
707 //Receive Pattern 22 register
708 #define DP83867_RXFPAT22_PATTERN_BYTES_42_43 0xFFFF
709 
710 //Receive Pattern 23 register
711 #define DP83867_RXFPAT23_PATTERN_BYTES_44_45 0xFFFF
712 
713 //Receive Pattern 24 register
714 #define DP83867_RXFPAT24_PATTERN_BYTES_46_47 0xFFFF
715 
716 //Receive Pattern 25 register
717 #define DP83867_RXFPAT25_PATTERN_BYTES_48_49 0xFFFF
718 
719 //Receive Pattern 26 register
720 #define DP83867_RXFPAT26_PATTERN_BYTES_50_51 0xFFFF
721 
722 //Receive Pattern 27 register
723 #define DP83867_RXFPAT27_PATTERN_BYTES_52_53 0xFFFF
724 
725 //Receive Pattern 28 register
726 #define DP83867_RXFPAT28_PATTERN_BYTES_54_55 0xFFFF
727 
728 //Receive Pattern 29 register
729 #define DP83867_RXFPAT29_PATTERN_BYTES_56_57 0xFFFF
730 
731 //Receive Pattern 30 register
732 #define DP83867_RXFPAT30_PATTERN_BYTES_58_59 0xFFFF
733 
734 //Receive Pattern 31 register
735 #define DP83867_RXFPAT31_PATTERN_BYTES_60_61 0xFFFF
736 
737 //Receive Pattern 32 register
738 #define DP83867_RXFPAT32_PATTERN_BYTES_62_63 0xFFFF
739 
740 //Receive Pattern Byte Mask 1 register
741 #define DP83867_RXFPBM1_PATTERN_BYTES_MASK_0_15 0xFFFF
742 
743 //Receive Pattern Byte Mask 2 register
744 #define DP83867_RXFPBM2_PATTERN_BYTES_MASK_16_31 0xFFFF
745 
746 //Receive Pattern Byte Mask 3 register
747 #define DP83867_RXFPBM3_PATTERN_BYTES_MASK_32_47 0xFFFF
748 
749 //Receive Pattern Byte Mask 4 register
750 #define DP83867_RXFPBM4_PATTERN_BYTES_MASK_48_63 0xFFFF
751 
752 //Receive Status register
753 #define DP83867_RXFPATC_PATTERN_START_POINT 0x003F
754 
755 //I/O Configuration register
756 #define DP83867_IO_MUX_CFG_CLK_O_SEL 0x1F00
757 #define DP83867_IO_MUX_CFG_CLK_O_DISABLE 0x0040
758 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL 0x001F
759 
760 //GPIO Mux Control 1 register
761 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL 0xF000
762 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_RX_D7 0x0000
763 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_1588_TX_SFD 0x1000
764 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_1588_RX_SFD 0x2000
765 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_WOL 0x3000
766 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_ED 0x4000
767 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_LED_3 0x6000
768 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_PRBS_ERR 0x7000
769 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_CONST_0 0x8000
770 #define DP83867_GPIO_MUX_CTRL1_RX_D7_GPIO_CTRL_CONST_1 0x9000
771 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL 0x0F00
772 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_RX_D6 0x0000
773 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_1588_TX_SFD 0x0100
774 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_1588_RX_SFD 0x0200
775 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_WOL 0x0300
776 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_ED 0x0400
777 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_LED_3 0x0600
778 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_PRBS_ERR 0x0700
779 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_CONST_0 0x0800
780 #define DP83867_GPIO_MUX_CTRL1_RX_D6_GPIO_CTRL_CONST_1 0x0900
781 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL 0x00F0
782 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_RX_D5 0x0000
783 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_1588_TX_SFD 0x0010
784 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_1588_RX_SFD 0x0020
785 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_WOL 0x0030
786 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_ED 0x0040
787 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_LED_3 0x0060
788 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_PRBS_ERR 0x0070
789 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_CONST_0 0x0080
790 #define DP83867_GPIO_MUX_CTRL1_RX_D5_GPIO_CTRL_CONST_1 0x0090
791 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL 0x000F
792 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_RX_D4 0x0000
793 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_1588_TX_SFD 0x0001
794 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_1588_RX_SFD 0x0002
795 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_WOL 0x0003
796 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_ED 0x0004
797 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_LED_3 0x0006
798 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_PRBS_ERR 0x0007
799 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_CONST_0 0x0008
800 #define DP83867_GPIO_MUX_CTRL1_RX_D4_GPIO_CTRL_CONST_1 0x0009
801 
802 //GPIO Mux Control 2 register
803 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL 0x0F00
804 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_CRS 0x0000
805 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_1588_TX_SFD 0x0100
806 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_1588_RX_SFD 0x0200
807 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_WOL 0x0300
808 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_ED 0x0400
809 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_LED_3 0x0600
810 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_PRBS_ERR 0x0700
811 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_CONST_0 0x0800
812 #define DP83867_GPIO_MUX_CTRL2_CRS_GPIO_CTRL_CONST_1 0x0900
813 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL 0x00F0
814 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_COL 0x0000
815 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_1588_TX_SFD 0x0010
816 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_1588_RX_SFD 0x0020
817 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_WOL 0x0030
818 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_ED 0x0040
819 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_LED_3 0x0060
820 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_PRBS_ERR 0x0070
821 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_CONST_0 0x0080
822 #define DP83867_GPIO_MUX_CTRL2_COL_GPIO_CTRL_CONST_1 0x0090
823 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL 0x000F
824 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_RX_ER 0x0000
825 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_1588_TX_SFD 0x0001
826 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_1588_RX_SFD 0x0002
827 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_WOL 0x0003
828 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_ED 0x0004
829 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_LED_3 0x0006
830 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_PRBS_ERR 0x0007
831 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_CONST_0 0x0008
832 #define DP83867_GPIO_MUX_CTRL2_RX_ER_GPIO_CTRL_CONST_1 0x0009
833 
834 //GPIO Mux Control register
835 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL 0x00F0
836 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_COL 0x0000
837 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_1588_TX_SFD 0x0010
838 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_1588_RX_SFD 0x0020
839 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_WOL 0x0030
840 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_ED 0x0040
841 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_LED_3 0x0060
842 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_PRBS_ERR 0x0070
843 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_CONST_0 0x0080
844 #define DP83867_GPIO_MUX_CTRL_GPIO_1_CTRL_CONST_1 0x0090
845 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL 0x000F
846 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_RX_ER 0x0000
847 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_1588_TX_SFD 0x0001
848 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_1588_RX_SFD 0x0002
849 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_WOL 0x0003
850 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_ED 0x0004
851 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_LED_3 0x0006
852 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_PRBS_ERR 0x0007
853 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_CONST_0 0x0008
854 #define DP83867_GPIO_MUX_CTRL_GPIO_0_CTRL_CONST_1 0x0009
855 
856 //TDR General Configuration 1 register
857 #define DP83867_TDR_GEN_CFG1_TDR_CH_CD_BYPASS 0x1000
858 #define DP83867_TDR_GEN_CFG1_TDR_CROSS_MODE_DIS 0x0800
859 #define DP83867_TDR_GEN_CFG1_TDR_NLP_CHECK 0x0400
860 #define DP83867_TDR_GEN_CFG1_TDR_AVG_NUM 0x0380
861 #define DP83867_TDR_GEN_CFG1_TDR_SEG_NUM 0x0070
862 #define DP83867_TDR_GEN_CFG1_TDR_CYCLE_TIME 0x000F
863 
864 //TDR Peak Locations 1 register
865 #define DP83867_TDR_PEAKS_LOC_1_TDR_PEAKS_LOC_A_1 0xFF00
866 #define DP83867_TDR_PEAKS_LOC_1_TDR_PEAKS_LOC_A_0 0x00FF
867 
868 //TDR Peak Locations 2 register
869 #define DP83867_TDR_PEAKS_LOC_2_TDR_PEAKS_LOC_A_3 0xFF00
870 #define DP83867_TDR_PEAKS_LOC_2_TDR_PEAKS_LOC_A_2 0x00FF
871 
872 //TDR Peak Locations 3 register
873 #define DP83867_TDR_PEAKS_LOC_3_TDR_PEAKS_LOC_B_0 0xFF00
874 #define DP83867_TDR_PEAKS_LOC_3_TDR_PEAKS_LOC_A_4 0x00FF
875 
876 //TDR Peak Locations 4 register
877 #define DP83867_TDR_PEAKS_LOC_4_TDR_PEAKS_LOC_B_2 0xFF00
878 #define DP83867_TDR_PEAKS_LOC_4_TDR_PEAKS_LOC_B_1 0x00FF
879 
880 //TDR Peak Locations 5 register
881 #define DP83867_TDR_PEAKS_LOC_5_TDR_PEAKS_LOC_B_4 0xFF00
882 #define DP83867_TDR_PEAKS_LOC_5_TDR_PEAKS_LOC_B_3 0x00FF
883 
884 //TDR Peak Locations 6 register
885 #define DP83867_TDR_PEAKS_LOC_6_TDR_PEAKS_LOC_C_1 0xFF00
886 #define DP83867_TDR_PEAKS_LOC_6_TDR_PEAKS_LOC_C_0 0x00FF
887 
888 //TDR Peak Locations 7 register
889 #define DP83867_TDR_PEAKS_LOC_7_TDR_PEAKS_LOC_C_3 0xFF00
890 #define DP83867_TDR_PEAKS_LOC_7_TDR_PEAKS_LOC_C_2 0x00FF
891 
892 //TDR Peak Locations 8 register
893 #define DP83867_TDR_PEAKS_LOC_8_TDR_PEAKS_LOC_D_0 0xFF00
894 #define DP83867_TDR_PEAKS_LOC_8_TDR_PEAKS_LOC_C_4 0x00FF
895 
896 //TDR Peak Locations 9 register
897 #define DP83867_TDR_PEAKS_LOC_9_TDR_PEAKS_LOC_D_2 0xFF00
898 #define DP83867_TDR_PEAKS_LOC_9_TDR_PEAKS_LOC_D_1 0x00FF
899 
900 //TDR Peak Locations 10 register
901 #define DP83867_TDR_PEAKS_LOC_10_TDR_PEAKS_LOC_D_4 0xFF00
902 #define DP83867_TDR_PEAKS_LOC_10_TDR_PEAKS_LOC_D_3 0x00FF
903 
904 //TDR Peak Amplitudes 1 register
905 #define DP83867_TDR_PEAKS_AMP_1_TDR_PEAKS_AMP_A_1 0x7F00
906 #define DP83867_TDR_PEAKS_AMP_1_TDR_PEAKS_AMP_A_0 0x007F
907 
908 //TDR Peak Amplitudes 2 register
909 #define DP83867_TDR_PEAKS_AMP_2_TDR_PEAKS_AMP_A_3 0x7F00
910 #define DP83867_TDR_PEAKS_AMP_2_TDR_PEAKS_AMP_A_2 0x007F
911 
912 //TDR Peak Amplitudes 3 register
913 #define DP83867_TDR_PEAKS_AMP_3_TDR_PEAKS_AMP_B_0 0x7F00
914 #define DP83867_TDR_PEAKS_AMP_3_TDR_PEAKS_AMP_A_4 0x007F
915 
916 //TDR Peak Amplitudes 4 register
917 #define DP83867_TDR_PEAKS_AMP_4_TDR_PEAKS_AMP_B_2 0x7F00
918 #define DP83867_TDR_PEAKS_AMP_4_TDR_PEAKS_AMP_B_1 0x007F
919 
920 //TDR Peak Amplitudes 5 register
921 #define DP83867_TDR_PEAKS_AMP_5_TDR_PEAKS_AMP_B_4 0x7F00
922 #define DP83867_TDR_PEAKS_AMP_5_TDR_PEAKS_AMP_B_3 0x007F
923 
924 //TDR Peak Amplitudes 6 register
925 #define DP83867_TDR_PEAKS_AMP_6_TDR_PEAKS_AMP_C_1 0x7F00
926 #define DP83867_TDR_PEAKS_AMP_6_TDR_PEAKS_AMP_C_0 0x007F
927 
928 //TDR Peak Amplitudes 7 register
929 #define DP83867_TDR_PEAKS_AMP_7_TDR_PEAKS_AMP_C_3 0x7F00
930 #define DP83867_TDR_PEAKS_AMP_7_TDR_PEAKS_AMP_C_2 0x007F
931 
932 //TDR Peak Amplitudes 8 register
933 #define DP83867_TDR_PEAKS_AMP_8_TDR_PEAKS_AMP_D_0 0x7F00
934 #define DP83867_TDR_PEAKS_AMP_8_TDR_PEAKS_AMP_C_4 0x007F
935 
936 //TDR Peak Amplitudes 9 register
937 #define DP83867_TDR_PEAKS_AMP_9_TDR_PEAKS_AMP_D_2 0x7F00
938 #define DP83867_TDR_PEAKS_AMP_9_TDR_PEAKS_AMP_D_1 0x007F
939 
940 //TDR Peak Amplitudes 10 register
941 #define DP83867_TDR_PEAKS_AMP_10_TDR_PEAKS_AMP_D_4 0x7F00
942 #define DP83867_TDR_PEAKS_AMP_10_TDR_PEAKS_AMP_D_3 0x007F
943 
944 //Programmable Gain register
945 #define DP83867_PROG_GAIN_UNF_FUNC_MODE 0x0008
946 #define DP83867_PROG_GAIN_SGMII_TX_POL_IN 0x0002
947 #define DP83867_PROG_GAIN_SGMII_RX_POL_IN 0x0001
948 
949 //C++ guard
950 #ifdef __cplusplus
951 extern "C" {
952 #endif
953 
954 //DP83867 Ethernet PHY driver
955 extern const PhyDriver dp83867PhyDriver;
956 
957 //DP83867 related functions
958 error_t dp83867Init(NetInterface *interface);
959 void dp83867InitHook(NetInterface *interface);
960 
961 void dp83867Tick(NetInterface *interface);
962 
963 void dp83867EnableIrq(NetInterface *interface);
964 void dp83867DisableIrq(NetInterface *interface);
965 
966 void dp83867EventHandler(NetInterface *interface);
967 
968 void dp83867WritePhyReg(NetInterface *interface, uint8_t address,
969  uint16_t data);
970 
971 uint16_t dp83867ReadPhyReg(NetInterface *interface, uint8_t address);
972 
973 void dp83867DumpPhyReg(NetInterface *interface);
974 
975 void dp83867WriteMmdReg(NetInterface *interface, uint8_t devAddr,
976  uint16_t regAddr, uint16_t data);
977 
978 uint16_t dp83867ReadMmdReg(NetInterface *interface, uint8_t devAddr,
979  uint16_t regAddr);
980 
981 //C++ guard
982 #ifdef __cplusplus
983 }
984 #endif
985 
986 #endif
Ethernet PHY driver.
Definition: nic.h:311
uint8_t data[]
Definition: ethernet.h:222
void dp83867WriteMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
const PhyDriver dp83867PhyDriver
DP83867 Ethernet PHY driver.
uint16_t dp83867ReadMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
error_t
Error codes.
Definition: error.h:43
void dp83867InitHook(NetInterface *interface)
DP83867 custom configuration.
uint16_t dp83867ReadPhyReg(NetInterface *interface, uint8_t address)
Read PHY register.
#define NetInterface
Definition: net.h:36
void dp83867WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data)
Write PHY register.
void dp83867DisableIrq(NetInterface *interface)
Disable interrupts.
void dp83867EnableIrq(NetInterface *interface)
Enable interrupts.
void dp83867EventHandler(NetInterface *interface)
DP83867 event handler.
uint16_t regAddr
Ipv6Addr address[]
Definition: ipv6.h:325
error_t dp83867Init(NetInterface *interface)
DP83867 PHY transceiver initialization.
Network interface controller abstraction layer.
void dp83867Tick(NetInterface *interface)
DP83867 timer handler.
void dp83867DumpPhyReg(NetInterface *interface)
Dump PHY registers for debugging purpose.