1139749Simp/*-
224910Sgibbs * Copyright (c) 1993, 1994, 1995
324910Sgibbs *	Rodney W. Grimes, Milwaukie, Oregon  97222.  All rights reserved.
424910Sgibbs *
524910Sgibbs * Redistribution and use in source and binary forms, with or without
624910Sgibbs * modification, are permitted provided that the following conditions
724910Sgibbs * are met:
824910Sgibbs * 1. Redistributions of source code must retain the above copyright
924910Sgibbs *    notice, this list of conditions and the following disclaimer as
1024910Sgibbs *    the first lines of this file unmodified.
1124910Sgibbs * 2. Redistributions in binary form must reproduce the above copyright
1224910Sgibbs *    notice, this list of conditions and the following disclaimer in the
1324910Sgibbs *    documentation and/or other materials provided with the distribution.
1424910Sgibbs * 3. All advertising materials mentioning features or use of this software
1524910Sgibbs *    must display the following acknowledgement:
1624910Sgibbs *	This product includes software developed by Rodney W. Grimes.
1724910Sgibbs * 4. The name of the author may not be used to endorse or promote products
1824910Sgibbs *    derived from this software without specific prior written permission.
1924910Sgibbs *
2024910Sgibbs * THIS SOFTWARE IS PROVIDED BY RODNEY W. GRIMES ``AS IS'' AND ANY EXPRESS OR
2124910Sgibbs * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2224910Sgibbs * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2324910Sgibbs * IN NO EVENT SHALL RODNEY W. GRIMES BE LIABLE FOR ANY DIRECT, INDIRECT,
2424910Sgibbs * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2524910Sgibbs * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2624910Sgibbs * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2724910Sgibbs * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2824910Sgibbs * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2924910Sgibbs * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3024910Sgibbs *
3159868Speter * $FreeBSD$
3224910Sgibbs */
3324910Sgibbs
3424910Sgibbs/*
3524910Sgibbs * Definitions for EtherExpress 16
3624910Sgibbs */
3724910Sgibbs
38112734Smdodd#define	IEE16_DATAPORT		0x00	/* shared memory data port */
39112734Smdodd#define	IEE16_WRITEPTR		0x02	/* shared memory write pointer */
40112734Smdodd#define	IEE16_READPTR		0x04	/* shared memory read pointer */
41112734Smdodd
4224910Sgibbs#define	IEE16_ATTN		0x06	/* channel attention control */
4324910Sgibbs#define	IEE16_IRQ		0x07	/* IRQ configuration */
44112734Smdodd#define	 IEE16_IRQ_DISABLE	0x00	/* disable board interrupts */
4524910Sgibbs#define	 IEE16_IRQ_ENABLE	0x08	/* enable board interrupts */
4624910Sgibbs
47112734Smdodd#define	IEE16_SHADOWPTR		0x08	/* shadow memory pointer */
48112734Smdodd
4924910Sgibbs#define	IEE16_MEMDEC		0x0a	/* memory decode */
5024910Sgibbs#define	IEE16_MCTRL		0x0b	/* memory control */
5124910Sgibbs#define  IEE16_MCTRL_FMCS16	0x10	/* MEMCS16- for F000 */
5224910Sgibbs
5324910Sgibbs#define	IEE16_MPCTRL		0x0c	/* memory page control */
5424910Sgibbs#define	IEE16_CONFIG		0x0d	/* config register */
5524910Sgibbs#define  IEE16_BART_LOOPBACK	0x02	/* loopback, 0=none, 1=loopback */
5624910Sgibbs#define  IEE16_BART_IOCHRDY_LATE 0x10	/* iochrdy late control bit */
5724910Sgibbs#define  IEE16_BART_IO_TEST_EN	0x20	/* enable iochrdy timing test */
5824910Sgibbs#define  IEE16_BART_IO_RESULT	0x40	/* result of the iochrdy test */
5924910Sgibbs#define  IEE16_BART_MCS16_TEST	0x80	/* enable memcs16 select test */
6024910Sgibbs
6124910Sgibbs#define	IEE16_ECTRL		0x0e	/* eeprom control */
6224910Sgibbs#define  IEE16_ECTRL_EESK	0x01	/* EEPROM clock bit */
6324910Sgibbs#define  IEE16_ECTRL_EECS	0x02	/* EEPROM chip select */
6424910Sgibbs#define  IEE16_ECTRL_EEDI	0x04	/* EEPROM data in bit */
6524910Sgibbs#define  IEE16_ECTRL_EEDO	0x08	/* EEPROM data out bit */
6624910Sgibbs#define  IEE16_RESET_ASIC	0x40	/* reset ASIC (bart) pin */
6724910Sgibbs#define  IEE16_RESET_586	0x80	/* reset 82586 pin */
6824910Sgibbs#define  IEE16_ECTRL_MASK	0xb2	/* and'ed with ECTRL to enable read  */
6924910Sgibbs
7024910Sgibbs#define IEE16_MECTRL		0x0f	/* memory control, 0xe000 seg 'W' */
7124910Sgibbs#define IEE16_ID_PORT		0x0f	/* auto-id port 'R' */
7224910Sgibbs
7324910Sgibbs#define IEE16_ID		0xbaba	/* known id of EE16 */
7424910Sgibbs
7524910Sgibbs#define IEE16_EEPROM_READ	0x06	/* EEPROM read opcode */
7624910Sgibbs#define IEE16_EEPROM_OPSIZE1	0x03	/* size of EEPROM opcodes */
7724910Sgibbs#define IEE16_EEPROM_ADDR_SIZE	0x06	/* size of EEPROM address */
7824910Sgibbs
7924910Sgibbs/* Locations in the EEPROM */
8024910Sgibbs#define IEE16_EEPROM_CONFIG1	0x00	/* Configuration register 1 */
81112734Smdodd#define	IEE16_EEPROM_MEDIA_EXT	0x1000	/* Using external transceiver 0 = AUI */
82112734Smdodd
8324910Sgibbs#define  IEE16_EEPROM_IRQ	0xE000	/* Encoded IRQ */
8424910Sgibbs#define  IEE16_EEPROM_IRQ_SHIFT	13	/* To shift IRQ to lower bits */
8524910Sgibbs#define IEE16_EEPROM_LOCK_ADDR	0x01	/* contains the lock bit */
8624910Sgibbs#define  IEE16_EEPROM_LOCKED	0x01	/* means that it is locked */
8724910Sgibbs
8824910Sgibbs#define IEE16_EEPROM_ENET_LOW	0x02	/* Ethernet address, low word */
8924910Sgibbs#define IEE16_EEPROM_ENET_MID	0x03	/* Ethernet address, middle word */
9024910Sgibbs#define IEE16_EEPROM_ENET_HIGH	0x04	/* Ethernet address, high word */
91112734Smdodd
92112734Smdodd#define	IEE16_EEPROM_MEDIA	0x05	/* Selects between TP/BNC */
93112734Smdodd#define	 IEE16_EEPROM_MEDIA_TP	0x01	/* if ON, using TP, else BNC */
94