Home | History | Annotate | Line # | Download | only in ic
      1  1.10   martin /*	$NetBSD: i82595reg.h,v 1.10 2008/04/28 20:23:50 martin Exp $	*/
      2   1.1       is 
      3   1.3       is /*-
      4   1.4       is  * Copyright (c) 1996 The NetBSD Foundation, Inc.
      5   1.1       is  * All rights reserved.
      6   1.1       is  *
      7   1.3       is  * This code is derived from software contributed to The NetBSD Foundation
      8   1.3       is  * by Ignatios Souvatzis.
      9   1.3       is  *
     10   1.1       is  * Redistribution and use in source and binary forms, with or without
     11   1.1       is  * modification, are permitted provided that the following conditions
     12   1.1       is  * are met:
     13   1.1       is  * 1. Redistributions of source code must retain the above copyright
     14   1.1       is  *    notice, this list of conditions and the following disclaimer.
     15   1.1       is  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1       is  *    notice, this list of conditions and the following disclaimer in the
     17   1.1       is  *    documentation and/or other materials provided with the distribution.
     18   1.1       is  *
     19   1.3       is  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.3       is  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.3       is  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.3       is  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.3       is  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.3       is  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.3       is  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.3       is  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.3       is  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.3       is  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.3       is  * POSSIBILITY OF SUCH DAMAGE.
     30   1.1       is  */
     31   1.1       is 
     32   1.1       is /*
     33   1.1       is  * Intel 82595 Ethernet chip register, bit, and structure definitions.
     34   1.1       is  *
     35   1.7    perry  * Written by is with reference to Intel's i82595FX data sheet, with some
     36   1.1       is  * clarification coming from looking at the Clarkson Packet Driver code for this
     37   1.1       is  * chip written by Russ Nelson and others;
     38   1.1       is  *
     39   1.1       is  * and
     40   1.1       is  *
     41   1.1       is  * configuration EEPROM layout. Written with reference to Intels
     42   1.1       is  * public "LAN595 Hardware and Software Specifications" document.
     43   1.1       is  */
     44   1.1       is 
     45   1.1       is /* registers */
     46   1.1       is 
     47   1.1       is /* bank0 */
     48   1.1       is 
     49   1.1       is #define COMMAND_REG 0	/* available in any bank */
     50   1.1       is 
     51   1.1       is #define		MC_SETUP_CMD	0x03
     52   1.1       is #define		XMT_CMD		0x04
     53   1.1       is #define		TDR_CMD		0x05
     54   1.1       is #define		DUMP_CMD	0x06
     55   1.1       is #define		DIAG_CMD	0x07
     56   1.1       is #define		RCV_ENABLE_CMD	0x08
     57   1.1       is #define		RCV_DISABLE_CMD	0x0a
     58   1.1       is #define		RCV_STOP_CMD	0x0b
     59   1.1       is #define		RESET_CMD	0x0e
     60   1.1       is #define		TRISTATE_CMD	0x16
     61   1.1       is #define		NO_TRISTATE_CMD	0x17
     62   1.1       is #define		POWER_DOWN_CMD	0x18
     63   1.1       is #define		SLEEP_MODE_CMD	0x19
     64   1.1       is #define		NEGOTIATE_CMD	0x1a
     65   1.1       is #define		RESUME_XMT_CMD	0x1c
     66   1.1       is #define		SEL_RESET_CMD	0x1e
     67   1.1       is #define		BANK_SEL(n)	(n<<6)	/* 0, 1, 2 */
     68   1.1       is 
     69   1.1       is #define STATUS_REG 1
     70   1.1       is 
     71   1.1       is #define		RX_STP_INT	0x01
     72   1.1       is #define		RX_INT		0x02
     73   1.1       is #define		TX_INT		0x04
     74   1.1       is #define		EXEC_INT	0x08
     75   1.1       is #define		EXEC_STATUS	0x30
     76   1.1       is 
     77   1.1       is #define ID_REG 2
     78   1.1       is 
     79   1.1       is #define		ID_REG_MASK	0x2c
     80   1.1       is #define		ID_REG_SIG	0x24
     81   1.1       is #define		R_ROBIN_BITS	0xc0
     82   1.1       is #define		R_ROBIN_SHIFT	6
     83   1.1       is #define		AUTO_ENABLE	0x10
     84   1.1       is 
     85   1.1       is #define INT_MASK_REG 3
     86   1.1       is 
     87   1.1       is #define		RX_STOP_BIT	0x01
     88   1.1       is #define		RX_BIT		0x02
     89   1.1       is #define		TX_BIT		0x04
     90   1.1       is #define		EXEC_BIT	0x08
     91   1.1       is #define		ALL_INTS	0x0f
     92   1.1       is 
     93   1.1       is #define RCV_START_LOW 4
     94   1.1       is #define RCV_START_HIGH 5
     95   1.1       is 
     96   1.1       is #define RCV_STOP_LOW 6
     97   1.1       is #define RCV_STOP_HIGH 7
     98   1.1       is 
     99   1.5       is #define RCV_COPY_THRESHOLD 8	/* byte */
    100   1.5       is 
    101   1.1       is #define XMT_ADDR_REG 0x0a
    102   1.1       is #define HOST_ADDR_REG 0x0c
    103   1.1       is #define MEM_PORT_REG 0x0e
    104   1.1       is 
    105   1.1       is /* -------------------- bank1 -------------------- */
    106   1.1       is 
    107   1.1       is #define REG1 1
    108   1.1       is 
    109   1.1       is #define		WORD_WIDTH	0x02
    110   1.1       is #define		INT_ENABLE	0x80
    111   1.1       is 
    112   1.1       is #define INT_NO_REG 2
    113   1.1       is 
    114   1.1       is #define RCV_LOWER_LIMIT_REG 8
    115   1.1       is #define RCV_UPPER_LIMIT_REG 9
    116   1.1       is 
    117   1.1       is #define XMT_LOWER_LIMIT_REG 10
    118   1.1       is #define XMT_UPPER_LIMIT_REG 11
    119   1.1       is 
    120   1.1       is /* bank2 */
    121   1.1       is 
    122   1.1       is /* reg1, apparently */
    123   1.1       is 
    124   1.6      wiz #define		XMT_CHAIN_INT	0x20	/* interrupt at end of xmt chain */
    125   1.1       is #define		XMT_CHAIN_ERRSTOP 0x40	/* int at end of chain even if err */
    126   1.1       is #define		RCV_DISCARD_BAD	0x80	/* Throw bad frames away and continue */
    127   1.1       is 
    128   1.1       is #define RECV_MODES_REG 2
    129   1.1       is 
    130   1.1       is #define		PROMISC_MODE	0x01
    131   1.2       is #define		NO_BRDCST	0x02
    132   1.1       is #define		NO_RX_CRC	0x04
    133   1.1       is #define		NO_ADD_INS	0x10
    134   1.1       is #define		MULTI_IA	0x20
    135   1.1       is 
    136   1.2       is #define		MATCH_ID	(NO_ADD_INS | NO_RX_CRC | NO_BRDCST)
    137   1.1       is #define		MATCH_BRDCST	(NO_ADD_INS | NO_RX_CRC)
    138   1.2       is #define		MATCH_MULTI	(NO_ADD_INS | NO_RX_CRC | MULTI_IA)
    139   1.2       is #define		MATCH_ALL	(NO_ADD_INS | NO_RX_CRC | PROMISC_MODE)
    140   1.1       is 
    141   1.1       is #define MEDIA_SELECT 3
    142   1.1       is 
    143   1.1       is #define		TPE_BIT		0x04
    144   1.1       is #define		BNC_BIT		0x20
    145   1.1       is #define		TEST_MODE_MASK	0x3f
    146   1.1       is 
    147   1.1       is #define I_ADD(n) (n+4)	/* 0..5 -> 4..9 */
    148   1.1       is 
    149   1.1       is #define EEPROM_REG 10
    150   1.1       is 
    151   1.1       is #define		EEDO 8
    152   1.1       is #define		EEDI 4
    153   1.1       is #define		EECS 2
    154   1.1       is #define		EESK 1
    155   1.1       is 
    156   1.1       is /*
    157   1.1       is  * EEPROM layout. Written with reference to Intels public "LAN595 Hardware and
    158   1.1       is  * Software Specifications" document.
    159   1.1       is  */
    160   1.1       is 
    161   1.1       is #define EEPPW0		0
    162   1.1       is #define		EEPP_BusWidth	0x0004
    163   1.1       is #define		EEPP_FlashAdrs	0x0038
    164   1.1       is #define		EEPP_FLASHTRANSFORM {-1, -1, 0xC8000, 0xCC000, 0xD0000, \
    165   1.1       is 					0xD4000, 0xD8000, 0xDC000}
    166   1.1       is #define		EEPP_AutoIO	0x0040
    167   1.1       is #define		EEPP_IOMapping	0xfc00
    168   1.1       is 
    169   1.1       is #define EEPPW1		1
    170   1.1       is #define		EEPP_Int	0x0007
    171   1.9  tsutsui #define		EEPP_INTMAP	{9, 3, 5, 10, 11, -1, -1, -1}
    172   1.1       is #define		EEPP_RINTMAP	{0xff, 0xff, 0x02, 0x00, 0xff, 0x01, 0xff, \
    173   1.1       is 				 0xff, 0xff, 0x02, 0x03, 0x04 }
    174   1.1       is 
    175   1.1       is #define		EEPP_LinkInteg	0x0008
    176   1.1       is #define		EEPP_PolarCorr	0x0010
    177   1.1       is #define		EEPP_AuiTpe	0x0020
    178   1.1       is #define		EEPP_Jabber	0x0040
    179   1.1       is #define		EEPP_AutoPort	0x0080
    180   1.1       is #define		EEPP_SmOut	0x0100
    181   1.1       is #define		EEPP_BootFls	0x0200
    182   1.1       is #define		EEPP_DramSize	0x1000
    183   1.1       is #define		EEPP_AltReady	0x2000
    184   1.1       is 
    185   1.1       is #define EEPPEther2	2
    186   1.1       is #define EEPPEther1	3
    187   1.1       is #define EEPPEther0	4
    188   1.1       is 
    189   1.1       is #define EEPPEther2a	0x3c
    190   1.1       is #define EEPPEther1a	0x3d
    191   1.1       is #define EEPPEther0a	0x3e
    192   1.1       is 
    193   1.1       is #define EEPPW5		5
    194   1.1       is #define		EEPP_BncTpe	0x0001
    195   1.1       is #define		EEPP_RomSlct	0x0006	/* none, NetWare, NDIS, rsrvd. */
    196   1.1       is #define		EEPP_NumConn	0x0008	/* 0=2, 1=3 */
    197   1.1       is 
    198   1.1       is #define EEPW6		6
    199   1.1       is #define EEPP_BoardRev	0x00FF
    200   1.1       is 
    201   1.1       is #define EEPP_LENGTH 0x40
    202   1.1       is #define EEPP_CHKSUM 0xBABA /* Intel claim 0x0, but this seems to be wrong */
    203   1.5       is 
    204   1.5       is #define RCV_NO_RSC_REG	11
    205   1.5       is 	/* How many packets were dropped due to insufficient space */
    206   1.5       is 
    207   1.5       is /* ---- xmt /rcv /exec buffer format ---- */
    208   1.1       is 
    209   1.1       is #define I595_XMT_HDRLEN	8
    210   1.1       is 
    211   1.1       is #define CMD_MASK	0x001f
    212   1.1       is #define TX_DONE		0x0080
    213   1.1       is #define CHAIN		0x8000
    214   1.1       is 
    215   1.1       is #define XMT_STATUS	0x02
    216   1.1       is #define XMT_CHAIN	0x04
    217   1.1       is #define XMT_COUNT	0x06
    218   1.1       is 
    219   1.1       is #define I595_RCV_HDRLEN	8
    220   1.1       is 
    221   1.1       is #define RCV_DONE	0x0008
    222   1.1       is #define RX_OK		0x2000
    223   1.1       is #define RX_ERR		0x0d81
    224   1.1       is 
    225   1.1       is 
    226