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