xref: /freebsd/sys/dev/mii/nsgphyreg.h (revision 3aae18bde818f170bbe9591b1d7acebb1177c428)
1ce4946daSBill Paul /*
2ce4946daSBill Paul  * Copyright (c) 2001 Wind River Systems
3ce4946daSBill Paul  * Copyright (c) 2001
4ce4946daSBill Paul  *	Bill Paul <wpaul@bsdi.com>.  All rights reserved.
5ce4946daSBill Paul  *
6ce4946daSBill Paul  * Redistribution and use in source and binary forms, with or without
7ce4946daSBill Paul  * modification, are permitted provided that the following conditions
8ce4946daSBill Paul  * are met:
9ce4946daSBill Paul  * 1. Redistributions of source code must retain the above copyright
10ce4946daSBill Paul  *    notice, this list of conditions and the following disclaimer.
11ce4946daSBill Paul  * 2. Redistributions in binary form must reproduce the above copyright
12ce4946daSBill Paul  *    notice, this list of conditions and the following disclaimer in the
13ce4946daSBill Paul  *    documentation and/or other materials provided with the distribution.
14ce4946daSBill Paul  * 3. All advertising materials mentioning features or use of this software
15ce4946daSBill Paul  *    must display the following acknowledgement:
16ce4946daSBill Paul  *	This product includes software developed by Bill Paul.
17ce4946daSBill Paul  * 4. Neither the name of the author nor the names of any co-contributors
18ce4946daSBill Paul  *    may be used to endorse or promote products derived from this software
19ce4946daSBill Paul  *    without specific prior written permission.
20ce4946daSBill Paul  *
21ce4946daSBill Paul  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
22ce4946daSBill Paul  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23ce4946daSBill Paul  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24ce4946daSBill Paul  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
25ce4946daSBill Paul  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26ce4946daSBill Paul  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27ce4946daSBill Paul  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28ce4946daSBill Paul  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29ce4946daSBill Paul  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30ce4946daSBill Paul  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31ce4946daSBill Paul  * THE POSSIBILITY OF SUCH DAMAGE.
32ce4946daSBill Paul  *
33ce4946daSBill Paul  * $FreeBSD$
34ce4946daSBill Paul  */
35ce4946daSBill Paul 
36ce4946daSBill Paul #ifndef _DEV_MII_NSGPHYREG_H_
37ce4946daSBill Paul #define	_DEV_MII_NSGPHYREG_H_
38ce4946daSBill Paul 
39ce4946daSBill Paul /*
40ce4946daSBill Paul  * NatSemi DP83891 registers
41ce4946daSBill Paul  */
42ce4946daSBill Paul 
43ce4946daSBill Paul #define NSGPHY_MII_STRAPOPT	0x10	/* Strap options */
44ce4946daSBill Paul #define NSGPHY_STRAPOPT_PHYADDR	0xF800	/* PHY address */
45ce4946daSBill Paul #define NSGPHY_STRAPOPT_COMPAT	0x0400	/* Broadcom compat mode */
46ce4946daSBill Paul #define NSGPHY_STRAPOPT_MMSE	0x0200	/* Manual master/slave enable */
47ce4946daSBill Paul #define NSGPHY_STRAPOPT_ANEG	0x0100	/* Autoneg enable */
48ce4946daSBill Paul #define NSGPHY_STRAPOPT_MMSV	0x0080	/* Manual master/slave setting */
49ce4946daSBill Paul #define NSGPHY_STRAPOPT_1000HDX	0x0010	/* Advertise 1000 half-duplex */
50ce4946daSBill Paul #define NSGPHY_STRAPOPT_1000FDX	0x0008	/* Advertise 1000 full-duplex */
51ce4946daSBill Paul #define NSGPHY_STRAPOPT_100_ADV	0x0004	/* Advertise 100 full/half-duplex */
523aae18bdSPoul-Henning Kamp #define NSGPHY_STRAPOPT_SPEED1	0x0002	/* speed selection */
533aae18bdSPoul-Henning Kamp #define NSGPHY_STRAPOPT_SPEED0	0x0001	/* speed selection */
543aae18bdSPoul-Henning Kamp #define NSGPHY_STRAPOPT_SPDSEL  (NSGPHY_STRAPOPT_SPEED1|NSGPHY_STRAPOPT_SPEED0)
55ce4946daSBill Paul 
56ce4946daSBill Paul #define NSGPHY_MII_PHYSUP	0x11	/* PHY support/current status */
573aae18bdSPoul-Henning Kamp #define NSGPHY_PHYSUP_SPEED1	0x0010	/* speed status */
583aae18bdSPoul-Henning Kamp #define NSGPHY_PHYSUP_SPEED0	0x0008	/* speed status */
593aae18bdSPoul-Henning Kamp #define NSGPHY_PHYSUP_SPDSTS	(NSGPHY_PHYSUP_SPEED1|NSGPHY_PHYSUP_SPEED0)
60ce4946daSBill Paul #define NSGPHY_PHYSUP_LNKSTS	0x0004	/* link status */
61ce4946daSBill Paul #define NSGPHY_PHYSUP_DUPSTS	0x0002	/* duplex status 1 == full */
62ce4946daSBill Paul #define NSGPHY_PHYSUP_10BT	0x0001	/* 10baseT resolved */
63ce4946daSBill Paul 
64ce4946daSBill Paul #define NSGPHY_SPDSTS_1000	0x0010
65ce4946daSBill Paul #define NSGPHY_SPDSTS_100	0x0008
66ce4946daSBill Paul #define NSGPHY_SPDSTS_10	0x0000
67ce4946daSBill Paul 
68ce4946daSBill Paul #endif /* _DEV_NSGPHY_MIIREG_H_ */
69