6
* Intel 10 Gigabit Ethernet network card driver
10
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
13
#include <ipxe/if_ether.h>
16
/** Device Control Register */
17
#define INTELX_CTRL 0x00000UL
18
#define INTELX_CTRL_LRST 0x00000008UL /**< Link reset */
19
#define INTELX_CTRL_RST 0x04000000UL /**< Device reset */
21
/** Time to delay for device reset, in milliseconds */
22
#define INTELX_RESET_DELAY_MS 20
24
/** Extended Interrupt Cause Read Register */
25
#define INTELX_EICR 0x00800UL
26
#define INTELX_EIRQ_RX0 0x00000001UL /**< RX0 (via IVAR) */
27
#define INTELX_EIRQ_TX0 0x00000002UL /**< RX0 (via IVAR) */
28
#define INTELX_EIRQ_RXO 0x00020000UL /**< Receive overrun */
29
#define INTELX_EIRQ_LSC 0x00100000UL /**< Link status change */
31
/** Interrupt Mask Set/Read Register */
32
#define INTELX_EIMS 0x00880UL
34
/** Interrupt Mask Clear Register */
35
#define INTELX_EIMC 0x00888UL
37
/** Interrupt Vector Allocation Register */
38
#define INTELX_IVAR 0x00900UL
39
#define INTELX_IVAR_RX0(bit) ( (bit) << 0 ) /**< RX queue 0 allocation */
40
#define INTELX_IVAR_RX0_DEFAULT INTELX_IVAR_RX0 ( 0x00 )
41
#define INTELX_IVAR_RX0_MASK INTELX_IVAR_RX0 ( 0x3f )
42
#define INTELX_IVAR_RX0_VALID 0x00000080UL /**< RX queue 0 valid */
43
#define INTELX_IVAR_TX0(bit) ( (bit) << 8 ) /**< TX queue 0 allocation */
44
#define INTELX_IVAR_TX0_DEFAULT INTELX_IVAR_TX0 ( 0x01 )
45
#define INTELX_IVAR_TX0_MASK INTELX_IVAR_TX0 ( 0x3f )
46
#define INTELX_IVAR_TX0_VALID 0x00008000UL /**< TX queue 0 valid */
48
/** Receive Filter Control Register */
49
#define INTELX_FCTRL 0x05080UL
50
#define INTELX_FCTRL_MPE 0x00000100UL /**< Multicast promiscuous */
51
#define INTELX_FCTRL_UPE 0x00000200UL /**< Unicast promiscuous mode */
52
#define INTELX_FCTRL_BAM 0x00000400UL /**< Broadcast accept mode */
54
/** Receive Address Low
56
* The MAC address registers RAL0/RAH0 exist at address 0x05400 for
57
* the 82598 and 0x0a200 for the 82599, according to the datasheet.
58
* In practice, the 82599 seems to also provide a copy of these
59
* registers at 0x05400. To aim for maximum compatibility, we try
60
* both addresses when reading the initial MAC address, and set both
61
* addresses when setting the MAC address.
63
#define INTELX_RAL0 0x05400UL
64
#define INTELX_RAL0_ALT 0x0a200UL
66
/** Receive Address High */
67
#define INTELX_RAH0 0x05404UL
68
#define INTELX_RAH0_ALT 0x0a204UL
69
#define INTELX_RAH0_AV 0x80000000UL /**< Address valid */
71
/** Receive Descriptor register block */
72
#define INTELX_RD 0x01000UL
74
/** Receive Descriptor Control Register */
75
#define INTELX_RXDCTL_VME 0x40000000UL /**< Strip VLAN tag */
77
/** Split Receive Control Register */
78
#define INTELX_SRRCTL 0x02100UL
79
#define INTELX_SRRCTL_BSIZE(kb) ( (kb) << 0 ) /**< Receive buffer size */
80
#define INTELX_SRRCTL_BSIZE_DEFAULT INTELX_SRRCTL_BSIZE ( 0x02 )
81
#define INTELX_SRRCTL_BSIZE_MASK INTELX_SRRCTL_BSIZE ( 0x1f )
83
/** Receive DMA Control Register */
84
#define INTELX_RDRXCTL 0x02f00UL
85
#define INTELX_RDRXCTL_SECRC 0x00000001UL /**< Strip CRC */
87
/** Receive Control Register */
88
#define INTELX_RXCTRL 0x03000UL
89
#define INTELX_RXCTRL_RXEN 0x00000001UL /**< Receive enable */
91
/** Transmit DMA Control Register */
92
#define INTELX_DMATXCTL 0x04a80UL
93
#define INTELX_DMATXCTL_TE 0x00000001UL /**< Transmit enable */
95
/** Transmit Descriptor register block */
96
#define INTELX_TD 0x06000UL
98
/** RX DCA Control Register */
99
#define INTELX_DCA_RXCTRL 0x02200UL
100
#define INTELX_DCA_RXCTRL_MUST_BE_ZERO 0x00001000UL /**< Must be zero */
102
/** MAC Core Control 0 Register */
103
#define INTELX_HLREG0 0x04240UL
104
#define INTELX_HLREG0_JUMBOEN 0x00000004UL /**< Jumbo frame enable */
106
/** Maximum Frame Size Register */
107
#define INTELX_MAXFRS 0x04268UL
108
#define INTELX_MAXFRS_MFS(len) ( (len) << 16 ) /**< Maximum frame size */
109
#define INTELX_MAXFRS_MFS_DEFAULT \
110
INTELX_MAXFRS_MFS ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ )
111
#define INTELX_MAXFRS_MFS_MASK INTELX_MAXFRS_MFS ( 0xffff )
113
/** Link Status Register */
114
#define INTELX_LINKS 0x042a4UL
115
#define INTELX_LINKS_UP 0x40000000UL /**< Link up */
117
#endif /* _INTELX_H */