glxtphyreg.h revision 1.2 1 1.2 martin /* $NetBSD: glxtphyreg.h,v 1.2 2008/04/28 20:23:53 martin 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 *
19 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 thorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 thorpej * POSSIBILITY OF SUCH DAMAGE.
30 1.1 thorpej */
31 1.1 thorpej
32 1.1 thorpej #ifndef _DEV_MII_GLXTPHYREG_H_
33 1.1 thorpej #define _DEV_MII_GLXTPHYREG_H_
34 1.1 thorpej
35 1.1 thorpej /*
36 1.1 thorpej * LXT-1000 registers.
37 1.1 thorpej */
38 1.1 thorpej
39 1.1 thorpej #define MII_GLXTPHY_PCR 0x10 /* port configuration register */
40 1.1 thorpej #define PCR_TX_DIS (1U << 13) /* transmit disable */
41 1.1 thorpej #define PCR_BYP_SCR (1U << 12) /* bypass scrambler */
42 1.1 thorpej #define PCR_BYP_4B5B (1U << 11) /* bypass 4b/5b encoder */
43 1.1 thorpej #define PCR_JAB_DIS (1U << 10) /* disable jabber */
44 1.1 thorpej #define PCR_SQE (1U << 9) /* enable heartbeat */
45 1.1 thorpej #define PCR_TP_LOOPBACK (1U << 8) /* disable TP loopback */
46 1.1 thorpej #define PCR_SMART_SPEED (1U << 7) /* enable SmartSpeed */
47 1.1 thorpej #define PCR_PRE_EN (1U << 5) /* preamble enable */
48 1.1 thorpej #define PCR_10_SERIAL (1U << 3) /* 10Mb/s serial mode */
49 1.1 thorpej #define PCR_AN_ISOLATE (1U << 2) /* autoneg. isolate */
50 1.1 thorpej #define PCR_TBI (1U << 1) /* use ten-bit interface */
51 1.1 thorpej
52 1.1 thorpej #define MII_GLXTPHY_QSR 0x11 /* quick status register */
53 1.1 thorpej #define QSR_SPEED_get(x) (((x) >> 14) & 0x3)
54 1.1 thorpej #define QSR_TX_STATUS (1U << 13) /* transmit active */
55 1.1 thorpej #define QSR_RX_STATUS (1U << 12) /* receive active */
56 1.1 thorpej #define QSR_COL_STATUS (1U << 11) /* collision active */
57 1.1 thorpej #define QSR_LINK (1U << 10) /* link up */
58 1.1 thorpej #define QSR_DUPLEX (1U << 9) /* full-duplex */
59 1.1 thorpej #define QSR_AN (1U << 8) /* autoneg. enabled */
60 1.1 thorpej #define QSR_ACOMP (1U << 7) /* autoneg. complete */
61 1.1 thorpej #define QSR_LINE_LENGTH_get(x) (((x) >> 4) & 0x7)
62 1.1 thorpej #define QSR_PAUSE (1U << 3) /* partner can pause */
63 1.1 thorpej #define QSR_APAUSE (1U << 2) /* partner can asym-pause */
64 1.1 thorpej #define QSR_EVENT (1U << 0) /* event has occurred */
65 1.1 thorpej
66 1.1 thorpej #define SPEED_10_SERIAL 0
67 1.1 thorpej #define SPEED_10_MII 1
68 1.1 thorpej #define SPEED_100 2
69 1.1 thorpej #define SPEED_1000 3
70 1.1 thorpej
71 1.1 thorpej #define MII_GLXT_IER 0x12 /* interrupt enable register */
72 1.1 thorpej #define IER_AN_FAULT (1U << 13) /* autoneg fault */
73 1.1 thorpej #define IER_CROSS (1U << 11) /* crossover MDIX */
74 1.1 thorpej #define IER_POLARITY (1U << 10) /* polarity change */
75 1.1 thorpej #define IER_SMRT (1U << 9) /* SmartSpeed event */
76 1.1 thorpej #define IER_CNTR (1U << 8) /* counter full */
77 1.1 thorpej #define IER_AN (1U << 7) /* autoneg complete */
78 1.1 thorpej #define IER_SPEED (1U << 6) /* speed change */
79 1.1 thorpej #define IER_DUPLEX (1U << 5) /* duplex change */
80 1.1 thorpej #define IER_LINK (1U << 4) /* link change */
81 1.1 thorpej #define IER_INTEN (1U << 1) /* enable interrupts */
82 1.1 thorpej #define IER_TINT (1U << 0) /* force interrupt */
83 1.1 thorpej
84 1.1 thorpej #define MII_GLXT_ISR 0x13 /* interrupt status register */
85 1.1 thorpej /* See IER bits. */
86 1.1 thorpej
87 1.1 thorpej #define MII_GLXT_LEDCFG 0x14 /* LED configuration register */
88 1.1 thorpej #define LEDCFG_LEDC(x) ((x) << 14) /* collision */
89 1.1 thorpej #define LEDCFG_LEDR(x) ((x) << 12) /* receive */
90 1.1 thorpej #define LEDCFG_LEDT(x) ((x) << 10) /* transmit */
91 1.1 thorpej #define LEDCFG_LEDG(x) ((x) << 8) /* gigabit */
92 1.1 thorpej #define LEDCFG_LEDS(x) ((x) << 6) /* speed */
93 1.1 thorpej #define LEDCFG_LEDL(x) ((x) << 4) /* link */
94 1.1 thorpej #define LEDCFG_LEDF(x) ((x) << 2) /* full-duplex */
95 1.1 thorpej #define LEDCFG_PULSESTRETCH (1U << 1)
96 1.1 thorpej #define LEDCFG_LEDFREQ (1U << 0)
97 1.1 thorpej
98 1.1 thorpej #define LED_MODE_INDICATION 0 /* indicate LED's event */
99 1.1 thorpej #define LED_MODE_BLINK 1 /* blink */
100 1.1 thorpej #define LED_MODE_ON 2 /* force on */
101 1.1 thorpej #define LED_MODE_OFF 3 /* force off */
102 1.1 thorpej
103 1.1 thorpej #define MII_GLXT_PORTCR 0x15 /* port control register */
104 1.1 thorpej #define PORTCR_TX_TCLK (1U << 15) /* enable TX_TCLK */
105 1.1 thorpej #define PORTCR_ALT_NP (1U << 13) /* alternet next-page feature */
106 1.1 thorpej
107 1.1 thorpej #endif /* _DEV_MII_GLXTPHYREG_H_ */
108