blob: 568d4a0fa4ff5ed366cbbfd42a94b7f5adc31077 [file] [log] [blame]
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02001/**
2 * @file IxEthAccMii_p.h
3 *
4 * @author Intel Corporation
5 * @date
6 *
7 * @brief MII Header file
8 *
9 * Design Notes:
10 *
11 *
12 * @par
13 * IXP400 SW Release version 2.0
14 *
15 * -- Copyright Notice --
16 *
17 * @par
18 * Copyright 2001-2005, Intel Corporation.
19 * All rights reserved.
20 *
21 * @par
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
24 * are met:
25 * 1. Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 * 3. Neither the name of the Intel Corporation nor the names of its contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
33 *
34 * @par
35 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
36 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
39 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
40 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
41 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
44 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 * SUCH DAMAGE.
46 *
47 * @par
48 * -- End of Copyright Notice --
49 */
50
51#ifndef IxEthAccMii_p_H
52#define IxEthAccMii_p_H
53
54/* MII definitions - these have been verified against the LXT971 and LXT972 PHYs*/
55
56#define IXP425_ETH_ACC_MII_MAX_REG 32 /* max register per phy */
57
58#define IX_ETH_ACC_MII_REG_SHL 16
59#define IX_ETH_ACC_MII_ADDR_SHL 21
60
61/* Definitions for MII access routines*/
62
63#define IX_ETH_ACC_MII_GO BIT(31)
64#define IX_ETH_ACC_MII_WRITE BIT(26)
65#define IX_ETH_ACC_MII_TIMEOUT_10TH_SECS 5
66#define IX_ETH_ACC_MII_10TH_SEC_IN_MILLIS 100
67#define IX_ETH_ACC_MII_READ_FAIL BIT(31)
68
69#define IX_ETH_ACC_MII_PHY_DEF_DELAY 300 /* max delay before link up, etc. */
70#define IX_ETH_ACC_MII_PHY_NO_DELAY 0x0 /* do not delay */
71#define IX_ETH_ACC_MII_PHY_NULL 0xff /* PHY is not present */
72#define IX_ETH_ACC_MII_PHY_DEF_ADDR 0x0 /* default PHY's logical address */
73
74#ifndef IX_ETH_ACC_MII_MONITOR_DELAY
75# define IX_ETH_ACC_MII_MONITOR_DELAY 0x5 /* in seconds */
76#endif
77
78/* Register definition */
79
80#define IX_ETH_ACC_MII_CTRL_REG 0x0 /* Control Register */
81#define IX_ETH_ACC_MII_STAT_REG 0x1 /* Status Register */
82#define IX_ETH_ACC_MII_PHY_ID1_REG 0x2 /* PHY identifier 1 Register */
83#define IX_ETH_ACC_MII_PHY_ID2_REG 0x3 /* PHY identifier 2 Register */
Wolfgang Denka1be4762008-05-20 16:00:29 +020084#define IX_ETH_ACC_MII_AN_ADS_REG 0x4 /* Auto-Negotiation */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020085 /* Advertisement Register */
Wolfgang Denka1be4762008-05-20 16:00:29 +020086#define IX_ETH_ACC_MII_AN_PRTN_REG 0x5 /* Auto-Negotiation */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020087 /* partner ability Register */
88#define IX_ETH_ACC_MII_AN_EXP_REG 0x6 /* Auto-Negotiation */
89 /* Expansion Register */
Wolfgang Denka1be4762008-05-20 16:00:29 +020090#define IX_ETH_ACC_MII_AN_NEXT_REG 0x7 /* Auto-Negotiation */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020091 /* next-page transmit Register */
92
93IxEthAccStatus ixEthAccMdioShow (void);
94IxEthAccStatus ixEthAccMiiInit(void);
95void ixEthAccMiiUnload(void);
96
97#endif /*IxEthAccMii_p_H*/