Go to the documentation of this file.
8 #ifndef XILINX_AXIENET_H
9 #define XILINX_AXIENET_H
11 #include <linux/netdevice.h>
16 #define XAE_HDR_SIZE 14
17 #define XAE_HDR_VLAN_SIZE 18
18 #define XAE_TRL_SIZE 4
20 #define XAE_JUMBO_MTU 9000
22 #define XAE_MAX_FRAME_SIZE (XAE_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
23 #define XAE_MAX_VLAN_FRAME_SIZE (XAE_MTU + XAE_HDR_VLAN_SIZE + XAE_TRL_SIZE)
24 #define XAE_MAX_JUMBO_FRAME_SIZE (XAE_JUMBO_MTU + XAE_HDR_SIZE + XAE_TRL_SIZE)
29 #define XAE_OPTION_PROMISC (1 << 0)
32 #define XAE_OPTION_JUMBO (1 << 1)
35 #define XAE_OPTION_VLAN (1 << 2)
38 #define XAE_OPTION_FLOW_CONTROL (1 << 4)
42 #define XAE_OPTION_FCS_STRIP (1 << 5)
46 #define XAE_OPTION_FCS_INSERT (1 << 6)
53 #define XAE_OPTION_LENTYPE_ERR (1 << 7)
56 #define XAE_OPTION_TXEN (1 << 11)
59 #define XAE_OPTION_RXEN (1 << 12)
62 #define XAE_OPTION_DEFAULTS \
64 XAE_OPTION_FLOW_CONTROL | \
69 #define XAXIDMA_TX_CR_OFFSET 0x00000000
70 #define XAXIDMA_TX_SR_OFFSET 0x00000004
71 #define XAXIDMA_TX_CDESC_OFFSET 0x00000008
72 #define XAXIDMA_TX_TDESC_OFFSET 0x00000010
74 #define XAXIDMA_RX_CR_OFFSET 0x00000030
75 #define XAXIDMA_RX_SR_OFFSET 0x00000034
76 #define XAXIDMA_RX_CDESC_OFFSET 0x00000038
77 #define XAXIDMA_RX_TDESC_OFFSET 0x00000040
79 #define XAXIDMA_CR_RUNSTOP_MASK 0x00000001
80 #define XAXIDMA_CR_RESET_MASK 0x00000004
82 #define XAXIDMA_BD_NDESC_OFFSET 0x00
83 #define XAXIDMA_BD_BUFA_OFFSET 0x08
84 #define XAXIDMA_BD_CTRL_LEN_OFFSET 0x18
85 #define XAXIDMA_BD_STS_OFFSET 0x1C
86 #define XAXIDMA_BD_USR0_OFFSET 0x20
87 #define XAXIDMA_BD_USR1_OFFSET 0x24
88 #define XAXIDMA_BD_USR2_OFFSET 0x28
89 #define XAXIDMA_BD_USR3_OFFSET 0x2C
90 #define XAXIDMA_BD_USR4_OFFSET 0x30
91 #define XAXIDMA_BD_ID_OFFSET 0x34
92 #define XAXIDMA_BD_HAS_STSCNTRL_OFFSET 0x38
93 #define XAXIDMA_BD_HAS_DRE_OFFSET 0x3C
95 #define XAXIDMA_BD_HAS_DRE_SHIFT 8
96 #define XAXIDMA_BD_HAS_DRE_MASK 0xF00
97 #define XAXIDMA_BD_WORDLEN_MASK 0xFF
99 #define XAXIDMA_BD_CTRL_LENGTH_MASK 0x007FFFFF
100 #define XAXIDMA_BD_CTRL_TXSOF_MASK 0x08000000
101 #define XAXIDMA_BD_CTRL_TXEOF_MASK 0x04000000
102 #define XAXIDMA_BD_CTRL_ALL_MASK 0x0C000000
104 #define XAXIDMA_DELAY_MASK 0xFF000000
105 #define XAXIDMA_COALESCE_MASK 0x00FF0000
107 #define XAXIDMA_DELAY_SHIFT 24
108 #define XAXIDMA_COALESCE_SHIFT 16
110 #define XAXIDMA_IRQ_IOC_MASK 0x00001000
111 #define XAXIDMA_IRQ_DELAY_MASK 0x00002000
112 #define XAXIDMA_IRQ_ERROR_MASK 0x00004000
113 #define XAXIDMA_IRQ_ALL_MASK 0x00007000
116 #define XAXIDMA_DFT_TX_THRESHOLD 24
117 #define XAXIDMA_DFT_TX_WAITBOUND 254
118 #define XAXIDMA_DFT_RX_THRESHOLD 24
119 #define XAXIDMA_DFT_RX_WAITBOUND 254
121 #define XAXIDMA_BD_CTRL_TXSOF_MASK 0x08000000
122 #define XAXIDMA_BD_CTRL_TXEOF_MASK 0x04000000
123 #define XAXIDMA_BD_CTRL_ALL_MASK 0x0C000000
125 #define XAXIDMA_BD_STS_ACTUAL_LEN_MASK 0x007FFFFF
126 #define XAXIDMA_BD_STS_COMPLETE_MASK 0x80000000
127 #define XAXIDMA_BD_STS_DEC_ERR_MASK 0x40000000
128 #define XAXIDMA_BD_STS_SLV_ERR_MASK 0x20000000
129 #define XAXIDMA_BD_STS_INT_ERR_MASK 0x10000000
130 #define XAXIDMA_BD_STS_ALL_ERR_MASK 0x70000000
131 #define XAXIDMA_BD_STS_RXSOF_MASK 0x08000000
132 #define XAXIDMA_BD_STS_RXEOF_MASK 0x04000000
133 #define XAXIDMA_BD_STS_ALL_MASK 0xFC000000
135 #define XAXIDMA_BD_MINIMUM_ALIGNMENT 0x40
138 #define XAE_RAF_OFFSET 0x00000000
139 #define XAE_TPF_OFFSET 0x00000004
140 #define XAE_IFGP_OFFSET 0x00000008
141 #define XAE_IS_OFFSET 0x0000000C
142 #define XAE_IP_OFFSET 0x00000010
143 #define XAE_IE_OFFSET 0x00000014
144 #define XAE_TTAG_OFFSET 0x00000018
145 #define XAE_RTAG_OFFSET 0x0000001C
146 #define XAE_UAWL_OFFSET 0x00000020
147 #define XAE_UAWU_OFFSET 0x00000024
148 #define XAE_TPID0_OFFSET 0x00000028
149 #define XAE_TPID1_OFFSET 0x0000002C
150 #define XAE_PPST_OFFSET 0x00000030
151 #define XAE_RCW0_OFFSET 0x00000400
152 #define XAE_RCW1_OFFSET 0x00000404
153 #define XAE_TC_OFFSET 0x00000408
154 #define XAE_FCC_OFFSET 0x0000040C
155 #define XAE_EMMC_OFFSET 0x00000410
156 #define XAE_PHYC_OFFSET 0x00000414
157 #define XAE_MDIO_MC_OFFSET 0x00000500
158 #define XAE_MDIO_MCR_OFFSET 0x00000504
159 #define XAE_MDIO_MWD_OFFSET 0x00000508
160 #define XAE_MDIO_MRD_OFFSET 0x0000050C
161 #define XAE_MDIO_MIS_OFFSET 0x00000600
162 #define XAE_MDIO_MIP_OFFSET 0x00000620
164 #define XAE_MDIO_MIE_OFFSET 0x00000640
166 #define XAE_MDIO_MIC_OFFSET 0x00000660
168 #define XAE_UAW0_OFFSET 0x00000700
169 #define XAE_UAW1_OFFSET 0x00000704
170 #define XAE_FMI_OFFSET 0x00000708
171 #define XAE_AF0_OFFSET 0x00000710
172 #define XAE_AF1_OFFSET 0x00000714
174 #define XAE_TX_VLAN_DATA_OFFSET 0x00004000
175 #define XAE_RX_VLAN_DATA_OFFSET 0x00008000
176 #define XAE_MCAST_TABLE_OFFSET 0x00020000
179 #define XAE_RAF_MCSTREJ_MASK 0x00000002
181 #define XAE_RAF_BCSTREJ_MASK 0x00000004
183 #define XAE_RAF_TXVTAGMODE_MASK 0x00000018
184 #define XAE_RAF_RXVTAGMODE_MASK 0x00000060
185 #define XAE_RAF_TXVSTRPMODE_MASK 0x00000180
186 #define XAE_RAF_RXVSTRPMODE_MASK 0x00000600
187 #define XAE_RAF_NEWFNCENBL_MASK 0x00000800
188 #define XAE_RAF_EMULTIFLTRENBL_MASK 0x00001000
191 #define XAE_RAF_STATSRST_MASK 0x00002000
192 #define XAE_RAF_RXBADFRMEN_MASK 0x00004000
193 #define XAE_RAF_TXVTAGMODE_SHIFT 3
194 #define XAE_RAF_RXVTAGMODE_SHIFT 5
195 #define XAE_RAF_TXVSTRPMODE_SHIFT 7
196 #define XAE_RAF_RXVSTRPMODE_SHIFT 9
199 #define XAE_TPF_TPFV_MASK 0x0000FFFF
200 #define XAE_IFGP0_IFGP_MASK 0x0000007F
205 #define XAE_INT_HARDACSCMPLT_MASK 0x00000001
207 #define XAE_INT_AUTONEG_MASK 0x00000002
209 #define XAE_INT_RXCMPIT_MASK 0x00000004
210 #define XAE_INT_RXRJECT_MASK 0x00000008
211 #define XAE_INT_RXFIFOOVR_MASK 0x00000010
212 #define XAE_INT_TXCMPIT_MASK 0x00000020
213 #define XAE_INT_RXDCMLOCK_MASK 0x00000040
214 #define XAE_INT_MGTRDY_MASK 0x00000080
215 #define XAE_INT_PHYRSTCMPLT_MASK 0x00000100
216 #define XAE_INT_ALL_MASK 0x0000003F
218 #define XAE_INT_RECV_ERROR_MASK \
219 (XAE_INT_RXRJECT_MASK | XAE_INT_RXFIFOOVR_MASK)
224 #define XAE_TPID_0_MASK 0x0000FFFF
225 #define XAE_TPID_1_MASK 0xFFFF0000
228 #define XAE_TPID_2_MASK 0x0000FFFF
229 #define XAE_TPID_3_MASK 0xFFFF0000
232 #define XAE_RCW1_RST_MASK 0x80000000
233 #define XAE_RCW1_JUM_MASK 0x40000000
234 #define XAE_RCW1_FCS_MASK 0x20000000
236 #define XAE_RCW1_RX_MASK 0x10000000
237 #define XAE_RCW1_VLAN_MASK 0x08000000
238 #define XAE_RCW1_LT_DIS_MASK 0x02000000
240 #define XAE_RCW1_CL_DIS_MASK 0x01000000
242 #define XAE_RCW1_PAUSEADDR_MASK 0x0000FFFF
247 #define XAE_TC_RST_MASK 0x80000000
248 #define XAE_TC_JUM_MASK 0x40000000
249 #define XAE_TC_FCS_MASK 0x20000000
251 #define XAE_TC_TX_MASK 0x10000000
252 #define XAE_TC_VLAN_MASK 0x08000000
253 #define XAE_TC_IFG_MASK 0x02000000
257 #define XAE_FCC_FCRX_MASK 0x20000000
258 #define XAE_FCC_FCTX_MASK 0x40000000
261 #define XAE_EMMC_LINKSPEED_MASK 0xC0000000
262 #define XAE_EMMC_RGMII_MASK 0x20000000
263 #define XAE_EMMC_SGMII_MASK 0x10000000
264 #define XAE_EMMC_GPCS_MASK 0x08000000
265 #define XAE_EMMC_HOST_MASK 0x04000000
266 #define XAE_EMMC_TX16BIT 0x02000000
267 #define XAE_EMMC_RX16BIT 0x01000000
268 #define XAE_EMMC_LINKSPD_10 0x00000000
269 #define XAE_EMMC_LINKSPD_100 0x40000000
270 #define XAE_EMMC_LINKSPD_1000 0x80000000
273 #define XAE_PHYC_SGMIILINKSPEED_MASK 0xC0000000
274 #define XAE_PHYC_RGMIILINKSPEED_MASK 0x0000000C
275 #define XAE_PHYC_RGMIIHD_MASK 0x00000002
276 #define XAE_PHYC_RGMIILINK_MASK 0x00000001
277 #define XAE_PHYC_RGLINKSPD_10 0x00000000
278 #define XAE_PHYC_RGLINKSPD_100 0x00000004
279 #define XAE_PHYC_RGLINKSPD_1000 0x00000008
280 #define XAE_PHYC_SGLINKSPD_10 0x00000000
281 #define XAE_PHYC_SGLINKSPD_100 0x40000000
282 #define XAE_PHYC_SGLINKSPD_1000 0x80000000
285 #define XAE_MDIO_MC_MDIOEN_MASK 0x00000040
286 #define XAE_MDIO_MC_CLOCK_DIVIDE_MAX 0x3F
289 #define XAE_MDIO_MCR_PHYAD_MASK 0x1F000000
290 #define XAE_MDIO_MCR_PHYAD_SHIFT 24
291 #define XAE_MDIO_MCR_REGAD_MASK 0x001F0000
292 #define XAE_MDIO_MCR_REGAD_SHIFT 16
293 #define XAE_MDIO_MCR_OP_MASK 0x0000C000
294 #define XAE_MDIO_MCR_OP_SHIFT 13
295 #define XAE_MDIO_MCR_OP_READ_MASK 0x00008000
296 #define XAE_MDIO_MCR_OP_WRITE_MASK 0x00004000
297 #define XAE_MDIO_MCR_INITIATE_MASK 0x00000800
298 #define XAE_MDIO_MCR_READY_MASK 0x00000080
301 #define XAE_MDIO_INT_MIIM_RDY_MASK 0x00000001
304 #define XAE_UAW1_UNICASTADDR_MASK 0x0000FFFF
310 #define XAE_FMI_PM_MASK 0x80000000
311 #define XAE_FMI_IND_MASK 0x00000003
313 #define XAE_MDIO_DIV_DFT 29
316 #define XAE_PHY_TYPE_MII 0
317 #define XAE_PHY_TYPE_GMII 1
318 #define XAE_PHY_TYPE_RGMII_1_3 2
319 #define XAE_PHY_TYPE_RGMII_2_0 3
320 #define XAE_PHY_TYPE_SGMII 4
321 #define XAE_PHY_TYPE_1000BASE_X 5
323 #define XAE_MULTICAST_CAM_TABLE_NUM 4
327 #define XAE_FEATURE_PARTIAL_RX_CSUM (1 << 0)
328 #define XAE_FEATURE_PARTIAL_TX_CSUM (1 << 1)
329 #define XAE_FEATURE_FULL_RX_CSUM (1 << 2)
330 #define XAE_FEATURE_FULL_TX_CSUM (1 << 3)
332 #define XAE_NO_CSUM_OFFLOAD 0
334 #define XAE_FULL_CSUM_STATUS_MASK 0x00000038
335 #define XAE_IP_UDP_CSUM_VALIDATED 0x00000003
336 #define XAE_IP_TCP_CSUM_VALIDATED 0x00000002
338 #define DELAY_OF_ONE_MILLISEC 1000