Home | History | Annotate | Line # | Download | only in marvell
gtethreg.h revision 1.2.10.1
      1  1.2.10.1  kent /*	$NetBSD: gtethreg.h,v 1.2.10.1 2005/04/29 11:28:55 kent Exp $	*/
      2       1.1  matt 
      3       1.1  matt /*
      4       1.1  matt  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
      5       1.1  matt  * All rights reserved.
      6       1.1  matt  *
      7       1.1  matt  * Redistribution and use in source and binary forms, with or without
      8       1.1  matt  * modification, are permitted provided that the following conditions
      9       1.1  matt  * are met:
     10       1.1  matt  * 1. Redistributions of source code must retain the above copyright
     11       1.1  matt  *    notice, this list of conditions and the following disclaimer.
     12       1.1  matt  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1  matt  *    notice, this list of conditions and the following disclaimer in the
     14       1.1  matt  *    documentation and/or other materials provided with the distribution.
     15       1.1  matt  * 3. All advertising materials mentioning features or use of this software
     16       1.1  matt  *    must display the following acknowledgement:
     17       1.1  matt  *      This product includes software developed for the NetBSD Project by
     18       1.1  matt  *      Allegro Networks, Inc., and Wasabi Systems, Inc.
     19       1.1  matt  * 4. The name of Allegro Networks, Inc. may not be used to endorse
     20       1.1  matt  *    or promote products derived from this software without specific prior
     21       1.1  matt  *    written permission.
     22       1.1  matt  * 5. The name of Wasabi Systems, Inc. may not be used to endorse
     23       1.1  matt  *    or promote products derived from this software without specific prior
     24       1.1  matt  *    written permission.
     25       1.1  matt  *
     26       1.1  matt  * THIS SOFTWARE IS PROVIDED BY ALLEGRO NETWORKS, INC. AND
     27       1.1  matt  * WASABI SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     28       1.1  matt  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     29       1.1  matt  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     30       1.1  matt  * IN NO EVENT SHALL EITHER ALLEGRO NETWORKS, INC. OR WASABI SYSTEMS, INC.
     31       1.1  matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32       1.1  matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33       1.1  matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34       1.1  matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35       1.1  matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36       1.1  matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37       1.1  matt  * POSSIBILITY OF SUCH DAMAGE.
     38       1.1  matt  */
     39       1.1  matt 
     40       1.1  matt #ifndef _DEV_GTETHREG_H_
     41       1.1  matt #define	_DEV_GTETHREG_H_
     42       1.1  matt 
     43       1.1  matt #define ETH__BIT(bit)			(1U << (bit))
     44       1.1  matt #define ETH__LLBIT(bit)			(1LLU << (bit))
     45       1.1  matt #define ETH__MASK(bit)			(ETH__BIT(bit) - 1)
     46       1.1  matt #define ETH__LLMASK(bit)		(ETH__LLBIT(bit) - 1)
     47       1.2  matt #define ETH__GEN(n, off)		(0x2400+((n) << 10)+(ETH__ ## off))
     48       1.1  matt #define	ETH__EXT(data, bit, len)	(((data) >> (bit)) & ETH__MASK(len))
     49       1.1  matt #define	ETH__LLEXT(data, bit, len)	(((data) >> (bit)) & ETH__LLMASK(len))
     50       1.1  matt #define	ETH__CLR(data, bit, len)	((data) &= ~(ETH__MASK(len) << (bit)))
     51       1.1  matt #define	ETH__INS(new, bit)		((new) << (bit))
     52       1.1  matt #define	ETH__LLINS(new, bit)		((uint64_t)(new) << (bit))
     53       1.1  matt 
     54       1.1  matt /*
     55       1.1  matt  * Descriptors used for both receive & transmit data.  Note that the descriptor
     56       1.1  matt  * must start on a 4LW boundary.  Since the GT accesses the descriptor as
     57       1.1  matt  * two 64-bit quantities, we must present them 32bit quantities in the right
     58       1.1  matt  * order based on endianess.
     59       1.1  matt  */
     60       1.1  matt 
     61       1.1  matt struct gt_eth_desc {
     62       1.1  matt #if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
     63       1.1  matt 	u_int32_t ed_lencnt;	/* length is hi 16 bits; count (rx) is lo 16 */
     64       1.1  matt 	u_int32_t ed_cmdsts;	/* command (hi16)/status (lo16) bits */
     65       1.1  matt 	u_int32_t ed_nxtptr;	/* next descriptor (must be 4LW aligned) */
     66       1.1  matt 	u_int32_t ed_bufptr;	/* pointer to packet buffer */
     67       1.1  matt #endif
     68       1.1  matt #if defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN
     69       1.1  matt 	u_int32_t ed_cmdsts;	/* command (hi16)/status (lo16) bits */
     70       1.1  matt 	u_int32_t ed_lencnt;	/* length is hi 16 bits; count (rx) is lo 16 */
     71       1.1  matt 	u_int32_t ed_bufptr;	/* pointer to packet buffer */
     72       1.1  matt 	u_int32_t ed_nxtptr;	/* next descriptor (must be 4LW aligned) */
     73       1.1  matt #endif
     74       1.1  matt };
     75       1.1  matt 
     76       1.1  matt /* Table 578: Ethernet TX Descriptor - Command/Status word
     77       1.1  matt  * All bits except F, EI, AM, O are only valid if TX_CMD_L is also set,
     78       1.1  matt  * otherwise should be 0 (tx).
     79       1.1  matt  */
     80       1.1  matt #define	TX_STS_LC	ETH__BIT(5)	/* Late Collision */
     81       1.1  matt #define	TX_STS_UR	ETH__BIT(6)	/* Underrun error */
     82       1.1  matt #define	TX_STS_RL	ETH__BIT(8)	/* Retransmit Limit (excession coll) */
     83       1.1  matt #define	TX_STS_COL	ETH__BIT(9)	/* Collision Occurred */
     84       1.1  matt #define	TX_STS_RC(v)	ETH__GETBITS(v, 10, 4)	/* Retransmit Count */
     85       1.1  matt #define	TX_STS_ES	ETH__BIT(15)	/* Error Summary (LC|UR|RL) */
     86       1.1  matt #define	TX_CMD_L	ETH__BIT(16)	/* Last - End Of Packet */
     87       1.1  matt #define	TX_CMD_F	ETH__BIT(17)	/* First - Start Of Packet */
     88       1.1  matt #define	TX_CMD_P	ETH__BIT(18)	/* Pad Packet */
     89       1.1  matt #define	TX_CMD_GC	ETH__BIT(22)	/* Generate CRC */
     90       1.1  matt #define	TX_CMD_EI	ETH__BIT(23)	/* Enable Interrupt */
     91       1.1  matt #define	TX_CMD_AM	ETH__BIT(30)	/* Auto Mode */
     92       1.1  matt #define	TX_CMD_O	ETH__BIT(31)	/* Ownership (1=GT 0=CPU) */
     93       1.1  matt 
     94       1.1  matt #define	TX_CMD_FIRST	(TX_CMD_F|TX_CMD_O)
     95       1.1  matt #define	TX_CMD_LAST	(TX_CMD_L|TX_CMD_GC|TX_CMD_P|TX_CMD_O)
     96       1.1  matt 
     97       1.1  matt /* Table 582: Ethernet RX Descriptor - Command/Status Word
     98       1.1  matt  * All bits except F, EI, AM, O are only valid if RX_CMD_L is also set,
     99       1.1  matt  * otherwise should be ignored (rx).
    100       1.1  matt  */
    101       1.1  matt #define	RX_STS_CE	ETH__BIT(0)	/* CRC Error */
    102       1.1  matt #define	RX_STS_COL	ETH__BIT(1)	/* Collision sensed during reception */
    103       1.1  matt #define	RX_STS_LC	ETH__BIT(5)	/* Late Collision (Reserved) */
    104       1.1  matt #define	RX_STS_OR	ETH__BIT(6)	/* Overrun Error */
    105       1.1  matt #define	RX_STS_MFL	ETH__BIT(7)	/* Max Frame Len Error */
    106       1.1  matt #define	RX_STS_SF	ETH__BIT(8)	/* Short Frame Error (< 64 bytes) */
    107       1.1  matt #define	RX_STS_FT	ETH__BIT(11)	/* Frame Type (1 = 802.3) */
    108       1.1  matt #define	RX_STS_M	ETH__BIT(12)	/* Missed Frame */
    109       1.1  matt #define	RX_STS_HE	ETH__BIT(13)	/* Hash Expired (manual match) */
    110       1.1  matt #define	RX_STS_IGMP	ETH__BIT(14)	/* IGMP Packet */
    111       1.1  matt #define	RX_STS_ES	ETH__BIT(15)	/* Error Summary (CE|COL|LC|OR|MFL|SF) */
    112       1.1  matt #define	RX_CMD_L	ETH__BIT(16)	/* Last - End Of Packet */
    113       1.1  matt #define	RX_CMD_F	ETH__BIT(17)	/* First - Start Of Packet */
    114       1.1  matt #define	RX_CMD_EI	ETH__BIT(23)	/* Enable Interrupt */
    115       1.1  matt #define	RX_CMD_AM	ETH__BIT(30)	/* Auto Mode */
    116       1.1  matt #define	RX_CMD_O	ETH__BIT(31)	/* Ownership (1=GT 0=CPU) */
    117       1.1  matt 
    118       1.1  matt /* Table 586: Hash Table Entry Fields
    119       1.1  matt  */
    120       1.1  matt #define HSH_V		ETH__LLBIT(0)	/* Entry is valid */
    121       1.1  matt #define HSH_S		ETH__LLBIT(1)	/* Skip this entry */
    122       1.1  matt #define HSH_RD		ETH__LLBIT(2)	/* Receive(1) / Discard (0) */
    123       1.1  matt #define HSH_R		ETH__LLBIT(2)	/* Receive(1) */
    124       1.1  matt #define	HSH_PRIO_GET(v)	ETH__LLEXT(v, 51, 2)
    125       1.1  matt #define	HSH_PRIO_INS(v)	ETH__LLINS(v, 51)
    126       1.1  matt #define	HSH_ADDR_MASK	0x7fffff8LLU
    127       1.1  matt #define	HSH_LIMIT	12
    128       1.1  matt 
    129       1.1  matt 
    130       1.1  matt #define	ETH_EPAR	0x2000		/* PHY Address Register */
    131       1.1  matt #define	ETH_ESMIR	0x2010		/* SMI Register */
    132       1.1  matt 
    133       1.1  matt #define	ETH_BASE_ETH0	0x2400		/* Ethernet0 Register Base */
    134       1.1  matt #define	ETH_BASE_ETH1	0x2800		/* Ethernet1 Register Base */
    135       1.1  matt #define	ETH_BASE_ETH2	0x2c00		/* Ethernet2 Register Base */
    136       1.2  matt #define	ETH_SIZE	0x0400		/* Register Space */
    137       1.1  matt 
    138       1.2  matt #define	ETH__EBASE	0x0000		/* Base of Registers */
    139       1.2  matt #define	ETH__EPCR	0x0000		/* Port Config. Register */
    140       1.2  matt #define	ETH__EPCXR	0x0008		/* Port Config. Extend Reg */
    141       1.2  matt #define	ETH__EPCMR	0x0010		/* Port Command Register */
    142       1.2  matt #define	ETH__EPSR	0x0018		/* Port Status Register */
    143       1.2  matt #define	ETH__ESPR	0x0020		/* Port Serial Parameters Reg */
    144       1.2  matt #define	ETH__EHTPR	0x0028		/* Port Hash Table Pointer Reg*/
    145       1.2  matt #define	ETH__EFCSAL	0x0030		/* Flow Control Src Addr Low */
    146       1.2  matt #define	ETH__EFCSAH	0x0038		/* Flow Control Src Addr High */
    147       1.2  matt #define	ETH__ESDCR	0x0040		/* SDMA Configuration Reg */
    148       1.2  matt #define	ETH__ESDCMR	0x0048		/* SDMA Command Register */
    149       1.2  matt #define	ETH__EICR	0x0050		/* Interrupt Cause Register */
    150       1.2  matt #define	ETH__EIMR	0x0058		/* Interrupt Mask Register */
    151       1.2  matt #define	ETH__EFRDP0	0x0080		/* First Rx Desc Pointer 0 */
    152       1.2  matt #define	ETH__EFRDP1	0x0084		/* First Rx Desc Pointer 1 */
    153       1.2  matt #define	ETH__EFRDP2	0x0088		/* First Rx Desc Pointer 2 */
    154       1.2  matt #define	ETH__EFRDP3	0x008c		/* First Rx Desc Pointer 3 */
    155       1.2  matt #define	ETH__ECRDP0	0x00a0		/* Current Rx Desc Pointer 0 */
    156       1.2  matt #define	ETH__ECRDP1	0x00a4		/* Current Rx Desc Pointer 1 */
    157       1.2  matt #define	ETH__ECRDP2	0x00a8		/* Current Rx Desc Pointer 2 */
    158       1.2  matt #define	ETH__ECRDP3	0x00ac		/* Current Rx Desc Pointer 3 */
    159       1.2  matt #define	ETH__ECTDP0	0x00e0		/* Current Tx Desc Pointer 0 */
    160       1.2  matt #define	ETH__ECTDP1	0x00e4		/* Current Tx Desc Pointer 1 */
    161       1.2  matt #define	ETH__EDSCP2P0L	0x0060		/* IP Differentiated Services
    162       1.2  matt 					   CodePoint to Priority0 low */
    163       1.2  matt #define	ETH__EDSCP2P0H	0x0064		/* IP Differentiated Services
    164       1.2  matt 					   CodePoint to Priority0 high*/
    165       1.2  matt #define	ETH__EDSCP2P1L	0x0068		/* IP Differentiated Services
    166       1.2  matt 					   CodePoint to Priority1 low */
    167       1.2  matt #define	ETH__EDSCP2P1H	0x006c		/* IP Differentiated Services
    168       1.2  matt 					   CodePoint to Priority1 high*/
    169       1.2  matt #define	ETH__EVPT2P	0x0068		/* VLAN Prio. Tag to Priority */
    170       1.2  matt #define	ETH__EMIBCTRS	0x0100		/* MIB Counters */
    171       1.2  matt 
    172       1.2  matt #define	ETH_BASE(n)	ETH__GEN(n, EBASE)
    173       1.2  matt #define	ETH_EPCR(n)	ETH__GEN(n, EPCR)	/* Port Config. Register */
    174       1.2  matt #define	ETH_EPCXR(n)	ETH__GEN(n, EPCXR)	/* Port Config. Extend Reg */
    175       1.2  matt #define	ETH_EPCMR(n)	ETH__GEN(n, EPCMR)	/* Port Command Register */
    176       1.2  matt #define	ETH_EPSR(n)	ETH__GEN(n, EPSR)	/* Port Status Register */
    177       1.2  matt #define	ETH_ESPR(n)	ETH__GEN(n, ESPR)	/* Port Serial Parameters Reg */
    178       1.2  matt #define	ETH_EHTPR(n)	ETH__GEN(n, EHPTR)	/* Port Hash Table Pointer Reg*/
    179       1.2  matt #define	ETH_EFCSAL(n)	ETH__GEN(n, EFCSAL)	/* Flow Control Src Addr Low */
    180       1.2  matt #define	ETH_EFCSAH(n)	ETH__GEN(n, EFCSAH)	/* Flow Control Src Addr High */
    181       1.2  matt #define	ETH_ESDCR(n)	ETH__GEN(n, ESDCR)	/* SDMA Configuration Reg */
    182       1.2  matt #define	ETH_ESDCMR(n)	ETH__GEN(n, ESDCMR)	/* SDMA Command Register */
    183       1.2  matt #define	ETH_EICR(n)	ETH__GEN(n, EICR)	/* Interrupt Cause Register */
    184       1.2  matt #define	ETH_EIMR(n)	ETH__GEN(n, EIMR)	/* Interrupt Mask Register */
    185       1.2  matt #define	ETH_EFRDP0(n)	ETH__GEN(n, EFRDP0)	/* First Rx Desc Pointer 0 */
    186       1.2  matt #define	ETH_EFRDP1(n)	ETH__GEN(n, EFRDP1)	/* First Rx Desc Pointer 1 */
    187       1.2  matt #define	ETH_EFRDP2(n)	ETH__GEN(n, EFRDP2)	/* First Rx Desc Pointer 2 */
    188       1.2  matt #define	ETH_EFRDP3(n)	ETH__GEN(n, EFRDP3)	/* First Rx Desc Pointer 3 */
    189       1.2  matt #define	ETH_ECRDP0(n)	ETH__GEN(n, ECRDP0)	/* Current Rx Desc Pointer 0 */
    190       1.2  matt #define	ETH_ECRDP1(n)	ETH__GEN(n, ECRDP1)	/* Current Rx Desc Pointer 1 */
    191       1.2  matt #define	ETH_ECRDP2(n)	ETH__GEN(n, ECRDP2)	/* Current Rx Desc Pointer 2 */
    192       1.2  matt #define	ETH_ECRDP3(n)	ETH__GEN(n, ECRDP3)	/* Current Rx Desc Pointer 3 */
    193       1.2  matt #define	ETH_ECTDP0(n)	ETH__GEN(n, ECTDP0)	/* Current Tx Desc Pointer 0 */
    194       1.2  matt #define	ETH_ECTDP1(n)	ETH__GEN(n, ECTDP1)	/* Current Tx Desc Pointer 1 */
    195       1.2  matt #define	ETH_EDSCP2P0L(n) ETH__GEN(n, EDSCP2P0L)	/* IP Differentiated Services
    196       1.1  matt 						   CodePoint to Priority0 low */
    197       1.2  matt #define	ETH_EDSCP2P0H(n) ETH__GEN(n, EDSCP2P0H)	/* IP Differentiated Services
    198       1.1  matt 						   CodePoint to Priority0 high*/
    199       1.2  matt #define	ETH_EDSCP2P1L(n) ETH__GEN(n, EDSCP2P1L)	/* IP Differentiated Services
    200       1.1  matt 						   CodePoint to Priority1 low */
    201       1.2  matt #define	ETH_EDSCP2P1H(n) ETH__GEN(n, EDSCP1P1H)	/* IP Differentiated Services
    202       1.1  matt 						   CodePoint to Priority1 high*/
    203       1.2  matt #define	ETH_EVPT2P(n)	ETH__GEN(n, EVPT2P)	/* VLAN Prio. Tag to Priority */
    204       1.2  matt #define	ETH_EMIBCTRS(n) ETH__GEN(n, EMIBCTRS)	/* MIB Counters */
    205       1.1  matt 
    206       1.1  matt #define	ETH_EPAR_PhyAD_GET(v, n)	(((v) >> ((n) * 5)) & 0x1f)
    207       1.1  matt 
    208       1.1  matt #define ETH_ESMIR_READ(phy, reg)	(ETH__INS(phy, 16)|\
    209       1.1  matt 					 ETH__INS(reg, 21)|\
    210       1.1  matt 					 ETH_ESMIR_ReadOpcode)
    211       1.1  matt #define ETH_ESMIR_WRITE(phy, reg, val)	(ETH__INS(phy, 16)|\
    212       1.1  matt 					 ETH__INS(reg, 21)|\
    213       1.1  matt 					 ETH__INS(val,  0)|\
    214       1.1  matt 					 ETH_ESMIR_WriteOpcode)
    215       1.1  matt #define ETH_ESMIR_Value_GET(v)		ETH__EXT(v, 0, 16)
    216       1.1  matt #define	ETH_ESMIR_WriteOpcode		0
    217       1.1  matt #define	ETH_ESMIR_ReadOpcode		ETH__BIT(26)
    218       1.1  matt #define	ETH_ESMIR_ReadValid		ETH__BIT(27)
    219       1.1  matt #define	ETH_ESMIR_Busy			ETH__BIT(28)
    220       1.1  matt 
    221  1.2.10.1  kent /*
    222       1.1  matt  * Table 597: Port Configuration Register (PCR)
    223       1.1  matt  * 00:00 PM			Promiscuous mode
    224       1.1  matt  *				0: Normal mode (Frames are only received if the
    225       1.1  matt  *				   destination address is found in the hash
    226       1.1  matt  *				   table)
    227       1.1  matt  *				1: Promiscuous mode (Frames are received
    228       1.1  matt  *				   regardless of their destination address.
    229       1.1  matt  *				   Errored frames are discarded unless the Port
    230       1.1  matt  *				   Configuration register's PBF bit is set)
    231       1.1  matt  * 01:01 RBM			Reject Broadcast Mode
    232       1.1  matt  *				0: Receive broadcast address
    233       1.1  matt  *				1: Reject frames with broadcast address
    234       1.1  matt  *				Overridden by the promiscuous mode.
    235       1.1  matt  * 02:02 PBF			Pass Bad Frames
    236       1.1  matt  *				(0: Normal mode, 1: Pass bad Frames)
    237       1.1  matt  *				The Ethernet receiver passes to the CPU errored
    238       1.1  matt  *				frames (like fragments and collided packets)
    239       1.1  matt  *				that are normally rejected.
    240       1.1  matt  *				NOTE: Frames are only passed if they
    241       1.1  matt  *				      successfully pass address filtering.
    242       1.1  matt  * 06:03 Reserved
    243       1.1  matt  * 07:07 EN			Enable (0: Disabled, 1: Enable)
    244       1.1  matt  *				When enabled, the ethernet port is ready to
    245       1.1  matt  *				transmit/receive.
    246       1.1  matt  * 09:08 LPBK			Loop Back Mode
    247       1.1  matt  *				00: Normal mode
    248       1.1  matt  *				01: Internal loop back mode (TX data is looped
    249       1.1  matt  *				    back to the RX lines. No transition is seen
    250       1.1  matt  *				    on the interface pins)
    251       1.1  matt  *				10: External loop back mode (TX data is looped
    252       1.1  matt  *				    back to the RX lines and also transmitted
    253       1.1  matt  *				    out to the MII interface pins)
    254       1.1  matt  *				11: Reserved
    255       1.1  matt  * 10:10 FC			Force Collision
    256       1.1  matt  *				0: Normal mode.
    257       1.1  matt  *				1: Force Collision on any TX frame.
    258       1.1  matt  *				   For RXM test (in Loopback mode).
    259       1.1  matt  * 11:11 Reserved.
    260       1.1  matt  * 12:12 HS			Hash Size
    261       1.1  matt  *				0: 8K address filtering
    262       1.1  matt  *				   (256KB of memory space required).
    263       1.1  matt  *				1: 512 address filtering
    264       1.1  matt  *				   ( 16KB of memory space required).
    265       1.1  matt  * 13:13 HM			Hash Mode (0: Hash Func. 0; 1: Hash Func. 1)
    266       1.1  matt  * 14:14 HDM			Hash Default Mode
    267       1.1  matt  *				0: Discard addresses not found in address table
    268       1.1  matt  *				1: Pass addresses not found in address table
    269       1.1  matt  * 15:15 HD			Duplex Mode (0: Half Duplex, 1: Full Duplex)
    270       1.1  matt  *				NOTE: Valid only when auto-negotiation for
    271       1.1  matt  *				      duplex mode is disabled.
    272       1.1  matt  * 30:16 Reserved
    273       1.1  matt  * 31:31 ACCS			Accelerate Slot Time
    274       1.1  matt  *				(0: Normal mode, 1: Reserved)
    275       1.1  matt  */
    276       1.1  matt #define	ETH_EPCR_PM		ETH__BIT(0)
    277       1.1  matt #define	ETH_EPCR_RBM		ETH__BIT(1)
    278       1.1  matt #define	ETH_EPCR_PBF		ETH__BIT(2)
    279       1.1  matt #define	ETH_EPCR_EN		ETH__BIT(7)
    280       1.1  matt #define	ETH_EPCR_LPBK_GET(v)	ETH__BIT(v, 8, 2)
    281       1.1  matt #define	ETH_EPCR_LPBK_Normal	0
    282       1.1  matt #define	ETH_EPCR_LPBK_Internal	1
    283       1.1  matt #define	ETH_EPCR_LPBK_External	2
    284       1.1  matt #define	ETH_EPCR_FC		ETH__BIT(10)
    285       1.1  matt 
    286       1.1  matt #define	ETH_EPCR_HS		ETH__BIT(12)
    287       1.1  matt #define	ETH_EPCR_HS_8K		0
    288       1.1  matt #define	ETH_EPCR_HS_512		ETH_EPCR_HS
    289       1.1  matt 
    290       1.1  matt #define	ETH_EPCR_HM		ETH__BIT(13)
    291       1.1  matt #define	ETH_EPCR_HM_0		0
    292       1.1  matt #define	ETH_EPCR_HM_1		ETH_EPCR_HM
    293       1.1  matt 
    294       1.1  matt #define	ETH_EPCR_HDM		ETH__BIT(14)
    295       1.1  matt #define	ETH_EPCR_HDM_Discard	0
    296       1.1  matt #define	ETH_EPCR_HDM_Pass	ETH_EPCR_HDM
    297       1.1  matt 
    298       1.1  matt #define	ETH_EPCR_HD_Half	0
    299       1.1  matt #define	ETH_EPCR_HD_Full	ETH_EPCR_HD_Full
    300       1.1  matt 
    301       1.1  matt #define	ETH_EPCR_ACCS		ETH__BIT(31)
    302       1.1  matt 
    303       1.1  matt 
    304       1.1  matt 
    305  1.2.10.1  kent /*
    306       1.1  matt  * Table 598: Port Configuration Extend Register (PCXR)
    307       1.1  matt  * 00:00 IGMP			IGMP Packets Capture Enable
    308       1.1  matt  *				0: IGMP packets are treated as normal Multicast
    309       1.1  matt  *				   packets.
    310       1.1  matt  *				1: IGMP packets on IPv4/Ipv6 over Ethernet/802.3
    311       1.1  matt  *				   are trapped and sent to high priority RX
    312       1.1  matt  *				   queue.
    313       1.1  matt  * 01:01 SPAN			Spanning Tree Packets Capture Enable
    314       1.1  matt  *				0: BPDU (Bridge Protocol Data Unit) packets are
    315       1.1  matt  *				   treated as normal Multicast packets.
    316       1.1  matt  *				1: BPDU packets are trapped and sent to high
    317       1.1  matt  *				   priority RX queue.
    318       1.1  matt  * 02:02 PAR			Partition Enable (0: Normal, 1: Partition)
    319       1.1  matt  *				When more than 61 collisions occur while
    320       1.1  matt  *				transmitting, the port enters Partition mode.
    321       1.1  matt  *				It waits for the first good packet from the
    322       1.1  matt  *				wire and then goes back to Normal mode.  Under
    323       1.1  matt  *				Partition mode it continues transmitting, but
    324       1.1  matt  *				it does not receive.
    325       1.1  matt  * 05:03 PRIOtx			Priority weight in the round-robin between high
    326       1.1  matt  *				and low priority TX queues.
    327       1.1  matt  *				000: 1 pkt from HIGH, 1 pkt from LOW.
    328       1.1  matt  *				001: 2 pkt from HIGH, 1 pkt from LOW.
    329       1.1  matt  *				010: 4 pkt from HIGH, 1 pkt from LOW.
    330       1.1  matt  *				011: 6 pkt from HIGH, 1 pkt from LOW.
    331       1.1  matt  *				100: 8 pkt from HIGH, 1 pkt from LOW.
    332       1.1  matt  *				101: 10 pkt from HIGH, 1 pkt from LOW.
    333       1.1  matt  *				110: 12 pkt from HIGH, 1 pkt from LOW.
    334       1.1  matt  *				111: All pkt from HIGH, 0 pkt from LOW. LOW is
    335       1.1  matt  *				     served only if HIGH is empty.
    336       1.1  matt  *				NOTE: If the HIGH queue is emptied before
    337       1.1  matt  *				      finishing the count, the count is reset
    338       1.1  matt  *				      until the next first HIGH comes in.
    339       1.1  matt  * 07:06 PRIOrx			Default Priority for Packets Received on this
    340       1.1  matt  *				Port (00: Lowest priority, 11: Highest priority)
    341       1.1  matt  * 08:08 PRIOrx_Override	Override Priority for Packets Received on this
    342       1.1  matt  *				Port (0: Do not override, 1: Override with
    343       1.1  matt  *				<PRIOrx> field)
    344       1.1  matt  * 09:09 DPLXen			Enable Auto-negotiation for Duplex Mode
    345       1.1  matt  *				(0: Enable, 1: Disable)
    346       1.1  matt  * 11:10 FCTLen			Enable Auto-negotiation for 802.3x Flow-control
    347       1.1  matt  *				0: Enable; When enabled, 1 is written (through
    348       1.1  matt  *				   SMI access) to the PHY's register 4 bit 10
    349       1.1  matt  *				   to advertise flow-control capability.
    350       1.1  matt  *				1: Disable; Only enables flow control after the
    351       1.1  matt  *				   PHY address is set by the CPU. When changing
    352       1.1  matt  *				   the PHY address the flow control
    353       1.1  matt  *				   auto-negotiation must be disabled.
    354       1.1  matt  * 11:11 FLP			Force Link Pass
    355       1.1  matt  *				(0: Force Link Pass, 1: Do NOT Force Link pass)
    356       1.1  matt  * 12:12 FCTL			802.3x Flow-Control Mode (0: Enable, 1: Disable)
    357       1.1  matt  *				NOTE: Only valid when auto negotiation for flow
    358       1.1  matt  *				      control is disabled.
    359       1.1  matt  * 13:13 Reserved
    360       1.1  matt  * 15:14 MFL			Max Frame Length
    361       1.1  matt  *				Maximum packet allowed for reception (including
    362       1.1  matt  *				CRC):   00: 1518 bytes,   01: 1536 bytes,
    363       1.1  matt  *					10: 2048 bytes,   11:  64K bytes
    364       1.1  matt  * 16:16 MIBclrMode		MIB Counters Clear Mode (0: Clear, 1: No effect)
    365       1.1  matt  * 17:17 MIBctrMode		Reserved. (MBZ)
    366       1.1  matt  * 18:18 Speed			Port Speed (0: 10Mbit/Sec, 1: 100Mbit/Sec)
    367       1.1  matt  *				NOTE: Only valid if SpeedEn bit is set.
    368       1.1  matt  * 19:19 SpeedEn		Enable Auto-negotiation for Speed
    369       1.1  matt  *				(0: Enable, 1: Disable)
    370       1.1  matt  * 20:20 RMIIen			RMII enable
    371       1.1  matt  *				0: Port functions as MII port
    372       1.1  matt  *				1: Port functions as RMII port
    373       1.1  matt  * 21:21 DSCPen			DSCP enable
    374       1.1  matt  *				0: IP DSCP field decoding is disabled.
    375       1.1  matt  *				1: IP DSCP field decoding is enabled.
    376       1.1  matt  * 31:22 Reserved
    377       1.1  matt  */
    378       1.1  matt #define	ETH_EPCXR_IGMP			ETH__BIT(0)
    379       1.1  matt #define	ETH_EPCXR_SPAN			ETH__BIT(1)
    380       1.1  matt #define	ETH_EPCXR_PAR			ETH__BIT(2)
    381       1.1  matt #define	ETH_EPCXR_PRIOtx_GET(v)		ETH__EXT(v, 3, 3)
    382       1.1  matt #define	ETH_EPCXR_PRIOrx_GET(v)		ETH__EXT(v, 3, 3)
    383       1.1  matt #define	ETH_EPCXR_PRIOrx_Override	ETH__BIT(8)
    384       1.1  matt #define	ETH_EPCXR_DLPXen		ETH__BIT(9)
    385       1.1  matt #define	ETH_EPCXR_FCTLen		ETH__BIT(10)
    386       1.1  matt #define	ETH_EPCXR_FLP			ETH__BIT(11)
    387       1.1  matt #define	ETH_EPCXR_FCTL			ETH__BIT(12)
    388       1.1  matt #define	ETH_EPCXR_MFL_GET(v)		ETH__EXT(v, 14, 2)
    389       1.1  matt #define	ETH_EPCXR_MFL_1518		0
    390       1.1  matt #define	ETH_EPCXR_MFL_1536		1
    391       1.1  matt #define	ETH_EPCXR_MFL_2084		2
    392       1.1  matt #define	ETH_EPCXR_MFL_64K		3
    393       1.1  matt #define	ETH_EPCXR_MIBclrMode		ETH__BIT(16)
    394       1.1  matt #define	ETH_EPCXR_MIBctrMode		ETH__BIT(17)
    395       1.1  matt #define	ETH_EPCXR_Speed			ETH__BIT(18)
    396       1.1  matt #define	ETH_EPCXR_SpeedEn		ETH__BIT(19)
    397       1.1  matt #define	ETH_EPCXR_RMIIEn		ETH__BIT(20)
    398       1.1  matt #define	ETH_EPCXR_DSCPEn		ETH__BIT(21)
    399       1.1  matt 
    400       1.1  matt 
    401       1.1  matt 
    402  1.2.10.1  kent /*
    403       1.1  matt  * Table 599: Port Command Register (PCMR)
    404       1.1  matt  * 14:00 Reserved
    405       1.1  matt  * 15:15 FJ			Force Jam / Flow Control
    406       1.1  matt  *				When in half-duplex mode, the CPU uses this bit
    407       1.1  matt  *				to force collisions on the Ethernet segment.
    408       1.1  matt  *				When the CPU recognizes that it is going to run
    409       1.1  matt  *				out of receive buffers, it can force the
    410       1.1  matt  *				transmitter to send jam frames, forcing
    411       1.1  matt  *				collisions on the wire.  To allow transmission
    412       1.1  matt  *				on the Ethernet segment, the CPU must clear the
    413       1.1  matt  *				FJ bit when more resources are available.  When
    414       1.1  matt  *				in full-duplex and flow-control is enabled, this
    415       1.1  matt  *				bit causes the port's transmitter to send
    416       1.1  matt  *				flow-control PAUSE packets. The CPU must reset
    417       1.1  matt  *				this bit when more resources are available.
    418       1.1  matt  * 31:16 Reserved
    419       1.1  matt  */
    420       1.1  matt 
    421       1.1  matt #define	ETH_EPCMR_FJ		ETH__BIT(15)
    422       1.1  matt 
    423       1.1  matt 
    424  1.2.10.1  kent /*
    425       1.1  matt  * Table 600: Port Status Register (PSR) -- Read Only
    426       1.1  matt  * 00:00 Speed			Indicates Port Speed (0: 10Mbs, 1: 100Mbs)
    427       1.1  matt  * 01:01 Duplex			Indicates Port Duplex Mode (0: Half, 1: Full)
    428       1.1  matt  * 02:02 Fctl			Indicates Flow-control Mode
    429       1.1  matt  *				(0: enabled, 1: disabled)
    430       1.1  matt  * 03:03 Link			Indicates Link Status (0: down, 1: up)
    431       1.1  matt  * 04:04 Pause			Indicates that the port is in flow-control
    432       1.1  matt  *				disabled state.  This bit is set when an IEEE
    433       1.1  matt  *				802.3x flow-control PAUSE (XOFF) packet is
    434       1.1  matt  *				received (assuming that flow-control is
    435       1.1  matt  *				enabled and the port is in full-duplex mode).
    436       1.1  matt  *				Reset when XON is received, or when the XOFF
    437       1.1  matt  *				timer has expired.
    438       1.1  matt  * 05:05 TxLow			Tx Low Priority Status
    439       1.1  matt  *				Indicates the status of the low priority
    440       1.1  matt  *				transmit queue: (0: Stopped, 1: Running)
    441       1.1  matt  * 06:06 TxHigh			Tx High Priority Status
    442       1.1  matt  *				Indicates the status of the high priority
    443       1.1  matt  *				transmit queue: (0: Stopped, 1: Running)
    444       1.1  matt  * 07:07 TXinProg		TX in Progress
    445       1.1  matt  *				Indicates that the port's transmitter is in an
    446       1.1  matt  *				active transmission state.
    447       1.1  matt  * 31:08 Reserved
    448       1.1  matt  */
    449       1.1  matt #define	ETH_EPSR_Speed		ETH__BIT(0)
    450       1.1  matt #define	ETH_EPSR_Duplex		ETH__BIT(1)
    451       1.1  matt #define	ETH_EPSR_Fctl		ETH__BIT(2)
    452       1.1  matt #define	ETH_EPSR_Link		ETH__BIT(3)
    453       1.1  matt #define	ETH_EPSR_Pause		ETH__BIT(4)
    454       1.1  matt #define	ETH_EPSR_TxLow		ETH__BIT(5)
    455       1.1  matt #define	ETH_EPSR_TxHigh		ETH__BIT(6)
    456       1.1  matt #define	ETH_EPSR_TXinProg	ETH__BIT(7)
    457       1.1  matt 
    458       1.1  matt 
    459  1.2.10.1  kent /*
    460       1.1  matt  * Table 601: Serial Parameters Register (SPR)
    461       1.1  matt  * 01:00 JAM_LENGTH		Two bits to determine the JAM Length
    462       1.1  matt  *				(in Backpressure) as follows:
    463       1.1  matt  *					00 = 12K bit-times
    464       1.1  matt  *					01 = 24K bit-times
    465       1.1  matt  *					10 = 32K bit-times
    466       1.1  matt  *					11 = 48K bit-times
    467       1.1  matt  * 06:02 JAM_IPG		Five bits to determine the JAM IPG.
    468       1.1  matt  *				The step is four bit-times. The value may vary
    469       1.1  matt  *				between 4 bit time to 124.
    470       1.1  matt  * 11:07 IPG_JAM_TO_DATA	Five bits to determine the IPG JAM to DATA.
    471       1.1  matt  *				The step is four bit-times. The value may vary
    472       1.1  matt  *				between 4 bit time to 124.
    473       1.1  matt  * 16:12 IPG_DATA		Inter-Packet Gap (IPG)
    474       1.1  matt  *				The step is four bit-times. The value may vary
    475       1.1  matt  *				between 12 bit time to 124.
    476       1.1  matt  *				NOTE: These bits may be changed only when the
    477       1.1  matt  *				      Ethernet ports is disabled.
    478       1.1  matt  * 21:17 Data_Blind		Data Blinder
    479       1.1  matt  *				The number of nibbles from the beginning of the
    480       1.1  matt  *				IPG, in which the IPG counter is restarted when
    481       1.1  matt  *				detecting a carrier activity.  Following this
    482       1.1  matt  *				value, the port enters the Data Blinder zone and
    483       1.1  matt  *				does not reset the IPG counter. This ensures
    484       1.1  matt  *				fair access to the medium.
    485       1.1  matt  *				The default is 10 hex (64 bit times - 2/3 of the
    486       1.1  matt  *				default IPG).  The step is 4 bit-times. Valid
    487       1.1  matt  *				range is 3 to 1F hex nibbles.
    488       1.1  matt  *				NOTE: These bits may be only changed when the
    489       1.1  matt  *				      Ethernet port is disabled.
    490       1.1  matt  * 22:22 Limit4			The number of consecutive packet collisions that
    491       1.1  matt  *				occur before the collision counter is reset.
    492       1.1  matt  *				  0: The port resets its collision counter after
    493       1.1  matt  *				     16 consecutive retransmit trials and
    494       1.1  matt  *				     restarts the Backoff algorithm.
    495       1.1  matt  *				  1: The port resets its collision counter and
    496       1.1  matt  *				     restarts the Backoff algorithm after 4
    497       1.1  matt  *				     consecutive transmit trials.
    498       1.1  matt  * 31:23 Reserved
    499       1.1  matt  */
    500       1.1  matt #define	ETH_ESPR_JAM_LENGTH_GET(v)	ETH__EXT(v, 0, 2)
    501       1.1  matt #define	ETH_ESPR_JAM_IPG_GET(v)		ETH__EXT(v, 2, 5)
    502       1.1  matt #define	ETH_ESPR_IPG_JAM_TO_DATA_GET(v)	ETH__EXT(v, 7, 5)
    503       1.1  matt #define	ETH_ESPR_IPG_DATA_GET(v)	ETH__EXT(v, 12, 5)
    504       1.1  matt #define	ETH_ESPR_Data_Bilnd_GET(v)	ETH__EXT(v, 17, 5)
    505       1.1  matt #define	ETH_ESPR_Limit4(v)		ETH__BIT(22)
    506       1.1  matt 
    507  1.2.10.1  kent /*
    508       1.1  matt  * Table 602: Hash Table Pointer Register (HTPR)
    509       1.1  matt  * 31:00 HTP			32-bit pointer to the address table.
    510       1.1  matt  *				Bits [2:0] must be set to zero.
    511       1.1  matt  */
    512       1.1  matt 
    513  1.2.10.1  kent /*
    514       1.1  matt  * Table 603: Flow Control Source Address Low (FCSAL)
    515       1.1  matt  * 15:0 SA[15:0]		Source Address
    516       1.1  matt  *				The least significant bits of the source
    517       1.1  matt  *				address for the port.  This address is used for
    518       1.1  matt  *				Flow Control.
    519       1.1  matt  * 31:16 Reserved
    520       1.1  matt  */
    521       1.1  matt 
    522  1.2.10.1  kent /*
    523       1.1  matt  * Table 604: Flow Control Source Address High (FCSAH)
    524       1.1  matt  * 31:0 SA[47:16]		Source Address
    525       1.1  matt  *				The most significant bits of the source address
    526       1.1  matt  *				for the port.  This address is used for Flow
    527       1.1  matt  *				Control.
    528       1.1  matt  */
    529       1.1  matt 
    530       1.1  matt 
    531  1.2.10.1  kent /*
    532       1.1  matt  * Table 605: SDMA Configuration Register (SDCR)
    533       1.1  matt  * 01:00 Reserved
    534       1.1  matt  * 05:02 RC			Retransmit Count
    535       1.1  matt  *				Sets the maximum number of retransmits per
    536       1.1  matt  *				packet.  After executing retransmit for RC
    537       1.1  matt  *				times, the TX SDMA closes the descriptor with a
    538       1.1  matt  *				Retransmit Limit error indication and processes
    539       1.1  matt  *				the next packet.  When RC is set to 0, the
    540       1.1  matt  *				number of retransmits is unlimited. In this
    541       1.1  matt  *				case, the retransmit process is only terminated
    542       1.1  matt  *				if CPU issues an Abort command.
    543       1.1  matt  * 06:06 BLMR			Big/Little Endian Receive Mode
    544       1.1  matt  *				The DMA supports Big or Little Endian
    545       1.1  matt  *				configurations on a per channel basis. The BLMR
    546       1.1  matt  *				bit only affects data transfer to memory.
    547       1.1  matt  *					0: Big Endian
    548       1.1  matt  *					1: Little Endian
    549       1.1  matt  * 07:07 BLMT			Big/Little Endian Transmit Mode
    550       1.1  matt  *				The DMA supports Big or Little Endian
    551       1.1  matt  *				configurations on a per channel basis. The BLMT
    552       1.1  matt  *				bit only affects data transfer from memory.
    553       1.1  matt  *					0: Big Endian
    554       1.1  matt  *					1: Little Endian
    555       1.1  matt  * 08:08 POVR			PCI Override
    556       1.1  matt  *				When set, causes the SDMA to direct all its
    557       1.1  matt  *				accesses in PCI_0 direction and overrides
    558       1.1  matt  *				normal address decoding process.
    559       1.1  matt  * 09:09 RIFB			Receive Interrupt on Frame Boundaries
    560       1.1  matt  *				When set, the SDMA Rx generates interrupts only
    561       1.1  matt  *				on frame boundaries (i.e. after writing the
    562       1.1  matt  *				frame status to the descriptor).
    563       1.1  matt  * 11:10 Reserved
    564       1.1  matt  * 13:12 BSZ			Burst Size
    565       1.1  matt  *				Sets the maximum burst size for SDMA
    566       1.1  matt  *				transactions:
    567       1.1  matt  *					00: Burst is limited to 1 64bit words.
    568       1.1  matt  *					01: Burst is limited to 2 64bit words.
    569       1.1  matt  *					10: Burst is limited to 4 64bit words.
    570       1.1  matt  *					11: Burst is limited to 8 64bit words.
    571       1.1  matt  * 31:14 Reserved
    572       1.1  matt  */
    573       1.1  matt #define	ETH_ESDCR_RC_GET(v)		ETH__EXT(v, 2, 4)
    574       1.1  matt #define	ETH_ESDCR_BLMR			ETH__BIT(6)
    575       1.1  matt #define	ETH_ESDCR_BLMT			ETH__BIT(7)
    576       1.1  matt #define	ETH_ESDCR_POVR			ETH__BIT(8)
    577       1.1  matt #define	ETH_ESDCR_RIFB			ETH__BIT(9)
    578       1.1  matt #define	ETH_ESDCR_BSZ_GET(v)		ETH__EXT(v, 12, 2)
    579       1.1  matt #define	ETH_ESDCR_BSZ_SET(v, n)		(ETH__CLR(v, 12, 2),\
    580       1.1  matt 					 (v) |= ETH__INS(n, 12))
    581       1.1  matt #define	ETH_ESDCR_BSZ_1			0
    582       1.1  matt #define	ETH_ESDCR_BSZ_2			1
    583       1.1  matt #define	ETH_ESDCR_BSZ_4			2
    584       1.1  matt #define	ETH_ESDCR_BSZ_8			3
    585       1.1  matt 
    586       1.1  matt #define	ETH_ESDCR_BSZ_Strings		{ "1 64-bit word", "2 64-bit words", \
    587       1.1  matt 					  "4 64-bit words", "8 64-bit words" }
    588       1.1  matt 
    589  1.2.10.1  kent /*
    590       1.1  matt  * Table 606: SDMA Command Register (SDCMR)
    591       1.1  matt  * 06:00 Reserved
    592       1.1  matt  * 07:07 ERD			Enable RX DMA.
    593       1.1  matt  *				Set to 1 by the CPU to cause the SDMA to start
    594       1.1  matt  *				a receive process.  Cleared when the CPU issues
    595       1.1  matt  *				an Abort Receive command.
    596       1.1  matt  * 14:08 Reserved
    597       1.1  matt  * 15:15 AR			Abort Receive
    598       1.1  matt  *				Set to 1 by the CPU to abort a receive SDMA
    599       1.1  matt  *				operation.  When the AR bit is set, the SDMA
    600       1.1  matt  *				aborts its current operation and moves to IDLE.
    601       1.1  matt  *				No descriptor is closed.  The AR bit is cleared
    602       1.1  matt  *				upon entering IDLE.  After setting the AR bit,
    603       1.1  matt  *				the CPU must poll the bit to verify that the
    604       1.1  matt  *				abort sequence is completed.
    605       1.1  matt  * 16:16 STDH			Stop TX High
    606       1.1  matt  *				Set to 1 by the CPU to stop the transmission
    607       1.1  matt  *				process from the high priority queue at the end
    608       1.1  matt  *				of the current frame. An interrupt is generated
    609       1.1  matt  *				when the stop command has been executed.
    610       1.1  matt  *				  Writing 1 to STDH resets TXDH bit.
    611       1.1  matt  *				  Writing 0 to this bit has no effect.
    612       1.1  matt  * 17:17 STDL			Stop TX Low
    613       1.1  matt  *				Set to 1 by the CPU to stop the transmission
    614       1.1  matt  *				process from the low priority queue at the end
    615       1.1  matt  *				of the current frame. An interrupt is generated
    616       1.1  matt  *				when the stop command has been executed.
    617       1.1  matt  *				  Writing 1 to STDL resets TXDL bit.
    618       1.1  matt  *				  Writing 0 to this bit has no effect.
    619       1.1  matt  * 22:18 Reserved
    620       1.1  matt  * 23:23 TXDH			Start Tx High
    621       1.1  matt  *				Set to 1 by the CPU to cause the SDMA to fetch
    622       1.1  matt  *				the first descriptor and start a transmit
    623       1.1  matt  *				process from the high priority Tx queue.
    624       1.1  matt  *				  Writing 1 to TXDH resets STDH bit.
    625       1.1  matt  *				  Writing 0 to this bit has no effect.
    626       1.1  matt  * 24:24 TXDL			Start Tx Low
    627       1.1  matt  *				Set to 1 by the CPU to cause the SDMA to fetch
    628       1.1  matt  *				the first descriptor and start a transmit
    629       1.1  matt  *				process from the low priority Tx queue.
    630       1.1  matt  *				  Writing 1 to TXDL resets STDL bit.
    631       1.1  matt  *				  Writing 0 to this bit has no effect.
    632       1.1  matt  * 30:25 Reserved
    633       1.1  matt  * 31:31 AT			Abort Transmit
    634       1.1  matt  *				Set to 1 by the CPU to abort a transmit DMA
    635       1.1  matt  *				operation.  When the AT bit is set, the SDMA
    636       1.1  matt  *				aborts its current operation and moves to IDLE.
    637       1.1  matt  *				No descriptor is closed.  Cleared upon entering
    638       1.1  matt  *				IDLE.  After setting AT bit, the CPU must poll
    639       1.1  matt  *				it in order to verify that the abort sequence
    640       1.1  matt  *				is completed.
    641       1.1  matt  */
    642       1.1  matt #define	ETH_ESDCMR_ERD			ETH__BIT(7)
    643       1.1  matt #define	ETH_ESDCMR_AR			ETH__BIT(15)
    644       1.1  matt #define	ETH_ESDCMR_STDH			ETH__BIT(16)
    645       1.1  matt #define	ETH_ESDCMR_STDL			ETH__BIT(17)
    646       1.1  matt #define	ETH_ESDCMR_TXDH			ETH__BIT(23)
    647       1.1  matt #define	ETH_ESDCMR_TXDL			ETH__BIT(24)
    648       1.1  matt #define	ETH_ESDCMR_AT			ETH__BIT(31)
    649       1.1  matt 
    650  1.2.10.1  kent /*
    651       1.1  matt  * Table 607: Interrupt Cause Register (ICR)
    652       1.1  matt  * 00:00 RxBuffer		Rx Buffer Return
    653       1.1  matt  *				Indicates an Rx buffer returned to CPU ownership
    654       1.1  matt  *				or that the port finished reception of a Rx
    655       1.1  matt  *				frame in either priority queues.
    656       1.1  matt  *				NOTE: In order to get a Rx Buffer return per
    657       1.1  matt  *				      priority queue, use bit 19:16. This bit is
    658       1.1  matt  *				      set upon closing any Rx descriptor which
    659       1.1  matt  *				      has its EI bit set. To limit the
    660       1.1  matt  *				      interrupts to frame (rather than buffer)
    661       1.1  matt  *				      boundaries, the user must set SDMA
    662       1.1  matt  *				      Configuration register's RIFB bit. When
    663       1.1  matt  *				      the RIFB bit is set, an interrupt
    664       1.1  matt  *				      generates only upon closing the first
    665       1.1  matt  *				      descriptor of a received packet, if this
    666       1.1  matt  *				      descriptor has it EI bit set.
    667       1.1  matt  * 01:01 Reserved
    668       1.1  matt  * 02:02 TxBufferHigh		Tx Buffer for High priority Queue
    669       1.1  matt  *				Indicates a Tx buffer returned to CPU ownership
    670       1.1  matt  *				or that the port finished transmission of a Tx
    671       1.1  matt  *				frame.
    672       1.1  matt  *				NOTE: This bit is set upon closing any Tx
    673       1.1  matt  *				      descriptor which has its EI bit set. To
    674       1.1  matt  *				      limit the interrupts to frame (rather than
    675       1.1  matt  *				      buffer) boundaries, the user must set EI
    676       1.1  matt  *				      only in the last descriptor.
    677       1.1  matt  * 03:03 TxBufferLow		Tx Buffer for Low Priority Queue
    678       1.1  matt  *				Indicates a Tx buffer returned to CPU ownership
    679       1.1  matt  *				or that the port finished transmission of a Tx
    680       1.1  matt  *				frame.
    681       1.1  matt  *				NOTE: This bit is set upon closing any Tx
    682       1.1  matt  *				      descriptor which has its EI bit set. To
    683       1.1  matt  *				      limit the interrupts to frame (rather than
    684       1.1  matt  *				      buffer) boundaries, the user must set EI
    685       1.1  matt  *				      only in the last descriptor.
    686       1.1  matt  * 05:04 Reserved
    687       1.1  matt  * 06:06 TxEndHigh		Tx End for High Priority Queue
    688       1.1  matt  *				Indicates that the Tx DMA stopped processing the
    689       1.1  matt  *				high priority queue after stop command, or that
    690       1.1  matt  *				it reached the end of the high priority
    691       1.1  matt  *				descriptor chain.
    692       1.1  matt  * 07:07 TxEndLow		Tx End for Low Priority Queue
    693       1.1  matt  *				Indicates that the Tx DMA stopped processing the
    694       1.1  matt  *				low priority queue after stop command, or that
    695       1.1  matt  *				it reached the end of the low priority
    696       1.1  matt  *				descriptor chain.
    697       1.1  matt  * 08:08 RxError		Rx Resource Error
    698       1.1  matt  *				Indicates a Rx resource error event in one of
    699       1.1  matt  *				the priority queues.
    700       1.1  matt  *				NOTE: To get a Rx Resource Error Indication per
    701       1.1  matt  *				      priority queue, use bit 23:20.
    702       1.1  matt  * 09:09 Reserved
    703       1.1  matt  * 10:10 TxErrorHigh		Tx Resource Error for High Priority Queue
    704       1.1  matt  *				Indicates a Tx resource error event during
    705       1.1  matt  *				packet transmission from the high priority queue
    706       1.1  matt  * 11:11 TxErrorLow		Tx Resource Error for Low Priority Queue
    707       1.1  matt  *				Indicates a Tx resource error event during
    708       1.1  matt  *				packet transmission from the low priority queue
    709       1.1  matt  * 12:12 RxOVR			Rx Overrun
    710       1.1  matt  *				Indicates an overrun event that occurred during
    711       1.1  matt  *				reception of a packet.
    712       1.1  matt  * 13:13 TxUdr			Tx Underrun
    713       1.1  matt  *				Indicates an underrun event that occurred during
    714       1.1  matt  *				transmission of packet from either queue.
    715       1.1  matt  * 15:14 Reserved
    716       1.1  matt  * 16:16 RxBuffer-Queue[0]	Rx Buffer Return in Priority Queue[0]
    717       1.1  matt  *				Indicates a Rx buffer returned to CPU ownership
    718       1.1  matt  *				or that the port completed reception of a Rx
    719       1.1  matt  *				frame in a receive priority queue[0]
    720       1.1  matt  * 17:17 RxBuffer-Queue[1]	Rx Buffer Return in Priority Queue[1]
    721       1.1  matt  *				Indicates a Rx buffer returned to CPU ownership
    722       1.1  matt  *				or that the port completed reception of a Rx
    723       1.1  matt  *				frame in a receive priority queue[1].
    724       1.1  matt  * 18:18 RxBuffer-Queue[2]	Rx Buffer Return in Priority Queue[2]
    725       1.1  matt  *				Indicates a Rx buffer returned to CPU ownership
    726       1.1  matt  *				or that the port completed reception of a Rx
    727       1.1  matt  *				frame in a receive priority queue[2].
    728       1.1  matt  * 19:19 RxBuffer-Queue[3]	Rx Buffer Return in Priority Queue[3]
    729       1.1  matt  *				Indicates a Rx buffer returned to CPU ownership
    730       1.1  matt  *				or that the port completed reception of a Rx
    731       1.1  matt  *				frame in a receive priority queue[3].
    732       1.1  matt  * 20:20 RxError-Queue[0]	Rx Resource Error in Priority Queue[0]
    733       1.1  matt  *				Indicates a Rx resource error event in receive
    734       1.1  matt  *				priority queue[0].
    735       1.1  matt  * 21:21 RxError-Queue[1]	Rx Resource Error in Priority Queue[1]
    736       1.1  matt  *				Indicates a Rx resource error event in receive
    737       1.1  matt  *				priority queue[1].
    738       1.1  matt  * 22:22 RxError-Queue[2]	Rx Resource Error in Priority Queue[2]
    739       1.1  matt  *				Indicates a Rx resource error event in receive
    740       1.1  matt  *				priority queue[2].
    741       1.1  matt  * 23:23 RxError-Queue[3]	Rx Resource Error in Priority Queue[3]
    742       1.1  matt  *				Indicates a Rx resource error event in receive
    743       1.1  matt  *				priority queue[3].
    744       1.1  matt  * 27:24 Reserved
    745       1.1  matt  * 28:29 MIIPhySTC		MII PHY Status Change
    746       1.1  matt  *				Indicates a status change reported by the PHY
    747       1.1  matt  *				connected to this port.  Set when the MII
    748       1.1  matt  *				management interface block identifies a change
    749       1.1  matt  *				in PHY's register 1.
    750       1.1  matt  * 29:29 SMIdone		SMI Command Done
    751       1.1  matt  *				Indicates that the SMI completed a MII
    752       1.1  matt  *				management command (either read or write) that
    753       1.1  matt  *				was initiated by the CPU writing to the SMI
    754       1.1  matt  *				register.
    755       1.1  matt  * 30:30 Reserved
    756       1.1  matt  * 31:31 EtherIntSum		Ethernet Interrupt Summary
    757       1.1  matt  *				This bit is a logical OR of the (unmasked) bits
    758       1.1  matt  *				[30:04] in the Interrupt Cause register.
    759       1.1  matt  */
    760       1.1  matt 
    761       1.1  matt #define	ETH_IR_RxBuffer		ETH__BIT(0)
    762       1.1  matt #define	ETH_IR_TxBufferHigh	ETH__BIT(2)
    763       1.1  matt #define	ETH_IR_TxBufferLow	ETH__BIT(3)
    764       1.1  matt #define	ETH_IR_TxEndHigh	ETH__BIT(6)
    765       1.1  matt #define	ETH_IR_TxEndLow		ETH__BIT(7)
    766       1.1  matt #define	ETH_IR_RxError		ETH__BIT(8)
    767       1.1  matt #define	ETH_IR_TxErrorHigh	ETH__BIT(10)
    768       1.1  matt #define	ETH_IR_TxErrorLow	ETH__BIT(11)
    769       1.1  matt #define	ETH_IR_RxOVR		ETH__BIT(12)
    770       1.1  matt #define	ETH_IR_TxUdr		ETH__BIT(13)
    771       1.1  matt #define	ETH_IR_RxBuffer_0	ETH__BIT(16)
    772       1.1  matt #define	ETH_IR_RxBuffer_1	ETH__BIT(17)
    773       1.1  matt #define	ETH_IR_RxBuffer_2	ETH__BIT(18)
    774       1.1  matt #define	ETH_IR_RxBuffer_3	ETH__BIT(19)
    775       1.1  matt #define	ETH_IR_RxBuffer_GET(v)	ETH__EXT(v, 16, 4)
    776       1.1  matt #define	ETH_IR_RxError_0	ETH__BIT(20)
    777       1.1  matt #define	ETH_IR_RxError_1	ETH__BIT(21)
    778       1.1  matt #define	ETH_IR_RxError_2	ETH__BIT(22)
    779       1.1  matt #define	ETH_IR_RxError_3	ETH__BIT(23)
    780       1.1  matt #define	ETH_IR_RxError_GET(v)	ETH__EXT(v, 20, 4)
    781       1.1  matt #define	ETH_IR_RxBits		(ETH_IR_RxBuffer_0|\
    782       1.1  matt 				 ETH_IR_RxBuffer_1|\
    783       1.1  matt 				 ETH_IR_RxBuffer_2|\
    784       1.1  matt 				 ETH_IR_RxBuffer_3|\
    785       1.1  matt 				 ETH_IR_RxError_0|\
    786       1.1  matt 				 ETH_IR_RxError_1|\
    787       1.1  matt 				 ETH_IR_RxError_2|\
    788       1.1  matt 				 ETH_IR_RxError_3)
    789       1.1  matt #define	ETH_IR_MIIPhySTC	ETH__BIT(28)
    790       1.1  matt #define	ETH_IR_SMIdone		ETH__BIT(29)
    791       1.1  matt #define	ETH_IR_EtherIntSum	ETH__BIT(31)
    792       1.1  matt #define	ETH_IR_Summary		ETH__BIT(31)
    793       1.1  matt 
    794  1.2.10.1  kent /*
    795       1.1  matt  * Table 608: Interrupt Mask Register (IMR)
    796       1.1  matt  * 31:00 Various		Mask bits for the Interrupt Cause register.
    797       1.1  matt  */
    798       1.1  matt 
    799  1.2.10.1  kent /*
    800       1.1  matt  * Table 609: IP Differentiated Services CodePoint to Priority0 low (DSCP2P0L),
    801       1.1  matt  * 31:00 Priority0_low		The LSB priority bits for DSCP[31:0] entries.
    802       1.1  matt  */
    803       1.1  matt 
    804  1.2.10.1  kent /*
    805       1.1  matt  * Table 610: IP Differentiated Services CodePoint to Priority0 high (DSCP2P0H)
    806       1.1  matt  * 31:00 Priority0_high		The LSB priority bits for DSCP[63:32] entries.
    807       1.1  matt  */
    808       1.1  matt 
    809  1.2.10.1  kent /*
    810       1.1  matt  * Table 611: IP Differentiated Services CodePoint to Priority1 low (DSCP2P1L)
    811       1.1  matt  * 31:00 Priority1_low		The MSB priority bits for DSCP[31:0] entries.
    812       1.1  matt  */
    813       1.1  matt 
    814  1.2.10.1  kent /*
    815       1.1  matt  * Table 612: IP Differentiated Services CodePoint to Priority1 high (DSCP2P1H)
    816       1.1  matt  * 31:00 Priority1_high		The MSB priority bit for DSCP[63:32] entries.
    817       1.1  matt  */
    818       1.1  matt 
    819  1.2.10.1  kent /*
    820       1.1  matt  * Table 613: VLAN Priority Tag to Priority (VPT2P)
    821       1.1  matt  * 07:00 Priority0		The LSB priority bits for VLAN Priority[7:0]
    822       1.1  matt  *				entries.
    823       1.1  matt  * 15:08 Priority1		The MSB priority bits for VLAN Priority[7:0]
    824       1.1  matt  *				entries.
    825       1.1  matt  * 31:16 Reserved
    826       1.1  matt  */
    827       1.1  matt #endif /* _DEV_GTETHREG_H_ */
    828