xref: /freebsd/sys/dev/mii/xmphyreg.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1098ca2bdSWarner Losh /*-
2*df57947fSPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3*df57947fSPedro F. Giffuni  *
4c0d7d4d4SBill Paul  * Copyright (c) 2000
5c0d7d4d4SBill Paul  *	Bill Paul <wpaul@ee.columbia.edu>.  All rights reserved.
6c0d7d4d4SBill Paul  *
7c0d7d4d4SBill Paul  * Redistribution and use in source and binary forms, with or without
8c0d7d4d4SBill Paul  * modification, are permitted provided that the following conditions
9c0d7d4d4SBill Paul  * are met:
10c0d7d4d4SBill Paul  * 1. Redistributions of source code must retain the above copyright
11c0d7d4d4SBill Paul  *    notice, this list of conditions and the following disclaimer.
12c0d7d4d4SBill Paul  * 2. Redistributions in binary form must reproduce the above copyright
13c0d7d4d4SBill Paul  *    notice, this list of conditions and the following disclaimer in the
14c0d7d4d4SBill Paul  *    documentation and/or other materials provided with the distribution.
15c0d7d4d4SBill Paul  * 3. All advertising materials mentioning features or use of this software
16c0d7d4d4SBill Paul  *    must display the following acknowledgement:
17c0d7d4d4SBill Paul  *	This product includes software developed by Bill Paul.
18c0d7d4d4SBill Paul  * 4. Neither the name of the author nor the names of any co-contributors
19c0d7d4d4SBill Paul  *    may be used to endorse or promote products derived from this software
20c0d7d4d4SBill Paul  *    without specific prior written permission.
21c0d7d4d4SBill Paul  *
22c0d7d4d4SBill Paul  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
23c0d7d4d4SBill Paul  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24c0d7d4d4SBill Paul  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25c0d7d4d4SBill Paul  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
26c0d7d4d4SBill Paul  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27c0d7d4d4SBill Paul  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28c0d7d4d4SBill Paul  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29c0d7d4d4SBill Paul  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30c0d7d4d4SBill Paul  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31c0d7d4d4SBill Paul  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32c0d7d4d4SBill Paul  * THE POSSIBILITY OF SUCH DAMAGE.
33c0d7d4d4SBill Paul  */
34c0d7d4d4SBill Paul 
35c0d7d4d4SBill Paul #ifndef _DEV_MII_XMPHYREG_H_
36c0d7d4d4SBill Paul #define	_DEV_MII_XMPHYREG_H_
37c0d7d4d4SBill Paul 
38c0d7d4d4SBill Paul /*
39c0d7d4d4SBill Paul  * XaQti XMAC II PHY registers
40c0d7d4d4SBill Paul  */
41c0d7d4d4SBill Paul 
42c0d7d4d4SBill Paul #define XMPHY_MII_BMCR		0x00
43c0d7d4d4SBill Paul #define XMPHY_BMCR_RESET	0x8000
44c0d7d4d4SBill Paul #define XMPHY_BMCR_LOOP		0x4000
45c0d7d4d4SBill Paul #define XMPHY_BMCR_AUTOEN	0x1000	/* Autoneg enabled */
46c0d7d4d4SBill Paul #define XMPHY_BMCR_PDOWN	0x0800	/* Power down */
47134c58d3SBill Paul #define XMPHY_BMCR_ISO		0x0400	/* Isolate */
48c0d7d4d4SBill Paul #define XMPHY_BMCR_STARTNEG	0x0200	/* Restart autoneg */
49c0d7d4d4SBill Paul #define XMPHY_BMCR_FDX		0x0100	/* Duplex mode */
50c0d7d4d4SBill Paul 
51c0d7d4d4SBill Paul #define XMPHY_MII_BMSR		0x01
52c0d7d4d4SBill Paul #define XMPHY_BMSR_EXTSTS	0x0100	/* Extended status present */
53c0d7d4d4SBill Paul #define XMPHY_BMSR_ACOMP	0x0020	/* Autoneg complete */
546882cb0cSMarius Strobl #define XMPHY_BMSR_RFAULT	0x0010	/* Remote fault condition occurred */
55c0d7d4d4SBill Paul #define XMPHY_BMSR_ANEG		0x0008	/* Autoneg capable */
56c0d7d4d4SBill Paul #define XMPHY_BMSR_LINK		0x0004	/* Link status */
57c0d7d4d4SBill Paul #define XMPHY_BMSR_EXT		0x0001	/* Extended capability */
58c0d7d4d4SBill Paul 
59c0d7d4d4SBill Paul #define XMPHY_MII_ANAR		0x04
60c0d7d4d4SBill Paul #define XMPHY_ANAR_NP		0x8000	/* Next page */
61c0d7d4d4SBill Paul #define XMPHY_ANAR_ACK		0x4000	/* Next page or base received */
62c0d7d4d4SBill Paul #define XMPHY_ANAR_RFBITS	0x3000	/* Remote fault bits */
63c0d7d4d4SBill Paul #define XMPHY_ANAR_PAUSEBITS	0x0180	/* Pause bits */
644fc53c22SArchie Cobbs #define XMPHY_ANAR_HDX		0x0040	/* Select half duplex */
654fc53c22SArchie Cobbs #define XMPHY_ANAR_FDX		0x0020	/* Select full duplex */
66c0d7d4d4SBill Paul 
67c0d7d4d4SBill Paul #define XMPHY_MII_ANLPAR	0x05
68c0d7d4d4SBill Paul #define XMPHY_ANLPAR_NP		0x8000	/* Next page */
69c0d7d4d4SBill Paul #define XMPHY_ANLPAR_ACK	0x4000	/* Next page or base received */
70c0d7d4d4SBill Paul #define XMPHY_ANLPAR_RFBITS	0x3000	/* Remote fault bits */
71c0d7d4d4SBill Paul #define XMPHY_ANLPAR_PAUSEBITS	0x0180	/* Pause bits */
724fc53c22SArchie Cobbs #define XMPHY_ANLPAR_HDX	0x0040	/* Select half duplex */
734fc53c22SArchie Cobbs #define XMPHY_ANLPAR_FDX	0x0020	/* Select full duplex */
74c0d7d4d4SBill Paul 
75c0d7d4d4SBill Paul #define XMPHY_RF_OK		0x0000	/* No error -- link is good */
76c0d7d4d4SBill Paul #define XMPHY_RF_LINKFAIL	0x1000	/* Link failure */
77c0d7d4d4SBill Paul #define XMPHY_RF_OFFLINE	0x2000	/* Offline */
78c0d7d4d4SBill Paul #define XMPHY_RF_ANEGFAIL	0x3000	/* Autonegotiation error */
79c0d7d4d4SBill Paul 
80c0d7d4d4SBill Paul #define XMPHY_PAUSE_NOPAUSE	0x0000	/* No pause possible */
81c0d7d4d4SBill Paul #define XMPHY_PAUSE_ASYMETRIC	0x0080	/* Asymetric pause toward LP */
82c0d7d4d4SBill Paul #define XMPHY_PAUSE_SYMETRIC	0x0100	/* Symetric pause */
83c0d7d4d4SBill Paul #define XMPHY_PAUSE_BOTH	0x0180	/* Both sym and asym pause */
84c0d7d4d4SBill Paul 
85c0d7d4d4SBill Paul #define XMPHY_MII_ANER		0x06
86c0d7d4d4SBill Paul #define XMPHY_ANER_LPNP		0x0008	/* Link partner can next page */
87c0d7d4d4SBill Paul #define XMPHY_ANER_NP		0x0004	/* Local PHY can next page */
88c0d7d4d4SBill Paul #define XMPHY_ANER_RX		0x0002	/* Next page received */
89c0d7d4d4SBill Paul 
90c0d7d4d4SBill Paul #define XMPHY_MII_NEXTP		0x07	/* Next page */
91c0d7d4d4SBill Paul #define XMPHY_NEXTP_MORE	0x8000	/* More next pages to follow */
92c0d7d4d4SBill Paul #define XMPHY_NEXTP_ACK1	0x4000	/* Ack bit received OK */
93c0d7d4d4SBill Paul #define XMPHY_NEXTP_MP		0x2000	/* Page is message page */
94c0d7d4d4SBill Paul #define XMPHY_NEXTP_ACK2	0x1000	/* can comply with message (r/o) */
95c0d7d4d4SBill Paul #define XMPHY_NEXTP_TOGGLE	0x0800	/* sync with LP */
96c0d7d4d4SBill Paul #define XMPHY_NEXTP_MESSAGE	0x07FF	/* message */
97c0d7d4d4SBill Paul 
98c0d7d4d4SBill Paul #define XMPHY_MII_NEXTPLP	0x08	/* Next page of link partner */
99c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_MORE	0x8000	/* More next pages to follow */
100c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_ACK1	0x4000	/* Ack bit received OK */
101c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_MP	0x2000	/* Page is message page */
102c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_ACK2	0x1000	/* can comply with message (r/o) */
103c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_TOGGLE	0x0800	/* sync with LP */
104c0d7d4d4SBill Paul #define XMPHY_NEXTPLP_MESSAGE	0x07FF	/* message */
105c0d7d4d4SBill Paul 
106c0d7d4d4SBill Paul #define XMPHY_MII_EXTSTS	0x0F	/* Extended status */
107c0d7d4d4SBill Paul #define XMPHY_EXTSTS_FDX	0x8000	/* 1000base-X FD capable */
108c0d7d4d4SBill Paul #define XMPHY_EXTSTS_HDX	0x4000	/* 1000base-X HD capable */
109c0d7d4d4SBill Paul 
110c0d7d4d4SBill Paul #define XMPHY_MII_RESAB		0x10	/* Resolved ability */
111c0d7d4d4SBill Paul #define XMPHY_RESAB_PAUSEBITS	0x0180	/* Pause bits */
112c0d7d4d4SBill Paul #define XMPHY_RESAB_HDX		0x0040	/* Half duplex selected */
113c0d7d4d4SBill Paul #define XMPHY_RESAB_FDX		0x0020	/* Full duplex selected */
114c0d7d4d4SBill Paul #define XMPHY_RESAB_ABLMIS	0x0010	/* Ability mismatch */
115c0d7d4d4SBill Paul #define XMPHY_RESAB_PAUSEMIS	0x0008	/* Pause mismatch */
116c0d7d4d4SBill Paul 
117c0d7d4d4SBill Paul #endif /* _DEV_MII_XMPHYREG_H_ */
118