xref: /freebsd/sys/dev/mii/lxtphyreg.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
19526a692SSemen Ustimenko /*	OpenBSD: lxtphyreg.h,v 1.1 1998/11/11 19:34:47 jason Exp 	*/
29526a692SSemen Ustimenko /*	NetBSD: lxtphyreg.h,v 1.1 1998/10/24 00:33:17 thorpej Exp 	*/
39526a692SSemen Ustimenko 
49526a692SSemen Ustimenko /*-
5*b61a5730SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
6718cf2ccSPedro F. Giffuni  *
79526a692SSemen Ustimenko  * Copyright (c) 1998 The NetBSD Foundation, Inc.
89526a692SSemen Ustimenko  * All rights reserved.
99526a692SSemen Ustimenko  *
109526a692SSemen Ustimenko  * This code is derived from software contributed to The NetBSD Foundation
119526a692SSemen Ustimenko  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
129526a692SSemen Ustimenko  * NASA Ames Research Center.
139526a692SSemen Ustimenko  *
149526a692SSemen Ustimenko  * Redistribution and use in source and binary forms, with or without
159526a692SSemen Ustimenko  * modification, are permitted provided that the following conditions
169526a692SSemen Ustimenko  * are met:
179526a692SSemen Ustimenko  * 1. Redistributions of source code must retain the above copyright
189526a692SSemen Ustimenko  *    notice, this list of conditions and the following disclaimer.
199526a692SSemen Ustimenko  * 2. Redistributions in binary form must reproduce the above copyright
209526a692SSemen Ustimenko  *    notice, this list of conditions and the following disclaimer in the
219526a692SSemen Ustimenko  *    documentation and/or other materials provided with the distribution.
229526a692SSemen Ustimenko  *
239526a692SSemen Ustimenko  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
249526a692SSemen Ustimenko  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
259526a692SSemen Ustimenko  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
269526a692SSemen Ustimenko  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
279526a692SSemen Ustimenko  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
289526a692SSemen Ustimenko  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
299526a692SSemen Ustimenko  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
309526a692SSemen Ustimenko  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
319526a692SSemen Ustimenko  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
329526a692SSemen Ustimenko  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
339526a692SSemen Ustimenko  * POSSIBILITY OF SUCH DAMAGE.
349526a692SSemen Ustimenko  */
359526a692SSemen Ustimenko 
369526a692SSemen Ustimenko #ifndef _DEV_MII_LXTPHYREG_H_
379526a692SSemen Ustimenko #define	_DEV_MII_LXTPHYREG_H_
389526a692SSemen Ustimenko 
399526a692SSemen Ustimenko /*
409526a692SSemen Ustimenko  * LXT970 registers.
419526a692SSemen Ustimenko  */
429526a692SSemen Ustimenko 
439526a692SSemen Ustimenko #define	MII_LXTPHY_MIRROR	0x10	/* Mirror register */
449526a692SSemen Ustimenko 	/* All bits user-defined */
459526a692SSemen Ustimenko 
469526a692SSemen Ustimenko #define	MII_LXTPHY_IER		0x11	/* Interrupt Enable Register */
479526a692SSemen Ustimenko #define	IER_MIIDRVLVL		0x0008	/* Rediced MII driver levels */
489526a692SSemen Ustimenko #define	IER_LNK_CRITERIA	0x0004	/* Enhanced Link Loss Criteria */
499526a692SSemen Ustimenko #define	IER_INTEN		0x0002	/* Interrupt Enable */
509526a692SSemen Ustimenko #define	IER_TINT		0x0001	/* Force Interrupt */
519526a692SSemen Ustimenko 
529526a692SSemen Ustimenko #define	MII_LXTPHY_ISR		0x12	/* Interrupt Status Register */
539526a692SSemen Ustimenko #define	ISR_MINT		0x8000	/* MII Interrupt Pending */
549526a692SSemen Ustimenko #define	ISR_XTALOK		0x4000	/* Clocks OK */
559526a692SSemen Ustimenko 
569526a692SSemen Ustimenko #define	MII_LXTPHY_CONFIG	0x13	/* Configuration Register */
579526a692SSemen Ustimenko #define	CONFIG_TXMIT_TEST	0x4000	/* 100base-T Transmit Test */
589526a692SSemen Ustimenko #define	CONFIG_REPEATER		0x2000	/* Repeater Mode */
599526a692SSemen Ustimenko #define	CONFIG_MDIO_INT		0x1000	/* Enable intr signalling on MDIO */
609526a692SSemen Ustimenko #define	CONFIG_TPLOOP		0x0800	/* Disable 10base-T Loopback */
619526a692SSemen Ustimenko #define	CONFIG_SQE		0x0400	/* Enable SQE */
629526a692SSemen Ustimenko #define	CONFIG_DISJABBER	0x0200	/* Disable Jabber */
639526a692SSemen Ustimenko #define	CONFIG_DISLINKTEST	0x0100	/* Disable Link Test */
649526a692SSemen Ustimenko #define	CONFIG_LEDC1		0x0080	/* LEDC configuration */
659526a692SSemen Ustimenko #define	CONFIG_LEDC0		0x0040	/* ... */
669526a692SSemen Ustimenko 					/* 0 0 LEDC indicates collision */
679526a692SSemen Ustimenko 					/* 0 1 LEDC is off */
689526a692SSemen Ustimenko 					/* 1 0 LEDC indicates activity */
699526a692SSemen Ustimenko 					/* 1 1 LEDC is on */
709526a692SSemen Ustimenko #define	CONFIG_ADVTXCLK		0x0020	/* Advance TX clock */
719526a692SSemen Ustimenko #define	CONFIG_5BSYMBOL		0x0010	/* 5-bit Symbol mode */
729526a692SSemen Ustimenko #define	CONFIG_SCRAMBLER	0x0008	/* Bypass scrambler */
739526a692SSemen Ustimenko #define	CONFIG_100BASEFX	0x0004	/* 100base-FX */
749526a692SSemen Ustimenko #define	CONFIG_TXDISCON		0x0001	/* Disconnect TP transmitter */
759526a692SSemen Ustimenko 
769526a692SSemen Ustimenko #define	MII_LXTPHY_CSR		0x14	/* Chip Status Register */
779526a692SSemen Ustimenko #define	CSR_LINK		0x2000	/* Link is up */
789526a692SSemen Ustimenko #define	CSR_DUPLEX		0x1000	/* Full-duplex */
799526a692SSemen Ustimenko #define	CSR_SPEED		0x0800	/* 100Mbps */
809526a692SSemen Ustimenko #define	CSR_ACOMP		0x0400	/* Autonegotiation complete */
819526a692SSemen Ustimenko #define	CSR_PAGERCVD		0x0200	/* Link page received */
829526a692SSemen Ustimenko #define	CSR_LOWVCC		0x0004	/* Low Voltage Fault */
839526a692SSemen Ustimenko 
849526a692SSemen Ustimenko #endif /* _DEV_MII_LXTPHYREG_H_ */
85