1 1.5 martin /* $NetBSD: sqphyreg.h,v 1.5 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_SQPHYREG_H_ 34 1.1 thorpej #define _DEV_MII_SQPHYREG_H_ 35 1.1 thorpej 36 1.1 thorpej /* 37 1.2 thorpej * Seeq 80220 registers. This also covers the Seeq 80225, which is 38 1.2 thorpej * a stripped-down-for-lower-power-consumption version of the 80223. 39 1.2 thorpej * It only has a STATUS register, and only the SPD_DET and DPLX_DET 40 1.2 thorpej * bits are valid. 41 1.1 thorpej */ 42 1.1 thorpej 43 1.1 thorpej #define MII_SQPHY_CONFIG1 0x10 /* Configuration 1 Register */ 44 1.1 thorpej #define CONFIG1_LNK_DIS 0x8000 /* Link Detect Disable */ 45 1.1 thorpej #define CONFIG1_XMT_DIS 0x4000 /* TP Transmitter Disable */ 46 1.1 thorpej #define CONFIG1_XMT_PDN 0x2000 /* TP Transmitter Powerdown */ 47 1.1 thorpej #define CONFIG1_TXEN_CRS 0x1000 /* TX_EN to CRS Loopback Disable */ 48 1.1 thorpej #define CONFIG1_BYP_ENC 0x0800 /* Bypass Encoder */ 49 1.1 thorpej #define CONFIG1_BYP_SCR 0x0400 /* Bypass Scrambler */ 50 1.1 thorpej #define CONFIG1_UNSCR_DIS 0x0200 /* Unscr. Idle Reception Disable */ 51 1.1 thorpej #define CONFIG1_EQLZR 0x0100 /* Rx Equalizer Disable */ 52 1.1 thorpej #define CONFIG1_CABLE 0x0080 /* Cable: 1 = STP, 0 = UTP */ 53 1.1 thorpej #define CONFIG1_RLVL0 0x0040 /* Receive Level Adjust */ 54 1.1 thorpej #define CONFIG1_TLVL3 0x0020 /* Transmit output level adjust */ 55 1.1 thorpej #define CONFIG1_TLVL2 0x0010 56 1.1 thorpej #define CONFIG1_TLVL1 0x0008 57 1.1 thorpej #define CONFIG1_TLVL0 0x0004 58 1.1 thorpej #define CONFIG1_TRF1 0x0002 /* Transmitter Rise/Fall Adjust */ 59 1.1 thorpej #define CONFIG1_TRF0 0x0001 60 1.1 thorpej 61 1.1 thorpej #define MII_SQPHY_CONFIG2 0x11 /* Configuration 2 Register */ 62 1.1 thorpej #define CONFIG2_PLED3_1 0x8000 /* PLED3 configuration */ 63 1.1 thorpej #define CONFIG2_PLED3_0 0x4000 64 1.1 thorpej /* 1 1 LINK100 (default) */ 65 1.1 thorpej /* 1 0 Blink */ 66 1.1 thorpej /* 0 1 On */ 67 1.1 thorpej /* 0 0 Off */ 68 1.1 thorpej #define CONFIG2_PLED2_1 0x2000 /* PLED2 configuration */ 69 1.1 thorpej #define CONFIG2_PLED2_0 0x1000 70 1.1 thorpej /* 1 1 Activity (default) */ 71 1.1 thorpej /* 1 0 Blink */ 72 1.1 thorpej /* 0 1 On */ 73 1.1 thorpej /* 0 0 Off */ 74 1.1 thorpej #define CONFIG2_PLED1_1 0x0800 /* PLED1 configuration */ 75 1.1 thorpej #define CONFIG2_PLED1_0 0x0400 76 1.1 thorpej /* 1 1 Full duplex (default) */ 77 1.1 thorpej /* 1 0 Blink */ 78 1.1 thorpej /* 0 1 On */ 79 1.1 thorpej /* 0 0 Off */ 80 1.1 thorpej #define CONFIG2_PLED0_1 0x0200 /* PLED0 configuration */ 81 1.1 thorpej #define CONFIG2_PLED0_0 0x0100 82 1.1 thorpej /* 1 1 LINK10 (default) */ 83 1.1 thorpej /* 1 0 Blink */ 84 1.1 thorpej /* 0 1 On */ 85 1.1 thorpej /* 0 0 Off */ 86 1.1 thorpej #define CONFIG2_LED_DEF1 0x0080 /* LED Normal Function Select */ 87 1.1 thorpej #define CONFIG2_LED_DEF0 0x0040 88 1.1 thorpej #define CONFIG2_APOL_DIS 0x0020 /* Auto Polarity Correct Disable */ 89 1.1 thorpej #define CONFIG2_JAB_DIS 0x0010 /* Jabber Disable */ 90 1.1 thorpej #define CONFIG2_MREG 0x0008 /* Multiple Register Access Enable */ 91 1.1 thorpej #define CONFIG2_INT_MDIO 0x0004 /* MDIO Interrupt when idle */ 92 1.1 thorpej #define CONFIG2_RJ_CFG 0x0002 /* R/J Configuration Select */ 93 1.1 thorpej 94 1.1 thorpej #define MII_SQPHY_STATUS 0x12 /* Status Output Register */ 95 1.1 thorpej #define STATUS_INT 0x8000 /* Interrupt Detect */ 96 1.1 thorpej #define STATUS_LNK_FAIL 0x4000 /* Link Fail */ 97 1.3 wiz #define STATUS_LOSS_SYNC 0x2000 /* Descrambler lost synchronization */ 98 1.1 thorpej #define STATUS_CWRD 0x1000 /* Codeword Error */ 99 1.1 thorpej #define STATUS_SSD 0x0800 /* Start of Stream Error */ 100 1.1 thorpej #define STATUS_ESD 0x0400 /* End of Stream Error */ 101 1.1 thorpej #define STATUS_RPOL 0x0200 /* Reverse Polarity Detected */ 102 1.1 thorpej #define STATUS_JAB 0x0100 /* Jabber Detected */ 103 1.1 thorpej #define STATUS_SPD_DET 0x0080 /* 100Mbps */ 104 1.1 thorpej #define STATUS_DPLX_DET 0x0040 /* Full Duplex */ 105 1.1 thorpej 106 1.1 thorpej #define MII_SQPHY_MASK 0x13 /* Mask Register */ 107 1.1 thorpej #define MASK_INT 0x8000 /* mask INT */ 108 1.1 thorpej #define MASK_LNK_FAIL 0x4000 /* mask LNK_FAIL */ 109 1.1 thorpej #define MASK_LOSS_SYNC 0x2000 /* mask LOSS_SYNC */ 110 1.1 thorpej #define MASK_CWRD 0x1000 /* mask CWRD */ 111 1.1 thorpej #define MASK_SSD 0x0800 /* mask SSD */ 112 1.1 thorpej #define MASK_ESD 0x0400 /* mask ESD */ 113 1.1 thorpej #define MASK_RPOL 0x0200 /* mask RPOL */ 114 1.1 thorpej #define MASK_JAB 0x0100 /* mask JAB */ 115 1.1 thorpej #define MASK_SPD_DET 0x0080 /* mask SPD_DET */ 116 1.1 thorpej #define MASK_DPLX_DET 0x0040 /* mask DPLX_DET */ 117 1.1 thorpej #define MASK_ANEG_STS1 0x0020 /* mask ANEG_STS1 */ 118 1.1 thorpej #define MASK_ANEG_STS0 0x0010 /* mask ANEG_STS0 */ 119 1.1 thorpej 120 1.1 thorpej #define MII_SQPHY_RESERVED 0x14 /* Reserved Register */ 121 1.1 thorpej /* All bits must be 0 */ 122 1.1 thorpej 123 1.1 thorpej #endif /* _DEV_MII_SQPHYREG_H_ */ 124