PDK API Guide for J721E
enet_mod_phy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
40 #ifndef ENET_MOD_PHY_H_
41 #define ENET_MOD_PHY_H_
42 
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46 
47 #include <stdint.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /* ========================================================================== */
56 /* Macros */
57 /* ========================================================================== */
58 
60 #define ENET_PHY_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
61  ENET_IOCTL_PHY_BASE | \
62  ENET_IOCTL_MIN(x))
63 
64 /* ========================================================================== */
65 /* Structures and Enums */
66 /* ========================================================================== */
67 
72 {
81 
90 
99 
108 
118 
128 
137 
146 
155 
164 
173 
182 
191 
200 };
201 
205 typedef struct EnetPhy_GenericInArgs_s
206 {
210 
214 typedef struct EnetPhy_ReadRegInArgs_s
215 {
218 
220  uint16_t reg;
222 
226 typedef struct EnetPhy_WriteRegInArgs_s
227 {
230 
232  uint16_t reg;
233 
235  uint16_t val;
237 
241 typedef struct EnetPhy_C45ReadRegInArgs_s
242 {
245 
247  uint8_t mmd;
248 
250  uint16_t reg;
252 
256 typedef struct EnetPhy_C45WriteRegInArgs_s
257 {
260 
262  uint8_t mmd;
263 
265  uint16_t reg;
266 
268  uint16_t val;
270 
271 /* ========================================================================== */
272 /* Global Variables Declarations */
273 /* ========================================================================== */
274 
275 /* None */
276 
277 /* ========================================================================== */
278 /* Function Declarations */
279 /* ========================================================================== */
280 
281 /* None */
282 
283 /* ========================================================================== */
284 /* Deprecated Function Declarations */
285 /* ========================================================================== */
286 
287 /* None */
288 
289 /* ========================================================================== */
290 /* Static Function Definitions */
291 /* ========================================================================== */
292 
293 /* None */
294 
295 #ifdef __cplusplus
296 }
297 #endif
298 
299 #endif /* ENET_MOD_PHY_H_ */
uint16_t val
Definition: enet_mod_phy.h:268
Enet_MacPort macPort
Definition: enet_mod_phy.h:229
Input args for ENET_PHY_IOCTL_WRITE_EXT_REG command.
Definition: enet_mod_phy.h:226
Check state-machine link state, that is, whether the state machine has reached the LINKED state.
Definition: enet_mod_phy.h:117
Check PHY alive status.
Definition: enet_mod_phy.h:107
Enet_MacPort macPort
Definition: enet_mod_phy.h:259
Print PHY registers.
Definition: enet_mod_phy.h:199
uint16_t reg
Definition: enet_mod_phy.h:220
uint16_t reg
Definition: enet_mod_phy.h:232
#define ENET_PHY_PUBLIC_IOCTL(x)
Helper macro to create PHY IOCTL commands.
Definition: enet_mod_phy.h:60
Input args for ENET_PHY_IOCTL_C45_WRITE_REG command.
Definition: enet_mod_phy.h:256
Get PHY identification.
Definition: enet_mod_phy.h:80
Read PHY extended register.
Definition: enet_mod_phy.h:163
Write PHY register.
Definition: enet_mod_phy.h:154
uint8_t mmd
Definition: enet_mod_phy.h:247
uint16_t val
Definition: enet_mod_phy.h:235
uint16_t reg
Definition: enet_mod_phy.h:265
Enet_MacPort macPort
Definition: enet_mod_phy.h:217
Generic input args.
Definition: enet_mod_phy.h:205
uint8_t mmd
Definition: enet_mod_phy.h:262
Input args for ENET_PHY_IOCTL_C45_READ_REG command.
Definition: enet_mod_phy.h:241
EnetPhy_Ioctl_e
PHY IOCTL commands.
Definition: enet_mod_phy.h:71
Write PHY extended register.
Definition: enet_mod_phy.h:172
Read PHY register using Clause-45 frame.
Definition: enet_mod_phy.h:181
Get the link speed and duplexity state after the state machine has reached the LINKED state.
Definition: enet_mod_phy.h:127
Enet_MacPort
MAC port.
Definition: enet_types.h:402
Read PHY register.
Definition: enet_mod_phy.h:145
Get PHY supported modes by local PHY device.
Definition: enet_mod_phy.h:89
Reset PHY.
Definition: enet_mod_phy.h:136
uint16_t reg
Definition: enet_mod_phy.h:250
Check if PHY is in loopback or not.
Definition: enet_mod_phy.h:98
This file contains the type definitions and helper macros for the Enet Module interface.
Write PHY register using Clause-45 frame.
Definition: enet_mod_phy.h:190
Input args for ENET_PHY_IOCTL_READ_EXT_REG command.
Definition: enet_mod_phy.h:214
Enet_MacPort macPort
Definition: enet_mod_phy.h:244
Enet_MacPort macPort
Definition: enet_mod_phy.h:208
This file contains the type definitions and helper macros for the Ethernet PHY interface.