adin1300_driver.h
Go to the documentation of this file.
1 /**
2  * @file adin1300_driver.h
3  * @brief ADIN1300 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 _ADIN1300_DRIVER_H
32 #define _ADIN1300_DRIVER_H
33 
34 //Dependencies
35 #include "core/nic.h"
36 
37 //PHY address
38 #ifndef ADIN1300_PHY_ADDR
39  #define ADIN1300_PHY_ADDR 0
40 #elif (ADIN1300_PHY_ADDR < 0 || ADIN1300_PHY_ADDR > 31)
41  #error ADIN1300_PHY_ADDR parameter is not valid
42 #endif
43 
44 //ADIN1300 PHY registers
45 #define ADIN1300_MII_CONTROL 0x00
46 #define ADIN1300_MII_STATUS 0x01
47 #define ADIN1300_PHY_ID_1 0x02
48 #define ADIN1300_PHY_ID_2 0x03
49 #define ADIN1300_AUTONEG_ADV 0x04
50 #define ADIN1300_LP_ABILITY 0x05
51 #define ADIN1300_AUTONEG_EXP 0x06
52 #define ADIN1300_TX_NEXT_PAGE 0x07
53 #define ADIN1300_LP_RX_NEXT_PAGE 0x08
54 #define ADIN1300_MSTR_SLV_CONTROL 0x09
55 #define ADIN1300_MSTR_SLV_STATUS 0x0A
56 #define ADIN1300_EXT_STATUS 0x0F
57 #define ADIN1300_EXT_REG_PTR 0x10
58 #define ADIN1300_EXT_REG_DATA 0x11
59 #define ADIN1300_PHY_CTRL_1 0x12
60 #define ADIN1300_PHY_CTRL_STATUS_1 0x13
61 #define ADIN1300_RX_ERR_CNT 0x14
62 #define ADIN1300_PHY_CTRL_STATUS_2 0x15
63 #define ADIN1300_PHY_CTRL_2 0x16
64 #define ADIN1300_PHY_CTRL_3 0x17
65 #define ADIN1300_IRQ_MASK 0x18
66 #define ADIN1300_IRQ_STATUS 0x19
67 #define ADIN1300_PHY_STATUS_1 0x1A
68 #define ADIN1300_LED_CTRL_1 0x1B
69 #define ADIN1300_LED_CTRL_2 0x1C
70 #define ADIN1300_LED_CTRL_3 0x1D
71 #define ADIN1300_PHY_STATUS_2 0x1F
72 
73 //ADIN1300 Extended registers
74 #define ADIN1300_EEE_CAPABILITY 0x8000
75 #define ADIN1300_EEE_ADV 0x8001
76 #define ADIN1300_EEE_LP_ABILITY 0x8002
77 #define ADIN1300_EEE_RSLVD 0x8008
78 #define ADIN1300_MSE_A 0x8402
79 #define ADIN1300_MSE_B 0x8403
80 #define ADIN1300_MSE_C 0x8404
81 #define ADIN1300_MSE_D 0x8405
82 #define ADIN1300_FLD_EN 0x8E27
83 #define ADIN1300_FLD_STAT_LAT 0x8E38
84 #define ADIN1300_RX_MII_CLK_STOP_EN 0x9400
85 #define ADIN1300_PCS_STATUS_1 0x9401
86 #define ADIN1300_FC_EN 0x9403
87 #define ADIN1300_FC_IRQ_EN 0x9406
88 #define ADIN1300_FC_TX_SEL 0x9407
89 #define ADIN1300_FC_MAX_FRM_SIZE 0x9408
90 #define ADIN1300_FC_FRM_CNT_H 0x940A
91 #define ADIN1300_FC_FRM_CNT_L 0x940B
92 #define ADIN1300_FC_LEN_ERR_CNT 0x940C
93 #define ADIN1300_FC_ALGN_ERR_CNT 0x940D
94 #define ADIN1300_FC_SYMB_ERR_CNT 0x940E
95 #define ADIN1300_FC_OSZ_CNT 0x940F
96 #define ADIN1300_FC_USZ_CNT 0x9410
97 #define ADIN1300_FC_ODD_CNT 0x9411
98 #define ADIN1300_FC_ODD_PRE_CNT 0x9412
99 #define ADIN1300_FC_DRIBBLE_BITS_CNT 0x9413
100 #define ADIN1300_FC_FALSE_CARRIER_CNT 0x9414
101 #define ADIN1300_FG_EN 0x9415
102 #define ADIN1300_FG_CNTRL_RSTRT 0x9416
103 #define ADIN1300_FG_CONT_MODE_EN 0x9417
104 #define ADIN1300_FG_IRQ_EN 0x9418
105 #define ADIN1300_FG_FRM_LEN 0x941A
106 #define ADIN1300_FG_NFRM_H 0x941C
107 #define ADIN1300_FG_NFRM_L 0x941D
108 #define ADIN1300_FG_DONE 0x941E
109 #define ADIN1300_FIFO_SYNC 0x9427
110 #define ADIN1300_SOP_CTRL 0x9428
111 #define ADIN1300_SOP_RX_DEL 0x9429
112 #define ADIN1300_SOP_TX_DEL 0x942A
113 #define ADIN1300_DPTH_MII_BYTE 0x9602
114 #define ADIN1300_LPI_WAKE_ERR_CNT 0xA000
115 #define ADIN1300_B_1000_RTRN_EN 0xA001
116 #define ADIN1300_B_10_E_EN 0xB403
117 #define ADIN1300_B_10_TX_TST_MODE 0xB412
118 #define ADIN1300_B_100_TX_TST_MODE 0xB413
119 #define ADIN1300_CDIAG_RUN 0xBA1B
120 #define ADIN1300_CDIAG_XPAIR_DIS 0xBA1C
121 #define ADIN1300_CDIAG_DTLD_RSLTS_0 0xBA1D
122 #define ADIN1300_CDIAG_DTLD_RSLTS_1 0xBA1E
123 #define ADIN1300_CDIAG_DTLD_RSLTS_2 0xBA1F
124 #define ADIN1300_CDIAG_DTLD_RSLTS_3 0xBA20
125 #define ADIN1300_CDIAG_FLT_DIST_0 0xBA21
126 #define ADIN1300_CDIAG_FLT_DIST_1 0xBA22
127 #define ADIN1300_CDIAG_FLT_DIST_2 0xBA23
128 #define ADIN1300_CDIAG_FLT_DIST_3 0xBA24
129 #define ADIN1300_CDIAG_CBL_LEN_EST 0xBA25
130 #define ADIN1300_LED_PUL_STR_DUR 0xBC00
131 
132 //ADIN1300 Subsystem registers
133 #define ADIN1300_GE_SFT_RST 0xFF0C
134 #define ADIN1300_GE_SFT_RST_CFG_EN 0xFF0D
135 #define ADIN1300_GE_CLK_CFG 0xFF1F
136 #define ADIN1300_GE_RGMII_CFG 0xFF23
137 #define ADIN1300_GE_RMII_CFG 0xFF24
138 #define ADIN1300_GE_PHY_BASE_CFG 0xFF26
139 #define ADIN1300_GE_LNK_STAT_INV_EN 0xFF3C
140 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL 0xFF3D
141 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL 0xFF3E
142 #define ADIN1300_GE_IO_INT_N_OR_CNTRL 0xFF3F
143 #define ADIN1300_GE_IO_LED_A_OR_CNTRL 0xFF41
144 
145 //MII Control register
146 #define ADIN1300_MII_CONTROL_SFT_RST 0x8000
147 #define ADIN1300_MII_CONTROL_LOOPBACK 0x4000
148 #define ADIN1300_MII_CONTROL_SPEED_SEL_LSB 0x2000
149 #define ADIN1300_MII_CONTROL_AUTONEG_EN 0x1000
150 #define ADIN1300_MII_CONTROL_SFT_PD 0x0800
151 #define ADIN1300_MII_CONTROL_ISOLATE 0x0400
152 #define ADIN1300_MII_CONTROL_RESTART_ANEG 0x0200
153 #define ADIN1300_MII_CONTROL_DPLX_MODE 0x0100
154 #define ADIN1300_MII_CONTROL_COLTEST 0x0080
155 #define ADIN1300_MII_CONTROL_SPEED_SEL_MSB 0x0040
156 #define ADIN1300_MII_CONTROL_UNIDIR_EN 0x0020
157 
158 //MII Status register
159 #define ADIN1300_MII_STATUS_T_4_SPRT 0x8000
160 #define ADIN1300_MII_STATUS_FD_100_SPRT 0x4000
161 #define ADIN1300_MII_STATUS_HD_100_SPRT 0x2000
162 #define ADIN1300_MII_STATUS_FD_10_SPRT 0x1000
163 #define ADIN1300_MII_STATUS_HD_10_SPRT 0x0800
164 #define ADIN1300_MII_STATUS_FD_T_2_SPRT 0x0400
165 #define ADIN1300_MII_STATUS_HD_T_2_SPRT 0x0200
166 #define ADIN1300_MII_STATUS_EXT_STAT_SPRT 0x0100
167 #define ADIN1300_MII_STATUS_UNIDIR_ABLE 0x0080
168 #define ADIN1300_MII_STATUS_MF_PREAM_SUP_ABLE 0x0040
169 #define ADIN1300_MII_STATUS_AUTONEG_DONE 0x0020
170 #define ADIN1300_MII_STATUS_REM_FLT_LAT 0x0010
171 #define ADIN1300_MII_STATUS_AUTONEG_ABLE 0x0008
172 #define ADIN1300_MII_STATUS_LINK_STAT_LAT 0x0004
173 #define ADIN1300_MII_STATUS_JABBER_DET_LAT 0x0002
174 #define ADIN1300_MII_STATUS_EXT_CAPABLE 0x0001
175 
176 //PHY Identifier 1 register
177 #define ADIN1300_PHY_ID_1_PHY_ID_1 0xFFFF
178 #define ADIN1300_PHY_ID_1_PHY_ID_1_DEFAULT 0x0283
179 
180 //PHY Identifier 2 register
181 #define ADIN1300_PHY_ID_2_PHY_ID_2_OUI 0xFC00
182 #define ADIN1300_PHY_ID_2_PHY_ID_2_OUI_DEFAULT 0xBC00
183 #define ADIN1300_PHY_ID_2_MODEL_NUM 0x03F0
184 #define ADIN1300_PHY_ID_2_MODEL_NUM_DEFAULT 0x0030
185 #define ADIN1300_PHY_ID_2_REV_NUM 0x000F
186 #define ADIN1300_PHY_ID_2_REV_NUM_DEFAULT 0x0000
187 
188 //Autonegotiation Advertisement register
189 #define ADIN1300_AUTONEG_ADV_NEXT_PAGE_ADV 0x8000
190 #define ADIN1300_AUTONEG_ADV_REM_FLT_ADV 0x2000
191 #define ADIN1300_AUTONEG_ADV_EXT_NEXT_PAGE_ADV 0x1000
192 #define ADIN1300_AUTONEG_ADV_APAUSE_ADV 0x0800
193 #define ADIN1300_AUTONEG_ADV_PAUSE_ADV 0x0400
194 #define ADIN1300_AUTONEG_ADV_T_4_ADV 0x0200
195 #define ADIN1300_AUTONEG_ADV_FD_100_ADV 0x0100
196 #define ADIN1300_AUTONEG_ADV_HD_100_ADV 0x0080
197 #define ADIN1300_AUTONEG_ADV_FD_10_ADV 0x0040
198 #define ADIN1300_AUTONEG_ADV_HD_10_ADV 0x0020
199 #define ADIN1300_AUTONEG_ADV_SELECTOR_ADV 0x001F
200 #define ADIN1300_AUTONEG_ADV_SELECTOR_ADV_DEFAULT 0x0001
201 
202 //Autonegotiation Link Partner Base Page Ability register
203 #define ADIN1300_LP_ABILITY_LP_NEXT_PAGE 0x8000
204 #define ADIN1300_LP_ABILITY_LP_ACK 0x4000
205 #define ADIN1300_LP_ABILITY_LP_REM_FLT 0x2000
206 #define ADIN1300_LP_ABILITY_LP_EXT_NEXT_PAGE_ABLE 0x1000
207 #define ADIN1300_LP_ABILITY_LP_APAUSE_ABLE 0x0800
208 #define ADIN1300_LP_ABILITY_LP_PAUSE_ABLE 0x0400
209 #define ADIN1300_LP_ABILITY_LP_T_4_ABLE 0x0200
210 #define ADIN1300_LP_ABILITY_LP_FD_100_ABLE 0x0100
211 #define ADIN1300_LP_ABILITY_LP_HD_100_ABLE 0x0080
212 #define ADIN1300_LP_ABILITY_LP_FD_10_ABLE 0x0040
213 #define ADIN1300_LP_ABILITY_LP_HD_10_ABLE 0x0020
214 #define ADIN1300_LP_ABILITY_LP_SELECTOR 0x001F
215 
216 //Autonegotiation Expansion register
217 #define ADIN1300_AUTONEG_EXP_RX_NP_LOC_ABLE 0x0040
218 #define ADIN1300_AUTONEG_EXP_RX_NP_LOC 0x0020
219 #define ADIN1300_AUTONEG_EXP_PAR_DET_FLT 0x0010
220 #define ADIN1300_AUTONEG_EXP_LP_NP_ABLE 0x0008
221 #define ADIN1300_AUTONEG_EXP_NP_ABLE 0x0004
222 #define ADIN1300_AUTONEG_EXP_PAGE_RX_LAT 0x0002
223 #define ADIN1300_AUTONEG_EXP_LP_AUTONEG_ABLE 0x0001
224 
225 //Autonegotiation Next Page Transmit register
226 #define ADIN1300_TX_NEXT_PAGE_NP_NEXT_PAGE 0x8000
227 #define ADIN1300_TX_NEXT_PAGE_NP_MSG_PAGE 0x2000
228 #define ADIN1300_TX_NEXT_PAGE_NP_ACK_2 0x1000
229 #define ADIN1300_TX_NEXT_PAGE_NP_TOGGLE 0x0800
230 #define ADIN1300_TX_NEXT_PAGE_NP_CODE 0x07FF
231 
232 //Autonegotiation Link Partner Received Next Page register
233 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_NEXT_PAGE 0x8000
234 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_ACK 0x4000
235 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_MSG_PAGE 0x2000
236 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_ACK_2 0x1000
237 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_TOGGLE 0x0800
238 #define ADIN1300_LP_RX_NEXT_PAGE_LP_NP_CODE 0x07FF
239 
240 //Master Slave Control register
241 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE 0xE000
242 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE_NORMAL 0x0000
243 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE_1 0x2000
244 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE_2 0x4000
245 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE_3 0x6000
246 #define ADIN1300_MSTR_SLV_CONTROL_TST_MODE_4 0x8000
247 #define ADIN1300_MSTR_SLV_CONTROL_MAN_MSTR_SLV_EN_ADV 0x1000
248 #define ADIN1300_MSTR_SLV_CONTROL_MAN_MSTR_ADV 0x0800
249 #define ADIN1300_MSTR_SLV_CONTROL_PREF_MSTR_ADV 0x0400
250 #define ADIN1300_MSTR_SLV_CONTROL_FD_1000_ADV 0x0200
251 #define ADIN1300_MSTR_SLV_CONTROL_HD_1000_ADV 0x0100
252 
253 //Master Slave Status register
254 #define ADIN1300_MSTR_SLV_STATUS_MSTR_SLV_FLT 0x8000
255 #define ADIN1300_MSTR_SLV_STATUS_MSTR_RSLVD 0x4000
256 #define ADIN1300_MSTR_SLV_STATUS_LOC_RCVR_STATUS 0x2000
257 #define ADIN1300_MSTR_SLV_STATUS_REM_RCVR_STATUS 0x1000
258 #define ADIN1300_MSTR_SLV_STATUS_LP_FD_1000_ABLE 0x0800
259 #define ADIN1300_MSTR_SLV_STATUS_LP_HD_1000_ABLE 0x0400
260 #define ADIN1300_MSTR_SLV_STATUS_IDLE_ERR_CNT 0x00FF
261 
262 //Extended Status register
263 #define ADIN1300_EXT_STATUS_FD_1000_X_SPRT 0x8000
264 #define ADIN1300_EXT_STATUS_HD_1000_X_SPRT 0x4000
265 #define ADIN1300_EXT_STATUS_FD_1000_SPRT 0x2000
266 #define ADIN1300_EXT_STATUS_HD_1000_SPRT 0x1000
267 
268 //PHY Control 1 register
269 #define ADIN1300_PHY_CTRL_1_AUTO_MDI_EN 0x0400
270 #define ADIN1300_PHY_CTRL_1_MAN_MDIX 0x0200
271 #define ADIN1300_PHY_CTRL_1_DIAG_CLK_EN 0x0004
272 
273 //PHY Control Status 1 register
274 #define ADIN1300_PHY_CTRL_STATUS_1_LB_ALL_DIG_SEL 0x1000
275 #define ADIN1300_PHY_CTRL_STATUS_1_LB_LD_SEL 0x0400
276 #define ADIN1300_PHY_CTRL_STATUS_1_LB_REMOTE_EN 0x0200
277 #define ADIN1300_PHY_CTRL_STATUS_1_ISOLATE_RX 0x0100
278 #define ADIN1300_PHY_CTRL_STATUS_1_LB_EXT_EN 0x0080
279 #define ADIN1300_PHY_CTRL_STATUS_1_LB_TX_SUP 0x0040
280 #define ADIN1300_PHY_CTRL_STATUS_1_LB_MII_LS_OK 0x0001
281 
282 //PHY Control Status 2 register
283 #define ADIN1300_PHY_CTRL_STATUS_2_NRG_PD_EN 0x0008
284 #define ADIN1300_PHY_CTRL_STATUS_2_NRG_PD_TX_EN 0x0004
285 #define ADIN1300_PHY_CTRL_STATUS_2_PHY_IN_NRG_PD 0x0002
286 
287 //PHY Control 2 register
288 #define ADIN1300_PHY_CTRL_2_DN_SPEED_TO_100_EN 0x0800
289 #define ADIN1300_PHY_CTRL_2_DN_SPEED_TO_10_EN 0x0400
290 #define ADIN1300_PHY_CTRL_2_GROUP_MDIO_EN 0x0040
291 
292 //PHY Control 3 register
293 #define ADIN1300_PHY_CTRL_3_LINK_EN 0x2000
294 #define ADIN1300_PHY_CTRL_3_NUM_SPEED_RETRY 0x1C00
295 
296 //Interrupt Mask register
297 #define ADIN1300_IRQ_MASK_CBL_DIAG_IRQ_EN 0x0400
298 #define ADIN1300_IRQ_MASK_MDIO_SYNC_IRQ_EN 0x0200
299 #define ADIN1300_IRQ_MASK_AN_STAT_CHNG_IRQ_EN 0x0100
300 #define ADIN1300_IRQ_MASK_PAGE_RX_IRQ_EN 0x0040
301 #define ADIN1300_IRQ_MASK_IDLE_ERR_CNT_IRQ_EN 0x0020
302 #define ADIN1300_IRQ_MASK_FIFO_OU_IRQ_EN 0x0010
303 #define ADIN1300_IRQ_MASK_RX_STAT_CHNG_IRQ_EN 0x0008
304 #define ADIN1300_IRQ_MASK_LNK_STAT_CHNG_IRQ_EN 0x0004
305 #define ADIN1300_IRQ_MASK_SPEED_CHNG_IRQ_EN 0x0002
306 #define ADIN1300_IRQ_MASK_HW_IRQ_EN 0x0001
307 
308 //Interrupt Status register
309 #define ADIN1300_IRQ_STATUS_CBL_DIAG_IRQ_STAT 0x0400
310 #define ADIN1300_IRQ_STATUS_MDIO_SYNC_IRQ_STAT 0x0200
311 #define ADIN1300_IRQ_STATUS_AN_STAT_CHNG_IRQ_STAT 0x0100
312 #define ADIN1300_IRQ_STATUS_PAGE_RX_IRQ_STAT 0x0040
313 #define ADIN1300_IRQ_STATUS_IDLE_ERR_CNT_IRQ_STAT 0x0020
314 #define ADIN1300_IRQ_STATUS_FIFO_OU_IRQ_STAT 0x0010
315 #define ADIN1300_IRQ_STATUS_RX_STAT_CHNG_IRQ_STAT 0x0008
316 #define ADIN1300_IRQ_STATUS_LNK_STAT_CHNG_IRQ_STAT 0x0004
317 #define ADIN1300_IRQ_STATUS_SPEED_CHNG_IRQ_STAT 0x0002
318 #define ADIN1300_IRQ_STATUS_IRQ_PENDING 0x0001
319 
320 //PHY Status 1 register
321 #define ADIN1300_PHY_STATUS_1_PHY_IN_STNDBY 0x8000
322 #define ADIN1300_PHY_STATUS_1_MSTR_SLV_FLT_STAT 0x4000
323 #define ADIN1300_PHY_STATUS_1_PAR_DET_FLT_STAT 0x2000
324 #define ADIN1300_PHY_STATUS_1_AUTONEG_STAT 0x1000
325 #define ADIN1300_PHY_STATUS_1_PAIR_01_SWAP 0x0800
326 #define ADIN1300_PHY_STATUS_1_B_10_POL_INV 0x0400
327 #define ADIN1300_PHY_STATUS_1_HCD_TECH 0x0380
328 #define ADIN1300_PHY_STATUS_1_HCD_TECH_10BT_HD 0x0000
329 #define ADIN1300_PHY_STATUS_1_HCD_TECH_10BT_FD 0x0080
330 #define ADIN1300_PHY_STATUS_1_HCD_TECH_100BTX_HD 0x0100
331 #define ADIN1300_PHY_STATUS_1_HCD_TECH_100BTX_FD 0x0180
332 #define ADIN1300_PHY_STATUS_1_HCD_TECH_1000BT_HD 0x0200
333 #define ADIN1300_PHY_STATUS_1_HCD_TECH_1000BT_FD 0x0280
334 #define ADIN1300_PHY_STATUS_1_LINK_STAT 0x0040
335 #define ADIN1300_PHY_STATUS_1_TX_EN_STAT 0x0020
336 #define ADIN1300_PHY_STATUS_1_RX_DV_STAT 0x0010
337 #define ADIN1300_PHY_STATUS_1_COL_STAT 0x0008
338 #define ADIN1300_PHY_STATUS_1_AUTONEG_SUP 0x0004
339 #define ADIN1300_PHY_STATUS_1_LP_PAUSE_ADV 0x0002
340 #define ADIN1300_PHY_STATUS_1_LP_APAUSE_ADV 0x0001
341 
342 //LED Control 1 register
343 #define ADIN1300_LED_CTRL_1_LED_A_EXT_CFG_EN 0x0400
344 #define ADIN1300_LED_CTRL_1_LED_PAT_PAUSE_DUR 0x00F0
345 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_DUR_SEL 0x000C
346 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_DUR_SEL_32MS 0x0000
347 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_DUR_SEL_64MS 0x0004
348 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_DUR_SEL_102MS 0x0008
349 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_DUR_SEL_USER 0x000C
350 #define ADIN1300_LED_CTRL_1_LED_OE_N 0x0002
351 #define ADIN1300_LED_CTRL_1_LED_PUL_STR_EN 0x0001
352 
353 //LED Control 2 register
354 #define ADIN1300_LED_CTRL_2_LED_A_CFG 0x001F
355 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_1000 0x0000
356 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100 0x0001
357 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10 0x0002
358 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_1000_BLICK_100 0x0003
359 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_LINK 0x0004
360 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_TX 0x0005
361 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_RX 0x0006
362 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_ACT 0x0007
363 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_FD 0x0008
364 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_COL 0x0009
365 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_LINK_BLINK_ACT 0x000A
366 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_LINK_BLINK_RX 0x000B
367 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_FD_BLINK_COL 0x000C
368 #define ADIN1300_LED_CTRL_2_LED_A_CFG_BLINK 0x000D
369 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON 0x000E
370 #define ADIN1300_LED_CTRL_2_LED_A_CFG_OFF 0x000F
371 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_100 0x0010
372 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100_1000 0x0011
373 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_BLINK_ACT 0x0012
374 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100_BLINK_ACT 0x0013
375 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_1000_BLINK_ACT 0x0014
376 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_100_BLINK_ACT 0x0015
377 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100_1000_BLINK_ACT 0x0016
378 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_1000 0x0017
379 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_1000_BLINK_ACT 0x0018
380 #define ADIN1300_LED_CTRL_2_LED_A_CFG_BLINK_ACT 0x0019
381 #define ADIN1300_LED_CTRL_2_LED_A_CFG_BLINK_TX 0x001A
382 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_1000_BLINK_10 0x001B
383 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100_BLINK_1000 0x001C
384 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_100_BLINK_10 0x001D
385 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_BLINK_1000 0x001E
386 #define ADIN1300_LED_CTRL_2_LED_A_CFG_ON_10_BLINK_100 0x001F
387 
388 //LED Control 3 register
389 #define ADIN1300_LED_CTRL_3_LED_PAT_SEL 0xC000
390 #define ADIN1300_LED_CTRL_3_LED_PAT_SEL_DEFAULT 0x0000
391 #define ADIN1300_LED_CTRL_3_LED_PAT_TICK_DUR 0x3F00
392 #define ADIN1300_LED_CTRL_3_LED_PAT_TICK_DUR_DEFAULT 0x1800
393 #define ADIN1300_LED_CTRL_3_LED_PAT 0x00FF
394 #define ADIN1300_LED_CTRL_3_LED_PAT_DEFAULT 0x0055
395 
396 //PHY Status 2 register
397 #define ADIN1300_PHY_STATUS_2_PAIR_23_SWAP 0x4000
398 #define ADIN1300_PHY_STATUS_2_PAIR_3_POL_INV 0x2000
399 #define ADIN1300_PHY_STATUS_2_PAIR_2_POL_INV 0x1000
400 #define ADIN1300_PHY_STATUS_2_PAIR_1_POL_INV 0x0800
401 #define ADIN1300_PHY_STATUS_2_PAIR_0_POL_INV 0x0400
402 #define ADIN1300_PHY_STATUS_2_B_1000_DSCR_ACQ_ERR 0x0001
403 
404 //Energy Efficient Ethernet Capability register
405 #define ADIN1300_EEE_CAPABILITY_EEE_10_G_KR_SPRT 0x0040
406 #define ADIN1300_EEE_CAPABILITY_EEE_10_G_KX_4_SPRT 0x0020
407 #define ADIN1300_EEE_CAPABILITY_EEE_1000_KX_SPRT 0x0010
408 #define ADIN1300_EEE_CAPABILITY_EEE_10_G_SPRT 0x0008
409 #define ADIN1300_EEE_CAPABILITY_EEE_1000_SPRT 0x0004
410 #define ADIN1300_EEE_CAPABILITY_EEE_100_SPRT 0x0002
411 
412 //Energy Efficient Ethernet Advertisement register
413 #define ADIN1300_EEE_ADV_EEE_10_G_KR_ADV 0x0040
414 #define ADIN1300_EEE_ADV_EEE_10_G_KX_4_ADV 0x0020
415 #define ADIN1300_EEE_ADV_EEE_1000_KX_ADV 0x0010
416 #define ADIN1300_EEE_ADV_EEE_10_G_ADV 0x0008
417 #define ADIN1300_EEE_ADV_EEE_1000_ADV 0x0004
418 #define ADIN1300_EEE_ADV_EEE_100_ADV 0x0002
419 
420 //Energy Efficient Ethernet Link Partner Ability register
421 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_10_G_KR_ABLE 0x0040
422 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_10_G_KX_4_ABLE 0x0020
423 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_1000_KX_ABLE 0x0010
424 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_10_G_ABLE 0x0008
425 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_1000_ABLE 0x0004
426 #define ADIN1300_EEE_LP_ABILITY_LP_EEE_100_ABLE 0x0002
427 
428 //Energy Efficient Ethernet Resolved register
429 #define ADIN1300_EEE_RSLVD_EEE_RSLVD 0x0001
430 
431 //Mean Square Error A register
432 #define ADIN1300_MSE_A_MSE_A 0x00FF
433 
434 //Mean Square Error B register
435 #define ADIN1300_MSE_B_MSE_B 0x00FF
436 
437 //Mean Square Error C register
438 #define ADIN1300_MSE_C_MSE_C 0x00FF
439 
440 //Mean Square Error D register
441 #define ADIN1300_MSE_D_MSE_D 0x00FF
442 
443 //Enhanced Link Detection Enable register
444 #define ADIN1300_FLD_EN_FLD_PCS_ERR_B_100_EN 0x0080
445 #define ADIN1300_FLD_EN_FLD_PCS_ERR_B_1000_EN 0x0040
446 #define ADIN1300_FLD_EN_FLD_SLCR_OUT_STUCK_B_100_EN 0x0020
447 #define ADIN1300_FLD_EN_FLD_SLCR_OUT_STUCK_B_1000_EN 0x0010
448 #define ADIN1300_FLD_EN_FLD_SLCR_IN_ZDET_B_100_EN 0x0008
449 #define ADIN1300_FLD_EN_FLD_SLCR_IN_ZDET_B_1000_EN 0x0004
450 #define ADIN1300_FLD_EN_FLD_SLCR_IN_INVLD_B_100_EN 0x0002
451 #define ADIN1300_FLD_EN_FLD_SLCR_IN_INVLD_B_1000_EN 0x0001
452 
453 //Enhanced Link Detection Latched Status register
454 #define ADIN1300_FLD_STAT_LAT_FAST_LINK_DOWN_LAT 0x2000
455 
456 //Receive MII Clock Stop Enable register
457 #define ADIN1300_RX_MII_CLK_STOP_EN_RX_MII_CLK_STOP_EN 0x0400
458 
459 //Physical Coding Sublayer (PCS) Status 1 register
460 #define ADIN1300_PCS_STATUS_1_TX_LPI_RCVD 0x0800
461 #define ADIN1300_PCS_STATUS_1_RX_LPI_RCVD 0x0400
462 #define ADIN1300_PCS_STATUS_1_TX_LPI 0x0200
463 #define ADIN1300_PCS_STATUS_1_RX_LPI 0x0100
464 #define ADIN1300_PCS_STATUS_1_TX_MII_CLK_STOP_CPBL 0x0040
465 
466 //Frame Checker Enable register
467 #define ADIN1300_FC_EN_FC_EN 0x0001
468 
469 //Frame Checker Interrupt Enable register
470 #define ADIN1300_FC_IRQ_EN_FC_IRQ_EN 0x0001
471 
472 //Frame Checker Transmit Select register
473 #define ADIN1300_FC_TX_SEL_FC_TX_SEL 0x0001
474 
475 //Frame Generator Enable register
476 #define ADIN1300_FG_EN_FG_EN 0x0001
477 
478 //Frame Generator Control and Restart register
479 #define ADIN1300_FG_CNTRL_RSTRT_FG_RSTRT 0x0008
480 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL 0x0007
481 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_NO_FRAMES 0x0000
482 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_RANDOM 0x0001
483 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_ALL_ZEROS 0x0002
484 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_ALL_ONES 0x0003
485 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_ALT 0x0004
486 #define ADIN1300_FG_CNTRL_RSTRT_FG_CNTRL_DEC 0x0005
487 
488 //Frame Generator Continuous Mode Enable register
489 #define ADIN1300_FG_CONT_MODE_EN_FG_CONT_MODE_EN 0x0001
490 
491 //Frame Generator Interrupt Enable register
492 #define ADIN1300_FG_IRQ_EN_FG_IRQ_EN 0x0001
493 
494 //Frame Generator Done register
495 #define ADIN1300_FG_DONE_FG_DONE 0x0001
496 
497 //FIFO Sync register
498 #define ADIN1300_FIFO_SYNC_FIFO_SYNC 0x0001
499 
500 //Start of Packet Control register
501 #define ADIN1300_SOP_CTRL_SOP_N_8_CYCM_1 0x0070
502 #define ADIN1300_SOP_CTRL_SOP_NCYC_EN 0x0008
503 #define ADIN1300_SOP_CTRL_SOP_SFD_EN 0x0004
504 #define ADIN1300_SOP_CTRL_SOP_RX_EN 0x0002
505 #define ADIN1300_SOP_CTRL_SOP_TX_EN 0x0001
506 
507 //Start of Packet Receive Detection Delay register
508 #define ADIN1300_SOP_RX_DEL_SOP_RX_10_DEL_NCYC 0xF800
509 #define ADIN1300_SOP_RX_DEL_SOP_RX_100_DEL_NCYC 0x07C0
510 #define ADIN1300_SOP_RX_DEL_SOP_RX_1000_DEL_NCYC 0x003F
511 
512 //Start of Packet Transmit Detection Delay register
513 #define ADIN1300_SOP_TX_DEL_SOP_TX_10_DEL_N_8_NS 0x1F00
514 #define ADIN1300_SOP_TX_DEL_SOP_TX_100_DEL_N_8_NS 0x00F0
515 #define ADIN1300_SOP_TX_DEL_SOP_TX_1000_DEL_N_8_NS 0x000F
516 
517 //Control of FIFO Depth for MII Modes register
518 #define ADIN1300_DPTH_MII_BYTE_DPTH_MII_BYTE 0x0001
519 
520 //Base 1000 Retrain Enable register
521 #define ADIN1300_B_1000_RTRN_EN_B_1000_RTRN_EN 0x0001
522 
523 //Base 10e Enable register
524 #define ADIN1300_B_10_E_EN_B_10_E_EN 0x0001
525 
526 //10BASE-T Transmit Test Mode register
527 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE 0x0007
528 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE_DISABLED 0x0000
529 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE_10MHZ_DIM_0 0x0001
530 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE_10MHZ_DIM_1 0x0002
531 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE_5MHZ_DIM_0 0x0003
532 #define ADIN1300_B_10_TX_TST_MODE_B_10_TX_TST_MODE_5MHZ_DIM_1 0x0004
533 
534 //100BASE-TX Transmit Test Mode register
535 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE 0x0007
536 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE_DISABLED 0x0000
537 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE_MLT3_16NS_DIM_0 0x0001
538 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE_MLT3_16NS_DIM_1 0x0002
539 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE_MLT3_112NS_DIM_0 0x0003
540 #define ADIN1300_B_100_TX_TST_MODE_B_100_TX_TST_MODE_MLT3_112NS_DIM_1 0x0004
541 
542 //Run Automated Cable Diagnostics register
543 #define ADIN1300_CDIAG_RUN_CDIAG_RUN 0x0001
544 
545 //Cable Diagnostics Cross Pair Fault Checking Disable register
546 #define ADIN1300_CDIAG_XPAIR_DIS_CDIAG_XPAIR_DIS 0x0001
547 
548 //Cable Diagnostics Results 0 register
549 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_BSY 0x0400
550 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSIM_3 0x0200
551 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSIM_2 0x0100
552 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSIM_1 0x0080
553 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_SIM 0x0040
554 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSHRT_3 0x0020
555 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSHRT_2 0x0010
556 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_XSHRT_1 0x0008
557 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_SHRT 0x0004
558 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_OPN 0x0002
559 #define ADIN1300_CDIAG_DTLD_RSLTS_0_CDIAG_RSLT_0_GD 0x0001
560 
561 //Cable Diagnostics Results 1 register
562 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_BSY 0x0400
563 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSIM_3 0x0200
564 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSIM_2 0x0100
565 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSIM_0 0x0080
566 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_SIM 0x0040
567 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSHRT_3 0x0020
568 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSHRT_2 0x0010
569 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_XSHRT_0 0x0008
570 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_SHRT 0x0004
571 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_OPN 0x0002
572 #define ADIN1300_CDIAG_DTLD_RSLTS_1_CDIAG_RSLT_1_GD 0x0001
573 
574 //Cable Diagnostics Results 2 register
575 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_BSY 0x0400
576 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSIM_3 0x0200
577 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSIM_1 0x0100
578 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSIM_0 0x0080
579 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_SIM 0x0040
580 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSHRT_3 0x0020
581 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSHRT_1 0x0010
582 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_XSHRT_0 0x0008
583 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_SHRT 0x0004
584 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_OPN 0x0002
585 #define ADIN1300_CDIAG_DTLD_RSLTS_2_CDIAG_RSLT_2_GD 0x0001
586 
587 //Cable Diagnostics Results 3 register
588 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_BSY 0x0400
589 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSIM_2 0x0200
590 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSIM_1 0x0100
591 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSIM_0 0x0080
592 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_SIM 0x0040
593 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSHRT_2 0x0020
594 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSHRT_1 0x0010
595 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_XSHRT_0 0x0008
596 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_SHRT 0x0004
597 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_OPN 0x0002
598 #define ADIN1300_CDIAG_DTLD_RSLTS_3_CDIAG_RSLT_3_GD 0x0001
599 
600 //Cable Diagnostics Fault Distance Pair 0 register
601 #define ADIN1300_CDIAG_FLT_DIST_0_CDIAG_FLT_DIST_0 0x00FF
602 
603 //Cable Diagnostics Fault Distance Pair 1 register
604 #define ADIN1300_CDIAG_FLT_DIST_1_CDIAG_FLT_DIST_1 0x00FF
605 
606 //Cable Diagnostics Fault Distance Pair 2 register
607 #define ADIN1300_CDIAG_FLT_DIST_2_CDIAG_FLT_DIST_2 0x00FF
608 
609 //Cable Diagnostics Fault Distance Pair 3 register
610 #define ADIN1300_CDIAG_FLT_DIST_3_CDIAG_FLT_DIST_3 0x00FF
611 
612 //Cable Diagnostics Cable Length Estimate register
613 #define ADIN1300_CDIAG_CBL_LEN_EST_CDIAG_CBL_LEN_EST 0x00FF
614 
615 //LED Pulse Stretching Duration register
616 #define ADIN1300_LED_PUL_STR_DUR_LED_PUL_STR_DUR 0x003F
617 
618 //Subsystem Software Reset register
619 #define ADIN1300_GE_SFT_RST_GE_SFT_RST 0x0001
620 
621 //Subsystem Software Reset Configuration Enable register
622 #define ADIN1300_GE_SFT_RST_CFG_EN_GE_SFT_RST_CFG_EN 0x0001
623 
624 //Subsystem Clock Configuration register
625 #define ADIN1300_GE_CLK_CFG_GE_CLK_RCVR_125_EN 0x0020
626 #define ADIN1300_GE_CLK_CFG_GE_CLK_FREE_125_EN 0x0010
627 #define ADIN1300_GE_CLK_CFG_GE_REF_CLK_EN 0x0008
628 #define ADIN1300_GE_CLK_CFG_GE_CLK_HRT_RCVR_EN 0x0004
629 #define ADIN1300_GE_CLK_CFG_GE_CLK_HRT_FREE_EN 0x0002
630 #define ADIN1300_GE_CLK_CFG_GE_CLK_25_EN 0x0001
631 
632 //Subsystem RGMII Configuration register
633 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_100_LOW_LTNCY_EN 0x0400
634 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_10_LOW_LTNCY_EN 0x0200
635 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_RX_SEL 0x01C0
636 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_GTX_SEL 0x0038
637 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_RX_ID_EN 0x0004
638 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_TX_ID_EN 0x0002
639 #define ADIN1300_GE_RGMII_CFG_GE_RGMII_EN 0x0001
640 
641 //Subsystem RMII Configuration register
642 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_RST 0x0080
643 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH 0x0070
644 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_4_BITS 0x0000
645 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_8_BITS 0x0010
646 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_12_BITS 0x0020
647 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_16_BITS 0x0030
648 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_20_BITS 0x0040
649 #define ADIN1300_GE_RMII_CFG_GE_RMII_FIFO_DPTH_24_BITS 0x0050
650 #define ADIN1300_GE_RMII_CFG_GE_RMII_TXD_CHK_EN 0x0008
651 #define ADIN1300_GE_RMII_CFG_GE_RMII_CRS_EN 0x0004
652 #define ADIN1300_GE_RMII_CFG_GE_RMII_BAD_SSD_RX_ER_EN 0x0002
653 #define ADIN1300_GE_RMII_CFG_GE_RMII_EN 0x0001
654 
655 //Subsystem PHY Base Configuration register
656 #define ADIN1300_GE_PHY_BASE_CFG_GE_RTRN_EN_CFG 0x1000
657 #define ADIN1300_GE_PHY_BASE_CFG_GE_FLD_1000_EN_CFG 0x0800
658 #define ADIN1300_GE_PHY_BASE_CFG_GE_FLD_100_EN_CFG 0x0400
659 #define ADIN1300_GE_PHY_BASE_CFG_GE_PHY_SFT_PD_CFG 0x0008
660 
661 //Subsystem Link Status Invert Enable register
662 #define ADIN1300_GE_LNK_STAT_INV_EN_GE_LNK_STAT_INV_EN 0x0001
663 
664 //Subsystem GP_CLK Pin Override Control register
665 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL 0x0007
666 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_DEFAULT 0x0000
667 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_LINK_STATUS 0x0001
668 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_TX_SOF 0x0002
669 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_RX_SOF 0x0003
670 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_CRS 0x0004
671 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_COL 0x0005
672 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_RX_ER 0x0006
673 #define ADIN1300_GE_IO_GP_CLK_OR_CNTRL_GE_IO_GP_CLK_OR_CNTRL_PHY_CLK 0x0007
674 
675 //Subsystem LINK_ST Pin Override Control register
676 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL 0x0007
677 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_DEFAULT 0x0000
678 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_LINK_STATUS 0x0001
679 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_TX_SOF 0x0002
680 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_RX_SOF 0x0003
681 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_CRS 0x0004
682 #define ADIN1300_GE_IO_GP_OUT_OR_CNTRL_GE_IO_GP_OUT_OR_CNTRL_COL 0x0005
683 
684 //Subsystem INT_N Pin Override Control register
685 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL 0x0007
686 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_DEFAULT 0x0000
687 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_LINK_STATUS 0x0001
688 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_TX_SOF 0x0002
689 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_RX_SOF 0x0003
690 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_CRS 0x0004
691 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_COL 0x0005
692 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_TX_ER 0x0006
693 #define ADIN1300_GE_IO_INT_N_OR_CNTRL_GE_IO_INT_N_OR_CNTRL_INT_N 0x0007
694 
695 //Subsystem LED_0 Pin Override Control register
696 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL 0x000F
697 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_DEFAULT 0x0000
698 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_LINK_STATUS 0x0001
699 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_TX_SOF 0x0002
700 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_RX_SOF 0x0003
701 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_CRS 0x0004
702 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_COL 0x0005
703 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_TX_ER 0x0006
704 #define ADIN1300_GE_IO_LED_A_OR_CNTRL_GE_IO_LED_A_OR_CNTRL_LED_0 0x0007
705 
706 //C++ guard
707 #ifdef __cplusplus
708 extern "C" {
709 #endif
710 
711 //ADIN1300 Ethernet PHY driver
712 extern const PhyDriver adin1300PhyDriver;
713 
714 //ADIN1300 related functions
715 error_t adin1300Init(NetInterface *interface);
716 void adin1300InitHook(NetInterface *interface);
717 
718 void adin1300Tick(NetInterface *interface);
719 
720 void adin1300EnableIrq(NetInterface *interface);
721 void adin1300DisableIrq(NetInterface *interface);
722 
723 void adin1300EventHandler(NetInterface *interface);
724 
725 void adin1300WritePhyReg(NetInterface *interface, uint8_t address,
726  uint16_t data);
727 
728 uint16_t adin1300ReadPhyReg(NetInterface *interface, uint8_t address);
729 
730 void adin1300DumpPhyReg(NetInterface *interface);
731 
732 void adin1300WriteExtReg(NetInterface *interface, uint16_t address,
733  uint16_t data);
734 
735 uint16_t adin1300ReadExtReg(NetInterface *interface, uint16_t address);
736 
737 //C++ guard
738 #ifdef __cplusplus
739 }
740 #endif
741 
742 #endif
void adin1300Tick(NetInterface *interface)
ADIN1300 timer handler.
error_t adin1300Init(NetInterface *interface)
ADIN1300 PHY transceiver initialization.
void adin1300EnableIrq(NetInterface *interface)
Enable interrupts.
Ethernet PHY driver.
Definition: nic.h:311
uint8_t data[]
Definition: ethernet.h:222
void adin1300EventHandler(NetInterface *interface)
ADIN1300 event handler.
error_t
Error codes.
Definition: error.h:43
#define NetInterface
Definition: net.h:36
void adin1300InitHook(NetInterface *interface)
ADIN1300 custom configuration.
const PhyDriver adin1300PhyDriver
ADIN1300 Ethernet PHY driver.
uint16_t adin1300ReadPhyReg(NetInterface *interface, uint8_t address)
Read PHY register.
Ipv6Addr address[]
Definition: ipv6.h:325
Network interface controller abstraction layer.
void adin1300DumpPhyReg(NetInterface *interface)
Dump PHY registers for debugging purpose.
void adin1300DisableIrq(NetInterface *interface)
Disable interrupts.
void adin1300WriteExtReg(NetInterface *interface, uint16_t address, uint16_t data)
Write extended register.
uint16_t adin1300ReadExtReg(NetInterface *interface, uint16_t address)
Read extended register.
void adin1300WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data)
Write PHY register.