4 * @brief this file contains the public API of @ref IxEthMii component
7 * The main intent of this API is to inplement MII high level fonctionalitoes
8 * to support the codelets provided with the IXP400 software releases. It
9 * superceedes previous interfaces provided with @ref IxEThAcc component.
11 * This API has been tested with the PHYs provided with the
12 * IXP400 development platforms. It may not work for specific Ethernet PHYs
13 * used on specific boards.
15 * This source code detects and interface the LXT972, LXT973 and KS6995
18 * This source code should be considered as an example which may need
19 * to be adapted for different hardware implementations.
21 * It is strongly recommended to use public domain and GPL utilities
22 * like libmii, mii-diag for MII interface support.
27 * IXP400 SW Release version 2.0
29 * -- Copyright Notice --
32 * Copyright 2001-2005, Intel Corporation.
33 * All rights reserved.
36 * SPDX-License-Identifier: BSD-3-Clause
38 * -- End of Copyright Notice --
47 * @defgroup IxEthMii IXP400 Ethernet Phy Access (IxEthMii) API
49 * @brief ethMii is a library that does provides access to the
58 * @fn ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount)
60 * @brief Scan the MDIO bus for PHYs
61 * This function scans PHY addresses 0 through 31, and sets phyPresent[n] to
62 * true if a phy is discovered at address n.
67 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
69 * @param phyPresent BOOL [in] - boolean array of IXP425_ETH_ACC_MII_MAX_ADDR entries
70 * @param maxPhyCount UINT32 [in] - number of PHYs to search for (the scan will stop when
71 * the indicated number of PHYs is found).
74 * - IX_ETH_ACC_SUCCESS
75 * - IX_ETH_ACC_FAIL : invalid arguments.
79 PUBLIC IX_STATUS ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount);
84 * @fn ixEthMiiPhyConfig(UINT32 phyAddr,
90 * @brief Configure a PHY
91 * Configure a PHY's speed, duplex and autonegotiation status
96 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
98 * @param phyAddr UINT32 [in]
99 * @param speed100 BOOL [in] - set to true for 100Mbit/s operation, false for 10Mbit/s
100 * @param fullDuplex BOOL [in] - set to true for Full Duplex, false for Half Duplex
101 * @param autonegotiate BOOL [in] - set to true to enable autonegotiation
105 * - IX_FAIL : invalid arguments.
109 PUBLIC IX_STATUS ixEthMiiPhyConfig(UINT32 phyAddr,
117 * @fn ixEthMiiPhyLoopbackEnable(UINT32 phyAddr)
120 * @brief Enable PHY Loopback in a specific Eth MII port
122 * @note When PHY Loopback is enabled, frames sent out to the PHY from the
123 * IXP400 will be looped back to the IXP400. They will not be transmitted out
127 * - ISR Callable - no
129 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
133 * - IX_FAIL : invalid arguments.
137 ixEthMiiPhyLoopbackEnable (UINT32 phyAddr);
142 * @fn ixEthMiiPhyLoopbackDisable(UINT32 phyAddr)
145 * @brief Disable PHY Loopback in a specific Eth MII port
148 * - ISR Callable - no
150 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
154 * - IX_FAIL : invalid arguments.
158 ixEthMiiPhyLoopbackDisable (UINT32 phyAddr);
163 * @fn ixEthMiiPhyReset(UINT32 phyAddr)
169 * - ISR Callable - no
171 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
173 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
177 * - IX_FAIL : invalid arguments.
181 PUBLIC IX_STATUS ixEthMiiPhyReset(UINT32 phyAddr);
187 * @fn ixEthMiiLinkStatus(UINT32 phyAddr,
193 * @brief Retrieve the current status of a PHY
194 * Retrieve the link, speed, duplex and autonegotiation status of a PHY
197 * - ISR Callable - no
199 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
201 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
202 * @param linkUp BOOL [out] - set to true if the link is up
203 * @param speed100 BOOL [out] - set to true indicates 100Mbit/s, false indicates 10Mbit/s
204 * @param fullDuplex BOOL [out] - set to true indicates Full Duplex, false indicates Half Duplex
205 * @param autoneg BOOL [out] - set to true indicates autonegotiation is enabled, false indicates autonegotiation is disabled
209 * - IX_FAIL : invalid arguments.
213 PUBLIC IX_STATUS ixEthMiiLinkStatus(UINT32 phyAddr,
222 * @fn ixEthMiiPhyShow (UINT32 phyAddr)
225 * @brief Display information on a specified PHY
226 * Display link status, speed, duplex and Auto Negotiation status
229 * - ISR Callable - no
231 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
233 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
237 * - IX_FAIL : invalid arguments.
241 PUBLIC IX_STATUS ixEthMiiPhyShow (UINT32 phyAddr);
243 #endif /* ndef IxEthMii_H */