xref: /freebsd/sys/dev/ffec/if_ffecreg.h (revision 685dc743dc3b5645e34836464128e1c0558b404b)
1dc823137SIan Lepore /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4dc823137SIan Lepore  * Copyright (c) 2013 Ian Lepore <ian@freebsd.org>
5dc823137SIan Lepore  * All rights reserved.
6dc823137SIan Lepore  *
7dc823137SIan Lepore  * Redistribution and use in source and binary forms, with or without
8dc823137SIan Lepore  * modification, are permitted provided that the following conditions
9dc823137SIan Lepore  * are met:
10dc823137SIan Lepore  * 1. Redistributions of source code must retain the above copyright
11dc823137SIan Lepore  *    notice, this list of conditions and the following disclaimer.
12dc823137SIan Lepore  * 2. Redistributions in binary form must reproduce the above copyright
13dc823137SIan Lepore  *    notice, this list of conditions and the following disclaimer in the
14dc823137SIan Lepore  *    documentation and/or other materials provided with the distribution.
15dc823137SIan Lepore  *
16dc823137SIan Lepore  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17dc823137SIan Lepore  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18dc823137SIan Lepore  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19dc823137SIan Lepore  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20dc823137SIan Lepore  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21dc823137SIan Lepore  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22dc823137SIan Lepore  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23dc823137SIan Lepore  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24dc823137SIan Lepore  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25dc823137SIan Lepore  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26dc823137SIan Lepore  * SUCH DAMAGE.
27dc823137SIan Lepore  *
28dc823137SIan Lepore  */
29dc823137SIan Lepore 
30dc823137SIan Lepore #ifndef IF_FFECREG_H
31dc823137SIan Lepore #define IF_FFECREG_H
32dc823137SIan Lepore 
33dc823137SIan Lepore #include <sys/cdefs.h>
34dc823137SIan Lepore /*
35dc823137SIan Lepore  * Hardware defines for Freescale Fast Ethernet Controller.
36dc823137SIan Lepore  */
37dc823137SIan Lepore 
38dc823137SIan Lepore /*
39dc823137SIan Lepore  * MAC registers.
40dc823137SIan Lepore  */
41dc823137SIan Lepore #define	FEC_IER_REG			0x0004
42dc823137SIan Lepore #define	FEC_IEM_REG			0x0008
437a22215cSEitan Adler #define	  FEC_IER_HBERR			  (1U << 31)
44dc823137SIan Lepore #define	  FEC_IER_BABR			  (1 << 30)
45dc823137SIan Lepore #define	  FEC_IER_BABT			  (1 << 29)
46dc823137SIan Lepore #define	  FEC_IER_GRA			  (1 << 28)
47dc823137SIan Lepore #define	  FEC_IER_TXF			  (1 << 27)
48dc823137SIan Lepore #define	  FEC_IER_TXB			  (1 << 26)
49dc823137SIan Lepore #define	  FEC_IER_RXF			  (1 << 25)
50dc823137SIan Lepore #define	  FEC_IER_RXB			  (1 << 24)
51dc823137SIan Lepore #define	  FEC_IER_MII			  (1 << 23)
52dc823137SIan Lepore #define	  FEC_IER_EBERR			  (1 << 22)
53dc823137SIan Lepore #define	  FEC_IER_LC			  (1 << 21)
54dc823137SIan Lepore #define	  FEC_IER_RL			  (1 << 20)
55dc823137SIan Lepore #define	  FEC_IER_UN			  (1 << 19)
56dc823137SIan Lepore #define	  FEC_IER_PLR			  (1 << 18)
57dc823137SIan Lepore #define	  FEC_IER_WAKEUP		  (1 << 17)
58dc823137SIan Lepore #define	  FEC_IER_AVAIL			  (1 << 16)
59dc823137SIan Lepore #define	  FEC_IER_TIMER			  (1 << 15)
60dc823137SIan Lepore 
61dc823137SIan Lepore #define	FEC_RDAR_REG			0x0010
62dc823137SIan Lepore #define	  FEC_RDAR_RDAR			  (1 << 24)
63dc823137SIan Lepore 
64dc823137SIan Lepore #define	FEC_TDAR_REG			0x0014
65dc823137SIan Lepore #define	  FEC_TDAR_TDAR			  (1 << 24)
66dc823137SIan Lepore 
67dc823137SIan Lepore #define	FEC_ECR_REG			0x0024
68dc823137SIan Lepore #define	  FEC_ECR_DBSWP			  (1 <<  8)
69dc823137SIan Lepore #define	  FEC_ECR_STOPEN		  (1 <<  7)
70dc823137SIan Lepore #define	  FEC_ECR_DBGEN			  (1 <<  6)
71dc823137SIan Lepore #define	  FEC_ECR_SPEED			  (1 <<  5)
72dc823137SIan Lepore #define	  FEC_ECR_EN1588		  (1 <<  4)
73dc823137SIan Lepore #define	  FEC_ECR_SLEEP			  (1 <<  3)
74dc823137SIan Lepore #define	  FEC_ECR_MAGICEN		  (1 <<  2)
75dc823137SIan Lepore #define	  FEC_ECR_ETHEREN		  (1 <<  1)
76dc823137SIan Lepore #define	  FEC_ECR_RESET			  (1 <<  0)
77dc823137SIan Lepore 
78dc823137SIan Lepore #define	FEC_MMFR_REG			0x0040
79dc823137SIan Lepore #define	  FEC_MMFR_ST_SHIFT		  30
80dc823137SIan Lepore #define	  FEC_MMFR_ST_VALUE		  (0x01 << FEC_MMFR_ST_SHIFT)
81dc823137SIan Lepore #define	  FEC_MMFR_OP_SHIFT		  28
82dc823137SIan Lepore #define	  FEC_MMFR_OP_WRITE		  (0x01 << FEC_MMFR_OP_SHIFT)
83dc823137SIan Lepore #define	  FEC_MMFR_OP_READ		  (0x02 << FEC_MMFR_OP_SHIFT)
84dc823137SIan Lepore #define	  FEC_MMFR_PA_SHIFT		  23
85dc823137SIan Lepore #define	  FEC_MMFR_PA_MASK		  (0x1f << FEC_MMFR_PA_SHIFT)
86dc823137SIan Lepore #define	  FEC_MMFR_RA_SHIFT		  18
87dc823137SIan Lepore #define	  FEC_MMFR_RA_MASK		  (0x1f << FEC_MMFR_RA_SHIFT)
88dc823137SIan Lepore #define	  FEC_MMFR_TA_SHIFT		  16
89dc823137SIan Lepore #define	  FEC_MMFR_TA_VALUE		  (0x02 << FEC_MMFR_TA_SHIFT)
90dc823137SIan Lepore #define	  FEC_MMFR_DATA_SHIFT		  0
91dc823137SIan Lepore #define	  FEC_MMFR_DATA_MASK		  (0xffff << FEC_MMFR_DATA_SHIFT)
92dc823137SIan Lepore 
93dc823137SIan Lepore #define	FEC_MSCR_REG			0x0044
94dc823137SIan Lepore #define	  FEC_MSCR_HOLDTIME_SHIFT	  8
95dc823137SIan Lepore #define	  FEC_MSCR_HOLDTIME_MASK	  (0x07 << FEC_MSCR_HOLDTIME_SHIFT)
96dc823137SIan Lepore #define	  FEC_MSCR_DIS_PRE      	  (1 <<  7)
97dc823137SIan Lepore #define	  FEC_MSCR_MII_SPEED_SHIFT	  1
98dc823137SIan Lepore #define	  FEC_MSCR_MII_SPEED_MASk	  (0x3f << FEC_MSCR_MII_SPEED_SHIFT)
99dc823137SIan Lepore 
100dc823137SIan Lepore #define	FEC_MIBC_REG			0x0064
1017a22215cSEitan Adler #define	  FEC_MIBC_DIS			  (1U << 31)
102dc823137SIan Lepore #define	  FEC_MIBC_IDLE			  (1 << 30)
103dc823137SIan Lepore #define	  FEC_MIBC_CLEAR		  (1 << 29) /* imx6 only */
104dc823137SIan Lepore 
105dc823137SIan Lepore #define	FEC_RCR_REG			0x0084
1067a22215cSEitan Adler #define	  FEC_RCR_GRS			  (1U << 31)
107dc823137SIan Lepore #define	  FEC_RCR_NLC			  (1 << 30)
108dc823137SIan Lepore #define	  FEC_RCR_MAX_FL_SHIFT		  16
109dc823137SIan Lepore #define	  FEC_RCR_MAX_FL_MASK		  (0x3fff << FEC_RCR_MAX_FL_SHIFT)
110dc823137SIan Lepore #define	  FEC_RCR_CFEN			  (1 << 15)
111dc823137SIan Lepore #define	  FEC_RCR_CRCFWD		  (1 << 14)
112dc823137SIan Lepore #define	  FEC_RCR_PAUFWD		  (1 << 13)
113dc823137SIan Lepore #define	  FEC_RCR_PADEN			  (1 << 12)
114dc823137SIan Lepore #define	  FEC_RCR_RMII_10T		  (1 <<  9)
115dc823137SIan Lepore #define	  FEC_RCR_RMII_MODE		  (1 <<  8)
116dc823137SIan Lepore #define	  FEC_RCR_RGMII_EN		  (1 <<  6)
117dc823137SIan Lepore #define	  FEC_RCR_FCE			  (1 <<  5)
118dc823137SIan Lepore #define	  FEC_RCR_BC_REJ		  (1 <<  4)
119dc823137SIan Lepore #define	  FEC_RCR_PROM			  (1 <<  3)
120dc823137SIan Lepore #define	  FEC_RCR_MII_MODE		  (1 <<  2)
121dc823137SIan Lepore #define	  FEC_RCR_DRT			  (1 <<  1)
122dc823137SIan Lepore #define	  FEC_RCR_LOOP			  (1 <<  0)
123dc823137SIan Lepore 
124dc823137SIan Lepore #define	FEC_TCR_REG			0x00c4
125dc823137SIan Lepore #define	  FEC_TCR_ADDINS		  (1 <<  9)
126dc823137SIan Lepore #define	  FEC_TCR_ADDSEL_SHIFT		  5
127dc823137SIan Lepore #define	  FEC_TCR_ADDSEL_MASK		  (0x07 << FEC_TCR_ADDSEL_SHIFT)
128dc823137SIan Lepore #define	  FEC_TCR_RFC_PAUSE		  (1 <<  4)
129dc823137SIan Lepore #define	  FEC_TCR_TFC_PAUSE		  (1 <<  3)
130dc823137SIan Lepore #define	  FEC_TCR_FDEN			  (1 <<  2)
131dc823137SIan Lepore #define	  FEC_TCR_GTS			  (1 <<  0)
132dc823137SIan Lepore 
133dc823137SIan Lepore #define	FEC_PALR_REG			0x00e4
134dc823137SIan Lepore #define	  FEC_PALR_PADDR1_SHIFT		  0
135dc823137SIan Lepore #define	  FEC_PALR_PADDR1_MASK		  (0xffffffff << FEC_PALR_PADDR1_SHIFT)
136dc823137SIan Lepore 
137dc823137SIan Lepore #define	FEC_PAUR_REG			0x00e8
138dc823137SIan Lepore #define	  FEC_PAUR_PADDR2_SHIFT		  16
139dc823137SIan Lepore #define	  FEC_PAUR_PADDR2_MASK		  (0xffff << FEC_PAUR_PADDR2_SHIFT)
140dc823137SIan Lepore #define	  FEC_PAUR_TYPE_VALUE		  (0x8808)
141dc823137SIan Lepore 
142dc823137SIan Lepore #define	FEC_OPD_REG			0x00ec
143dc823137SIan Lepore #define	  FEC_OPD_PAUSE_DUR_SHIFT	  0
144dc823137SIan Lepore #define	  FEC_OPD_PAUSE_DUR_MASK	  (0xffff << FEC_OPD_PAUSE_DUR_SHIFT)
145dc823137SIan Lepore 
146dc823137SIan Lepore #define	FEC_IAUR_REG			0x0118
147dc823137SIan Lepore #define	FEC_IALR_REG			0x011c
148dc823137SIan Lepore 
149dc823137SIan Lepore #define	FEC_GAUR_REG			0x0120
150dc823137SIan Lepore #define	FEC_GALR_REG			0x0124
151dc823137SIan Lepore 
152dc823137SIan Lepore #define	FEC_TFWR_REG			0x0144
153dc823137SIan Lepore #define	  FEC_TFWR_STRFWD		  (1 <<  8)
154dc823137SIan Lepore #define	  FEC_TFWR_TWFR_SHIFT		  0
155dc823137SIan Lepore #define	  FEC_TFWR_TWFR_MASK		  (0x3f << FEC_TFWR_TWFR_SHIFT)
156dc823137SIan Lepore #define	  FEC_TFWR_TWFR_128BYTE		  (0x02 << FEC_TFWR_TWFR_SHIFT)
157dc823137SIan Lepore 
158dc823137SIan Lepore #define	FEC_RDSR_REG			0x0180
159dc823137SIan Lepore 
160dc823137SIan Lepore #define	FEC_TDSR_REG			0x0184
161dc823137SIan Lepore 
162dc823137SIan Lepore #define	FEC_MRBR_REG			0x0188
163dc823137SIan Lepore #define	  FEC_MRBR_R_BUF_SIZE_SHIFT	  0
164dc823137SIan Lepore #define	  FEC_MRBR_R_BUF_SIZE_MASK	  (0x3fff << FEC_MRBR_R_BUF_SIZE_SHIFT)
165dc823137SIan Lepore 
166dc823137SIan Lepore #define	FEC_RSFL_REG			0x0190
167dc823137SIan Lepore #define	FEC_RSEM_REG			0x0194
168dc823137SIan Lepore #define	FEC_RAEM_REG			0x0198
169dc823137SIan Lepore #define	FEC_RAFL_REG			0x019c
170dc823137SIan Lepore #define	FEC_TSEM_REG			0x01a0
171dc823137SIan Lepore #define	FEC_TAEM_REG			0x01a4
172dc823137SIan Lepore #define	FEC_TAFL_REG			0x01a8
173dc823137SIan Lepore #define	FEC_TIPG_REG			0x01ac
174dc823137SIan Lepore #define	FEC_FTRL_REG			0x01b0
175dc823137SIan Lepore 
176dc823137SIan Lepore #define	FEC_TACC_REG			0x01c0
177dc823137SIan Lepore #define	  FEC_TACC_PROCHK		  (1 <<  4)
178dc823137SIan Lepore #define	  FEC_TACC_IPCHK		  (1 <<  3)
179dc823137SIan Lepore #define	  FEC_TACC_SHIFT16		  (1 <<  0)
180dc823137SIan Lepore 
181dc823137SIan Lepore #define	FEC_RACC_REG			0x01c4
182dc823137SIan Lepore #define	  FEC_RACC_SHIFT16		  (1 <<  7)
183dc823137SIan Lepore #define	  FEC_RACC_LINEDIS		  (1 <<  6)
184dc823137SIan Lepore #define	  FEC_RACC_PRODIS		  (1 <<  2)
185dc823137SIan Lepore #define	  FEC_RACC_IPDIS		  (1 <<  1)
186dc823137SIan Lepore #define	  FEC_RACC_PADREM		  (1 <<  0)
187dc823137SIan Lepore 
188dc823137SIan Lepore /*
1892f45dab7SIan Lepore  * IEEE-1588 timer registers
1902f45dab7SIan Lepore  */
1912f45dab7SIan Lepore 
1922f45dab7SIan Lepore #define	FEC_ATCR_REG			0x0400
1932f45dab7SIan Lepore #define	  FEC_ATCR_SLAVE		  (1u << 13)
1942f45dab7SIan Lepore #define	  FEC_ATCR_CAPTURE		  (1u << 11)
1952f45dab7SIan Lepore #define	  FEC_ATCR_RESTART		  (1u << 9)
1962f45dab7SIan Lepore #define	  FEC_ATCR_PINPER		  (1u << 7)
1972f45dab7SIan Lepore #define	  FEC_ATCR_PEREN		  (1u << 4)
1982f45dab7SIan Lepore #define	  FEC_ATCR_OFFRST		  (1u << 3)
1992f45dab7SIan Lepore #define	  FEC_ATCR_OFFEN		  (1u << 2)
2002f45dab7SIan Lepore #define	  FEC_ATCR_EN			  (1u << 0)
2012f45dab7SIan Lepore 
2022f45dab7SIan Lepore #define	FEC_ATVR_REG			0x0404
2032f45dab7SIan Lepore #define	FEC_ATOFF_REG			0x0408
2042f45dab7SIan Lepore #define	FEC_ATPER_REG			0x040c
2052f45dab7SIan Lepore #define	FEC_ATCOR_REG			0x0410
2062f45dab7SIan Lepore #define	FEC_ATINC_REG			0x0414
2072f45dab7SIan Lepore #define	FEC_ATSTMP_REG			0x0418
2082f45dab7SIan Lepore 
2092f45dab7SIan Lepore /*
210dc823137SIan Lepore  * Statistics registers
211dc823137SIan Lepore  */
212dc823137SIan Lepore #define	FEC_RMON_T_DROP			0x200
213dc823137SIan Lepore #define	FEC_RMON_T_PACKETS		0x204
214dc823137SIan Lepore #define	FEC_RMON_T_BC_PKT		0x208
215dc823137SIan Lepore #define	FEC_RMON_T_MC_PKT		0x20C
216dc823137SIan Lepore #define	FEC_RMON_T_CRC_ALIGN		0x210
217dc823137SIan Lepore #define	FEC_RMON_T_UNDERSIZE		0x214
218dc823137SIan Lepore #define	FEC_RMON_T_OVERSIZE		0x218
219dc823137SIan Lepore #define	FEC_RMON_T_FRAG			0x21C
220dc823137SIan Lepore #define	FEC_RMON_T_JAB			0x220
221dc823137SIan Lepore #define	FEC_RMON_T_COL			0x224
222dc823137SIan Lepore #define	FEC_RMON_T_P64			0x228
223dc823137SIan Lepore #define	FEC_RMON_T_P65TO127		0x22C
224dc823137SIan Lepore #define	FEC_RMON_T_P128TO255		0x230
225dc823137SIan Lepore #define	FEC_RMON_T_P256TO511		0x234
226dc823137SIan Lepore #define	FEC_RMON_T_P512TO1023		0x238
227dc823137SIan Lepore #define	FEC_RMON_T_P1024TO2047		0x23C
228dc823137SIan Lepore #define	FEC_RMON_T_P_GTE2048		0x240
229dc823137SIan Lepore #define	FEC_RMON_T_OCTECTS		0x240
230dc823137SIan Lepore #define	FEC_IEEE_T_DROP			0x248
231dc823137SIan Lepore #define	FEC_IEEE_T_FRAME_OK		0x24C
232dc823137SIan Lepore #define	FEC_IEEE_T_1COL			0x250
233dc823137SIan Lepore #define	FEC_IEEE_T_MCOL			0x254
234dc823137SIan Lepore #define	FEC_IEEE_T_DEF			0x258
235dc823137SIan Lepore #define	FEC_IEEE_T_LCOL			0x25C
236dc823137SIan Lepore #define	FEC_IEEE_T_EXCOL		0x260
237dc823137SIan Lepore #define	FEC_IEEE_T_MACERR		0x264
238dc823137SIan Lepore #define	FEC_IEEE_T_CSERR		0x268
239dc823137SIan Lepore #define	FEC_IEEE_T_SQE			0x26C
240dc823137SIan Lepore #define	FEC_IEEE_T_FDXFC		0x270
241dc823137SIan Lepore #define	FEC_IEEE_T_OCTETS_OK		0x274
242dc823137SIan Lepore #define	FEC_RMON_R_PACKETS		0x284
243dc823137SIan Lepore #define	FEC_RMON_R_BC_PKT		0x288
244dc823137SIan Lepore #define	FEC_RMON_R_MC_PKT		0x28C
245dc823137SIan Lepore #define	FEC_RMON_R_CRC_ALIGN		0x290
246dc823137SIan Lepore #define	FEC_RMON_R_UNDERSIZE		0x294
247dc823137SIan Lepore #define	FEC_RMON_R_OVERSIZE		0x298
248dc823137SIan Lepore #define	FEC_RMON_R_FRAG			0x29C
249dc823137SIan Lepore #define	FEC_RMON_R_JAB			0x2A0
250dc823137SIan Lepore #define	FEC_RMON_R_RESVD_0		0x2A4
251dc823137SIan Lepore #define	FEC_RMON_R_P64			0x2A8
252dc823137SIan Lepore #define	FEC_RMON_R_P65TO127		0x2AC
253dc823137SIan Lepore #define	FEC_RMON_R_P128TO255		0x2B0
254dc823137SIan Lepore #define	FEC_RMON_R_P256TO511		0x2B4
255dc823137SIan Lepore #define	FEC_RMON_R_P512TO1023		0x2B8
256dc823137SIan Lepore #define	FEC_RMON_R_P1024TO2047		0x2BC
257dc823137SIan Lepore #define	FEC_RMON_R_P_GTE2048		0x2C0
258dc823137SIan Lepore #define	FEC_RMON_R_OCTETS		0x2C4
259dc823137SIan Lepore #define	FEC_IEEE_R_DROP			0x2C8
260dc823137SIan Lepore #define	FEC_IEEE_R_FRAME_OK		0x2CC
261dc823137SIan Lepore #define	FEC_IEEE_R_CRC			0x2D0
262dc823137SIan Lepore #define	FEC_IEEE_R_ALIGN		0x2D4
263dc823137SIan Lepore #define	FEC_IEEE_R_MACERR		0x2D8
264dc823137SIan Lepore #define	FEC_IEEE_R_FDXFC		0x2DC
265dc823137SIan Lepore #define	FEC_IEEE_R_OCTETS_OK		0x2E0
266dc823137SIan Lepore 
267dc823137SIan Lepore #define	FEC_MIIGSK_CFGR			0x300
268dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_FRCONT		(1 << 6)   /* Freq: 0=50MHz, 1=5MHz */
269dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_LBMODE		(1 << 4)   /* loopback mode */
270dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_EMODE		(1 << 3)   /* echo mode */
271dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_IF_MODE_MASK	(0x3 << 0)
272dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_IF_MODE_MII	  (0 << 0)
273dc823137SIan Lepore #define	FEC_MIIGSK_CFGR_IF_MODE_RMII	  (1 << 0)
274dc823137SIan Lepore 
275dc823137SIan Lepore #define	FEC_MIIGSK_ENR			0x308
276dc823137SIan Lepore #define	FEC_MIIGSK_ENR_READY		(1 << 2)
277dc823137SIan Lepore #define	FEC_MIIGSK_ENR_EN		(1 << 1)
278dc823137SIan Lepore 
279dc823137SIan Lepore /*
280dc823137SIan Lepore  * A hardware buffer descriptor.  Rx and Tx buffers have the same descriptor
281dc823137SIan Lepore  * layout, but the bits in the flags field have different meanings.
282dc823137SIan Lepore  */
283dc823137SIan Lepore struct ffec_hwdesc
284dc823137SIan Lepore {
285dc823137SIan Lepore 	uint32_t	flags_len;
286dc823137SIan Lepore 	uint32_t	buf_paddr;
287dc823137SIan Lepore };
288dc823137SIan Lepore 
2897a22215cSEitan Adler #define	FEC_TXDESC_READY		(1U << 31)
290dc823137SIan Lepore #define	FEC_TXDESC_T01			(1 << 30)
291dc823137SIan Lepore #define	FEC_TXDESC_WRAP			(1 << 29)
292dc823137SIan Lepore #define	FEC_TXDESC_T02			(1 << 28)
293dc823137SIan Lepore #define	FEC_TXDESC_L			(1 << 27)
294dc823137SIan Lepore #define	FEC_TXDESC_TC			(1 << 26)
295dc823137SIan Lepore #define	FEC_TXDESC_ABC			(1 << 25)
296dc823137SIan Lepore #define	FEC_TXDESC_LEN_MASK		(0xffff)
297dc823137SIan Lepore 
2987a22215cSEitan Adler #define	FEC_RXDESC_EMPTY		(1U << 31)
299dc823137SIan Lepore #define	FEC_RXDESC_R01			(1 << 30)
300dc823137SIan Lepore #define	FEC_RXDESC_WRAP			(1 << 29)
301dc823137SIan Lepore #define	FEC_RXDESC_R02			(1 << 28)
302dc823137SIan Lepore #define	FEC_RXDESC_L			(1 << 27)
303dc823137SIan Lepore #define	FEC_RXDESC_M			(1 << 24)
304dc823137SIan Lepore #define	FEC_RXDESC_BC			(1 << 23)
305dc823137SIan Lepore #define	FEC_RXDESC_MC			(1 << 22)
306dc823137SIan Lepore #define	FEC_RXDESC_LG			(1 << 21)
307dc823137SIan Lepore #define	FEC_RXDESC_NO			(1 << 20)
308dc823137SIan Lepore #define	FEC_RXDESC_CR			(1 << 18)
309dc823137SIan Lepore #define	FEC_RXDESC_OV			(1 << 17)
310dc823137SIan Lepore #define	FEC_RXDESC_TR			(1 << 16)
311dc823137SIan Lepore #define	FEC_RXDESC_LEN_MASK		(0xffff)
312dc823137SIan Lepore 
313dc823137SIan Lepore #define	FEC_RXDESC_ERROR_BITS	(FEC_RXDESC_LG | FEC_RXDESC_NO | \
314dc823137SIan Lepore     FEC_RXDESC_OV | FEC_RXDESC_TR)
315dc823137SIan Lepore 
316dc823137SIan Lepore /*
317dc823137SIan Lepore  * The hardware imposes alignment restrictions on various objects involved in
318dc823137SIan Lepore  * DMA transfers.  These values are expressed in bytes (not bits).
319dc823137SIan Lepore  */
3202eedde5fSIan Lepore #define	FEC_DESC_RING_ALIGN		64
321dc823137SIan Lepore 
322dc823137SIan Lepore #endif	/* IF_FFECREG_H */
323