1 1.2 martin /* $NetBSD: nsphyreg.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) 1998 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 of the Numerical Aerospace Simulation Facility, 9 1.1 thorpej * NASA Ames Research Center. 10 1.1 thorpej * 11 1.1 thorpej * Redistribution and use in source and binary forms, with or without 12 1.1 thorpej * modification, are permitted provided that the following conditions 13 1.1 thorpej * are met: 14 1.1 thorpej * 1. Redistributions of source code must retain the above copyright 15 1.1 thorpej * notice, this list of conditions and the following disclaimer. 16 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright 17 1.1 thorpej * notice, this list of conditions and the following disclaimer in the 18 1.1 thorpej * documentation and/or other materials provided with the distribution. 19 1.1 thorpej * 20 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 1.1 thorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 1.1 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 1.1 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 1.1 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 1.1 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 1.1 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 1.1 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 1.1 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 1.1 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 1.1 thorpej * POSSIBILITY OF SUCH DAMAGE. 31 1.1 thorpej */ 32 1.1 thorpej 33 1.1 thorpej #ifndef _DEV_MII_NSPHYREG_H_ 34 1.1 thorpej #define _DEV_MII_NSPHYREG_H_ 35 1.1 thorpej 36 1.1 thorpej /* 37 1.1 thorpej * DP83840 registers. 38 1.1 thorpej */ 39 1.1 thorpej 40 1.1 thorpej #define MII_NSPHY_DCR 0x12 /* Disconnect counter */ 41 1.1 thorpej 42 1.1 thorpej #define MII_NSPHY_FCSCR 0x13 /* False carrier sense counter */ 43 1.1 thorpej 44 1.1 thorpej #define MII_NSPHY_RECR 0x15 /* Receive error counter */ 45 1.1 thorpej 46 1.1 thorpej #define MII_NSPHY_SRR 0x16 /* Silicon revision */ 47 1.1 thorpej 48 1.1 thorpej #define MII_NSPHY_PCR 0x17 /* PCS sub-layer configuration */ 49 1.1 thorpej #define PCR_NRZI 0x8000 /* NRZI encoding enabled for 100TX */ 50 1.1 thorpej #define PCR_DESCRTOSEL 0x4000 /* descrambler t/o select (2ms) */ 51 1.1 thorpej #define PCR_DESCRTODIS 0x2000 /* descrambler t/o disable */ 52 1.1 thorpej #define PCR_REPEATER 0x1000 /* repeater mode */ 53 1.1 thorpej #define PCR_ENCSEL 0x0800 /* encoder mode select */ 54 1.1 thorpej #define PCR_CLK25MDIS 0x0080 /* CLK25M disable */ 55 1.1 thorpej #define PCR_FLINK100 0x0040 /* force good link in 100mbps */ 56 1.1 thorpej #define PCR_CIMDIS 0x0020 /* carrier integrity monitor disable */ 57 1.1 thorpej #define PCR_TXOFF 0x0010 /* force transmit off */ 58 1.1 thorpej #define PCR_LED1MODE 0x0004 /* LED1 mode: see below */ 59 1.1 thorpej #define PCR_LED4MODE 0x0002 /* LED4 mode: see below */ 60 1.1 thorpej 61 1.1 thorpej /* 62 1.1 thorpej * LED1 Mode: 63 1.1 thorpej * 64 1.1 thorpej * 1 LED1 output configured to PAR's CON_STATUS, useful for 65 1.1 thorpej * network management in 100baseTX mode. 66 1.1 thorpej * 67 1.1 thorpej * 0 Normal LED1 operation - 10baseTX and 100baseTX transmission 68 1.1 thorpej * activity. 69 1.1 thorpej * 70 1.1 thorpej * LED4 Mode: 71 1.1 thorpej * 72 1.1 thorpej * 1 LED4 output configured to indicate full-duplex in both 73 1.1 thorpej * 10baseT and 100baseTX modes. 74 1.1 thorpej * 75 1.1 thorpej * 0 LED4 output configured to indicate polarity in 10baseT 76 1.1 thorpej * mode and full-duplex in 100baseTX mode. 77 1.1 thorpej */ 78 1.1 thorpej 79 1.1 thorpej #define MII_NSPHY_LBREMR 0x18 /* Loopback, bypass, error mask */ 80 1.1 thorpej #define LBREMR_BADSSDEN 0x8000 /* enable bad SSD detection */ 81 1.1 thorpej #define LBREMR_BP4B5B 0x4000 /* bypass 4b/5b encoding */ 82 1.1 thorpej #define LBREMR_BPSCR 0x2000 /* bypass scrambler */ 83 1.1 thorpej #define LBREMR_BPALIGN 0x1000 /* bypass alignment function */ 84 1.1 thorpej #define LBREMR_10LOOP 0x0800 /* 10baseT loopback */ 85 1.1 thorpej #define LBREMR_LB1 0x0200 /* loopback ctl 1 */ 86 1.1 thorpej #define LBREMR_LB0 0x0100 /* loopback ctl 0 */ 87 1.1 thorpej #define LBREMR_ALTCRS 0x0040 /* alt crs operation */ 88 1.1 thorpej #define LBREMR_LOOPXMTDIS 0x0020 /* disable transmit in 100TX loopbk */ 89 1.1 thorpej #define LBREMR_CODEERR 0x0010 /* code errors */ 90 1.1 thorpej #define LBREMR_PEERR 0x0008 /* premature end errors */ 91 1.1 thorpej #define LBREMR_LINKERR 0x0004 /* link errors */ 92 1.1 thorpej #define LBREMR_PKTERR 0x0002 /* packet errors */ 93 1.1 thorpej 94 1.1 thorpej #define MII_NSPHY_PAR 0x19 /* Physical address and status */ 95 1.1 thorpej #define PAR_DISCRSJAB 0x0800 /* disable car sense during jab */ 96 1.1 thorpej #define PAR_ANENSTAT 0x0400 /* autoneg mode status */ 97 1.1 thorpej #define PAR_FEFIEN 0x0100 /* far end fault enable */ 98 1.1 thorpej #define PAR_FDX 0x0080 /* full duplex status */ 99 1.1 thorpej #define PAR_10 0x0040 /* 10mbps mode */ 100 1.1 thorpej #define PAR_CON 0x0020 /* connect status */ 101 1.1 thorpej #define PAR_AMASK 0x001f /* PHY address bits */ 102 1.1 thorpej 103 1.1 thorpej #define MII_NSPHY_10BTSR 0x1b /* 10baseT status */ 104 1.1 thorpej #define MII_NSPHY_10BTCR 0x1c /* 10baseT configuration */ 105 1.1 thorpej 106 1.1 thorpej #endif /* _DEV_MII_NSPHYREG_H_ */ 107