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