rgephyreg.h revision 1.5 1 1.5 cegger /* $NetBSD: rgephyreg.h,v 1.5 2009/01/09 21:56:35 cegger Exp $ */
2 1.4 tsutsui
3 1.1 jonathan /*
4 1.1 jonathan * Copyright (c) 2003
5 1.1 jonathan * Bill Paul <wpaul (at) windriver.com>. All rights reserved.
6 1.1 jonathan *
7 1.1 jonathan * Redistribution and use in source and binary forms, with or without
8 1.1 jonathan * modification, are permitted provided that the following conditions
9 1.1 jonathan * are met:
10 1.1 jonathan * 1. Redistributions of source code must retain the above copyright
11 1.1 jonathan * notice, this list of conditions and the following disclaimer.
12 1.1 jonathan * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 jonathan * notice, this list of conditions and the following disclaimer in the
14 1.1 jonathan * documentation and/or other materials provided with the distribution.
15 1.1 jonathan * 3. All advertising materials mentioning features or use of this software
16 1.1 jonathan * must display the following acknowledgement:
17 1.1 jonathan * This product includes software developed by Bill Paul.
18 1.1 jonathan * 4. Neither the name of the author nor the names of any co-contributors
19 1.1 jonathan * may be used to endorse or promote products derived from this software
20 1.1 jonathan * without specific prior written permission.
21 1.1 jonathan *
22 1.1 jonathan * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
23 1.1 jonathan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 jonathan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 jonathan * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
26 1.1 jonathan * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 1.1 jonathan * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.1 jonathan * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.1 jonathan * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.1 jonathan * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.1 jonathan * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 1.1 jonathan * THE POSSIBILITY OF SUCH DAMAGE.
33 1.1 jonathan *
34 1.1 jonathan * $FreeBSD: /repoman/r/ncvs/src/sys/dev/mii/rgephyreg.h,v 1.1 2003/09/11 03:53:46 wpaul Exp $
35 1.1 jonathan */
36 1.1 jonathan
37 1.1 jonathan #ifndef _DEV_MII_RGEPHYREG_H_
38 1.1 jonathan #define _DEV_MII_RGEPHYREG_H_
39 1.1 jonathan
40 1.1 jonathan /*
41 1.1 jonathan * RealTek 8169S/8110S gigE PHY registers
42 1.1 jonathan */
43 1.1 jonathan
44 1.1 jonathan #define RGEPHY_MII_BMCR 0x00
45 1.1 jonathan #define RGEPHY_BMCR_RESET 0x8000
46 1.1 jonathan #define RGEPHY_BMCR_LOOP 0x4000
47 1.1 jonathan #define RGEPHY_BMCR_SPD0 0x2000 /* speed select, lower bit */
48 1.1 jonathan #define RGEPHY_BMCR_AUTOEN 0x1000 /* Autoneg enabled */
49 1.1 jonathan #define RGEPHY_BMCR_PDOWN 0x0800 /* Power down */
50 1.1 jonathan #define RGEPHY_BMCR_ISO 0x0400 /* Isolate */
51 1.1 jonathan #define RGEPHY_BMCR_STARTNEG 0x0200 /* Restart autoneg */
52 1.1 jonathan #define RGEPHY_BMCR_FDX 0x0100 /* Duplex mode */
53 1.1 jonathan #define RGEPHY_BMCR_CTEST 0x0080 /* Collision test enable */
54 1.1 jonathan #define RGEPHY_BMCR_SPD1 0x0040 /* Speed select, upper bit */
55 1.1 jonathan
56 1.1 jonathan #define RGEPHY_S1000 RGEPHY_BMCR_SPD1 /* 1000mbps */
57 1.1 jonathan #define RGEPHY_S100 RGEPHY_BMCR_SPD0 /* 100mpbs */
58 1.1 jonathan #define RGEPHY_S10 0 /* 10mbps */
59 1.1 jonathan
60 1.1 jonathan #define RGEPHY_MII_BMSR 0x01
61 1.1 jonathan #define RGEPHY_BMSR_100T4 0x8000 /* 100 base T4 capable */
62 1.1 jonathan #define RGEPHY_BMSR_100TXFDX 0x4000 /* 100 base Tx full duplex capable */
63 1.1 jonathan #define RGEPHY_BMSR_100TXHDX 0x2000 /* 100 base Tx half duplex capable */
64 1.1 jonathan #define RGEPHY_BMSR_10TFDX 0x1000 /* 10 base T full duplex capable */
65 1.1 jonathan #define RGEPHY_BMSR_10THDX 0x0800 /* 10 base T half duplex capable */
66 1.1 jonathan #define RGEPHY_BMSR_100T2FDX 0x0400 /* 100 base T2 full duplex capable */
67 1.1 jonathan #define RGEPHY_BMSR_100T2HDX 0x0200 /* 100 base T2 half duplex capable */
68 1.1 jonathan #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */
69 1.1 jonathan #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */
70 1.1 jonathan #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */
71 1.1 jonathan #define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */
72 1.1 jonathan #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */
73 1.1 jonathan #define RGEPHY_BMSR_LINK 0x0004 /* Link status */
74 1.1 jonathan #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */
75 1.1 jonathan #define RGEPHY_BMSR_EXT 0x0001 /* Extended capability */
76 1.1 jonathan
77 1.1 jonathan #define RGEPHY_MII_ANAR 0x04
78 1.1 jonathan #define RGEPHY_ANAR_NP 0x8000 /* Next page */
79 1.1 jonathan #define RGEPHY_ANAR_RF 0x2000 /* Remote fault */
80 1.1 jonathan #define RGEPHY_ANAR_ASP 0x0800 /* Asymmetric Pause */
81 1.1 jonathan #define RGEPHY_ANAR_PC 0x0400 /* Pause capable */
82 1.1 jonathan #define RGEPHY_ANAR_T4 0x0200 /* local device supports 100bT4 */
83 1.1 jonathan #define RGEPHY_ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */
84 1.1 jonathan #define RGEPHY_ANAR_TX 0x0080 /* local device supports 100bTx */
85 1.1 jonathan #define RGEPHY_ANAR_10_FD 0x0040 /* local device supports 10bT FD */
86 1.1 jonathan #define RGEPHY_ANAR_10 0x0020 /* local device supports 10bT */
87 1.1 jonathan #define RGEPHY_ANAR_SEL 0x001F /* selector field, 00001=Ethernet */
88 1.1 jonathan
89 1.1 jonathan #define RGEPHY_MII_ANLPAR 0x05
90 1.1 jonathan #define RGEPHY_ANLPAR_NP 0x8000 /* Next page */
91 1.1 jonathan #define RGEPHY_ANLPAR_RF 0x2000 /* Remote fault */
92 1.1 jonathan #define RGEPHY_ANLPAR_ASP 0x0800 /* Asymmetric Pause */
93 1.1 jonathan #define RGEPHY_ANLPAR_PC 0x0400 /* Pause capable */
94 1.1 jonathan #define RGEPHY_ANLPAR_T4 0x0200 /* link partner supports 100bT4 */
95 1.1 jonathan #define RGEPHY_ANLPAR_TX_FD 0x0100 /* link partner supports 100bTx FD */
96 1.1 jonathan #define RGEPHY_ANLPAR_TX 0x0080 /* link partner supports 100bTx */
97 1.1 jonathan #define RGEPHY_ANLPAR_10_FD 0x0040 /* link partner supports 10bT FD */
98 1.1 jonathan #define RGEPHY_ANLPAR_10 0x0020 /* link partner supports 10bT */
99 1.1 jonathan #define RGEPHY_ANLPAR_SEL 0x001F /* selector field, 00001=Ethernet */
100 1.1 jonathan
101 1.1 jonathan #define RGEPHY_SEL_TYPE 0x0001 /* ethernet */
102 1.1 jonathan
103 1.1 jonathan #define RGEPHY_MII_ANER 0x06
104 1.1 jonathan #define RGEPHY_ANER_PDF 0x0010 /* Parallel detection fault */
105 1.1 jonathan #define RGEPHY_ANER_LPNP 0x0008 /* Link partner can next page */
106 1.1 jonathan #define RGEPHY_ANER_NP 0x0004 /* Local PHY can next page */
107 1.1 jonathan #define RGEPHY_ANER_RX 0x0002 /* Next page received */
108 1.1 jonathan #define RGEPHY_ANER_LPAN 0x0001 /* Link partner autoneg capable */
109 1.1 jonathan
110 1.1 jonathan #define RGEPHY_MII_NEXTP 0x07 /* Next page */
111 1.1 jonathan
112 1.1 jonathan #define RGEPHY_MII_NEXTP_LP 0x08 /* Next page of link partner */
113 1.1 jonathan
114 1.1 jonathan #define RGEPHY_MII_1000CTL 0x09 /* 1000baseT control */
115 1.1 jonathan #define RGEPHY_1000CTL_TST 0xE000 /* test modes */
116 1.1 jonathan #define RGEPHY_1000CTL_MSE 0x1000 /* Master/Slave manual enable */
117 1.1 jonathan #define RGEPHY_1000CTL_MSC 0x0800 /* Master/Slave select */
118 1.1 jonathan #define RGEPHY_1000CTL_RD 0x0400 /* Repeater/DTE */
119 1.1 jonathan #define RGEPHY_1000CTL_AFD 0x0200 /* Advertise full duplex */
120 1.1 jonathan #define RGEPHY_1000CTL_AHD 0x0100 /* Advertise half duplex */
121 1.1 jonathan
122 1.1 jonathan #define RGEPHY_TEST_TX_JITTER 0x2000
123 1.1 jonathan #define RGEPHY_TEST_TX_JITTER_MASTER_MODE 0x4000
124 1.1 jonathan #define RGEPHY_TEST_TX_JITTER_SLAVE_MODE 0x6000
125 1.1 jonathan #define RGEPHY_TEST_TX_DISTORTION 0x8000
126 1.1 jonathan
127 1.1 jonathan #define RGEPHY_MII_1000STS 0x0A /* 1000baseT status */
128 1.1 jonathan #define RGEPHY_1000STS_MSF 0x8000 /* Master/slave fault */
129 1.1 jonathan #define RGEPHY_1000STS_MSR 0x4000 /* Master/slave result */
130 1.1 jonathan #define RGEPHY_1000STS_LRS 0x2000 /* Local receiver status */
131 1.1 jonathan #define RGEPHY_1000STS_RRS 0x1000 /* Remote receiver status */
132 1.1 jonathan #define RGEPHY_1000STS_LPFD 0x0800 /* Link partner can FD */
133 1.1 jonathan #define RGEPHY_1000STS_LPHD 0x0400 /* Link partner can HD */
134 1.1 jonathan #define RGEPHY_1000STS_IEC 0x00FF /* Idle error count */
135 1.1 jonathan
136 1.1 jonathan #define RGEPHY_MII_EXTSTS 0x0F /* Extended status */
137 1.1 jonathan #define RGEPHY_EXTSTS_X_FD_CAP 0x8000 /* 1000base-X FD capable */
138 1.1 jonathan #define RGEPHY_EXTSTS_X_HD_CAP 0x4000 /* 1000base-X HD capable */
139 1.1 jonathan #define RGEPHY_EXTSTS_T_FD_CAP 0x2000 /* 1000base-T FD capable */
140 1.1 jonathan #define RGEPHY_EXTSTS_T_HD_CAP 0x1000 /* 1000base-T HD capable */
141 1.1 jonathan
142 1.5 cegger /* RTL8211B(L)/RTL8211C(L) */
143 1.3 tsutsui #define RGEPHY_MII_SSR 0x11 /* PHY Specific status register */
144 1.3 tsutsui #define RGEPHY_SSR_S1000 0x8000 /* 1000Mbps */
145 1.3 tsutsui #define RGEPHY_SSR_S100 0x4000 /* 100Mbps */
146 1.3 tsutsui #define RGEPHY_SSR_S10 0x0000 /* 10Mbps */
147 1.3 tsutsui #define RGEPHY_SSR_SPD_MASK 0xc000
148 1.3 tsutsui #define RGEPHY_SSR_FDX 0x2000 /* full duplex */
149 1.3 tsutsui #define RGEPHY_SSR_PAGE_RECEIVED 0x1000 /* new page received */
150 1.3 tsutsui #define RGEPHY_SSR_SPD_DPLX_RESOLVED 0x0800 /* speed/duplex resolved */
151 1.3 tsutsui #define RGEPHY_SSR_LINK 0x0400 /* link up */
152 1.3 tsutsui #define RGEPHY_SSR_MDI_XOVER 0x0040 /* MDI crossover */
153 1.5 cegger #define RGEPHY_SSR_ALDPS 0x0008 /* RTL8211C(L) only */
154 1.3 tsutsui #define RGEPHY_SSR_JABBER 0x0001 /* Jabber */
155 1.1 jonathan
156 1.2 tsutsui #endif /* _DEV_MII_RGEPHYREG_H_ */
157