xref: /freebsd/sys/dev/mii/tdkphyreg.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
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 
31 /*
32  * Register definitions for TDK 78Q2120
33  */
34 
35 #ifndef	_DEV_MII_TDKPHYREG_H_
36 #define	_DEV_MII_TDKPHYREG_H_
37 
38 #define	MII_VENDOR	16
39 #define	VENDOR_RXCC	0x0001
40 #define	VENDOR_PCSBP	0x0002
41 #define	VENDOR_RVSPOL	0x0010
42 #define	VENDOR_NOAPOL	0x0020
43 #define	VENDOR_GPIO0DIR	0x0040
44 #define	VENDOR_GPIO0DAT	0x0080
45 #define	VENDOR_GPIO1DIR	0x0100
46 #define	VENDOR_GPIO1DAT	0x0200
47 #define	VENDOR_10BTLOOP	0x0400
48 #define	VENDOR_NOSQE	0x0800
49 #define	VENDOR_TXHIM	0x1000
50 #define	VENDOR_INTLVL	0x4000
51 #define	VENDOR_RPTR	0x8000
52 
53 #define	MII_INT		17
54 #define	INT_STAT_MASK	0x00ff
55 #define	INT_STAT_ACOMP	0x0001
56 #define	INT_STAT_RFAULT	0x0002
57 #define	INT_STAT_LSCHG	0x0004
58 #define	INT_STAT_LPACK	0x0008
59 #define	INT_STAT_PDF	0x0010
60 #define	INT_STAT_PRX	0x0020
61 #define	INT_STAT_RXERR	0x0040
62 #define	INT_STAT_JABBER	0x0080
63 #define	INT_CTRL_MASK	0xff00
64 #define	INT_CTRL_ACOMP	0x0100
65 #define	INT_CTRL_RFAULT	0x0200
66 #define	INT_CTRL_LSCHG	0x0400
67 #define	INT_CTRL_LPACK	0x0800
68 #define	INT_CTRL_PDF	0x1000
69 #define	INT_CTRL_PRX	0x2000
70 #define	INT_CTRL_RXERR	0x4000
71 #define	INT_CTRL_JABBER	0x8000
72 
73 #define	MII_DIAG	18
74 #define	DIAG_RLOCK	0x0100
75 #define	DIAG_RPASS	0x0200
76 #define	DIAG_RATE_100	0x0400
77 #define	DIAG_DUPLEX	0x0800
78 #define	DIAG_NEGFAIL	0x1000
79 
80 #endif
81