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 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the Intel Corporation nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
50 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * -- End of Copyright Notice --
71 * @defgroup IxEthMii IXP400 Ethernet Phy Access (IxEthMii) API
73 * @brief ethMii is a library that does provides access to the
82 * @fn ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount)
84 * @brief Scan the MDIO bus for PHYs
85 * This function scans PHY addresses 0 through 31, and sets phyPresent[n] to
86 * TRUE if a phy is discovered at address n.
91 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
93 * @param phyPresent BOOL [in] - boolean array of IXP425_ETH_ACC_MII_MAX_ADDR entries
94 * @param maxPhyCount UINT32 [in] - number of PHYs to search for (the scan will stop when
95 * the indicated number of PHYs is found).
98 * - IX_ETH_ACC_SUCCESS
99 * - IX_ETH_ACC_FAIL : invalid arguments.
103 PUBLIC IX_STATUS
ixEthMiiPhyScan(BOOL phyPresent
[], UINT32 maxPhyCount
);
108 * @fn ixEthMiiPhyConfig(UINT32 phyAddr,
114 * @brief Configure a PHY
115 * Configure a PHY's speed, duplex and autonegotiation status
118 * - ISR Callable - no
120 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
122 * @param phyAddr UINT32 [in]
123 * @param speed100 BOOL [in] - set to TRUE for 100Mbit/s operation, FALSE for 10Mbit/s
124 * @param fullDuplex BOOL [in] - set to TRUE for Full Duplex, FALSE for Half Duplex
125 * @param autonegotiate BOOL [in] - set to TRUE to enable autonegotiation
129 * - IX_FAIL : invalid arguments.
133 PUBLIC IX_STATUS
ixEthMiiPhyConfig(UINT32 phyAddr
,
141 * @fn ixEthMiiPhyLoopbackEnable(UINT32 phyAddr)
144 * @brief Enable PHY Loopback in a specific Eth MII port
146 * @note When PHY Loopback is enabled, frames sent out to the PHY from the
147 * IXP400 will be looped back to the IXP400. They will not be transmitted out
151 * - ISR Callable - no
153 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
157 * - IX_FAIL : invalid arguments.
161 ixEthMiiPhyLoopbackEnable (UINT32 phyAddr
);
166 * @fn ixEthMiiPhyLoopbackDisable(UINT32 phyAddr)
169 * @brief Disable PHY Loopback in a specific Eth MII port
172 * - ISR Callable - no
174 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
178 * - IX_FAIL : invalid arguments.
182 ixEthMiiPhyLoopbackDisable (UINT32 phyAddr
);
187 * @fn ixEthMiiPhyReset(UINT32 phyAddr)
193 * - ISR Callable - no
195 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
197 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
201 * - IX_FAIL : invalid arguments.
205 PUBLIC IX_STATUS
ixEthMiiPhyReset(UINT32 phyAddr
);
211 * @fn ixEthMiiLinkStatus(UINT32 phyAddr,
217 * @brief Retrieve the current status of a PHY
218 * Retrieve the link, speed, duplex and autonegotiation status of a PHY
221 * - ISR Callable - no
223 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
225 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
226 * @param linkUp BOOL [out] - set to TRUE if the link is up
227 * @param speed100 BOOL [out] - set to TRUE indicates 100Mbit/s, FALSE indicates 10Mbit/s
228 * @param fullDuplex BOOL [out] - set to TRUE indicates Full Duplex, FALSE indicates Half Duplex
229 * @param autoneg BOOL [out] - set to TRUE indicates autonegotiation is enabled, FALSE indicates autonegotiation is disabled
233 * - IX_FAIL : invalid arguments.
237 PUBLIC IX_STATUS
ixEthMiiLinkStatus(UINT32 phyAddr
,
246 * @fn ixEthMiiPhyShow (UINT32 phyAddr)
249 * @brief Display information on a specified PHY
250 * Display link status, speed, duplex and Auto Negotiation status
253 * - ISR Callable - no
255 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
257 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
261 * - IX_FAIL : invalid arguments.
265 PUBLIC IX_STATUS
ixEthMiiPhyShow (UINT32 phyAddr
);
267 #endif /* ndef IxEthMii_H */