6 * Intel 10 Gigabit Ethernet network card driver
10 FILE_LICENCE ( GPL2_OR_LATER );
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 /** Split Receive Control Register */
75 #define INTELX_SRRCTL 0x02100UL
76 #define INTELX_SRRCTL_BSIZE(kb) ( (kb) << 0 ) /**< Receive buffer size */
77 #define INTELX_SRRCTL_BSIZE_DEFAULT INTELX_SRRCTL_BSIZE ( 0x02 )
78 #define INTELX_SRRCTL_BSIZE_MASK INTELX_SRRCTL_BSIZE ( 0x1f )
80 /** Receive DMA Control Register */
81 #define INTELX_RDRXCTL 0x02f00UL
82 #define INTELX_RDRXCTL_SECRC 0x00000001UL /**< Strip CRC */
84 /** Receive Control Register */
85 #define INTELX_RXCTRL 0x03000UL
86 #define INTELX_RXCTRL_RXEN 0x00000001UL /**< Receive enable */
88 /** Transmit DMA Control Register */
89 #define INTELX_DMATXCTL 0x04a80UL
90 #define INTELX_DMATXCTL_TE 0x00000001UL /**< Transmit enable */
92 /** Transmit Descriptor register block */
93 #define INTELX_TD 0x06000UL
95 /** RX DCA Control Register */
96 #define INTELX_DCA_RXCTRL 0x02200UL
97 #define INTELX_DCA_RXCTRL_MUST_BE_ZERO 0x00001000UL /**< Must be zero */
99 /** MAC Core Control 0 Register */
100 #define INTELX_HLREG0 0x04240UL
101 #define INTELX_HLREG0_JUMBOEN 0x00000004UL /**< Jumbo frame enable */
103 /** Maximum Frame Size Register */
104 #define INTELX_MAXFRS 0x04268UL
105 #define INTELX_MAXFRS_MFS(len) ( (len) << 16 ) /**< Maximum frame size */
106 #define INTELX_MAXFRS_MFS_DEFAULT \
107 INTELX_MAXFRS_MFS ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* CRC */ )
108 #define INTELX_MAXFRS_MFS_MASK INTELX_MAXFRS_MFS ( 0xffff )
110 /** Link Status Register */
111 #define INTELX_LINKS 0x042a4UL
112 #define INTELX_LINKS_UP 0x40000000UL /**< Link up */
114 #endif /* _INTELX_H */