1*2ca5b659SJoost Mulders /* 2*2ca5b659SJoost Mulders * CDDL HEADER START 3*2ca5b659SJoost Mulders * 4*2ca5b659SJoost Mulders * The contents of this file are subject to the terms of the 5*2ca5b659SJoost Mulders * Common Development and Distribution License (the "License"). 6*2ca5b659SJoost Mulders * You may not use this file except in compliance with the License. 7*2ca5b659SJoost Mulders * 8*2ca5b659SJoost Mulders * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*2ca5b659SJoost Mulders * or http://www.opensolaris.org/os/licensing. 10*2ca5b659SJoost Mulders * See the License for the specific language governing permissions 11*2ca5b659SJoost Mulders * and limitations under the License. 12*2ca5b659SJoost Mulders * 13*2ca5b659SJoost Mulders * When distributing Covered Code, include this CDDL HEADER in each 14*2ca5b659SJoost Mulders * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*2ca5b659SJoost Mulders * If applicable, add the following below this CDDL HEADER, with the 16*2ca5b659SJoost Mulders * fields enclosed by brackets "[]" replaced with your own identifying 17*2ca5b659SJoost Mulders * information: Portions Copyright [yyyy] [name of copyright owner] 18*2ca5b659SJoost Mulders * 19*2ca5b659SJoost Mulders * CDDL HEADER END 20*2ca5b659SJoost Mulders */ 21*2ca5b659SJoost Mulders 22*2ca5b659SJoost Mulders /* 23*2ca5b659SJoost Mulders * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*2ca5b659SJoost Mulders * Use is subject to license terms. 25*2ca5b659SJoost Mulders */ 26*2ca5b659SJoost Mulders 27*2ca5b659SJoost Mulders /* 28*2ca5b659SJoost Mulders * Register definitions for the VIA Rhine ethernet adapters 29*2ca5b659SJoost Mulders */ 30*2ca5b659SJoost Mulders #ifndef _VRREG_H 31*2ca5b659SJoost Mulders #define _VRREG_H 32*2ca5b659SJoost Mulders 33*2ca5b659SJoost Mulders #ifdef __cplusplus 34*2ca5b659SJoost Mulders extern "C" { 35*2ca5b659SJoost Mulders #endif 36*2ca5b659SJoost Mulders 37*2ca5b659SJoost Mulders /* 38*2ca5b659SJoost Mulders * MAC address 39*2ca5b659SJoost Mulders */ 40*2ca5b659SJoost Mulders #define VR_ETHERADDR 0x00 41*2ca5b659SJoost Mulders 42*2ca5b659SJoost Mulders /* 43*2ca5b659SJoost Mulders * Receive Configuration 44*2ca5b659SJoost Mulders * The thresholds denote the level in the FIFO before transmission 45*2ca5b659SJoost Mulders * to host memory starts. 46*2ca5b659SJoost Mulders */ 47*2ca5b659SJoost Mulders #define VR_RXCFG 0x06 48*2ca5b659SJoost Mulders #define VR_RXCFG_ACCEPTERROR (1 << 0) 49*2ca5b659SJoost Mulders #define VR_RXCFG_ACCEPTRUNT (1 << 1) 50*2ca5b659SJoost Mulders #define VR_RXCFG_ACCEPTMULTI (1 << 2) 51*2ca5b659SJoost Mulders #define VR_RXCFG_ACCEPTBROAD (1 << 3) 52*2ca5b659SJoost Mulders #define VR_RXCFG_PROMISC (1 << 4) 53*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_0 (1 << 5) 54*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_1 (1 << 6) 55*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_2 (1 << 7) 56*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_BITS (VR_RXCFG_FIFO_THRESHOLD_0 | \ 57*2ca5b659SJoost Mulders VR_RXCFG_FIFO_THRESHOLD_1 | \ 58*2ca5b659SJoost Mulders VR_RXCFG_FIFO_THRESHOLD_2) 59*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_64 (0) 60*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_32 (VR_RXCFG_FIFO_THRESHOLD_0) 61*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_128 (VR_RXCFG_FIFO_THRESHOLD_1) 62*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_256 (VR_RXCFG_FIFO_THRESHOLD_0 | \ 63*2ca5b659SJoost Mulders VR_RXCFG_FIFO_THRESHOLD_1) 64*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_512 (VR_RXCFG_FIFO_THRESHOLD_2) 65*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_768 (VR_RXCFG_FIFO_THRESHOLD_0 | \ 66*2ca5b659SJoost Mulders VR_RXCFG_FIFO_THRESHOLD_2) 67*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_1024 (VR_RXCFG_FIFO_THRESHOLD_2 | \ 68*2ca5b659SJoost Mulders VR_RXCFG_FIFO_THRESHOLD_1) 69*2ca5b659SJoost Mulders #define VR_RXCFG_FIFO_THRESHOLD_STFW (VR_RXCFG_FIFO_THRESHOLD_BITS) 70*2ca5b659SJoost Mulders 71*2ca5b659SJoost Mulders /* 72*2ca5b659SJoost Mulders * Transmit Configuration 73*2ca5b659SJoost Mulders * The transmission starts when the data in the FIFO reaches the threshold. 74*2ca5b659SJoost Mulders * Store and Forward means that a transmission starts when a complete frame 75*2ca5b659SJoost Mulders * is in the FIFO. 76*2ca5b659SJoost Mulders */ 77*2ca5b659SJoost Mulders #define VR_TXCFG 0x07 78*2ca5b659SJoost Mulders #define VR_TXCFG_8021PQ_EN (1 << 0) /* VT6105M */ 79*2ca5b659SJoost Mulders #define VR_TXCFG_LOOPBACK_0 (1 << 1) 80*2ca5b659SJoost Mulders #define VR_TXCFG_LOOPBACK_1 (2 << 2) 81*2ca5b659SJoost Mulders #define VR_TXCFG_BACKOFF_NATIONAL (1 << 3) /* < VT6105M */ 82*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_0 (1 << 5) 83*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_1 (1 << 6) 84*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_2 (1 << 7) 85*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_BITS (VR_TXCFG_FIFO_THRESHOLD_0 | \ 86*2ca5b659SJoost Mulders VR_TXCFG_FIFO_THRESHOLD_1 | \ 87*2ca5b659SJoost Mulders VR_TXCFG_FIFO_THRESHOLD_2) 88*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_128 (0) 89*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_256 (VR_TXCFG_FIFO_THRESHOLD_0) 90*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_512 (VR_TXCFG_FIFO_THRESHOLD_1) 91*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_1024 (VR_TXCFG_FIFO_THRESHOLD_0 | \ 92*2ca5b659SJoost Mulders VR_TXCFG_FIFO_THRESHOLD_1) 93*2ca5b659SJoost Mulders #define VR_TXCFG_FIFO_THRESHOLD_STFW (VR_TXCFG_FIFO_THRESHOLD_BITS) 94*2ca5b659SJoost Mulders 95*2ca5b659SJoost Mulders /* 96*2ca5b659SJoost Mulders * Chip control 97*2ca5b659SJoost Mulders */ 98*2ca5b659SJoost Mulders #define VR_CTRL0 0x08 99*2ca5b659SJoost Mulders #define VR_CTRL0_RESERVED (1 << 0) 100*2ca5b659SJoost Mulders #define VR_CTRL0_DMA_ENABLE (1 << 1) 101*2ca5b659SJoost Mulders #define VR_CTRL0_DMA_STOP (1 << 2) 102*2ca5b659SJoost Mulders #define VR_CTRL0_RX_DMA_ENABLE (1 << 3) 103*2ca5b659SJoost Mulders #define VR_CTRL0_TX_DMA_ENABLE (1 << 4) 104*2ca5b659SJoost Mulders #define VR_CTRL0_TXPOLL (1 << 5) /* < 6105M */ 105*2ca5b659SJoost Mulders #define VR_CTRL0_RXPOLL (1 << 6) /* < 6105M */ 106*2ca5b659SJoost Mulders 107*2ca5b659SJoost Mulders #define VR_CTRL0_DMA_GO (VR_CTRL0_DMA_ENABLE | \ 108*2ca5b659SJoost Mulders VR_CTRL0_RX_DMA_ENABLE | \ 109*2ca5b659SJoost Mulders VR_CTRL0_TX_DMA_ENABLE | \ 110*2ca5b659SJoost Mulders VR_CTRL0_TXPOLL) 111*2ca5b659SJoost Mulders #define VR_CTRL1 0x09 112*2ca5b659SJoost Mulders #define VR_CTRL1_RESERVED (1 << 0) 113*2ca5b659SJoost Mulders #define VR_CTRL1_UNICAST_EN (1 << 1) 114*2ca5b659SJoost Mulders #define VR_CTRL1_MACFULLDUPLEX (1 << 2) 115*2ca5b659SJoost Mulders #define VR_CTRL1_NOAUTOPOLL (1 << 3) 116*2ca5b659SJoost Mulders #define VR_CTRL1_RESERVED2 (1 << 4) 117*2ca5b659SJoost Mulders #define VR_CTRL1_TXPOLL (1 << 5) /* VT6105M */ 118*2ca5b659SJoost Mulders #define VR_CTRL1_RXPOLL (1 << 6) /* VT6105M */ 119*2ca5b659SJoost Mulders #define VR_CTRL1_RESET (1 << 7) 120*2ca5b659SJoost Mulders 121*2ca5b659SJoost Mulders #define VR_T_XQNWAKE 0x0a /* VT6105M */ 122*2ca5b659SJoost Mulders 123*2ca5b659SJoost Mulders /* 124*2ca5b659SJoost Mulders * Interrupt Status 125*2ca5b659SJoost Mulders * This register reflects NIC status 126*2ca5b659SJoost Mulders * The host reads it to determine the cause of the interrupt 127*2ca5b659SJoost Mulders * This register must be cleared after power-up 128*2ca5b659SJoost Mulders */ 129*2ca5b659SJoost Mulders #define VR_ISR0 0x0C 130*2ca5b659SJoost Mulders #define VR_ISR0_RX_DONE (1 << 0) 131*2ca5b659SJoost Mulders #define VR_ISR0_TX_DONE (1 << 1) 132*2ca5b659SJoost Mulders #define VR_ISR0_RX_ERR (1 << 2) 133*2ca5b659SJoost Mulders #define VR_ISR0_TX_ERR (1 << 3) 134*2ca5b659SJoost Mulders #define VR_ISR0_TX_BUF_UFLOW (1 << 4) 135*2ca5b659SJoost Mulders #define VR_ISR0_RX_LINKERR (1 << 5) 136*2ca5b659SJoost Mulders #define VR_ISR0_BUSERR (1 << 6) 137*2ca5b659SJoost Mulders #define VR_ISR0_STATSMAX (1 << 7) 138*2ca5b659SJoost Mulders #define VR_ISR0_RX_EARLY (1 << 8) 139*2ca5b659SJoost Mulders #define VR_ISR0_TX_FIFO_UFLOW (1 << 9) 140*2ca5b659SJoost Mulders #define VR_ISR0_RX_FIFO_OFLOW (1 << 10) 141*2ca5b659SJoost Mulders #define VR_ISR0_RX_DROPPED (1 << 11) 142*2ca5b659SJoost Mulders #define VR_ISR0_RX_NOBUF (1 << 12) 143*2ca5b659SJoost Mulders #define VR_ISR0_TX_ABORT (1 << 13) 144*2ca5b659SJoost Mulders #define VR_ISR0_LINKSTATUS (1 << 14) 145*2ca5b659SJoost Mulders #define VR_ISR0_GENERAL (1 << 15) 146*2ca5b659SJoost Mulders 147*2ca5b659SJoost Mulders /* 148*2ca5b659SJoost Mulders * Interrupt Configuration 149*2ca5b659SJoost Mulders * All bits in this register correspond to the bits in the Interrupt Status 150*2ca5b659SJoost Mulders * register Setting individual bits will enable the corresponding interrupt 151*2ca5b659SJoost Mulders * This register defaults to all zeros on power up 152*2ca5b659SJoost Mulders */ 153*2ca5b659SJoost Mulders #define VR_ICR0 0x0E 154*2ca5b659SJoost Mulders #define VR_ICR0_RX_DONE VR_ISR0_RX_DONE 155*2ca5b659SJoost Mulders #define VR_ICR0_TX_DONE VR_ISR0_TX_DONE 156*2ca5b659SJoost Mulders #define VR_ICR0_RX_ERR VR_ISR0_RX_ERR 157*2ca5b659SJoost Mulders #define VR_ICR0_TX_ERR VR_ISR0_TX_ERR 158*2ca5b659SJoost Mulders #define VR_ICR0_TX_BUF_UFLOW VR_ISR0_TX_BUF_UFLOW 159*2ca5b659SJoost Mulders #define VR_ICR0_RX_LINKERR VR_ISR0_RX_LINKERR 160*2ca5b659SJoost Mulders #define VR_ICR0_BUSERR VR_ISR0_BUSERR 161*2ca5b659SJoost Mulders #define VR_ICR0_STATSMAX VR_ISR0_STATSMAX 162*2ca5b659SJoost Mulders #define VR_ICR0_RX_EARLY VR_ISR0_RX_EARLY 163*2ca5b659SJoost Mulders #define VR_ICR0_TX_FIFO_UFLOW VR_ISR0_TX_FIFO_UFLOW 164*2ca5b659SJoost Mulders #define VR_ICR0_RX_FIFO_OFLOW VR_ISR0_RX_FIFO_OFLOW 165*2ca5b659SJoost Mulders #define VR_ICR0_RX_DROPPED VR_ISR0_RX_DROPPED 166*2ca5b659SJoost Mulders #define VR_ICR0_RX_NOBUF VR_ISR0_RX_NOBUF 167*2ca5b659SJoost Mulders #define VR_ICR0_TX_ABORT VR_ISR0_TX_ABORT 168*2ca5b659SJoost Mulders #define VR_ICR0_LINKSTATUS VR_ISR0_LINKSTATUS 169*2ca5b659SJoost Mulders #define VR_ICR0_GENERAL VR_ISR0_GENERAL 170*2ca5b659SJoost Mulders 171*2ca5b659SJoost Mulders /* 172*2ca5b659SJoost Mulders * Mulicast address registers (MAR), 8 bytes 173*2ca5b659SJoost Mulders */ 174*2ca5b659SJoost Mulders #define VR_MAR0 0x10 /* - 0x13 */ 175*2ca5b659SJoost Mulders #define VR_MAR1 0x14 /* - 0x17 */ 176*2ca5b659SJoost Mulders 177*2ca5b659SJoost Mulders /* 178*2ca5b659SJoost Mulders * VT6105M has a multicast/vlan filter and the hash bits are also used as 179*2ca5b659SJoost Mulders * CAM data port 180*2ca5b659SJoost Mulders */ 181*2ca5b659SJoost Mulders #define VR_MCAM0 0x10 /* VT6105M */ 182*2ca5b659SJoost Mulders #define VR_MCAM1 0x11 183*2ca5b659SJoost Mulders #define VR_MCAM2 0x12 184*2ca5b659SJoost Mulders #define VR_MCAM3 0x13 185*2ca5b659SJoost Mulders #define VR_MCAM4 0x14 186*2ca5b659SJoost Mulders #define VR_MCAM5 0x15 187*2ca5b659SJoost Mulders #define VR_VCAM0 0x16 188*2ca5b659SJoost Mulders #define VR_VCAM1 0x17 189*2ca5b659SJoost Mulders 190*2ca5b659SJoost Mulders /* 191*2ca5b659SJoost Mulders * Start addresses of receive and transmit ring 192*2ca5b659SJoost Mulders */ 193*2ca5b659SJoost Mulders #define VR_RXADDR 0x18 /* - 0x1B */ 194*2ca5b659SJoost Mulders #define VR_TXADDR 0x1C /* - 0x1F */ 195*2ca5b659SJoost Mulders 196*2ca5b659SJoost Mulders /* 197*2ca5b659SJoost Mulders * VT6105M has 8 TX queues 198*2ca5b659SJoost Mulders */ 199*2ca5b659SJoost Mulders #define VR_TX7_ADDR 0x1C 200*2ca5b659SJoost Mulders #define VR_TX6_ADDR 0x20 201*2ca5b659SJoost Mulders #define VR_TX5_ADDR 0x24 202*2ca5b659SJoost Mulders #define VR_TX4_ADDR 0x28 203*2ca5b659SJoost Mulders #define VR_TX3_ADDR 0x2C 204*2ca5b659SJoost Mulders #define VR_TX2_ADDR 0x30 205*2ca5b659SJoost Mulders #define VR_TX1_ADDR 0x34 206*2ca5b659SJoost Mulders #define VR_TX0_ADDR 0x38 207*2ca5b659SJoost Mulders 208*2ca5b659SJoost Mulders /* 209*2ca5b659SJoost Mulders * Current and receive- and transmit descriptors. 210*2ca5b659SJoost Mulders * These are listed in the VT6102 manual but not in the VT6105. 211*2ca5b659SJoost Mulders */ 212*2ca5b659SJoost Mulders #define VR_RXCUR_DES0 0x20 /* - 0x23 */ 213*2ca5b659SJoost Mulders #define VR_RXCUR_DES1 0x24 /* - 0x27 */ 214*2ca5b659SJoost Mulders #define VR_RXCUR_DES2 0x28 /* - 0x2B */ 215*2ca5b659SJoost Mulders #define VR_RXCUR_DES3 0x2C /* - 0x2F */ 216*2ca5b659SJoost Mulders 217*2ca5b659SJoost Mulders /* VIA secrets here */ 218*2ca5b659SJoost Mulders 219*2ca5b659SJoost Mulders #define VR_INTRLINE 0x3c 220*2ca5b659SJoost Mulders #define VR_INTRPIN 0x3d 221*2ca5b659SJoost Mulders 222*2ca5b659SJoost Mulders /* VIA secrets here */ 223*2ca5b659SJoost Mulders 224*2ca5b659SJoost Mulders #define VR_TXCUR_DES0 0x40 /* - 0x43 */ 225*2ca5b659SJoost Mulders #define VR_TXCUR_DES1 0x44 /* - 0x47 */ 226*2ca5b659SJoost Mulders #define VR_TXCUR_DES2 0x48 /* - 0x4B */ 227*2ca5b659SJoost Mulders #define VR_TXCUR_DES3 0x4C /* - 0x4F */ 228*2ca5b659SJoost Mulders 229*2ca5b659SJoost Mulders #define VR_MODE0 0x50 230*2ca5b659SJoost Mulders #define VR_MODE0_QPKTDS 0x80 231*2ca5b659SJoost Mulders 232*2ca5b659SJoost Mulders #define VR_MODE1 0x51 233*2ca5b659SJoost Mulders #define VR_FIFOTST 0x51 234*2ca5b659SJoost Mulders 235*2ca5b659SJoost Mulders /* 236*2ca5b659SJoost Mulders * These are not in the datasheet but used in the 'fet' driver 237*2ca5b659SJoost Mulders */ 238*2ca5b659SJoost Mulders #define VR_MODE2 0x52 239*2ca5b659SJoost Mulders #define VR_MODE2_PCEROPT 0x80 /* VT6102 only */ 240*2ca5b659SJoost Mulders #define VR_MODE2_DISABT 0x40 241*2ca5b659SJoost Mulders #define VR_MODE2_MRDPL 0x08 /* VT6107A1 and above */ 242*2ca5b659SJoost Mulders #define VR_MODE2_MODE10T 0x02 243*2ca5b659SJoost Mulders 244*2ca5b659SJoost Mulders #define VR_MODE3 0x53 245*2ca5b659SJoost Mulders #define VR_MODE3_XONOPT 0x80 246*2ca5b659SJoost Mulders #define VR_MODE3_TPACEN 0x40 247*2ca5b659SJoost Mulders #define VR_MODE3_BACKOPT 0x20 248*2ca5b659SJoost Mulders #define VR_MODE3_DLTSEL 0x10 249*2ca5b659SJoost Mulders #define VR_MODE3_MIIDMY 0x08 250*2ca5b659SJoost Mulders #define VR_MODE3_MIION 0x04 251*2ca5b659SJoost Mulders 252*2ca5b659SJoost Mulders #define VR_PCI_DELAY_TIMER 0x54 253*2ca5b659SJoost Mulders #define VR_FIFOCMD 0x56 254*2ca5b659SJoost Mulders #define VR_FIFOSTA 0x57 255*2ca5b659SJoost Mulders 256*2ca5b659SJoost Mulders /* VIA secrets here */ 257*2ca5b659SJoost Mulders 258*2ca5b659SJoost Mulders /* 259*2ca5b659SJoost Mulders * MII Configuration 260*2ca5b659SJoost Mulders */ 261*2ca5b659SJoost Mulders #define VR_MIIPHYADDR 0x6C 262*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDR0 (1 << 0) 263*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDR1 (1 << 1) 264*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDR2 (1 << 2) 265*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDR3 (1 << 3) 266*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDR4 (1 << 4) 267*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_ADDRBITS (VR_MIIPHYADDR_ADDR0 | \ 268*2ca5b659SJoost Mulders VR_MIIPHYADDR_ADDR1 | \ 269*2ca5b659SJoost Mulders VR_MIIPHYADDR_ADDR2 | \ 270*2ca5b659SJoost Mulders VR_MIIPHYADDR_ADDR3 | \ 271*2ca5b659SJoost Mulders VR_MIIPHYADDR_ADDR4) 272*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_MD_CLOCK_FAST (1 << 5) 273*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_POLLBITS ((1 << 7) | (1 << 6)) 274*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_POLL1024 ((0 << 7) | (0 << 6)) 275*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_POLL512 ((0 << 7) | (1 << 6)) 276*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_POLL128 ((1 << 7) | (0 << 6)) 277*2ca5b659SJoost Mulders #define VR_MIIPHYADDR_POLL64 ((1 << 7) | (1 << 6)) 278*2ca5b659SJoost Mulders 279*2ca5b659SJoost Mulders /* 280*2ca5b659SJoost Mulders * MII status 281*2ca5b659SJoost Mulders */ 282*2ca5b659SJoost Mulders #define VR_MIISR 0x6D 283*2ca5b659SJoost Mulders #define VR_MIISR_SPEED (1 << 0) /* VT6102 and VT6105 */ 284*2ca5b659SJoost Mulders #define VR_MIISR_LINKFAIL (1 << 1) /* VT6102 and VT6105 */ 285*2ca5b659SJoost Mulders #define VR_MIISR_DUPLEX (1 << 2) /* VT6105 only */ 286*2ca5b659SJoost Mulders #define VR_MIISR_PHYERR (1 << 3) /* VT6102 and VT6105 */ 287*2ca5b659SJoost Mulders #define VR_MIISR_PHYOPT (1 << 4) /* VT6102 only */ 288*2ca5b659SJoost Mulders #define VR_MIISR_NWAYLINKOK (1 << 4) /* VT6105 only */ 289*2ca5b659SJoost Mulders #define VR_MIISR_NWAYPAUSE (1 << 5) /* VT6105M */ 290*2ca5b659SJoost Mulders #define VR_MIISR_NWAYASMPAUSE (1 << 6) /* VT6105M */ 291*2ca5b659SJoost Mulders #define VR_MIISR_PHYRST (1 << 7) 292*2ca5b659SJoost Mulders 293*2ca5b659SJoost Mulders /* 294*2ca5b659SJoost Mulders * Bus control 295*2ca5b659SJoost Mulders */ 296*2ca5b659SJoost Mulders #define VR_BCR0 0x6E /* receive */ 297*2ca5b659SJoost Mulders #define VR_BCR0_DMA0 (1 << 0) 298*2ca5b659SJoost Mulders #define VR_BCR0_DMA1 (1 << 1) 299*2ca5b659SJoost Mulders #define VR_BCR0_DMA2 (1 << 2) 300*2ca5b659SJoost Mulders #define VR_BCR0_DMABITS (VR_BCR0_DMA0|VR_BCR0_DMA1 | \ 301*2ca5b659SJoost Mulders VR_BCR0_DMA2) 302*2ca5b659SJoost Mulders #define VR_BCR0_DMA32 (0) 303*2ca5b659SJoost Mulders #define VR_BCR0_DMA64 (VR_BCR0_DMA0) 304*2ca5b659SJoost Mulders #define VR_BCR0_DMA128 (VR_BCR0_DMA1) 305*2ca5b659SJoost Mulders #define VR_BCR0_DMA256 (VR_BCR0_DMA0|VR_BCR0_DMA1) 306*2ca5b659SJoost Mulders #define VR_BCR0_DMA512 (VR_BCR0_DMA2) 307*2ca5b659SJoost Mulders #define VR_BCR0_DMA1024 (VR_BCR0_DMA0|VR_BCR0_DMA2) 308*2ca5b659SJoost Mulders #define VR_BCR0_DMASTFW (VR_BCR0_DMABITS) 309*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_0 (1 << 3) 310*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_1 (1 << 4) 311*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_2 (1 << 5) 312*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_BITS (VR_BCR0_RX_FIFO_THRESHOLD_0 | \ 313*2ca5b659SJoost Mulders VR_BCR0_RX_FIFO_THRESHOLD_1 | \ 314*2ca5b659SJoost Mulders VR_BCR0_RX_FIFO_THRESHOLD_2) 315*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_64 (0) 316*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_32 (VR_BCR0_RX_FIFO_THRESHOLD_0) 317*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_128 (VR_BCR0_RX_FIFO_THRESHOLD_1) 318*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_256 (VR_BCR0_RX_FIFO_THRESHOLD_0 | \ 319*2ca5b659SJoost Mulders VR_BCR0_RX_FIFO_THRESHOLD_1) 320*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_512 (VR_BCR0_RX_FIFO_THRESHOLD_2) 321*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_768 (VR_BCR0_RX_FIFO_THRESHOLD_0 | \ 322*2ca5b659SJoost Mulders VR_BCR0_RX_FIFO_THRESHOLD_2) 323*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_1024 (VR_BCR0_RX_FIFO_THRESHOLD_1 | \ 324*2ca5b659SJoost Mulders VR_BCR0_RX_FIFO_THRESHOLD_2) 325*2ca5b659SJoost Mulders #define VR_BCR0_RX_FIFO_THRESHOLD_STFW (VR_BCR0_RX_FIFO_THRESHOLD_BITS) 326*2ca5b659SJoost Mulders #define VR_BCR0_LEDCR (1 << 6) 327*2ca5b659SJoost Mulders #define VR_BCR0_MSEL (1 << 7) 328*2ca5b659SJoost Mulders 329*2ca5b659SJoost Mulders #define VR_BCR1 0x6F /* transmit */ 330*2ca5b659SJoost Mulders #define VR_BCR1_POLLT_0 (1 << 0) 331*2ca5b659SJoost Mulders #define VR_BCR1_POLLT_1 (1 << 1) 332*2ca5b659SJoost Mulders #define VR_BCR1_POLLT_2 (1 << 2) 333*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_0 (1 << 3) 334*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_1 (1 << 4) 335*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_2 (1 << 5) 336*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_BITS (VR_BCR1_TX_FIFO_THRESHOLD_0 | \ 337*2ca5b659SJoost Mulders VR_BCR1_TX_FIFO_THRESHOLD_1 | \ 338*2ca5b659SJoost Mulders VR_BCR1_TX_FIFO_THRESHOLD_2) 339*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_128 (0) 340*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_256 (VR_BCR1_TX_FIFO_THRESHOLD_0) 341*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_512 (VR_BCR1_TX_FIFO_THRESHOLD_1) 342*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_1024 (VR_BCR1_TX_FIFO_THRESHOLD_0 | \ 343*2ca5b659SJoost Mulders VR_BCR1_FIFO_THRESHOLD_1) 344*2ca5b659SJoost Mulders #define VR_BCR1_TX_FIFO_THRESHOLD_STFW (VR_BCR1_FIFO_THRESHOLD_BITS) 345*2ca5b659SJoost Mulders #define VR_BCR1_TXQPRIO (1 << 6) /* VT6105M */ 346*2ca5b659SJoost Mulders #define VR_BCR1_VLANFILTER (1 << 7) /* VT6105M */ 347*2ca5b659SJoost Mulders 348*2ca5b659SJoost Mulders /* 349*2ca5b659SJoost Mulders * MII Configuration 350*2ca5b659SJoost Mulders */ 351*2ca5b659SJoost Mulders #define VR_MIICMD 0x70 352*2ca5b659SJoost Mulders #define VR_MIICMD_MD_CLOCK (1 << 0) 353*2ca5b659SJoost Mulders #define VR_MIICMD_MD_CLOCK_READ (1 << 1) 354*2ca5b659SJoost Mulders #define VR_MIICMD_MD_CLOCK_WRITE (1 << 2) 355*2ca5b659SJoost Mulders #define VR_MIICMD_MD_OUT (1 << 3) 356*2ca5b659SJoost Mulders #define VR_MIICMD_MD_MODE_AUTO (1 << 4) 357*2ca5b659SJoost Mulders #define VR_MIICMD_MD_WRITE (1 << 5) 358*2ca5b659SJoost Mulders #define VR_MIICMD_MD_READ (1 << 6) 359*2ca5b659SJoost Mulders #define VR_MIICMD_MD_AUTO (1 << 7) 360*2ca5b659SJoost Mulders 361*2ca5b659SJoost Mulders #define VR_MIIADDR 0x71 362*2ca5b659SJoost Mulders #define VR_MIIADDR_MAD0 (1 << 0) 363*2ca5b659SJoost Mulders #define VR_MIIADDR_MAD1 (1 << 1) 364*2ca5b659SJoost Mulders #define VR_MIIADDR_MAD2 (1 << 2) 365*2ca5b659SJoost Mulders #define VR_MIIADDR_MAD3 (1 << 3) 366*2ca5b659SJoost Mulders #define VR_MIIADDR_MAD4 (1 << 4) 367*2ca5b659SJoost Mulders #define VR_MIIADDR_BITS (VR_MIIADDR_MAD0 | \ 368*2ca5b659SJoost Mulders VR_MIIADDR_MAD1 | \ 369*2ca5b659SJoost Mulders VR_MIIADDR_MAD2 | \ 370*2ca5b659SJoost Mulders VR_MIIADDR_MAD3 | \ 371*2ca5b659SJoost Mulders VR_MIIADDR_MAD4) 372*2ca5b659SJoost Mulders #define VR_MIIADDR_MDONE (1 << 5) 373*2ca5b659SJoost Mulders #define VR_MIIADDR_MAUTO (1 << 6) 374*2ca5b659SJoost Mulders #define VR_MIIADDR_MIDLE (1 << 7) 375*2ca5b659SJoost Mulders 376*2ca5b659SJoost Mulders #define VR_MIIDATA 0x72 377*2ca5b659SJoost Mulders #define VR_MIIDATA_1 0x72 378*2ca5b659SJoost Mulders #define VR_MIIDATA_2 0x73 379*2ca5b659SJoost Mulders 380*2ca5b659SJoost Mulders /* 381*2ca5b659SJoost Mulders * EEPROM Config / Status 382*2ca5b659SJoost Mulders */ 383*2ca5b659SJoost Mulders #define VR_PROMCTL 0x74 384*2ca5b659SJoost Mulders #define VR_PROMCTL_DATAOUT (1 << 0) 385*2ca5b659SJoost Mulders #define VR_PROMCTL_DATAIN (1 << 1) 386*2ca5b659SJoost Mulders #define VR_PROMCTL_CLOCK (1 << 2) 387*2ca5b659SJoost Mulders #define VR_PROMCTL_CHIPSELECT (1 << 3) 388*2ca5b659SJoost Mulders #define VR_PROMCTL_DIRPROG (1 << 4) 389*2ca5b659SJoost Mulders #define VR_PROMCTL_RELOAD (1 << 5) 390*2ca5b659SJoost Mulders #define VR_PROMCTL_PROGRAM (1 << 6) 391*2ca5b659SJoost Mulders #define VR_PROMCTL_PRGSTATUS (1 << 7) 392*2ca5b659SJoost Mulders 393*2ca5b659SJoost Mulders /* 394*2ca5b659SJoost Mulders * Chip Configuration A 395*2ca5b659SJoost Mulders */ 396*2ca5b659SJoost Mulders #define VR_CFGA 0x78 397*2ca5b659SJoost Mulders #define VR_CFGA_PRE_ACPI_WAKEUP (1 << 0) /* VT6105M */ 398*2ca5b659SJoost Mulders #define VR_CFGA_WAKEUP_PANIC (1 << 1) /* VT6105M */ 399*2ca5b659SJoost Mulders #define VR_CFGA_VLANTAG_INCRC (1 << 5) /* VT6105M */ 400*2ca5b659SJoost Mulders #define VR_CFGA_MIIOPT (1 << 6) 401*2ca5b659SJoost Mulders #define VR_CFGA_EELOAD (1 << 7) 402*2ca5b659SJoost Mulders 403*2ca5b659SJoost Mulders /* 404*2ca5b659SJoost Mulders * Chip Configuration B 405*2ca5b659SJoost Mulders */ 406*2ca5b659SJoost Mulders #define VR_CFGB 0x79 407*2ca5b659SJoost Mulders #define VR_CFGB_LATENCYTIMER (1 << 0) 408*2ca5b659SJoost Mulders #define VR_CFGB_WWAIT (1 << 1) 409*2ca5b659SJoost Mulders #define VR_CFGB_RWAIT (1 << 2) 410*2ca5b659SJoost Mulders #define VR_CFGB_RXARBIT (1 << 3) 411*2ca5b659SJoost Mulders #define VR_CFGB_TXARBIT (1 << 4) 412*2ca5b659SJoost Mulders #define VR_CFGB_MRLDIS (1 << 5) 413*2ca5b659SJoost Mulders #define VR_CFGB_PERRDIS (1 << 6) 414*2ca5b659SJoost Mulders #define VR_CFGB_QPKTDIS (1 << 7) 415*2ca5b659SJoost Mulders 416*2ca5b659SJoost Mulders /* 417*2ca5b659SJoost Mulders * Chip Configuration C 418*2ca5b659SJoost Mulders */ 419*2ca5b659SJoost Mulders #define VR_CFGC 0x7A 420*2ca5b659SJoost Mulders #define VR_CFGC_BPS0 (1 << 0) 421*2ca5b659SJoost Mulders #define VR_CFGC_BPS1 (1 << 1) 422*2ca5b659SJoost Mulders #define VR_CFGC_BPS2 (1 << 2) 423*2ca5b659SJoost Mulders #define VR_CFGC_BTSEL (1 << 3) 424*2ca5b659SJoost Mulders #define VR_CFGC_DLYEN (1 << 5) 425*2ca5b659SJoost Mulders #define VR_CFGC_BROPT (1 << 6) 426*2ca5b659SJoost Mulders #define VR_CFGC_MED3 (1 << 7) /* VT6102 */ 427*2ca5b659SJoost Mulders 428*2ca5b659SJoost Mulders /* 429*2ca5b659SJoost Mulders * Chip Configuration D 430*2ca5b659SJoost Mulders */ 431*2ca5b659SJoost Mulders #define VR_CFGD 0x7B 432*2ca5b659SJoost Mulders #define VR_CFGD_BAKOPT (1 << 0) 433*2ca5b659SJoost Mulders #define VR_CFGD_MBA (1 << 1) 434*2ca5b659SJoost Mulders #define VR_CFGD_CAP (1 << 2) 435*2ca5b659SJoost Mulders #define VR_CFGD_CRADOM (1 << 3) 436*2ca5b659SJoost Mulders #define VR_CFGD_PMCDIG (1 << 4) 437*2ca5b659SJoost Mulders #define VR_CFGD_MRLEN (1 << 5) 438*2ca5b659SJoost Mulders #define VR_CFGD_TAG_ON_SNAP (1 << 5) /* VT6105M */ 439*2ca5b659SJoost Mulders #define VR_CFGD_DIAG (1 << 6) 440*2ca5b659SJoost Mulders #define VR_CFGD_MMIOEN (1 << 7) 441*2ca5b659SJoost Mulders 442*2ca5b659SJoost Mulders /* 443*2ca5b659SJoost Mulders * Tally counters 444*2ca5b659SJoost Mulders */ 445*2ca5b659SJoost Mulders #define VR_TALLY_MPA 0x7c /* 16 bits */ 446*2ca5b659SJoost Mulders #define VR_TALLY_CRC 0x7e /* 16 bits */ 447*2ca5b659SJoost Mulders 448*2ca5b659SJoost Mulders /* 449*2ca5b659SJoost Mulders * Misceleneous register 0 450*2ca5b659SJoost Mulders */ 451*2ca5b659SJoost Mulders #define VR_MISC0 0x80 452*2ca5b659SJoost Mulders #define VR_MISC0_TIMER0_EN (1 << 0) 453*2ca5b659SJoost Mulders #define VR_MISC0_TIMER0_SUSP (1 << 1) 454*2ca5b659SJoost Mulders #define VR_MISC0_HDXFEN (1 << 2) 455*2ca5b659SJoost Mulders #define VR_MISC0_FDXRFEN (1 << 3) 456*2ca5b659SJoost Mulders #define VR_MISC0_FDXTFEN (1 << 4) 457*2ca5b659SJoost Mulders #define VR_MISC0_TIMER0_USEC_EN (1 << 5) 458*2ca5b659SJoost Mulders 459*2ca5b659SJoost Mulders /* 460*2ca5b659SJoost Mulders * Misceleneous register 1 461*2ca5b659SJoost Mulders */ 462*2ca5b659SJoost Mulders #define VR_MISC1 0x81 463*2ca5b659SJoost Mulders #define VR_MISC1_TIMER1_EN (1 << 0) 464*2ca5b659SJoost Mulders #define VR_MISC1_VAXJMP (1 << 5) 465*2ca5b659SJoost Mulders #define VR_MISC1_RESET (1 << 6) 466*2ca5b659SJoost Mulders 467*2ca5b659SJoost Mulders /* 468*2ca5b659SJoost Mulders * Power management 469*2ca5b659SJoost Mulders */ 470*2ca5b659SJoost Mulders #define VR_PWR 0x83 471*2ca5b659SJoost Mulders #define VR_PWR_DS0 (1 << 0) 472*2ca5b659SJoost Mulders #define VR_PWR_DS1 (1 << 1) 473*2ca5b659SJoost Mulders #define VR_PWR_WOLEN (1 << 2) 474*2ca5b659SJoost Mulders #define VR_PWR_WOLSR (1 << 3) 475*2ca5b659SJoost Mulders #define VR_PWR_LGWOL (1 << 7) 476*2ca5b659SJoost Mulders 477*2ca5b659SJoost Mulders /* 478*2ca5b659SJoost Mulders * Second interrupt register status 479*2ca5b659SJoost Mulders */ 480*2ca5b659SJoost Mulders #define VR_ISR1 0x84 481*2ca5b659SJoost Mulders #define VR_ISR1_TIMER0 (1 << 0) 482*2ca5b659SJoost Mulders #define VR_ISR1_TIMER1 (1 << 1) 483*2ca5b659SJoost Mulders #define VR_ISR1_PHYEVENT (1 << 2) 484*2ca5b659SJoost Mulders #define VR_ISR1_TDERR (1 << 3) 485*2ca5b659SJoost Mulders #define VR_ISR1_SSRCI (1 << 4) 486*2ca5b659SJoost Mulders #define VR_ISR1_UINTR_SET (1 << 5) 487*2ca5b659SJoost Mulders #define VR_ISR1_UINTR_CLR (1 << 6) 488*2ca5b659SJoost Mulders #define VR_ISR1_PWEI (1 << 7) 489*2ca5b659SJoost Mulders 490*2ca5b659SJoost Mulders /* 491*2ca5b659SJoost Mulders * Second interrupt register configuration 492*2ca5b659SJoost Mulders */ 493*2ca5b659SJoost Mulders #define VR_ICR1 0x86 494*2ca5b659SJoost Mulders #define VR_ICR1_TIMER0 VR_ISR1_TIMER0 495*2ca5b659SJoost Mulders #define VR_ICR1_TIMER1 VR_ISR1_TIMER1 496*2ca5b659SJoost Mulders #define VR_ICR1_PHYEVENT VR_ISR1_PHYEVENT 497*2ca5b659SJoost Mulders #define VR_ICR1_TDERR VR_ISR1_TDERR 498*2ca5b659SJoost Mulders #define VR_ICR1_SSRCI VR_ISR1_SSRCI 499*2ca5b659SJoost Mulders #define VR_ICR1_UINTR_SET VR_ISR1_UINTR_SET 500*2ca5b659SJoost Mulders #define VR_ICR1_UINTR_CLR VR_ISR1_UINTR_CLR 501*2ca5b659SJoost Mulders #define VR_ICR1_PWEI VR_ISR1_PWEI 502*2ca5b659SJoost Mulders 503*2ca5b659SJoost Mulders /* 504*2ca5b659SJoost Mulders * Content Addressable Memory (CAM) stuff for the VT6105M 505*2ca5b659SJoost Mulders */ 506*2ca5b659SJoost Mulders #define VR_CAM_MASK 0x88 507*2ca5b659SJoost Mulders 508*2ca5b659SJoost Mulders #define VR_CAM_CTRL 0x92 509*2ca5b659SJoost Mulders #define VR_CAM_CTRL_RD (1 << 3) 510*2ca5b659SJoost Mulders #define VR_CAM_CTRL_WR (1 << 2) 511*2ca5b659SJoost Mulders #define VR_CAM_CTRL_SELECT_VLAN (1 << 1) 512*2ca5b659SJoost Mulders #define VR_CAM_CTRL_ENABLE (1 << 0) 513*2ca5b659SJoost Mulders #define VR_CAM_CTRL_WRITE (VR_CAM_CTRL_ENABLE | VR_CAM_CTRL_WR) 514*2ca5b659SJoost Mulders #define VR_CAM_CTRL_READ (VR_CAM_CTRL_ENABLE | VR_CAM_CTRL_RD) 515*2ca5b659SJoost Mulders #define VR_CAM_CTRL_RW (VR_CAM_CTRL_ENABLE | \ 516*2ca5b659SJoost Mulders VR_CAM_CTRL_RD | VR_CAM_CTRL_WR) 517*2ca5b659SJoost Mulders #define VR_CAM_CTRL_DONE (0) 518*2ca5b659SJoost Mulders 519*2ca5b659SJoost Mulders #define VR_CAM_ADDR 0x93 520*2ca5b659SJoost Mulders 521*2ca5b659SJoost Mulders /* 522*2ca5b659SJoost Mulders * MIB Control register 523*2ca5b659SJoost Mulders */ 524*2ca5b659SJoost Mulders #define VR_MIB_CTRL 0x94 525*2ca5b659SJoost Mulders #define VR_MIB_CTRL_ENABLE (1 << 4) 526*2ca5b659SJoost Mulders #define VR_MIB_CTRL_HDUPLEX (1 << 5) 527*2ca5b659SJoost Mulders #define VR_MIB_CTRL_INCR (1 << 6) 528*2ca5b659SJoost Mulders #define VR_MIB_CTRL_RTN (1 << 7) 529*2ca5b659SJoost Mulders 530*2ca5b659SJoost Mulders /* 531*2ca5b659SJoost Mulders * MIB port 532*2ca5b659SJoost Mulders */ 533*2ca5b659SJoost Mulders #define VR_MIB_PORT 0x96 534*2ca5b659SJoost Mulders 535*2ca5b659SJoost Mulders /* 536*2ca5b659SJoost Mulders * MIB data 537*2ca5b659SJoost Mulders */ 538*2ca5b659SJoost Mulders #define VR_MIB_DATA 0x97 539*2ca5b659SJoost Mulders 540*2ca5b659SJoost Mulders 541*2ca5b659SJoost Mulders /* 542*2ca5b659SJoost Mulders * Power configuration 543*2ca5b659SJoost Mulders */ 544*2ca5b659SJoost Mulders #define VR_PWRCFG 0xA1 /* VT6105LOM */ 545*2ca5b659SJoost Mulders #define VR_PWRCFG_WOLEN (1 << 0) 546*2ca5b659SJoost Mulders #define VR_PWRCFG_WOLSR (1 << 1) 547*2ca5b659SJoost Mulders #define VR_PWRCFG_PHYPOWERDOWN (7 << 1) 548*2ca5b659SJoost Mulders 549*2ca5b659SJoost Mulders /* 550*2ca5b659SJoost Mulders * Flow control, VT6105 and above 551*2ca5b659SJoost Mulders */ 552*2ca5b659SJoost Mulders #define VR_FCR0 0x98 553*2ca5b659SJoost Mulders #define VR_FCR0_RXBUFCOUNT VR_FCR0 554*2ca5b659SJoost Mulders 555*2ca5b659SJoost Mulders #define VR_FCR1 0x99 556*2ca5b659SJoost Mulders #define VR_FCR1_HD_EN (1 << 0) 557*2ca5b659SJoost Mulders #define VR_FCR1_FD_RX_EN (1 << 1) 558*2ca5b659SJoost Mulders #define VR_FCR1_FD_TX_EN (1 << 2) 559*2ca5b659SJoost Mulders #define VR_FCR1_XONXOFF_EN (1 << 3) 560*2ca5b659SJoost Mulders 561*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEOFFBITS ((1 << 5) | (1 << 4)) 562*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEOFF_24 ((0 << 5) | (0 << 4)) 563*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEOFF_32 ((0 << 5) | (1 << 4)) 564*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEOFF_48 ((1 << 5) | (0 << 4)) 565*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEOFF_64 ((1 << 5) | (1 << 4)) 566*2ca5b659SJoost Mulders 567*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEONBITS ((1 << 7) | (1 << 6)) 568*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEON_04 ((0 << 7) | (0 << 6)) 569*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEON_08 ((0 << 7) | (1 << 6)) 570*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEON_16 ((1 << 7) | (0 << 6)) 571*2ca5b659SJoost Mulders #define VR_FCR1_PAUSEON_24 ((1 << 7) | (1 << 6)) 572*2ca5b659SJoost Mulders 573*2ca5b659SJoost Mulders #define VR_FCR2 0x9a 574*2ca5b659SJoost Mulders #define VR_FCR2_PAUSE (VR_FCR2) 575*2ca5b659SJoost Mulders 576*2ca5b659SJoost Mulders #define VR_TIMER0 0x9c 577*2ca5b659SJoost Mulders #define VR_TIMER0_TIMEOUT VR_TIMER0 /* 16 bits */ 578*2ca5b659SJoost Mulders 579*2ca5b659SJoost Mulders #define VR_TIMER1 0x9e 580*2ca5b659SJoost Mulders #define VR_TIMER1_TIMEOUT VR_TIMER1 /* 16 bits */ 581*2ca5b659SJoost Mulders 582*2ca5b659SJoost Mulders #define VR_CRC_PATTERN0 0xb0 /* 32 bits, VT6105M */ 583*2ca5b659SJoost Mulders #define VR_CRC_PATTERN1 0xb4 /* 32 bits, VT6105M */ 584*2ca5b659SJoost Mulders #define VR_CRC_PATTERN2 0xb8 /* 32 bits, VT6105M */ 585*2ca5b659SJoost Mulders #define VR_CRC_PATTERN3 0xbC /* 32 bits, VT6105M */ 586*2ca5b659SJoost Mulders 587*2ca5b659SJoost Mulders /* 588*2ca5b659SJoost Mulders * Receive desctriptor 589*2ca5b659SJoost Mulders */ 590*2ca5b659SJoost Mulders #define VR_RDES0_RXERR (1 << 0) 591*2ca5b659SJoost Mulders #define VR_RDES0_CRCERR (1 << 1) 592*2ca5b659SJoost Mulders #define VR_RDES0_FAE (1 << 2) 593*2ca5b659SJoost Mulders #define VR_RDES0_FOV (1 << 3) 594*2ca5b659SJoost Mulders #define VR_RDES0_LONG (1 << 4) 595*2ca5b659SJoost Mulders #define VR_RDES0_RUNT (1 << 5) 596*2ca5b659SJoost Mulders #define VR_RDES0_SERR (1 << 6) 597*2ca5b659SJoost Mulders #define VR_RDES0_BUFF (1 << 7) 598*2ca5b659SJoost Mulders 599*2ca5b659SJoost Mulders #define VR_RDES0_EDP (1 << 8) 600*2ca5b659SJoost Mulders #define VR_RDES0_STP (1 << 9) 601*2ca5b659SJoost Mulders #define VR_RDES0_CHN (1 << 10) 602*2ca5b659SJoost Mulders #define VR_RDES0_PHY (1 << 11) 603*2ca5b659SJoost Mulders #define VR_RDES0_BAR (1 << 12) 604*2ca5b659SJoost Mulders #define VR_RDES0_MAR (1 << 13) 605*2ca5b659SJoost Mulders #define VR_RDES0_VIDHIT (1 << 14) /* VT6105M or reserved */ 606*2ca5b659SJoost Mulders #define VR_RDES0_RXOK (1 << 15) 607*2ca5b659SJoost Mulders 608*2ca5b659SJoost Mulders #define VR_RDES0_ABN ((1 << 27) | (1 << 28) | (1 << 29) | (1 << 30)) 609*2ca5b659SJoost Mulders #define VR_RDES0_OWN (1U << 31) 610*2ca5b659SJoost Mulders 611*2ca5b659SJoost Mulders /* 612*2ca5b659SJoost Mulders * Transmit descriptor 613*2ca5b659SJoost Mulders */ 614*2ca5b659SJoost Mulders #define VR_TDES0_NCR ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3)) 615*2ca5b659SJoost Mulders #define VR_TDES0_COL (1 << 4) 616*2ca5b659SJoost Mulders #define VR_TDES0_CDH (1 << 7) 617*2ca5b659SJoost Mulders #define VR_TDES0_ABT (1 << 8) 618*2ca5b659SJoost Mulders #define VR_TDES0_OWC (1 << 9) 619*2ca5b659SJoost Mulders #define VR_TDES0_CRS (1 << 10) 620*2ca5b659SJoost Mulders #define VR_TDES0_UDF (1 << 11) 621*2ca5b659SJoost Mulders #define VR_TDES0_TERR (1 << 15) 622*2ca5b659SJoost Mulders /* VLAN stuff is for VT6105M only */ 623*2ca5b659SJoost Mulders #define VR_TDES0_VLANID ((1 << 27) | (1 << 26) | (1 << 25) | (1 << 24) \ 624*2ca5b659SJoost Mulders (1 << 23) | (1 << 22) | (1 << 21) | \ 625*2ca5b659SJoost Mulders (1 << 20) | (1 << 19) | (1 << 18) | \ 626*2ca5b659SJoost Mulders (1 << 17) | (1 << 16)) 627*2ca5b659SJoost Mulders #define VR_TDES0_VLANPRI ((1 << 30) | (1 << 29) | (1 << 28)) 628*2ca5b659SJoost Mulders #define VR_TDES0_OWN (1U << 31) 629*2ca5b659SJoost Mulders 630*2ca5b659SJoost Mulders #define VR_TDES1_LEN ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | \ 631*2ca5b659SJoost Mulders (1 << 4) | (1 << 5) | (1 << 6) | \ 632*2ca5b659SJoost Mulders (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10)) 633*2ca5b659SJoost Mulders 634*2ca5b659SJoost Mulders #define VR_TDES1_CHN (1 << 15) 635*2ca5b659SJoost Mulders #define VR_TDES1_CRC (1 << 16) 636*2ca5b659SJoost Mulders #define VR_TDES1_STP (1 << 21) /* EDP/STP are flipped in DS6105! */ 637*2ca5b659SJoost Mulders #define VR_TDES1_EDP (1 << 22) 638*2ca5b659SJoost Mulders #define VR_TDES1_INTR (1 << 23) 639*2ca5b659SJoost Mulders 640*2ca5b659SJoost Mulders #define VR_TDES3_SUPPRESS_INTR (1 << 0) 641*2ca5b659SJoost Mulders 642*2ca5b659SJoost Mulders #endif /* _VRREG_H */ 643