xref: /freebsd/sys/dev/mii/tdkphyreg.h (revision 47dd1d1b619cc035b82b49a91a25544309ff95ae)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2000,2001 Jonathan Chen.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions, and the following disclaimer,
12  *    without modification, immediately at the beginning of the file.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
22  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32 
33 /*
34  * Register definitions for TDK 78Q2120
35  */
36 
37 #ifndef	_DEV_MII_TDKPHYREG_H_
38 #define	_DEV_MII_TDKPHYREG_H_
39 
40 #define	MII_VENDOR	16
41 #define	VENDOR_RXCC	0x0001
42 #define	VENDOR_PCSBP	0x0002
43 #define	VENDOR_RVSPOL	0x0010
44 #define	VENDOR_NOAPOL	0x0020
45 #define	VENDOR_GPIO0DIR	0x0040
46 #define	VENDOR_GPIO0DAT	0x0080
47 #define	VENDOR_GPIO1DIR	0x0100
48 #define	VENDOR_GPIO1DAT	0x0200
49 #define	VENDOR_10BTLOOP	0x0400
50 #define	VENDOR_NOSQE	0x0800
51 #define	VENDOR_TXHIM	0x1000
52 #define	VENDOR_INTLVL	0x4000
53 #define	VENDOR_RPTR	0x8000
54 
55 #define	MII_INT		17
56 #define	INT_STAT_MASK	0x00ff
57 #define	INT_STAT_ACOMP	0x0001
58 #define	INT_STAT_RFAULT	0x0002
59 #define	INT_STAT_LSCHG	0x0004
60 #define	INT_STAT_LPACK	0x0008
61 #define	INT_STAT_PDF	0x0010
62 #define	INT_STAT_PRX	0x0020
63 #define	INT_STAT_RXERR	0x0040
64 #define	INT_STAT_JABBER	0x0080
65 #define	INT_CTRL_MASK	0xff00
66 #define	INT_CTRL_ACOMP	0x0100
67 #define	INT_CTRL_RFAULT	0x0200
68 #define	INT_CTRL_LSCHG	0x0400
69 #define	INT_CTRL_LPACK	0x0800
70 #define	INT_CTRL_PDF	0x1000
71 #define	INT_CTRL_PRX	0x2000
72 #define	INT_CTRL_RXERR	0x4000
73 #define	INT_CTRL_JABBER	0x8000
74 
75 
76 #define	MII_DIAG	18
77 #define	DIAG_RLOCK	0x0100
78 #define	DIAG_RPASS	0x0200
79 #define	DIAG_RATE_100	0x0400
80 #define	DIAG_DUPLEX	0x0800
81 #define	DIAG_NEGFAIL	0x1000
82 
83 
84 #endif
85