change console=tty0 to enable linux framebuffer console
[jz_uboot.git] / cpu / ixp / npe / include / IxEthMii.h
bloba1bfe0672413592ef6d5e173ea0d92477a71bd1b
1 /**
2 * @file IxEthMii.h
4 * @brief this file contains the public API of @ref IxEthMii component
6 * Design notes :
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
16 * Ethernet PHYs.
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.
26 * @par
27 * IXP400 SW Release version 2.0
29 * -- Copyright Notice --
31 * @par
32 * Copyright 2001-2005, Intel Corporation.
33 * All rights reserved.
35 * @par
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
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.
48 * @par
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
59 * SUCH DAMAGE.
61 * @par
62 * -- End of Copyright Notice --
65 #ifndef IxEthMii_H
66 #define IxEthMii_H
68 #include <IxTypes.h>
70 /**
71 * @defgroup IxEthMii IXP400 Ethernet Phy Access (IxEthMii) API
73 * @brief ethMii is a library that does provides access to the
74 * Ethernet PHYs
76 *@{
79 /**
80 * @ingroup IxEthMii
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.
88 * - Reentrant - no
89 * - ISR Callable - no
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).
97 * @return IX_STATUS
98 * - IX_ETH_ACC_SUCCESS
99 * - IX_ETH_ACC_FAIL : invalid arguments.
101 * <hr>
103 PUBLIC IX_STATUS ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount);
106 * @ingroup IxEthMii
108 * @fn ixEthMiiPhyConfig(UINT32 phyAddr,
109 BOOL speed100,
110 BOOL fullDuplex,
111 BOOL autonegotiate)
114 * @brief Configure a PHY
115 * Configure a PHY's speed, duplex and autonegotiation status
117 * - Reentrant - no
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
127 * @return IX_STATUS
128 * - IX_SUCCESS
129 * - IX_FAIL : invalid arguments.
131 * <hr>
133 PUBLIC IX_STATUS ixEthMiiPhyConfig(UINT32 phyAddr,
134 BOOL speed100,
135 BOOL fullDuplex,
136 BOOL autonegotiate);
139 * @ingroup IxEthMii
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
148 * on the wire.
150 * - Reentrant - no
151 * - ISR Callable - no
153 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
155 * @return IX_STATUS
156 * - IX_SUCCESS
157 * - IX_FAIL : invalid arguments.
158 * <hr>
160 PUBLIC IX_STATUS
161 ixEthMiiPhyLoopbackEnable (UINT32 phyAddr);
164 * @ingroup IxEthMii
166 * @fn ixEthMiiPhyLoopbackDisable(UINT32 phyAddr)
169 * @brief Disable PHY Loopback in a specific Eth MII port
171 * - Reentrant - no
172 * - ISR Callable - no
174 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
176 * @return IX_STATUS
177 * - IX_SUCCESS
178 * - IX_FAIL : invalid arguments.
179 * <hr>
181 PUBLIC IX_STATUS
182 ixEthMiiPhyLoopbackDisable (UINT32 phyAddr);
185 * @ingroup IxEthMii
187 * @fn ixEthMiiPhyReset(UINT32 phyAddr)
189 * @brief Reset a PHY
190 * Reset a PHY
192 * - Reentrant - no
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)
199 * @return IX_STATUS
200 * - IX_SUCCESS
201 * - IX_FAIL : invalid arguments.
203 * <hr>
205 PUBLIC IX_STATUS ixEthMiiPhyReset(UINT32 phyAddr);
209 * @ingroup IxEthMii
211 * @fn ixEthMiiLinkStatus(UINT32 phyAddr,
212 BOOL *linkUp,
213 BOOL *speed100,
214 BOOL *fullDuplex,
215 BOOL *autoneg)
217 * @brief Retrieve the current status of a PHY
218 * Retrieve the link, speed, duplex and autonegotiation status of a PHY
220 * - Reentrant - no
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
231 * @return IX_STATUS
232 * - IX_SUCCESS
233 * - IX_FAIL : invalid arguments.
235 * <hr>
237 PUBLIC IX_STATUS ixEthMiiLinkStatus(UINT32 phyAddr,
238 BOOL *linkUp,
239 BOOL *speed100,
240 BOOL *fullDuplex,
241 BOOL *autoneg);
244 * @ingroup IxEthMii
246 * @fn ixEthMiiPhyShow (UINT32 phyAddr)
249 * @brief Display information on a specified PHY
250 * Display link status, speed, duplex and Auto Negotiation status
252 * - Reentrant - no
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)
259 * @return IX_STATUS
260 * - IX_SUCCESS
261 * - IX_FAIL : invalid arguments.
263 * <hr>
265 PUBLIC IX_STATUS ixEthMiiPhyShow (UINT32 phyAddr);
267 #endif /* ndef IxEthMii_H */