xref: /openbsd/sys/dev/mii/sqphyreg.h (revision 5fc4cb21)
1 /*	$OpenBSD: sqphyreg.h,v 1.5 2008/08/31 09:54:32 jsg Exp $	*/
2 /*	$NetBSD: sqphyreg.h,v 1.1 1998/11/03 23:51:29 thorpej Exp $	*/
3 
4 /*-
5  * Copyright (c) 1998 The NetBSD Foundation, Inc.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to The NetBSD Foundation
9  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
10  * NASA Ames Research Center.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _DEV_MII_SQPHYREG_H_
35 #define	_DEV_MII_SQPHYREG_H_
36 
37 /*
38  * Seeq 80220 Register definitions.
39  */
40 
41 #define	MII_SQPHY_CONFIG1	0x10	/* Configuration 1 Register */
42 #define	CONFIG1_LNK_DIS		0x8000	/* Link Detect Disable */
43 #define	CONFIG1_XMT_DIS		0x4000	/* TP Transmitter Disable */
44 #define	CONFIG1_XMT_PDN		0x2000	/* TP Transmitter Powerdown */
45 #define	CONFIG1_TXEN_CRS	0x1000	/* TX_EN to CRS Loopback Disable */
46 #define	CONFIG1_BYP_ENC		0x0800	/* Bypass Encoder */
47 #define	CONFIG1_BYP_SCR		0x0400	/* Bypass Scrambler */
48 #define	CONFIG1_UNSCR_DIS	0x0200	/* Unscr. Idle Reception Disable */
49 #define	CONFIG1_EQLZR		0x0100	/* Rx Equalizer Disable */
50 #define	CONFIG1_CABLE		0x0080	/* Cable: 1 = STP, 0 = UTP */
51 #define	CONFIG1_RLVL0		0x0040	/* Receive Level Adjust */
52 #define	CONFIG1_TLVL3		0x0020	/* Transmit output level adjust */
53 #define	CONFIG1_TLVL2		0x0010
54 #define	CONFIG1_TLVL1		0x0008
55 #define	CONFIG1_TLVL0		0x0004
56 #define	CONFIG1_TRF1		0x0002	/* Transmitter Rise/Fall Adjust */
57 #define	CONFIG1_TRF0		0x0001
58 
59 #define	MII_SQPHY_CONFIG2	0x11	/* Configuration 2 Register */
60 #define	CONFIG2_PLED3_1		0x8000	/* PLED3 configuration */
61 #define	CONFIG2_PLED3_0		0x4000
62 					/* 1 1 LINK100 (default) */
63 					/* 1 0 Blink */
64 					/* 0 1 On */
65 					/* 0 0 Off */
66 #define	CONFIG2_PLED2_1		0x2000	/* PLED2 configuration */
67 #define	CONFIG2_PLED2_0		0x1000
68 					/* 1 1 Activity (default) */
69 					/* 1 0 Blink */
70 					/* 0 1 On */
71 					/* 0 0 Off */
72 #define	CONFIG2_PLED1_1		0x0800	/* PLED1 configuration */
73 #define	CONFIG2_PLED1_0		0x0400
74 					/* 1 1 Full duplex (default) */
75 					/* 1 0 Blink */
76 					/* 0 1 On */
77 					/* 0 0 Off */
78 #define	CONFIG2_PLED0_1		0x0200	/* PLED0 configuration */
79 #define	CONFIG2_PLED0_0		0x0100
80 					/* 1 1 LINK10 (default) */
81 					/* 1 0 Blink */
82 					/* 0 1 On */
83 					/* 0 0 Off */
84 #define	CONFIG2_LED_DEF1	0x0080	/* LED Normal Function Select */
85 #define	CONFIG2_LED_DEF0	0x0040
86 #define	CONFIG2_APOL_DIS	0x0020	/* Auto Polarity Correct Disable */
87 #define	CONFIG2_JAB_DIS		0x0010	/* Jabber Disable */
88 #define	CONFIG2_MREG		0x0008	/* Multiple Register Access Enable */
89 #define	CONFIG2_INT_MDIO	0x0004	/* MDIO Interrupt when idle */
90 #define	CONFIG2_RJ_CFG		0x0002	/* R/J Configuration Select */
91 
92 #define	MII_SQPHY_STATUS	0x12	/* Status Output Register */
93 #define	STATUS_INT		0x8000	/* Interrupt Detect */
94 #define	STATUS_LNK_FAIL		0x4000	/* Link Fail */
95 #define	STATUS_LOSS_SYNC	0x2000	/* Descrambler lost synchronization */
96 #define	STATUS_CWRD		0x1000	/* Codeword Error */
97 #define	STATUS_SSD		0x0800	/* Start of Stream Error */
98 #define	STATUS_ESD		0x0400	/* End of Stream Error */
99 #define	STATUS_RPOL		0x0200	/* Reverse Polarity Detected */
100 #define	STATUS_JAB		0x0100	/* Jabber Detected */
101 #define	STATUS_SPD_DET		0x0080	/* 100Mbps */
102 #define	STATUS_DPLX_DET		0x0040	/* Full Duplex */
103 
104 #define	MII_SQPHY_MASK		0x13	/* Mask Register */
105 #define	MASK_INT		0x8000	/* mask INT */
106 #define	MASK_LNK_FAIL		0x4000	/* mask LNK_FAIL */
107 #define	MASK_LOSS_SYNC		0x2000	/* mask LOSS_SYNC */
108 #define	MASK_CWRD		0x1000	/* mask CWRD */
109 #define	MASK_SSD		0x0800	/* mask SSD */
110 #define	MASK_ESD		0x0400	/* mask ESD */
111 #define	MASK_RPOL		0x0200	/* mask RPOL */
112 #define	MASK_JAB		0x0100	/* mask JAB */
113 #define	MASK_SPD_DET		0x0080	/* mask SPD_DET */
114 #define	MASK_DPLX_DET		0x0040	/* mask DPLX_DET */
115 #define	MASK_ANEG_STS1		0x0020	/* mask ANEG_STS1 */
116 #define	MASK_ANEG_STS0		0x0010	/* mask ANEG_STS0 */
117 
118 #define	MII_SQPHY_RESERVED	0x14	/* Reserved Register */
119 	/* All bits must be 0 */
120 
121 #endif /* _DEV_MII_SQPHYREG_H_ */
122