glxtphyreg.h revision 1.1 1 1.1 thorpej /* $NetBSD: glxtphyreg.h,v 1.1 2001/07/12 21:54:40 thorpej Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*-
4 1.1 thorpej * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.1 thorpej * All rights reserved.
6 1.1 thorpej *
7 1.1 thorpej * This code is derived from software contributed to The NetBSD Foundation
8 1.1 thorpej * by Jason R. Thorpe.
9 1.1 thorpej *
10 1.1 thorpej * Redistribution and use in source and binary forms, with or without
11 1.1 thorpej * modification, are permitted provided that the following conditions
12 1.1 thorpej * are met:
13 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
14 1.1 thorpej * notice, this list of conditions and the following disclaimer.
15 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
17 1.1 thorpej * documentation and/or other materials provided with the distribution.
18 1.1 thorpej * 3. All advertising materials mentioning features or use of this software
19 1.1 thorpej * must display the following acknowledgement:
20 1.1 thorpej * This product includes software developed by the NetBSD
21 1.1 thorpej * Foundation, Inc. and its contributors.
22 1.1 thorpej * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 thorpej * contributors may be used to endorse or promote products derived
24 1.1 thorpej * from this software without specific prior written permission.
25 1.1 thorpej *
26 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 thorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 thorpej * POSSIBILITY OF SUCH DAMAGE.
37 1.1 thorpej */
38 1.1 thorpej
39 1.1 thorpej #ifndef _DEV_MII_GLXTPHYREG_H_
40 1.1 thorpej #define _DEV_MII_GLXTPHYREG_H_
41 1.1 thorpej
42 1.1 thorpej /*
43 1.1 thorpej * LXT-1000 registers.
44 1.1 thorpej */
45 1.1 thorpej
46 1.1 thorpej #define MII_GLXTPHY_PCR 0x10 /* port configuration register */
47 1.1 thorpej #define PCR_TX_DIS (1U << 13) /* transmit disable */
48 1.1 thorpej #define PCR_BYP_SCR (1U << 12) /* bypass scrambler */
49 1.1 thorpej #define PCR_BYP_4B5B (1U << 11) /* bypass 4b/5b encoder */
50 1.1 thorpej #define PCR_JAB_DIS (1U << 10) /* disable jabber */
51 1.1 thorpej #define PCR_SQE (1U << 9) /* enable heartbeat */
52 1.1 thorpej #define PCR_TP_LOOPBACK (1U << 8) /* disable TP loopback */
53 1.1 thorpej #define PCR_SMART_SPEED (1U << 7) /* enable SmartSpeed */
54 1.1 thorpej #define PCR_PRE_EN (1U << 5) /* preamble enable */
55 1.1 thorpej #define PCR_10_SERIAL (1U << 3) /* 10Mb/s serial mode */
56 1.1 thorpej #define PCR_AN_ISOLATE (1U << 2) /* autoneg. isolate */
57 1.1 thorpej #define PCR_TBI (1U << 1) /* use ten-bit interface */
58 1.1 thorpej
59 1.1 thorpej #define MII_GLXTPHY_QSR 0x11 /* quick status register */
60 1.1 thorpej #define QSR_SPEED_get(x) (((x) >> 14) & 0x3)
61 1.1 thorpej #define QSR_TX_STATUS (1U << 13) /* transmit active */
62 1.1 thorpej #define QSR_RX_STATUS (1U << 12) /* receive active */
63 1.1 thorpej #define QSR_COL_STATUS (1U << 11) /* collision active */
64 1.1 thorpej #define QSR_LINK (1U << 10) /* link up */
65 1.1 thorpej #define QSR_DUPLEX (1U << 9) /* full-duplex */
66 1.1 thorpej #define QSR_AN (1U << 8) /* autoneg. enabled */
67 1.1 thorpej #define QSR_ACOMP (1U << 7) /* autoneg. complete */
68 1.1 thorpej #define QSR_LINE_LENGTH_get(x) (((x) >> 4) & 0x7)
69 1.1 thorpej #define QSR_PAUSE (1U << 3) /* partner can pause */
70 1.1 thorpej #define QSR_APAUSE (1U << 2) /* partner can asym-pause */
71 1.1 thorpej #define QSR_EVENT (1U << 0) /* event has occurred */
72 1.1 thorpej
73 1.1 thorpej #define SPEED_10_SERIAL 0
74 1.1 thorpej #define SPEED_10_MII 1
75 1.1 thorpej #define SPEED_100 2
76 1.1 thorpej #define SPEED_1000 3
77 1.1 thorpej
78 1.1 thorpej #define MII_GLXT_IER 0x12 /* interrupt enable register */
79 1.1 thorpej #define IER_AN_FAULT (1U << 13) /* autoneg fault */
80 1.1 thorpej #define IER_CROSS (1U << 11) /* crossover MDIX */
81 1.1 thorpej #define IER_POLARITY (1U << 10) /* polarity change */
82 1.1 thorpej #define IER_SMRT (1U << 9) /* SmartSpeed event */
83 1.1 thorpej #define IER_CNTR (1U << 8) /* counter full */
84 1.1 thorpej #define IER_AN (1U << 7) /* autoneg complete */
85 1.1 thorpej #define IER_SPEED (1U << 6) /* speed change */
86 1.1 thorpej #define IER_DUPLEX (1U << 5) /* duplex change */
87 1.1 thorpej #define IER_LINK (1U << 4) /* link change */
88 1.1 thorpej #define IER_INTEN (1U << 1) /* enable interrupts */
89 1.1 thorpej #define IER_TINT (1U << 0) /* force interrupt */
90 1.1 thorpej
91 1.1 thorpej #define MII_GLXT_ISR 0x13 /* interrupt status register */
92 1.1 thorpej /* See IER bits. */
93 1.1 thorpej
94 1.1 thorpej #define MII_GLXT_LEDCFG 0x14 /* LED configuration register */
95 1.1 thorpej #define LEDCFG_LEDC(x) ((x) << 14) /* collision */
96 1.1 thorpej #define LEDCFG_LEDR(x) ((x) << 12) /* receive */
97 1.1 thorpej #define LEDCFG_LEDT(x) ((x) << 10) /* transmit */
98 1.1 thorpej #define LEDCFG_LEDG(x) ((x) << 8) /* gigabit */
99 1.1 thorpej #define LEDCFG_LEDS(x) ((x) << 6) /* speed */
100 1.1 thorpej #define LEDCFG_LEDL(x) ((x) << 4) /* link */
101 1.1 thorpej #define LEDCFG_LEDF(x) ((x) << 2) /* full-duplex */
102 1.1 thorpej #define LEDCFG_PULSESTRETCH (1U << 1)
103 1.1 thorpej #define LEDCFG_LEDFREQ (1U << 0)
104 1.1 thorpej
105 1.1 thorpej #define LED_MODE_INDICATION 0 /* indicate LED's event */
106 1.1 thorpej #define LED_MODE_BLINK 1 /* blink */
107 1.1 thorpej #define LED_MODE_ON 2 /* force on */
108 1.1 thorpej #define LED_MODE_OFF 3 /* force off */
109 1.1 thorpej
110 1.1 thorpej #define MII_GLXT_PORTCR 0x15 /* port control register */
111 1.1 thorpej #define PORTCR_TX_TCLK (1U << 15) /* enable TX_TCLK */
112 1.1 thorpej #define PORTCR_ALT_NP (1U << 13) /* alternet next-page feature */
113 1.1 thorpej
114 1.1 thorpej #endif /* _DEV_MII_GLXTPHYREG_H_ */
115