/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
* NASA Ames Research Center.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define ER_RXCTL_HEADER 0x00040000 /* descriptor is for hdr copy */
#define ER_RXCTL_LFFORM 0x00020000 /* alternate fraglist format */
#define ER_RXCTL_FRAGLIST 0x00010000 /* descriptor points to fraglist */
/*
* This is not really part of the register description, but we need
* to define the number of transmit fragments *somewhere*.
*/
#define EPIC_NFRAGS 16 /* maximum number of frags in list */
/*
* EPIC fraglist descriptor.
*/
struct epic_fraglist {
volatile uint32_t ef_nfrags; /* number of frags in list */
struct {
volatile uint32_t ef_addr; /* address of frag */
volatile uint32_t ef_length; /* length of frag */
} ef_frags[EPIC_NFRAGS];
};
/*
* Explanation of MEMORY READ CONTROL:
*
* These bits control which PCI command the transmit DMA will use when
* bursting data over the PCI bus. When CTL1 is set, the transmit DMA
* will use the PCI "memory read line" command. When CTL0 is set, the
* transmit DMA will use the PCI "memory read multiple" command. When
* neither bit is set, the transmit DMA will use the "memory read" command.
* Use of "memory read line" or "memory read multiple" may enhance
* performance on some systems.
*/
/*
* Explanation of RECEIVE FIFO THRESHOLD:
*
* Controls the level at which the PCI burst state machine begins to
* empty the receive FIFO. Default is "1/2 full" (0,1).
*
* 0,0 1/4 full 32 bytes
* 0,1 1/2 full 64 bytes
* 1,0 3/4 full 96 bytes
* 1,1 full 128 bytes
*/
#define EPIC_MMDATA 0x34 /* MII MANAGEMENT INTERFACE DATA */
#define MMDATA_MASK 0x0000ffff /* MII frame data */
#define EPIC_MIICFG 0x38 /* MII CONFIGURATION */
#define MIICFG_ALTDIR 0x00000080 /* alternate direction */
#define MIICFG_ALTDATA 0x00000040 /* alternate data */
#define MIICFG_ALTCLOCK 0x00000020 /* alternate clock source */
#define MIICFG_ENASER 0x00000010 /* enable serial manag intf */
#define MIICFG_PHYPRESENT 0x00000008 /* phy present on MII */
#define MIICFG_LINKSTATUS 0x00000004 /* 694 link status */
#define MIICFG_ENABLE 0x00000002 /* enable 694 */
#define MIICFG_SERMODEENA 0x00000001 /* serial mode enable */
#define EPIC_IPG 0x3c /* INTERPACKET GAP */
#define IPG_INTERFRAME_MASK 0x00007f00 /* interframe gap time */
#define IPG_INTERPKT_MASK 0x000000ff /* interpacket gap time */
#define EPIC_LAN0 0x40 /* LAN ADDRESS */
#define EPIC_LAN1 0x44
#define EPIC_LAN2 0x48
#define LANn_MASK 0x0000ffff
/*
* Explanation of LAN ADDRESS registers:
*
* LAN address is described as:
*
* 0000 [n1][n0][n3][n2] | 0000 [n5][n4][n7][n6] | 0000 [n9][n8][n11][n10]
*
* n == one nibble, mapped as follows:
*
* LAN0 [15-12] n3
* LAN0 [11-8] n2
* LAN0 [7-4] n1
* LAN0 [3-0] n0
* LAN1 [15-12] n7
* LAN1 [11-8] n6
* LAN1 [7-4] n5
* LAN1 [3-0] n4
* LAN2 [15-12] n11
* LAN2 [11-8] n10
* LAN2 [7-4] n9
* LAN2 [3-0] n8
*
* The LAN address is automatically recalled from the EEPROM after a
* hard reset.
*/