xref: /freebsd/sys/dev/e1000/e1000_82575.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
18cfa0ad2SJack F Vogel /******************************************************************************
27282444bSPedro F. Giffuni   SPDX-License-Identifier: BSD-3-Clause
38cfa0ad2SJack F Vogel 
4702cac6cSKevin Bowling   Copyright (c) 2001-2020, Intel Corporation
58cfa0ad2SJack F Vogel   All rights reserved.
68cfa0ad2SJack F Vogel 
78cfa0ad2SJack F Vogel   Redistribution and use in source and binary forms, with or without
88cfa0ad2SJack F Vogel   modification, are permitted provided that the following conditions are met:
98cfa0ad2SJack F Vogel 
108cfa0ad2SJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
118cfa0ad2SJack F Vogel       this list of conditions and the following disclaimer.
128cfa0ad2SJack F Vogel 
138cfa0ad2SJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
148cfa0ad2SJack F Vogel       notice, this list of conditions and the following disclaimer in the
158cfa0ad2SJack F Vogel       documentation and/or other materials provided with the distribution.
168cfa0ad2SJack F Vogel 
178cfa0ad2SJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
188cfa0ad2SJack F Vogel       contributors may be used to endorse or promote products derived from
198cfa0ad2SJack F Vogel       this software without specific prior written permission.
208cfa0ad2SJack F Vogel 
218cfa0ad2SJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
228cfa0ad2SJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
238cfa0ad2SJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
248cfa0ad2SJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
258cfa0ad2SJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
268cfa0ad2SJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
278cfa0ad2SJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
288cfa0ad2SJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
298cfa0ad2SJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
308cfa0ad2SJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
318cfa0ad2SJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
328cfa0ad2SJack F Vogel 
338cfa0ad2SJack F Vogel ******************************************************************************/
348cfa0ad2SJack F Vogel 
358cfa0ad2SJack F Vogel #ifndef _E1000_82575_H_
368cfa0ad2SJack F Vogel #define _E1000_82575_H_
378cfa0ad2SJack F Vogel 
388cfa0ad2SJack F Vogel #define ID_LED_DEFAULT_82575_SERDES	((ID_LED_DEF1_DEF2 << 12) | \
398cfa0ad2SJack F Vogel 					 (ID_LED_DEF1_DEF2 <<  8) | \
408cfa0ad2SJack F Vogel 					 (ID_LED_DEF1_DEF2 <<  4) | \
418cfa0ad2SJack F Vogel 					 (ID_LED_OFF1_ON2))
428cfa0ad2SJack F Vogel /*
438cfa0ad2SJack F Vogel  * Receive Address Register Count
448cfa0ad2SJack F Vogel  * Number of high/low register pairs in the RAR.  The RAR (Receive Address
458cfa0ad2SJack F Vogel  * Registers) holds the directed and multicast addresses that we monitor.
468cfa0ad2SJack F Vogel  * These entries are also used for MAC-based filtering.
478cfa0ad2SJack F Vogel  */
488cfa0ad2SJack F Vogel /*
498cfa0ad2SJack F Vogel  * For 82576, there are an additional set of RARs that begin at an offset
508cfa0ad2SJack F Vogel  * separate from the first set of RARs.
518cfa0ad2SJack F Vogel  */
528cfa0ad2SJack F Vogel #define E1000_RAR_ENTRIES_82575	16
538cfa0ad2SJack F Vogel #define E1000_RAR_ENTRIES_82576	24
544edd8523SJack F Vogel #define E1000_RAR_ENTRIES_82580	24
55f0ecc46dSJack F Vogel #define E1000_RAR_ENTRIES_I350	32
564edd8523SJack F Vogel #define E1000_SW_SYNCH_MB	0x00000100
574edd8523SJack F Vogel #define E1000_STAT_DEV_RST_SET	0x00100000
588cfa0ad2SJack F Vogel 
598cfa0ad2SJack F Vogel struct e1000_adv_data_desc {
604edd8523SJack F Vogel 	__le64 buffer_addr;    /* Address of the descriptor's data buffer */
618cfa0ad2SJack F Vogel 	union {
628cfa0ad2SJack F Vogel 		u32 data;
638cfa0ad2SJack F Vogel 		struct {
648cfa0ad2SJack F Vogel 			u32 datalen:16; /* Data buffer length */
658cfa0ad2SJack F Vogel 			u32 rsvd:4;
668cfa0ad2SJack F Vogel 			u32 dtyp:4;  /* Descriptor type */
678cfa0ad2SJack F Vogel 			u32 dcmd:8;  /* Descriptor command */
688cfa0ad2SJack F Vogel 		} config;
698cfa0ad2SJack F Vogel 	} lower;
708cfa0ad2SJack F Vogel 	union {
718cfa0ad2SJack F Vogel 		u32 data;
728cfa0ad2SJack F Vogel 		struct {
738cfa0ad2SJack F Vogel 			u32 status:4;  /* Descriptor status */
748cfa0ad2SJack F Vogel 			u32 idx:4;
758cfa0ad2SJack F Vogel 			u32 popts:6;  /* Packet Options */
768cfa0ad2SJack F Vogel 			u32 paylen:18; /* Payload length */
778cfa0ad2SJack F Vogel 		} options;
788cfa0ad2SJack F Vogel 	} upper;
798cfa0ad2SJack F Vogel };
808cfa0ad2SJack F Vogel 
818cfa0ad2SJack F Vogel #define E1000_TXD_DTYP_ADV_C	0x2  /* Advanced Context Descriptor */
828cfa0ad2SJack F Vogel #define E1000_TXD_DTYP_ADV_D	0x3  /* Advanced Data Descriptor */
838cfa0ad2SJack F Vogel #define E1000_ADV_TXD_CMD_DEXT	0x20 /* Descriptor extension (0 = legacy) */
848cfa0ad2SJack F Vogel #define E1000_ADV_TUCMD_IPV4	0x2  /* IP Packet Type: 1=IPv4 */
858cfa0ad2SJack F Vogel #define E1000_ADV_TUCMD_IPV6	0x0  /* IP Packet Type: 0=IPv6 */
868cfa0ad2SJack F Vogel #define E1000_ADV_TUCMD_L4T_UDP	0x0  /* L4 Packet TYPE of UDP */
878cfa0ad2SJack F Vogel #define E1000_ADV_TUCMD_L4T_TCP	0x4  /* L4 Packet TYPE of TCP */
888cfa0ad2SJack F Vogel #define E1000_ADV_TUCMD_MKRREQ	0x10 /* Indicates markers are required */
898cfa0ad2SJack F Vogel #define E1000_ADV_DCMD_EOP	0x1  /* End of Packet */
908cfa0ad2SJack F Vogel #define E1000_ADV_DCMD_IFCS	0x2  /* Insert FCS (Ethernet CRC) */
918cfa0ad2SJack F Vogel #define E1000_ADV_DCMD_RS	0x8  /* Report Status */
928cfa0ad2SJack F Vogel #define E1000_ADV_DCMD_VLE	0x40 /* Add VLAN tag */
938cfa0ad2SJack F Vogel #define E1000_ADV_DCMD_TSE	0x80 /* TCP Seg enable */
948cfa0ad2SJack F Vogel /* Extended Device Control */
958cfa0ad2SJack F Vogel #define E1000_CTRL_EXT_NSICR	0x00000001 /* Disable Intr Clear all on read */
968cfa0ad2SJack F Vogel 
978cfa0ad2SJack F Vogel struct e1000_adv_context_desc {
988cfa0ad2SJack F Vogel 	union {
998cfa0ad2SJack F Vogel 		u32 ip_config;
1008cfa0ad2SJack F Vogel 		struct {
1018cfa0ad2SJack F Vogel 			u32 iplen:9;
1028cfa0ad2SJack F Vogel 			u32 maclen:7;
1038cfa0ad2SJack F Vogel 			u32 vlan_tag:16;
1048cfa0ad2SJack F Vogel 		} fields;
1058cfa0ad2SJack F Vogel 	} ip_setup;
1068cfa0ad2SJack F Vogel 	u32 seq_num;
1078cfa0ad2SJack F Vogel 	union {
1088cfa0ad2SJack F Vogel 		u64 l4_config;
1098cfa0ad2SJack F Vogel 		struct {
1108cfa0ad2SJack F Vogel 			u32 mkrloc:9;
1118cfa0ad2SJack F Vogel 			u32 tucmd:11;
1128cfa0ad2SJack F Vogel 			u32 dtyp:4;
1138cfa0ad2SJack F Vogel 			u32 adv:8;
1148cfa0ad2SJack F Vogel 			u32 rsvd:4;
1158cfa0ad2SJack F Vogel 			u32 idx:4;
1168cfa0ad2SJack F Vogel 			u32 l4len:8;
1178cfa0ad2SJack F Vogel 			u32 mss:16;
1188cfa0ad2SJack F Vogel 		} fields;
1198cfa0ad2SJack F Vogel 	} l4_setup;
1208cfa0ad2SJack F Vogel };
1218cfa0ad2SJack F Vogel 
1228cfa0ad2SJack F Vogel /* SRRCTL bit definitions */
1238cfa0ad2SJack F Vogel #define E1000_SRRCTL_BSIZEPKT_SHIFT		10 /* Shift _right_ */
1248cfa0ad2SJack F Vogel #define E1000_SRRCTL_BSIZEHDRSIZE_MASK		0x00000F00
1258cfa0ad2SJack F Vogel #define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT		2  /* Shift _left_ */
1268cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_LEGACY		0x00000000
1278cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF	0x02000000
1288cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT		0x04000000
1298cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS	0x0A000000
1308cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION	0x06000000
1318cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
1328cfa0ad2SJack F Vogel #define E1000_SRRCTL_DESCTYPE_MASK		0x0E000000
1334edd8523SJack F Vogel #define E1000_SRRCTL_TIMESTAMP			0x40000000
134d035aa2dSJack F Vogel #define E1000_SRRCTL_DROP_EN			0x80000000
1358cfa0ad2SJack F Vogel 
1368cfa0ad2SJack F Vogel #define E1000_SRRCTL_BSIZEPKT_MASK		0x0000007F
1378cfa0ad2SJack F Vogel #define E1000_SRRCTL_BSIZEHDR_MASK		0x00003F00
1388cfa0ad2SJack F Vogel 
1398cfa0ad2SJack F Vogel #define E1000_TX_HEAD_WB_ENABLE		0x1
1408cfa0ad2SJack F Vogel #define E1000_TX_SEQNUM_WB_ENABLE	0x2
1418cfa0ad2SJack F Vogel 
14269e8e8eaSKevin Bowling #define E1000_MRQC_ENABLE_RSS_MQ		0x00000002
1438cfa0ad2SJack F Vogel #define E1000_MRQC_ENABLE_VMDQ			0x00000003
144d035aa2dSJack F Vogel #define E1000_MRQC_ENABLE_VMDQ_RSS_2Q		0x00000005
1458cfa0ad2SJack F Vogel #define E1000_MRQC_RSS_FIELD_IPV4_UDP		0x00400000
1468cfa0ad2SJack F Vogel #define E1000_MRQC_RSS_FIELD_IPV6_UDP		0x00800000
1478cfa0ad2SJack F Vogel #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX	0x01000000
1488cfa0ad2SJack F Vogel 
1498cfa0ad2SJack F Vogel #define E1000_VMRCTL_MIRROR_PORT_SHIFT		8
1504dab5c37SJack F Vogel #define E1000_VMRCTL_MIRROR_DSTPORT_MASK	(7 << \
1514dab5c37SJack F Vogel 						 E1000_VMRCTL_MIRROR_PORT_SHIFT)
1528cfa0ad2SJack F Vogel #define E1000_VMRCTL_POOL_MIRROR_ENABLE		(1 << 0)
1538cfa0ad2SJack F Vogel #define E1000_VMRCTL_UPLINK_MIRROR_ENABLE	(1 << 1)
1548cfa0ad2SJack F Vogel #define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE	(1 << 2)
1558cfa0ad2SJack F Vogel 
1568cfa0ad2SJack F Vogel #define E1000_EICR_TX_QUEUE ( \
1578cfa0ad2SJack F Vogel 	E1000_EICR_TX_QUEUE0 |    \
1588cfa0ad2SJack F Vogel 	E1000_EICR_TX_QUEUE1 |    \
1598cfa0ad2SJack F Vogel 	E1000_EICR_TX_QUEUE2 |    \
1608cfa0ad2SJack F Vogel 	E1000_EICR_TX_QUEUE3)
1618cfa0ad2SJack F Vogel 
1628cfa0ad2SJack F Vogel #define E1000_EICR_RX_QUEUE ( \
1638cfa0ad2SJack F Vogel 	E1000_EICR_RX_QUEUE0 |    \
1648cfa0ad2SJack F Vogel 	E1000_EICR_RX_QUEUE1 |    \
1658cfa0ad2SJack F Vogel 	E1000_EICR_RX_QUEUE2 |    \
1668cfa0ad2SJack F Vogel 	E1000_EICR_RX_QUEUE3)
1678cfa0ad2SJack F Vogel 
1688cfa0ad2SJack F Vogel #define E1000_EIMS_RX_QUEUE	E1000_EICR_RX_QUEUE
1698cfa0ad2SJack F Vogel #define E1000_EIMS_TX_QUEUE	E1000_EICR_TX_QUEUE
1708cfa0ad2SJack F Vogel 
1718cfa0ad2SJack F Vogel #define EIMS_ENABLE_MASK ( \
1728cfa0ad2SJack F Vogel 	E1000_EIMS_RX_QUEUE  | \
1738cfa0ad2SJack F Vogel 	E1000_EIMS_TX_QUEUE  | \
1748cfa0ad2SJack F Vogel 	E1000_EIMS_TCP_TIMER | \
1758cfa0ad2SJack F Vogel 	E1000_EIMS_OTHER)
1768cfa0ad2SJack F Vogel 
1778cfa0ad2SJack F Vogel /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
1788cfa0ad2SJack F Vogel #define E1000_IMIR_PORT_IM_EN	0x00010000  /* TCP port enable */
1798cfa0ad2SJack F Vogel #define E1000_IMIR_PORT_BP	0x00020000  /* TCP port check bypass */
1808cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_URG	0x00002000  /* Check URG bit in header */
1818cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_ACK	0x00004000  /* Check ACK bit in header */
1828cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_PSH	0x00008000  /* Check PSH bit in header */
1838cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_RST	0x00010000  /* Check RST bit in header */
1848cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_SYN	0x00020000  /* Check SYN bit in header */
1858cfa0ad2SJack F Vogel #define E1000_IMIREXT_CTRL_FIN	0x00040000  /* Check FIN bit in header */
1868cfa0ad2SJack F Vogel 
1879d81738fSJack F Vogel #define E1000_RXDADV_RSSTYPE_MASK	0x0000000F
1888cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_SHIFT	12
1898cfa0ad2SJack F Vogel #define E1000_RXDADV_HDRBUFLEN_MASK	0x7FE0
1908cfa0ad2SJack F Vogel #define E1000_RXDADV_HDRBUFLEN_SHIFT	5
1918cfa0ad2SJack F Vogel #define E1000_RXDADV_SPLITHEADER_EN	0x00001000
1928cfa0ad2SJack F Vogel #define E1000_RXDADV_SPH		0x8000
1934edd8523SJack F Vogel #define E1000_RXDADV_STAT_TS		0x10000 /* Pkt was time stamped */
1948cfa0ad2SJack F Vogel #define E1000_RXDADV_ERR_HBO		0x00800000
1958cfa0ad2SJack F Vogel 
1968cfa0ad2SJack F Vogel /* RSS Hash results */
1978cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_NONE	0x00000000
1988cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV4_TCP	0x00000001
1998cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV4	0x00000002
2008cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6_TCP	0x00000003
2018cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6_EX	0x00000004
2028cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6	0x00000005
2038cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006
2048cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV4_UDP	0x00000007
2058cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6_UDP	0x00000008
2068cfa0ad2SJack F Vogel #define E1000_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009
2078cfa0ad2SJack F Vogel 
2088cfa0ad2SJack F Vogel /* RSS Packet Types as indicated in the receive descriptor */
2097609433eSJack F Vogel #define E1000_RXDADV_PKTTYPE_ILMASK	0x000000F0
2107609433eSJack F Vogel #define E1000_RXDADV_PKTTYPE_TLMASK	0x00000F00
2118cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_NONE	0x00000000
2128cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPV4	0x00000010 /* IPV4 hdr present */
2138cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPV4_EX	0x00000020 /* IPV4 hdr + extensions */
2148cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPV6	0x00000040 /* IPV6 hdr present */
2158cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPV6_EX	0x00000080 /* IPV6 hdr + extensions */
2168cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_TCP	0x00000100 /* TCP hdr present */
2178cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_UDP	0x00000200 /* UDP hdr present */
2188cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_SCTP	0x00000400 /* SCTP hdr present */
2198cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_NFS	0x00000800 /* NFS hdr present */
2208cfa0ad2SJack F Vogel 
2218cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPSEC_ESP	0x00001000 /* IPSec ESP */
2228cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_IPSEC_AH	0x00002000 /* IPSec AH */
2238cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_LINKSEC	0x00004000 /* LinkSec Encap */
2248cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_ETQF	0x00008000 /* PKTTYPE is ETQF index */
2258cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_ETQF_MASK	0x00000070 /* ETQF has 8 indices */
2268cfa0ad2SJack F Vogel #define E1000_RXDADV_PKTTYPE_ETQF_SHIFT	4 /* Right-shift 4 bits */
2278cfa0ad2SJack F Vogel 
2288cfa0ad2SJack F Vogel /* LinkSec results */
2298cfa0ad2SJack F Vogel /* Security Processing bit Indication */
2308cfa0ad2SJack F Vogel #define E1000_RXDADV_LNKSEC_STATUS_SECP		0x00020000
2318cfa0ad2SJack F Vogel #define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK	0x18000000
2328cfa0ad2SJack F Vogel #define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH	0x08000000
2338cfa0ad2SJack F Vogel #define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR	0x10000000
2348cfa0ad2SJack F Vogel #define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG	0x18000000
2358cfa0ad2SJack F Vogel 
2368cfa0ad2SJack F Vogel #define E1000_RXDADV_IPSEC_STATUS_SECP			0x00020000
2378cfa0ad2SJack F Vogel #define E1000_RXDADV_IPSEC_ERROR_BIT_MASK		0x18000000
2388cfa0ad2SJack F Vogel #define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL	0x08000000
2398cfa0ad2SJack F Vogel #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH		0x10000000
2408cfa0ad2SJack F Vogel #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED	0x18000000
2418cfa0ad2SJack F Vogel 
2428cfa0ad2SJack F Vogel /* Adv Transmit Descriptor Config Masks */
2438cfa0ad2SJack F Vogel #define E1000_ADVTXD_DTYP_CTXT	0x00200000 /* Advanced Context Descriptor */
2448cfa0ad2SJack F Vogel #define E1000_ADVTXD_DTYP_DATA	0x00300000 /* Advanced Data Descriptor */
2458cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_EOP	0x01000000 /* End of Packet */
2468cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_IFCS	0x02000000 /* Insert FCS (Ethernet CRC) */
2478cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_RS	0x08000000 /* Report Status */
2488cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_DDTYP_ISCSI	0x10000000 /* DDP hdr type or iSCSI */
2498cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_DEXT	0x20000000 /* Descriptor extension (1=Adv) */
2508cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_VLE	0x40000000 /* VLAN pkt enable */
2518cfa0ad2SJack F Vogel #define E1000_ADVTXD_DCMD_TSE	0x80000000 /* TCP Seg enable */
2524dab5c37SJack F Vogel #define E1000_ADVTXD_MAC_LINKSEC	0x00040000 /* Apply LinkSec on pkt */
2534dab5c37SJack F Vogel #define E1000_ADVTXD_MAC_TSTAMP		0x00080000 /* IEEE1588 Timestamp pkt */
2544dab5c37SJack F Vogel #define E1000_ADVTXD_STAT_SN_CRC	0x00000002 /* NXTSEQ/SEED prsnt in WB */
2558cfa0ad2SJack F Vogel #define E1000_ADVTXD_IDX_SHIFT		4  /* Adv desc Index shift */
2568cfa0ad2SJack F Vogel #define E1000_ADVTXD_POPTS_ISCO_1ST	0x00000000 /* 1st TSO of iSCSI PDU */
2578cfa0ad2SJack F Vogel #define E1000_ADVTXD_POPTS_ISCO_MDL	0x00000800 /* Middle TSO of iSCSI PDU */
2588cfa0ad2SJack F Vogel #define E1000_ADVTXD_POPTS_ISCO_LAST	0x00001000 /* Last TSO of iSCSI PDU */
2594dab5c37SJack F Vogel /* 1st & Last TSO-full iSCSI PDU*/
2604dab5c37SJack F Vogel #define E1000_ADVTXD_POPTS_ISCO_FULL	0x00001800
2618cfa0ad2SJack F Vogel #define E1000_ADVTXD_POPTS_IPSEC	0x00000400 /* IPSec offload request */
2628cfa0ad2SJack F Vogel #define E1000_ADVTXD_PAYLEN_SHIFT	14 /* Adv desc PAYLEN shift */
2638cfa0ad2SJack F Vogel 
2648cfa0ad2SJack F Vogel /* Additional Transmit Descriptor Control definitions */
2654dab5c37SJack F Vogel #define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Tx Queue */
2664dab5c37SJack F Vogel #define E1000_TXDCTL_SWFLSH		0x04000000 /* Tx Desc. wbk flushing */
2678cfa0ad2SJack F Vogel /* Tx Queue Arbitration Priority 0=low, 1=high */
2688cfa0ad2SJack F Vogel #define E1000_TXDCTL_PRIORITY		0x08000000
2698cfa0ad2SJack F Vogel 
2708cfa0ad2SJack F Vogel /* Additional Receive Descriptor Control definitions */
2714dab5c37SJack F Vogel #define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Rx Queue */
2724dab5c37SJack F Vogel #define E1000_RXDCTL_SWFLSH		0x04000000 /* Rx Desc. wbk flushing */
2738cfa0ad2SJack F Vogel 
2748cfa0ad2SJack F Vogel /* Direct Cache Access (DCA) definitions */
2758cfa0ad2SJack F Vogel #define E1000_DCA_CTRL_DCA_ENABLE	0x00000000 /* DCA Enable */
2768cfa0ad2SJack F Vogel #define E1000_DCA_CTRL_DCA_DISABLE	0x00000001 /* DCA Disable */
2778cfa0ad2SJack F Vogel 
2788cfa0ad2SJack F Vogel #define E1000_DCA_CTRL_DCA_MODE_CB1	0x00 /* DCA Mode CB1 */
2798cfa0ad2SJack F Vogel #define E1000_DCA_CTRL_DCA_MODE_CB2	0x02 /* DCA Mode CB2 */
2808cfa0ad2SJack F Vogel 
2818cfa0ad2SJack F Vogel #define E1000_DCA_RXCTRL_CPUID_MASK	0x0000001F /* Rx CPUID Mask */
2828cfa0ad2SJack F Vogel #define E1000_DCA_RXCTRL_DESC_DCA_EN	(1 << 5) /* DCA Rx Desc enable */
2834dab5c37SJack F Vogel #define E1000_DCA_RXCTRL_HEAD_DCA_EN	(1 << 6) /* DCA Rx Desc header ena */
2844dab5c37SJack F Vogel #define E1000_DCA_RXCTRL_DATA_DCA_EN	(1 << 7) /* DCA Rx Desc payload ena */
2856ab6bfe3SJack F Vogel #define E1000_DCA_RXCTRL_DESC_RRO_EN	(1 << 9) /* DCA Rx Desc Relax Order */
2868cfa0ad2SJack F Vogel 
2878cfa0ad2SJack F Vogel #define E1000_DCA_TXCTRL_CPUID_MASK	0x0000001F /* Tx CPUID Mask */
2888cfa0ad2SJack F Vogel #define E1000_DCA_TXCTRL_DESC_DCA_EN	(1 << 5) /* DCA Tx Desc enable */
2896ab6bfe3SJack F Vogel #define E1000_DCA_TXCTRL_DESC_RRO_EN	(1 << 9) /* Tx rd Desc Relax Order */
2908cfa0ad2SJack F Vogel #define E1000_DCA_TXCTRL_TX_WB_RO_EN	(1 << 11) /* Tx Desc writeback RO bit */
2916ab6bfe3SJack F Vogel #define E1000_DCA_TXCTRL_DATA_RRO_EN	(1 << 13) /* Tx rd data Relax Order */
2928cfa0ad2SJack F Vogel 
2938cfa0ad2SJack F Vogel #define E1000_DCA_TXCTRL_CPUID_MASK_82576	0xFF000000 /* Tx CPUID Mask */
2948cfa0ad2SJack F Vogel #define E1000_DCA_RXCTRL_CPUID_MASK_82576	0xFF000000 /* Rx CPUID Mask */
295daf9197cSJack F Vogel #define E1000_DCA_TXCTRL_CPUID_SHIFT_82576	24 /* Tx CPUID */
296daf9197cSJack F Vogel #define E1000_DCA_RXCTRL_CPUID_SHIFT_82576	24 /* Rx CPUID */
2978cfa0ad2SJack F Vogel 
2988cfa0ad2SJack F Vogel /* Additional interrupt register bit definitions */
2998cfa0ad2SJack F Vogel #define E1000_ICR_LSECPNS	0x00000020 /* PN threshold - server */
3008cfa0ad2SJack F Vogel #define E1000_IMS_LSECPNS	E1000_ICR_LSECPNS /* PN threshold - server */
3018cfa0ad2SJack F Vogel #define E1000_ICS_LSECPNS	E1000_ICR_LSECPNS /* PN threshold - server */
3028cfa0ad2SJack F Vogel 
3038cfa0ad2SJack F Vogel /*
3048cfa0ad2SJack F Vogel  * ETQF filter list: one static filter per filter consumer. This is
3058cfa0ad2SJack F Vogel  *                   to avoid filter collisions later. Add new filters
3068cfa0ad2SJack F Vogel  *                   here!!
3078cfa0ad2SJack F Vogel  *
3088cfa0ad2SJack F Vogel  * Current filters:
3098cfa0ad2SJack F Vogel  *    EAPOL 802.1x (0x888e): Filter 0
3108cfa0ad2SJack F Vogel  */
3118cfa0ad2SJack F Vogel #define E1000_ETQF_FILTER_EAPOL		0
3128cfa0ad2SJack F Vogel 
3134edd8523SJack F Vogel #define E1000_FTQF_MASK_SOURCE_ADDR_BP	0x20000000
3144edd8523SJack F Vogel #define E1000_FTQF_MASK_DEST_ADDR_BP	0x40000000
3154edd8523SJack F Vogel #define E1000_FTQF_MASK_SOURCE_PORT_BP	0x80000000
3164edd8523SJack F Vogel 
3178cfa0ad2SJack F Vogel #define E1000_NVM_APME_82575		0x0400
3184dab5c37SJack F Vogel #define MAX_NUM_VFS			7
3198cfa0ad2SJack F Vogel 
3204dab5c37SJack F Vogel #define E1000_DTXSWC_MAC_SPOOF_MASK	0x000000FF /* Per VF MAC spoof cntrl */
3214dab5c37SJack F Vogel #define E1000_DTXSWC_VLAN_SPOOF_MASK	0x0000FF00 /* Per VF VLAN spoof cntrl */
3228cfa0ad2SJack F Vogel #define E1000_DTXSWC_LLE_MASK		0x00FF0000 /* Per VF Local LB enables */
323d035aa2dSJack F Vogel #define E1000_DTXSWC_VLAN_SPOOF_SHIFT	8
324d035aa2dSJack F Vogel #define E1000_DTXSWC_LLE_SHIFT		16
3258f07d847SEitan Adler #define E1000_DTXSWC_VMDQ_LOOPBACK_EN	(1U << 31)  /* global VF LB enable */
3268cfa0ad2SJack F Vogel 
3278cfa0ad2SJack F Vogel /* Easy defines for setting default pool, would normally be left a zero */
3288cfa0ad2SJack F Vogel #define E1000_VT_CTL_DEFAULT_POOL_SHIFT	7
3298cfa0ad2SJack F Vogel #define E1000_VT_CTL_DEFAULT_POOL_MASK	(0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
3308cfa0ad2SJack F Vogel 
3318cfa0ad2SJack F Vogel /* Other useful VMD_CTL register defines */
3328cfa0ad2SJack F Vogel #define E1000_VT_CTL_IGNORE_MAC		(1 << 28)
3338cfa0ad2SJack F Vogel #define E1000_VT_CTL_DISABLE_DEF_POOL	(1 << 29)
3348cfa0ad2SJack F Vogel #define E1000_VT_CTL_VM_REPL_EN		(1 << 30)
3358cfa0ad2SJack F Vogel 
3368cfa0ad2SJack F Vogel /* Per VM Offload register setup */
337d035aa2dSJack F Vogel #define E1000_VMOLR_RLPML_MASK	0x00003FFF /* Long Packet Maximum Length mask */
3388cfa0ad2SJack F Vogel #define E1000_VMOLR_LPE		0x00010000 /* Accept Long packet */
339d035aa2dSJack F Vogel #define E1000_VMOLR_RSSE	0x00020000 /* Enable RSS */
3408cfa0ad2SJack F Vogel #define E1000_VMOLR_AUPE	0x01000000 /* Accept untagged packets */
341d035aa2dSJack F Vogel #define E1000_VMOLR_ROMPE	0x02000000 /* Accept overflow multicast */
342d035aa2dSJack F Vogel #define E1000_VMOLR_ROPE	0x04000000 /* Accept overflow unicast */
3438cfa0ad2SJack F Vogel #define E1000_VMOLR_BAM		0x08000000 /* Accept Broadcast packets */
3448cfa0ad2SJack F Vogel #define E1000_VMOLR_MPME	0x10000000 /* Multicast promiscuous mode */
3458cfa0ad2SJack F Vogel #define E1000_VMOLR_STRVLAN	0x40000000 /* Vlan stripping enable */
346d035aa2dSJack F Vogel #define E1000_VMOLR_STRCRC	0x80000000 /* CRC stripping enable */
3478ec87fc5SJack F Vogel 
348f0ecc46dSJack F Vogel #define E1000_VMOLR_VPE		0x00800000 /* VLAN promiscuous enable */
349f0ecc46dSJack F Vogel #define E1000_VMOLR_UPE		0x20000000 /* Unicast promisuous enable */
350f0ecc46dSJack F Vogel #define E1000_DVMOLR_HIDVLAN	0x20000000 /* Vlan hiding enable */
351f0ecc46dSJack F Vogel #define E1000_DVMOLR_STRVLAN	0x40000000 /* Vlan stripping enable */
352f0ecc46dSJack F Vogel #define E1000_DVMOLR_STRCRC	0x80000000 /* CRC stripping enable */
353f0ecc46dSJack F Vogel 
354f0ecc46dSJack F Vogel #define E1000_PBRWAC_WALPB	0x00000007 /* Wrap around event on LAN Rx PB */
355f0ecc46dSJack F Vogel #define E1000_PBRWAC_PBE	0x00000008 /* Rx packet buffer empty */
3568cfa0ad2SJack F Vogel 
357d035aa2dSJack F Vogel #define E1000_VLVF_ARRAY_SIZE		32
358d035aa2dSJack F Vogel #define E1000_VLVF_VLANID_MASK		0x00000FFF
359d035aa2dSJack F Vogel #define E1000_VLVF_POOLSEL_SHIFT	12
360d035aa2dSJack F Vogel #define E1000_VLVF_POOLSEL_MASK		(0xFF << E1000_VLVF_POOLSEL_SHIFT)
361d035aa2dSJack F Vogel #define E1000_VLVF_LVLAN		0x00100000
362d035aa2dSJack F Vogel #define E1000_VLVF_VLANID_ENABLE	0x80000000
3638cfa0ad2SJack F Vogel 
3644edd8523SJack F Vogel #define E1000_VMVIR_VLANA_DEFAULT	0x40000000 /* Always use default VLAN */
3654edd8523SJack F Vogel #define E1000_VMVIR_VLANA_NEVER		0x80000000 /* Never insert VLAN tag */
3664edd8523SJack F Vogel 
367d035aa2dSJack F Vogel #define E1000_VF_INIT_TIMEOUT	200 /* Number of retries to clear RSTI */
3688cfa0ad2SJack F Vogel 
369d035aa2dSJack F Vogel #define E1000_IOVCTL		0x05BBC
370d035aa2dSJack F Vogel #define E1000_IOVCTL_REUSE_VFQ	0x00000001
371daf9197cSJack F Vogel 
3729d81738fSJack F Vogel #define E1000_RPLOLR_STRVLAN	0x40000000
3739d81738fSJack F Vogel #define E1000_RPLOLR_STRCRC	0x80000000
3749d81738fSJack F Vogel 
375a69ed8dfSJack F Vogel #define E1000_TCTL_EXT_COLD	0x000FFC00
376a69ed8dfSJack F Vogel #define E1000_TCTL_EXT_COLD_SHIFT	10
377a69ed8dfSJack F Vogel 
3784edd8523SJack F Vogel #define E1000_DTXCTL_8023LL	0x0004
3794edd8523SJack F Vogel #define E1000_DTXCTL_VLAN_ADDED	0x0008
3804edd8523SJack F Vogel #define E1000_DTXCTL_OOS_ENABLE	0x0010
3814edd8523SJack F Vogel #define E1000_DTXCTL_MDP_EN	0x0020
3824edd8523SJack F Vogel #define E1000_DTXCTL_SPOOF_INT	0x0040
3834edd8523SJack F Vogel 
3844dab5c37SJack F Vogel #define E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT	(1 << 14)
3854dab5c37SJack F Vogel 
386daf9197cSJack F Vogel #define ALL_QUEUES		0xFFFF
387daf9197cSJack F Vogel 
388*6b9d35faSGuinan Sun s32 e1000_reset_init_script_82575(struct e1000_hw *hw);
389*6b9d35faSGuinan Sun s32 e1000_init_nvm_params_82575(struct e1000_hw *hw);
390*6b9d35faSGuinan Sun 
391f0ecc46dSJack F Vogel /* Rx packet buffer size defines */
3924edd8523SJack F Vogel #define E1000_RXPBS_SIZE_MASK_82576	0x0000007F
3939d81738fSJack F Vogel void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable);
3947d9119bdSJack F Vogel void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
3959d81738fSJack F Vogel void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
3961fd3c44fSJack F Vogel 
397b8270585SJack F Vogel enum e1000_promisc_type {
398b8270585SJack F Vogel 	e1000_promisc_disabled = 0,   /* all promisc modes disabled */
399b8270585SJack F Vogel 	e1000_promisc_unicast = 1,    /* unicast promiscuous enabled */
400b8270585SJack F Vogel 	e1000_promisc_multicast = 2,  /* multicast promiscuous enabled */
401b8270585SJack F Vogel 	e1000_promisc_enabled = 3,    /* both uni and multicast promisc */
402b8270585SJack F Vogel 	e1000_num_promisc_types
403b8270585SJack F Vogel };
404b8270585SJack F Vogel 
405b8270585SJack F Vogel void e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
406b8270585SJack F Vogel void e1000_rlpml_set_vf(struct e1000_hw *, u16);
407b8270585SJack F Vogel s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
408295df609SEric Joyner void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
4094edd8523SJack F Vogel u16 e1000_rxpbs_adjust_82580(u32 data);
4107609433eSJack F Vogel s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data);
411c80429ceSEric Joyner s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M);
412c80429ceSEric Joyner s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M);
4137609433eSJack F Vogel s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *);
4148cc64f1eSJack F Vogel s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw);
415c80429ceSEric Joyner s32 e1000_initialize_M88E1543_phy(struct e1000_hw *hw);
4164dab5c37SJack F Vogel 
4174dab5c37SJack F Vogel /* I2C SDA and SCL timing parameters for standard mode */
4184dab5c37SJack F Vogel #define E1000_I2C_T_HD_STA	4
4194dab5c37SJack F Vogel #define E1000_I2C_T_LOW		5
4204dab5c37SJack F Vogel #define E1000_I2C_T_HIGH	4
4214dab5c37SJack F Vogel #define E1000_I2C_T_SU_STA	5
4224dab5c37SJack F Vogel #define E1000_I2C_T_HD_DATA	5
4234dab5c37SJack F Vogel #define E1000_I2C_T_SU_DATA	1
4244dab5c37SJack F Vogel #define E1000_I2C_T_RISE	1
4254dab5c37SJack F Vogel #define E1000_I2C_T_FALL	1
4264dab5c37SJack F Vogel #define E1000_I2C_T_SU_STO	4
4274dab5c37SJack F Vogel #define E1000_I2C_T_BUF		5
4284dab5c37SJack F Vogel 
4294dab5c37SJack F Vogel s32 e1000_set_i2c_bb(struct e1000_hw *hw);
4304dab5c37SJack F Vogel s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
4314dab5c37SJack F Vogel 				u8 dev_addr, u8 *data);
4324dab5c37SJack F Vogel s32 e1000_write_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
4334dab5c37SJack F Vogel 				 u8 dev_addr, u8 data);
4344dab5c37SJack F Vogel void e1000_i2c_bus_clear(struct e1000_hw *hw);
435d035aa2dSJack F Vogel #endif /* _E1000_82575_H_ */
436