DEC21143_tulipreg.h

Go to the documentation of this file.
00001 /* ES40 emulator.
00002  * Copyright (C) 2007-2008 by the ES40 Emulator Project
00003  *
00004  * WWW    : http://sourceforge.net/projects/es40
00005  * E-mail : camiel@camicom.com
00006  * 
00007  * This file is based upon NetBsd.
00008  *
00009  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
00010  * All rights reserved.
00011  *
00012  * This code is derived from software contributed to The NetBSD Foundation
00013  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
00014  * NASA Ames Research Center.
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions
00018  * are met:
00019  * 1. Redistributions of source code must retain the above copyright
00020  *    notice, this list of conditions and the following disclaimer.
00021  * 2. Redistributions in binary form must reproduce the above copyright
00022  *    notice, this list of conditions and the following disclaimer in the
00023  *    documentation and/or other materials provided with the distribution.
00024  * 3. All advertising materials mentioning features or use of this software
00025  *    must display the following acknowledgement:
00026  *      This product includes software developed by the NetBSD
00027  *      Foundation, Inc. and its contributors.
00028  * 4. Neither the name of The NetBSD Foundation nor the names of its
00029  *    contributors may be used to endorse or promote products derived
00030  *    from this software without specific prior written permission.
00031  *
00032  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
00033  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00034  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00035  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
00036  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00037  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00038  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00039  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00040  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00041  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00042  * POSSIBILITY OF SUCH DAMAGE.
00043  */
00044 
00063 #ifndef __volatile
00064 #define __volatile
00065 #endif
00066 #ifndef _DEV_IC_TULIPREG_H_
00067 #define _DEV_IC_TULIPREG_H_
00068 
00069 /*
00070  * Register description for the Digital Semiconductor ``Tulip'' (21x4x)
00071  * Ethernet controller family.
00072  */
00073 
00074 /*
00075  * Descriptor Status bits common to transmit and receive.
00076  */
00077 #define TDSTAT_OWN  0x80000000          /* Tulip owns descriptor */
00078 #define TDSTAT_ES   0x00008000          /* Error Summary */
00079 
00080 /*
00081  * Descriptor Status bits for Receive Descriptor.
00082  */
00083 #define TDSTAT_Rx_FF        0x40000000  /* Filtering Fail */
00084 #define TDSTAT_Rx_FL        0x3fff0000  /* Frame Length including CRC */
00085 #define TDSTAT_Rx_DE        0x00004000  /* Descriptor Error */
00086 #define TDSTAT_Rx_DT        0x00003000  /* Data Type */
00087 #define TDSTAT_Rx_RF        0x00000800  /* Runt Frame */
00088 #define TDSTAT_Rx_MF        0x00000400  /* Multicast Frame */
00089 #define TDSTAT_Rx_FS        0x00000200  /* First Descriptor */
00090 #define TDSTAT_Rx_LS        0x00000100  /* Last Descriptor */
00091 #define TDSTAT_Rx_TL        0x00000080  /* Frame Too Long */
00092 #define TDSTAT_Rx_CS        0x00000040  /* Collision Seen */
00093 #define TDSTAT_Rx_RT        0x00000020  /* Frame Type */
00094 #define TDSTAT_Rx_RW        0x00000010  /* Receive Watchdog */
00095 #define TDSTAT_Rx_RE        0x00000008  /* Report on MII Error */
00096 #define TDSTAT_Rx_DB        0x00000004  /* Dribbling Bit */
00097 #define TDSTAT_Rx_CE        0x00000002  /* CRC Error */
00098 #define TDSTAT_Rx_ZER       0x00000001  /* Zero (always 0) */
00099 
00100 #define TDSTAT_Rx_LENGTH(x) (((x) & TDSTAT_Rx_FL) >> 16)
00101 #define TDSTAT_Rx_DT_SR     0x00000000  /* Serial Received Frame */
00102 #define TDSTAT_Rx_DT_IL     0x00001000  /* Internal Loopback Frame */
00103 #define TDSTAT_Rx_DT_EL     0x00002000  /* External Loopback Frame */
00104 #define TDSTAT_Rx_DT_r      0x00003000  /* Reserved */
00105 
00106 /*
00107  * Descriptor Status bits for Transmit Descriptor.
00108  */
00109 #define TDSTAT_Tx_TO            0x00004000  /* Transmit Jabber Timeout */
00110 #define TDSTAT_Tx_LO            0x00000800  /* Loss of Carrier */
00111 #define TDSTAT_Tx_NC            0x00000400  /* No Carrier */
00112 #define TDSTAT_Tx_LC            0x00000200  /* Late Collision */
00113 #define TDSTAT_Tx_EC            0x00000100  /* Excessive Collisions */
00114 #define TDSTAT_Tx_HF            0x00000080  /* Heartbeat Fail */
00115 #define TDSTAT_Tx_CC            0x00000078  /* Collision Count */
00116 #define TDSTAT_Tx_LF            0x00000004  /* Link Fail */
00117 #define TDSTAT_Tx_UF            0x00000002  /* Underflow Error */
00118 #define TDSTAT_Tx_DE            0x00000001  /* Deferred */
00119 
00120 #define TDSTAT_Tx_COLLISIONS(x) (((x) & TDSTAT_Tx_CC) >> 3)
00121 
00122 /*
00123  * Descriptor Control bits common to transmit and receive.
00124  */
00125 #define TDCTL_SIZE1       0x000007ff        /* Size of buffer 1 */
00126 #define TDCTL_SIZE1_SHIFT 0
00127 
00128 #define TDCTL_SIZE2       0x003ff800        /* Size of buffer 2 */
00129 #define TDCTL_SIZE2_SHIFT 11
00130 
00131 #define TDCTL_ER          0x02000000        /* End of Ring */
00132 #define TDCTL_CH          0x01000000        /* Second Address Chained */
00133 
00134 /*
00135  * Descriptor Control bits for Transmit Descriptor.
00136  */
00137 #define TDCTL_Tx_IC   0x80000000            /* Interrupt on Completion */
00138 #define TDCTL_Tx_LS   0x40000000            /* Last Segment */
00139 #define TDCTL_Tx_FS   0x20000000            /* First Segment */
00140 #define TDCTL_Tx_FT1  0x10000000            /* Filtering Type 1 */
00141 #define TDCTL_Tx_SET  0x08000000            /* Setup Packet */
00142 #define TDCTL_Tx_AC   0x04000000            /* Add CRC Disable */
00143 #define TDCTL_Tx_DPD  0x00800000            /* Disabled Padding */
00144 #define TDCTL_Tx_FT0  0x00400000            /* Filtering Type 0 */
00145 
00146 /*
00147  * The Tulip filter is programmed by "transmitting" a Setup Packet
00148  * (indicated by TDCTL_Tx_SET).  The filtering type is indicated
00149  * as follows:
00150  *
00151  *      FT1     FT0     Description
00152  *      ---     ---     -----------
00153  *      0       0       Perfect Filtering: The Tulip interprets the
00154  *                      descriptor buffer as a table of 16 MAC addresses
00155  *                      that the Tulip should receive.
00156  *
00157  *      0       1       Hash Filtering: The Tulip interprets the
00158  *                      descriptor buffer as a 512-bit hash table
00159  *                      plus one perfect address.  If the incoming
00160  *                      address is Multicast, the hash table filters
00161  *                      the address, else the address is filtered by
00162  *                      the perfect address.
00163  *
00164  *      1       0       Inverse Filtering: Like Perfect Filtering, except
00165  *                      the table is addresses that the Tulip does NOT
00166  *                      receive.
00167  *
00168  *      1       1       Hash-only Filtering: Like Hash Filtering, but
00169  *                      physical addresses are matched by the hash table
00170  *                      as well, and not by matching a single perfect
00171  *                      address.
00172  *
00173  * A Setup Packet must always be 192 bytes long.  The Tulip can store
00174  * 16 MAC addresses.  If not all 16 are specified in Perfect Filtering
00175  * or Inverse Filtering mode,  then unused entries should duplicate
00176  * one of the valid entries.
00177  */
00178 #define TDCTL_Tx_FT_PERFECT     0
00179 #define TDCTL_Tx_FT_HASH        TDCTL_Tx_FT0
00180 #define TDCTL_Tx_FT_INVERSE     TDCTL_Tx_FT1
00181 #define TDCTL_Tx_FT_HASHONLY    (TDCTL_Tx_FT1 | TDCTL_Tx_FT0)
00182 #define TULIP_SETUP_PACKET_LEN  192
00183 #define TULIP_MAXADDRS          16
00184 #define TULIP_MCHASHSIZE        512
00185 
00186 /*
00187  * Maximum size of a Tulip Ethernet Address ROM or SROM.
00188  */
00189 #define TULIP_ROM_SIZE(bits)  (2 << (bits))
00190 #define TULIP_MAX_ROM_SIZE    512
00191 
00192 /*
00193  * Format of the standard Tulip SROM information:
00194  *
00195  *      Byte offset     Size    Usage
00196  *      0               18      reserved
00197  *      18              1       SROM Format Version
00198  *      19              1       Chip Count
00199  *      20              6       IEEE Network Address
00200  *      26              1       Chip 0 Device Number
00201  *      27              2       Chip 0 Info Leaf Offset
00202  *      29              1       Chip 1 Device Number
00203  *      30              2       Chip 1 Info Leaf Offset
00204  *      32              1       Chip 2 Device Number
00205  *      33              2       Chip 2 Info Leaf Offset
00206  *      ...             1       Chip n Device Number
00207  *      ...             2       Chip n Info Leaf Offset
00208  *      ...             ...     ...
00209  *      Chip Info Leaf Information
00210  *      ...
00211  *      ...
00212  *      ...
00213  *      126             2       CRC32 checksum
00214  */
00215 #define TULIP_ROM_SROM_FORMAT_VERION        18  /* B */
00216 #define TULIP_ROM_CHIP_COUNT                19  /* B */
00217 #define TULIP_ROM_IEEE_NETWORK_ADDRESS      20
00218 #define TULIP_ROM_CHIPn_DEVICE_NUMBER(n)    (26 + ((n) * 3))  /* B */
00219 #define TULIP_ROM_CHIPn_INFO_LEAF_OFFSET(n) (27 + ((n) * 3))  /* W */
00220 #define TULIP_ROM_CRC32_CHECKSUM            126 /* W */
00221 #define TULIP_ROM_CRC32_CHECKSUM1           94  /* W */
00222 
00223 #define TULIP_ROM_IL_SELECT_CONN_TYPE       0   /* W */
00224 #define TULIP_ROM_IL_MEDIA_COUNT            2   /* B */
00225 #define TULIP_ROM_IL_MEDIAn_BLOCK_BASE      3
00226 
00227 #define SELECT_CONN_TYPE_TP                 0x0000
00228 #define SELECT_CONN_TYPE_BNC                0x0001
00229 #define SELECT_CONN_TYPE_AUI                0x0002
00230 #define SELECT_CONN_TYPE_100TX              0x0003
00231 #define SELECT_CONN_TYPE_100T4              0x0006
00232 #define SELECT_CONN_TYPE_100FX              0x0007
00233 #define SELECT_CONN_TYPE                    MII_10T 0x0009
00234 #define SELECT_CONN_TYPE_MII_100TX          0x000d
00235 #define SELECT_CONN_TYPE_MII_100T4          0x000f
00236 #define SELECT_CONN_TYPE_MII_100FX          0x0010
00237 #define SELECT_CONN_TYPE_TP_AUTONEG         0x0100
00238 #define SELECT_CONN_TYPE_TP_FDX             0x0204
00239 #define SELECT_CONN_TYPE_MII_10T_FDX        0x020a
00240 #define SELECT_CONN_TYPE_100TX_FDX          0x020e
00241 #define SELECT_CONN_TYPE_MII_100TX_FDX      0x0211
00242 #define SELECT_CONN_TYPE_TP_NOLINKPASS      0x0400
00243 #define SELECT_CONN_TYPE_ASENSE             0x0800
00244 #define SELECT_CONN_TYPE_ASENSE_POWERUP     0x8800
00245 #define SELECT_CONN_TYPE_ASENSE_AUTONEG     0x0900
00246 
00247 #define TULIP_ROM_MB_MEDIA_CODE             0x3f
00248 #define TULIP_ROM_MB_MEDIA_TP               0x00
00249 #define TULIP_ROM_MB_MEDIA_BNC              0x01
00250 #define TULIP_ROM_MB_MEDIA_AUI              0x02
00251 #define TULIP_ROM_MB_MEDIA_100TX            0x03
00252 #define TULIP_ROM_MB_MEDIA_TP_FDX           0x04
00253 #define TULIP_ROM_MB_MEDIA_100TX_FDX        0x05
00254 #define TULIP_ROM_MB_MEDIA_100T4            0x06
00255 #define TULIP_ROM_MB_MEDIA_100FX            0x07
00256 #define TULIP_ROM_MB_MEDIA_100FX_FDX        0x08
00257 
00258 #define TULIP_ROM_MB_EXT                    0x40
00259 
00260 #define TULIP_ROM_MB_CSR13                  1   /* W */
00261 #define TULIP_ROM_MB_CSR14                  3   /* W */
00262 #define TULIP_ROM_MB_CSR15                  5   /* W */
00263 
00264 #define TULIP_ROM_MB_SIZE(mc)               (((mc) & TULIP_ROM_MB_EXT) ? 7 : 1)
00265 #define TULIP_ROM_MB_NOINDICATOR            0x8000
00266 #define TULIP_ROM_MB_DEFAULT                0x4000
00267 #define TULIP_ROM_MB_POLARITY               0x0080
00268 #define TULIP_ROM_MB_OPMODE(x)              (((x) & 0x71) << 18)
00269 #define TULIP_ROM_MB_BITPOS(x)              (1 << (((x) & 0x0e) >> 1))
00270 #define TULIP_ROM_MB_21140_GPR              0   /* 21140[A] GPR block */
00271 #define TULIP_ROM_MB_21140_MII              1   /* 21140[A] MII block */
00272 #define TULIP_ROM_MB_21142_SIA              2   /* 2114[23] SIA block */
00273 #define TULIP_ROM_MB_21142_MII              3   /* 2114[23] MII block */
00274 #define TULIP_ROM_MB_21143_SYM              4   /* 21143 SYM block */
00275 #define TULIP_ROM_MB_21143_RESET            5   /* 21143 reset block */
00276 
00277 #define TULIP_ROM_GETW(data, off) \
00278     ((uint32_t) (data)[(off)] | (uint32_t) ((data)[(off) + 1]) << 8)
00279 
00280 /*
00281  * Tulip control registers.
00282  */
00283 #define TULIP_CSR0            0x00
00284 #define TULIP_CSR1            0x08
00285 #define TULIP_CSR2            0x10
00286 #define TULIP_CSR3            0x18
00287 #define TULIP_CSR4            0x20
00288 #define TULIP_CSR5            0x28
00289 #define TULIP_CSR6            0x30
00290 #define TULIP_CSR7            0x38
00291 #define TULIP_CSR8            0x40
00292 #define TULIP_CSR9            0x48
00293 #define TULIP_CSR10           0x50
00294 #define TULIP_CSR11           0x58
00295 #define TULIP_CSR12           0x60
00296 #define TULIP_CSR13           0x68
00297 #define TULIP_CSR14           0x70
00298 #define TULIP_CSR15           0x78
00299 #define TULIP_CSR16           0x80
00300 #define TULIP_CSR17           0x88
00301 #define TULIP_CSR18           0x90
00302 #define TULIP_CSR19           0x98
00303 #define TULIP_CSR20           0xa0
00304 #define TULIP_CSR21           0xa8
00305 #define TULIP_CSR22           0xb0
00306 #define TULIP_CSR23           0xb8
00307 #define TULIP_CSR24           0xc0
00308 #define TULIP_CSR25           0xc8
00309 #define TULIP_CSR26           0xd0
00310 #define TULIP_CSR27           0xd8
00311 #define TULIP_CSR28           0xe0
00312 #define TULIP_CSR29           0xe8
00313 #define TULIP_CSR30           0xf0
00314 #define TULIP_CSR31           0xf8
00315 
00316 #define TULIP_CSR_INDEX(csr)  ((csr) >> 3)
00317 
00318 /* CSR0 - Bus Mode */
00319 #define CSR_BUSMODE TULIP_CSR0
00320 #define BUSMODE_SWR 0x00000001            /* software reset */
00321 #define BUSMODE_BAR 0x00000002            /* bus arbitration */
00322 #define BUSMODE_DSL 0x0000007c            /* descriptor skip length */
00323 #define BUSMODE_BLE 0x00000080            /* big endian */
00324 
00325 /* programmable burst length */
00326 #define BUSMODE_PBL_DEFAULT 0x00000000    /*     default value */
00327 #define BUSMODE_PBL_1LW     0x00000100    /*     1 longword */
00328 #define BUSMODE_PBL_2LW     0x00000200    /*     2 longwords */
00329 #define BUSMODE_PBL_4LW     0x00000400    /*     4 longwords */
00330 #define BUSMODE_PBL_8LW     0x00000800    /*     8 longwords */
00331 #define BUSMODE_PBL_16LW    0x00001000    /*    16 longwords */
00332 #define BUSMODE_PBL_32LW    0x00002000    /*    32 longwords */
00333 
00334 /* cache alignment */
00335 #define BUSMODE_CAL_NONE  0x00000000      /*     no alignment */
00336 #define BUSMODE_CAL_8LW   0x00004000      /*     8 longwords */
00337 #define BUSMODE_CAL_16LW  0x00008000      /*    16 longwords */
00338 #define BUSMODE_CAL_32LW  0x0000c000      /*    32 longwords */
00339 #define BUSMODE_DAS       0x00010000      /* diagnostic address space */
00340 
00341 /*   must be zero on most */
00342 
00343 /* transmit auto-poll */
00344 #define BUSMODE_TAP_NONE    0x00000000    /*     no auto-polling */
00345 #define BUSMODE_TAP_200us   0x00020000    /*   200 uS */
00346 #define BUSMODE_TAP_800us   0x00040000    /*   400 uS */
00347 #define BUSMODE_TAP_1_6ms   0x00060000    /*   1.6 mS */
00348 #define BUSMODE_TAP_12_8us  0x00080000    /*  12.8 uS (21041+) */
00349 #define BUSMODE_TAP_25_6us  0x000a0000    /*  25.6 uS (21041+) */
00350 #define BUSMODE_TAP_51_2us  0x000c0000    /*  51.2 uS (21041+) */
00351 #define BUSMODE_TAP_102_4us 0x000e0000    /* 102.4 uS (21041+) */
00352 #define BUSMODE_DBO         0x00100000    /* desc-only b/e (21041+) */
00353 #define BUSMODE_RME         0x00200000    /* rd/mult enab (21140+) */
00354 #define BUSMODE_RLE         0x00800000    /* rd/line enab (21140+) */
00355 #define BUSMODE_WLE         0x01000000    /* wt/line enab (21140+) */
00356 
00357 /* CSR1 - Transmit Poll Demand */
00358 #define CSR_TXPOLL  TULIP_CSR1
00359 #define TXPOLL_TPD  0x00000001            /* transmit poll demand */
00360 
00361 /* CSR2 - Receive Poll Demand */
00362 #define CSR_RXPOLL  TULIP_CSR2
00363 #define RXPOLL_RPD  0x00000001            /* receive poll demand */
00364 
00365 /* CSR3 - Receive List Base Address */
00366 #define CSR_RXLIST  TULIP_CSR3
00367 
00368 /* CSR4 - Transmit List Base Address */
00369 #define CSR_TXLIST  TULIP_CSR4
00370 
00371 /* CSR5 - Status */
00372 #define CSR_STATUS          TULIP_CSR5
00373 #define STATUS_TI           0x00000001    /* transmit interrupt */
00374 #define STATUS_TPS          0x00000002    /* transmit process stopped */
00375 #define STATUS_TU           0x00000004    /* transmit buffer unavail */
00376 #define STATUS_TJT          0x00000008    /* transmit jabber timeout */
00377 #define STATUS_LNPANC       0x00000010    /* link pass (21041) */
00378 #define STATUS_UNF          0x00000020    /* transmit underflow */
00379 #define STATUS_RI           0x00000040    /* receive interrupt */
00380 #define STATUS_RU           0x00000080    /* receive buffer unavail */
00381 #define STATUS_RPS          0x00000100    /* receive process stopped */
00382 #define STATUS_RWT          0x00000200    /* receive watchdog timeout */
00383 #define STATUS_AT           0x00000400    /* SIA AUI/TP pin changed
00384                                                    (21040) */
00385 #define STATUS_ETI          0x00000400    /* early transmit interrupt
00386                                                    (21142) */
00387 #define STATUS_FD           0x00000800    /* full duplex short frame
00388                                                    received (21040) */
00389 #define STATUS_TM           0x00000800    /* timer expired (21041) */
00390 #define STATUS_LNF          0x00001000    /* link fail (21040) */
00391 #define STATUS_SE           0x00002000    /* system error */
00392 #define STATUS_ER           0x00004000    /* early receive (21041) */
00393 #define STATUS_AIS          0x00008000    /* abnormal interrupt summary */
00394 #define STATUS_NIS          0x00010000    /* normal interrupt summary */
00395 #define STATUS_RS           0x000e0000    /* receive process state */
00396 #define STATUS_RS_STOPPED   0x00000000    /* Stopped */
00397 #define STATUS_RS_FETCH     0x00020000    /* Running - fetch receive
00398                                                    descriptor */
00399 #define STATUS_RS_CHECK     0x00040000    /* Running - check for end
00400                                                    of receive */
00401 #define STATUS_RS_WAIT      0x00060000    /* Running - wait for packet */
00402 #define STATUS_RS_SUSPENDED 0x00080000    /* Suspended */
00403 #define STATUS_RS_CLOSE     0x000a0000    /* Running - close receive
00404                                                    descriptor */
00405 #define STATUS_RS_FLUSH     0x000c0000    /* Running - flush current
00406                                                    frame from FIFO */
00407 #define STATUS_RS_QUEUE     0x000e0000    /* Running - queue current
00408                                                    frame from FIFO into
00409                                                    buffer */
00410 #define STATUS_TS           0x00700000    /* transmit process state */
00411 #define STATUS_TS_STOPPED   0x00000000    /* Stopped */
00412 #define STATUS_TS_FETCH     0x00100000    /* Running - fetch transmit
00413                                                    descriptor */
00414 #define STATUS_TS_WAIT      0x00200000    /* Running - wait for end
00415                                                    of transmission */
00416 #define STATUS_TS_READING   0x00300000    /* Running - read buffer from
00417                                                    memory and queue into
00418                                                    FIFO */
00419 #define STATUS_TS_RESERVED  0x00400000    /* RESERVED */
00420 #define STATUS_TS_SETUP     0x00500000    /* Running - Setup packet */
00421 #define STATUS_TS_SUSPENDED 0x00600000    /* Suspended */
00422 #define STATUS_TS_CLOSE     0x00700000    /* Running - close transmit descriptor */
00423 #define STATUS_EB           0x03800000    /* error bits */
00424 #define STATUS_EB_PARITY    0x00000000    /* parity errror */
00425 #define STATUS_EB_MABT      0x00800000    /* master abort */
00426 #define STATUS_EB_TABT      0x01000000    /* target abort */
00427 #define STATUS_GPPI         0x04000000    /* GPIO interrupt (21142) */
00428 #define STATUS_LC           0x08000000    /* 100baseTX link change (21142) */
00429 #define STATUS_X3201_PMEIS  0x10000000    /* power management event interrupt summary */
00430 #define STATUS_X3201_SFIS   0x80000000    /* second function (Modem) interrupt status */
00431 
00432 /* CSR6 - Operation Mode */
00433 #define CSR_OPMODE        TULIP_CSR6
00434 #define OPMODE_HP         0x00000001      /* hash/perfect mode (ro) */
00435 #define OPMODE_SR         0x00000002      /* start receive */
00436 #define OPMODE_HO         0x00000004      /* hash only mode (ro) */
00437 #define OPMODE_PB         0x00000008      /* pass bad frames */
00438 #define OPMODE_IF         0x00000010      /* inverse filter mode (ro) */
00439 #define OPMODE_SB         0x00000020      /* start backoff counter */
00440 #define OPMODE_PR         0x00000040      /* promiscuous mode */
00441 #define OPMODE_PM         0x00000080      /* pass all multicast */
00442 #define OPMODE_FKD        0x00000100      /* flaky oscillator disable */
00443 #define OPMODE_FD         0x00000200      /* full-duplex mode */
00444 #define OPMODE_OM         0x00000c00      /* operating mode */
00445 #define OPMODE_OM_NORMAL  0x00000000      /*     normal mode */
00446 #define OPMODE_OM_INTLOOP 0x00000400      /*     internal loopback */
00447 #define OPMODE_OM_EXTLOOP 0x00000800      /*     external loopback */
00448 #define OPMODE_FC         0x00001000      /* force collision */
00449 #define OPMODE_ST         0x00002000      /* start transmitter */
00450 #define OPMODE_TR         0x0000c000      /* threshold control */
00451 #define OPMODE_TR_72      0x00000000      /*     72 bytes */
00452 #define OPMODE_TR_96      0x00004000      /*     96 bytes */
00453 #define OPMODE_TR_128     0x00008000      /*    128 bytes */
00454 #define OPMODE_TR_160     0x0000c000      /*    160 bytes */
00455 #define OPMODE_BP         0x00010000      /* backpressure enable */
00456 #define OPMODE_CA         0x00020000      /* capture effect enable */
00457 #define OPMODE_PS         0x00040000      /* port select: 1 = MII/SYM, 0 = SRL (21140) */
00458 #define OPMODE_HBD        0x00080000      /* heartbeat disable: set in MII/SYM 100mbps, set according to PHY in MII 10mbps mode (21140) */
00459 #define OPMODE_SF         0x00200000      /* store and forward mode (21140) */
00460 #define OPMODE_TTM        0x00400000      /* Transmit Threshold Mode: 1 = 10mbps, 0 = 100mbps (21140) */
00461 #define OPMODE_PCS        0x00800000      /* PCS function (21140) */
00462 #define OPMODE_SCR        0x01000000      /* scrambler mode (21140) */
00463 #define OPMODE_MBO        0x02000000      /* must be one (21140) */
00464 #define OPMODE_IDAMSB     0x04000000      /* ignore dest addr MSB (21142) */
00465 #define OPMODE_RA         0x40000000      /* receive all (21140) */
00466 #define OPMODE_SC         0x80000000      /* special capture effect enable (21041+) */
00467 
00468 /* Shorthand for media-related OPMODE bits */
00469 #define OPMODE_MEDIA_BITS (OPMODE_FD | OPMODE_PS | OPMODE_TTM | OPMODE_PCS | OPMODE_SCR)
00470 
00471 /* CSR7 - Interrupt Enable */
00472 #define CSR_INTEN TULIP_CSR7
00473 
00474 /* See bits for CSR5 -- Status */
00475 
00476 /* CSR8 - Missed Frames */
00477 #define CSR_MISSED        TULIP_CSR8
00478 #define MISSED_MFC        0x0000ffff      /* missed packet count */
00479 #define MISSED_MFO        0x00010000      /* missed packet count
00480                                                    overflowed */
00481 #define MISSED_FOC        0x0ffe0000      /* fifo overflow counter
00482                                                    (21140) */
00483 #define MISSED_OCO        0x10000000      /* overflow counter overflowed
00484                                                    (21140) */
00485 
00486 #define MISSED_GETMFC(x)  ((x) & MISSED_MFC)
00487 #define MISSED_GETFOC(x)  (((x) & MISSED_FOC) >> 17)
00488 
00489 /* CSR9 - MII, SROM, Boot ROM, Ethernet Address ROM register. */
00490 #define CSR_MIIROM    TULIP_CSR9
00491 #define MIIROM_DATA   0x000000ff          /* byte of data to/from Boot ROM (21041+) */
00492 #define MIIROM_SROMCS 0x00000001          /* SROM chip select */
00493 #define MIIROM_SROMSK 0x00000002          /* SROM clock */
00494 #define MIIROM_SROMDI 0x00000004          /* SROM data in (to) */
00495 #define MIIROM_SROMDO 0x00000008          /* SROM data out (from) */
00496 #define MIIROM_REG    0x00000400          /* external register select */
00497 #define MIIROM_SR     0x00000800          /* SROM select */
00498 #define MIIROM_BR     0x00001000          /* boot ROM select */
00499 #define MIIROM_WR     0x00002000          /* write to boot ROM */
00500 #define MIIROM_RD     0x00004000          /* read from boot ROM */
00501 #define MIIROM_MOD    0x00008000          /* mode select (ro) (21041) */
00502 #define MIIROM_MDC    0x00010000          /* MII clock */
00503 #define MIIROM_MDO    0x00020000          /* MII data out */
00504 #define MIIROM_MIIDIR 0x00040000          /* MII direction mode
00505                                                    1 = PHY in read,
00506                                                    0 = PHY in write */
00507 #define MIIROM_MDI    0x00080000          /* MII data in */
00508 #define MIIROM_DN     0x80000000          /* data not valid (21040) */
00509 
00510 /* SROM opcodes */
00511 #define TULIP_SROM_OPC_ERASE  0x04
00512 #define TULIP_SROM_OPC_WRITE  0x05
00513 #define TULIP_SROM_OPC_READ   0x06
00514 
00515 /* CSR10 - Boot ROM address register (21041+). */
00516 #define CSR_ROMADDR   TULIP_CSR10
00517 #define ROMADDR_MASK  0x000003ff          /* boot rom address */
00518 
00519 /* CSR11 - General Purpose Timer (21041+). */
00520 #define CSR_GPT   TULIP_CSR11
00521 #define GPT_VALUE 0x0000ffff              /* timer value */
00522 #define GPT_CON   0x00010000              /* continuous mode */
00523 
00524 /* 21143-PD and 21143-TD Interrupt Mitigation bits */
00525 #define GPT_NRX   0x000e0000              /* number of Rx packets */
00526 #define GPT_RXT   0x00f00000              /* Rx timer */
00527 #define GPT_NTX   0x07000000              /* number of Tx packets */
00528 #define GPT_TXT   0x78000000              /* Tx timer */
00529 #define GPT_CYCLE 0x80000000              /* cycle size */
00530 
00531 /* CSR12 - SIA Status Register. */
00532 #define CSR_SIASTAT           TULIP_CSR12
00533 #define SIASTAT_PAUI          0x00000001  /* pin AUI/TP indication (21040) */
00534 #define SIASTAT_MRA           0x00000001  /* MII receive activity (21142) */
00535 #define SIASTAT_NCR           0x00000002  /* network connection error */
00536 #define SIASTAT_LS100         0x00000002  /* 100baseT link status 0 == pass (21142) */
00537 #define SIASTAT_LKF           0x00000004  /* link fail status */
00538 #define SIASTAT_LS10          0x00000004  /* 10baseT link status 0 == pass (21142) */
00539 #define SIASTAT_APS           0x00000008  /* auto polarity status */
00540 #define SIASTAT_DSD           0x00000010  /* PLL self test done */
00541 #define SIASTAT_DSP           0x00000020  /* PLL self test pass */
00542 #define SIASTAT_DAZ           0x00000040  /* PLL all zero */
00543 #define SIASTAT_DAO           0x00000080  /* PLL all one */
00544 #define SIASTAT_SRA           0x00000100  /* selected port receive activity (21041) */
00545 #define SIASTAT_ARA           0x00000100  /* AUI receive activity (21142) */
00546 #define SIASTAT_NRA           0x00000200  /* non-selected port receive activity (21041) */
00547 #define SIASTAT_TRA           0x00000200  /* 10base-T receive activity (21142) */
00548 #define SIASTAT_NSN           0x00000400  /* non-stable NLPs detected (21041) */
00549 #define SIASTAT_TRF           0x00000800  /* transmit remote fault (21041) */
00550 #define SIASTAT_ANS           0x00007000  /* autonegotiation state (21041) */
00551 #define SIASTAT_ANS_DIS       0x00000000  /*     disabled */
00552 #define SIASTAT_ANS_TXDIS     0x00001000  /*     transmit disabled */
00553 #define SIASTAT_ANS_START     0x00001000  /*     (MX98715AEC) */
00554 #define SIASTAT_ANS_ABD       0x00002000  /*     ability detect */
00555 #define SIASTAT_ANS_ACKD      0x00003000  /*     acknowledge detect */
00556 #define SIASTAT_ANS_ACKC      0x00004000  /*     complete acknowledge */
00557 #define SIASTAT_ANS_FLPGOOD   0x00005000  /*     FLP link good */
00558 #define SIASTAT_ANS_LINKCHECK 0x00006000  /*     link check */
00559 #define SIASTAT_LPN           0x00008000  /* link partner negotiable (21041) */
00560 #define SIASTAT_LPC           0xffff0000  /* link partner code word */
00561 #define SIASTAT_GETLPC(x)     (((x) & SIASTAT_LPC) >> 16)
00562 
00563 /* CSR13 - SIA Connectivity Register. */
00564 #define CSR_SIACONN     TULIP_CSR13
00565 #define SIACONN_SRL     0x00000001        /* SIA reset (0 == reset) */
00566 #define SIACONN_PS      0x00000002        /* pin AUI/TP selection (21040) */
00567 #define SIACONN_CAC     0x00000004        /* CSR autoconfiguration */
00568 #define SIACONN_AUI     0x00000008        /* select AUI (0 = TP) */
00569 #define SIACONN_EDP     0x00000010        /* SIA PLL external input enable (21040) */
00570 #define SIACONN_ENI     0x00000020        /* encoder input multiplexer (21040) */
00571 #define SIACONN_SIM     0x00000040        /* serial interface input multiplexer (21040) */
00572 #define SIACONN_ASE     0x00000080        /* APLL start enable (21040) */
00573 #define SIACONN_SEL     0x00000f00        /* external port output multiplexer select (21040) */
00574 #define SIACONN_IE      0x00001000        /* input enable (21040) */
00575 #define SIACONN_OE1_3   0x00002000        /* output enable 1, 3 (21040) */
00576 #define SIACONN_OE2_4   0x00004000        /* output enable 2, 4 (21040) */
00577 #define SIACONN_OE5_6_7 0x00008000        /* output enable 5, 6, 7 (21040) */
00578 #define SIACONN_SDM     0x0000ef00        /* SIA diagnostic mode; always set to this value for normal operation (21041) */
00579 
00580 /* CSR14 - SIA Transmit Receive Register. */
00581 #define CSR_SIATXRX           TULIP_CSR14
00582 #define SIATXRX_ECEN          0x00000001  /* encoder enable */
00583 #define SIATXRX_LBK           0x00000002  /* loopback enable */
00584 #define SIATXRX_DREN          0x00000004  /* driver enable */
00585 #define SIATXRX_LSE           0x00000008  /* link pulse send enable */
00586 #define SIATXRX_CPEN          0x00000030  /* compensation enable */
00587 #define SIATXRX_CPEN_DIS0     0x00000000  /*     disabled */
00588 #define SIATXRX_CPEN_DIS1     0x00000010  /*     disabled */
00589 #define SIATXRX_CPEN_HIGHPWR  0x00000020  /*     high power */
00590 #define SIATXRX_CPEN_NORMAL   0x00000030  /*     normal */
00591 #define SIATXRX_MBO           0x00000040  /* must be one (21041 pass 2) */
00592 #define SIATXRX_TH            0x00000040  /* 10baseT HDX enable (21142) */
00593 #define SIATXRX_ANE           0x00000080  /* autonegotiation enable (21041/21142) */
00594 #define SIATXRX_RSQ           0x00000100  /* receive squelch enable */
00595 #define SIATXRX_CSQ           0x00000200  /* collision squelch enable */
00596 #define SIATXRX_CLD           0x00000400  /* collision detect enable */
00597 #define SIATXRX_SQE           0x00000800  /* signal quality generation enable */
00598 #define SIATXRX_LTE           0x00001000  /* link test enable */
00599 #define SIATXRX_APE           0x00002000  /* auto-polarity enable */
00600 #define SIATXRX_SPP           0x00004000  /* set polarity plus */
00601 #define SIATXRX_TAS           0x00008000  /* 10base-T/AUI autosensing enable (21041/21142) */
00602 #define SIATXRX_THX           0x00010000  /* 100baseTX-HDX (21142) */
00603 #define SIATXRX_TXF           0x00020000  /* 100baseTX-FDX (21142) */
00604 #define SIATXRX_T4            0x00040000  /* 100baseT4 (21142) */
00605 
00606 /* CSR15 - SIA General Register. */
00607 #define CSR_SIAGEN  TULIP_CSR15
00608 #define SIAGEN_JBD  0x00000001            /* jabber disable */
00609 #define SIAGEN_HUJ  0x00000002            /* host unjab */
00610 #define SIAGEN_JCK  0x00000004            /* jabber clock */
00611 #define SIAGEN_ABM  0x00000008            /* BNC select (21041) */
00612 #define SIAGEN_RWD  0x00000010            /* receive watchdog disable */
00613 #define SIAGEN_RWR  0x00000020            /* receive watchdog release */
00614 #define SIAGEN_LE1  0x00000040            /* LED 1 enable (21041) */
00615 #define SIAGEN_LV1  0x00000080            /* LED 1 value (21041) */
00616 #define SIAGEN_TSCK 0x00000100            /* test clock */
00617 #define SIAGEN_FUSQ 0x00000200            /* force unsquelch */
00618 #define SIAGEN_FLF  0x00000400            /* force link fail */
00619 #define SIAGEN_LSD  0x00000800            /* LED stretch disable (21041) */
00620 #define SIAGEN_LEE  0x00000800            /* Link extend enable (21142) */
00621 #define SIAGEN_DPST 0x00001000            /* PLL self-test start */
00622 #define SIAGEN_FRL  0x00002000            /* force receiver low */
00623 #define SIAGEN_LE2  0x00004000            /* LED 2 enable (21041) */
00624 #define SIAGEN_RMP  0x00004000            /* received magic packet (21143) */
00625 #define SIAGEN_LV2  0x00008000            /* LED 2 value (21041) */
00626 #define SIAGEN_HCKR 0x00008000            /* hacker (21143) */
00627 #define SIAGEN_MD   0x000f0000            /* general purpose mode/data */
00628 #define SIAGEN_LGS0 0x00100000            /* LED/GEP 0 select */
00629 #define SIAGEN_LGS1 0x00200000            /* LED/GEP 1 select */
00630 #define SIAGEN_LGS2 0x00400000            /* LED/GEP 2 select */
00631 #define SIAGEN_LGS3 0x00800000            /* LED/GEP 3 select */
00632 #define SIAGEN_GEI0 0x01000000            /* GEP pin 0 intr enable */
00633 #define SIAGEN_GEI1 0x02000000            /* GEP pin 1 intr enable */
00634 #define SIAGEN_RME  0x04000000            /* receive match enable */
00635 #define SIAGEN_CWE  0x08000000            /* control write enable */
00636 #define SIAGEN_GI0  0x10000000            /* GEP pin 0 interrupt */
00637 #define SIAGEN_GI1  0x20000000            /* GEP pin 1 interrupt */
00638 #define SIAGEN_RMI  0x40000000            /* receive match interrupt */
00639 
00640 /* CSR12 - General Purpose Port (21140+). */
00641 #define CSR_GPP TULIP_CSR12
00642 #define GPP_MD  0x000000ff  /* general purpose mode/data */
00643 #define GPP_GPC 0x00000100  /* general purpose control */
00644 
00645 /*
00646  * Digital Semiconductor 21142/21143 registers.
00647  */
00648 
00649 /* SIA configuration for 10baseT (from the 21143 manual) */
00650 #define SIACONN_21142_10BASET 0x00000001
00651 #define SIATXRX_21142_10BASET 0x00007f3f
00652 #define SIAGEN_21142_10BASET  0x00000008
00653 
00654 /* SIA configuration for 10baseT full-duplex (from the 21143 manual) */
00655 #define SIACONN_21142_10BASET_FDX 0x00000001
00656 #define SIATXRX_21142_10BASET_FDX 0x00007f3d
00657 #define SIAGEN_21142_10BASET_FDX  0x00000008
00658 
00659 /* SIA configuration for 10base5 (from the 21143 manual) */
00660 #define SIACONN_21142_AUI 0x00000009
00661 #define SIATXRX_21142_AUI 0x00004705
00662 #define SIAGEN_21142_AUI  0x0000000e
00663 
00664 /* SIA configuration for 10base2 (from the 21143 manual) */
00665 #define SIACONN_21142_BNC 0x00000009
00666 #define SIATXRX_21142_BNC 0x00004705
00667 #define SIAGEN_21142_BNC  0x00000006
00668 #endif /* _DEV_IC_TULIPREG_H_ */

SourceForge.net Logo
Project space on SourceForge.net