Go to the documentation of this file.
2 #ifndef XILINX_LL_TEMAC_H
3 #define XILINX_LL_TEMAC_H
5 #include <linux/netdevice.h>
15 #define XTE_HDR_SIZE 14
16 #define XTE_TRL_SIZE 4
17 #define XTE_JUMBO_MTU 9000
18 #define XTE_MAX_JUMBO_FRAME_SIZE (XTE_JUMBO_MTU + XTE_HDR_SIZE + XTE_TRL_SIZE)
24 #define XTE_OPTION_PROMISC (1 << 0)
27 #define XTE_OPTION_JUMBO (1 << 1)
30 #define XTE_OPTION_VLAN (1 << 2)
33 #define XTE_OPTION_FLOW_CONTROL (1 << 4)
37 #define XTE_OPTION_FCS_STRIP (1 << 5)
40 #define XTE_OPTION_FCS_INSERT (1 << 6)
47 #define XTE_OPTION_LENTYPE_ERR (1 << 7)
50 #define XTE_OPTION_TXEN (1 << 11)
53 #define XTE_OPTION_RXEN (1 << 12)
56 #define XTE_OPTION_DEFAULTS \
58 XTE_OPTION_FLOW_CONTROL | \
63 #define TX_NXTDESC_PTR 0x00
64 #define TX_CURBUF_ADDR 0x01
65 #define TX_CURBUF_LENGTH 0x02
66 #define TX_CURDESC_PTR 0x03
67 #define TX_TAILDESC_PTR 0x04
68 #define TX_CHNL_CTRL 0x05
82 #define CHNL_CTRL_IRQ_IOE (1 << 9)
83 #define CHNL_CTRL_IRQ_EN (1 << 7)
84 #define CHNL_CTRL_IRQ_ERR_EN (1 << 2)
85 #define CHNL_CTRL_IRQ_DLY_EN (1 << 1)
86 #define CHNL_CTRL_IRQ_COAL_EN (1 << 0)
87 #define TX_IRQ_REG 0x06
99 #define TX_CHNL_STS 0x07
119 #define RX_NXTDESC_PTR 0x08
120 #define RX_CURBUF_ADDR 0x09
121 #define RX_CURBUF_LENGTH 0x0a
122 #define RX_CURDESC_PTR 0x0b
123 #define RX_TAILDESC_PTR 0x0c
124 #define RX_CHNL_CTRL 0x0d
138 #define RX_IRQ_REG 0x0e
139 #define IRQ_COAL (1 << 0)
140 #define IRQ_DLY (1 << 1)
141 #define IRQ_ERR (1 << 2)
142 #define IRQ_DMAERR (1 << 7)
151 #define RX_CHNL_STS 0x0f
152 #define CHNL_STS_ENGBUSY (1 << 1)
153 #define CHNL_STS_EOP (1 << 2)
154 #define CHNL_STS_SOP (1 << 3)
155 #define CHNL_STS_CMPLT (1 << 4)
156 #define CHNL_STS_SOE (1 << 5)
157 #define CHNL_STS_IOE (1 << 6)
158 #define CHNL_STS_ERR (1 << 7)
160 #define CHNL_STS_BSYWR (1 << 16)
161 #define CHNL_STS_CURPERR (1 << 17)
162 #define CHNL_STS_NXTPERR (1 << 18)
163 #define CHNL_STS_ADDRERR (1 << 19)
164 #define CHNL_STS_CMPERR (1 << 20)
165 #define CHNL_STS_TAILERR (1 << 21)
185 #define DMA_CONTROL_REG 0x10
186 #define DMA_CONTROL_RST (1 << 0)
187 #define DMA_TAIL_ENABLE (1 << 2)
191 #define XTE_RAF0_OFFSET 0x00
192 #define RAF0_RST (1 << 0)
193 #define RAF0_MCSTREJ (1 << 1)
194 #define RAF0_BCSTREJ (1 << 2)
195 #define XTE_TPF0_OFFSET 0x04
196 #define XTE_IFGP0_OFFSET 0x08
197 #define XTE_ISR0_OFFSET 0x0c
198 #define ISR0_HARDACSCMPLT (1 << 0)
199 #define ISR0_AUTONEG (1 << 1)
200 #define ISR0_RXCMPLT (1 << 2)
201 #define ISR0_RXREJ (1 << 3)
202 #define ISR0_RXFIFOOVR (1 << 4)
203 #define ISR0_TXCMPLT (1 << 5)
204 #define ISR0_RXDCMLCK (1 << 6)
206 #define XTE_IPR0_OFFSET 0x10
207 #define XTE_IER0_OFFSET 0x14
209 #define XTE_MSW0_OFFSET 0x20
210 #define XTE_LSW0_OFFSET 0x24
211 #define XTE_CTL0_OFFSET 0x28
212 #define XTE_RDY0_OFFSET 0x2c
214 #define XTE_RSE_MIIM_RR_MASK 0x0002
215 #define XTE_RSE_MIIM_WR_MASK 0x0004
216 #define XTE_RSE_CFG_RR_MASK 0x0020
217 #define XTE_RSE_CFG_WR_MASK 0x0040
218 #define XTE_RDY0_HARD_ACS_RDY_MASK (0x10000)
222 #define XTE_RXC0_OFFSET 0x00000200
223 #define XTE_RXC1_OFFSET 0x00000240
224 #define XTE_RXC1_RXRST_MASK (1 << 31)
225 #define XTE_RXC1_RXJMBO_MASK (1 << 30)
226 #define XTE_RXC1_RXFCS_MASK (1 << 29)
227 #define XTE_RXC1_RXEN_MASK (1 << 28)
228 #define XTE_RXC1_RXVLAN_MASK (1 << 27)
229 #define XTE_RXC1_RXHD_MASK (1 << 26)
230 #define XTE_RXC1_RXLT_MASK (1 << 25)
232 #define XTE_TXC_OFFSET 0x00000280
233 #define XTE_TXC_TXRST_MASK (1 << 31)
234 #define XTE_TXC_TXJMBO_MASK (1 << 30)
235 #define XTE_TXC_TXFCS_MASK (1 << 29)
236 #define XTE_TXC_TXEN_MASK (1 << 28)
237 #define XTE_TXC_TXVLAN_MASK (1 << 27)
238 #define XTE_TXC_TXHD_MASK (1 << 26)
240 #define XTE_FCC_OFFSET 0x000002C0
241 #define XTE_FCC_RXFLO_MASK (1 << 29)
242 #define XTE_FCC_TXFLO_MASK (1 << 30)
244 #define XTE_EMCFG_OFFSET 0x00000300
245 #define XTE_EMCFG_LINKSPD_MASK 0xC0000000
246 #define XTE_EMCFG_HOSTEN_MASK (1 << 26)
247 #define XTE_EMCFG_LINKSPD_10 0x00000000
248 #define XTE_EMCFG_LINKSPD_100 (1 << 30)
249 #define XTE_EMCFG_LINKSPD_1000 (1 << 31)
251 #define XTE_GMIC_OFFSET 0x00000320
252 #define XTE_MC_OFFSET 0x00000340
253 #define XTE_UAW0_OFFSET 0x00000380
254 #define XTE_UAW1_OFFSET 0x00000384
256 #define XTE_MAW0_OFFSET 0x00000388
257 #define XTE_MAW1_OFFSET 0x0000038C
258 #define XTE_AFM_OFFSET 0x00000390
259 #define XTE_AFM_EPPRM_MASK (1 << 31)
262 #define XTE_TIS_OFFSET 0x000003A0
263 #define TIS_FRIS (1 << 0)
264 #define TIS_MRIS (1 << 1)
265 #define TIS_MWIS (1 << 2)
266 #define TIS_ARIS (1 << 3)
267 #define TIS_AWIS (1 << 4)
268 #define TIS_CRIS (1 << 5)
269 #define TIS_CWIS (1 << 6)
271 #define XTE_TIE_OFFSET 0x000003A4
274 #define XTE_MGTDR_OFFSET 0x000003B0
275 #define XTE_MIIMAI_OFFSET 0x000003B4
277 #define CNTLREG_WRITE_ENABLE_MASK 0x8000
278 #define CNTLREG_EMAC1SEL_MASK 0x0400
279 #define CNTLREG_ADDRESSCODE_MASK 0x03ff
283 #define STS_CTRL_APP0_ERR (1 << 31)
284 #define STS_CTRL_APP0_IRQONEND (1 << 30)
286 #define STS_CTRL_APP0_STOPONEND (1 << 29)
287 #define STS_CTRL_APP0_CMPLT (1 << 28)
288 #define STS_CTRL_APP0_SOP (1 << 27)
289 #define STS_CTRL_APP0_EOP (1 << 26)
290 #define STS_CTRL_APP0_ENGBUSY (1 << 25)
292 #define STS_CTRL_APP0_ENGRST (1 << 24)
294 #define TX_CONTROL_CALC_CSUM_MASK 1
296 #define MULTICAST_CAM_TABLE_NUM 4
299 #define TEMAC_FEATURE_RX_CSUM (1 << 0)
300 #define TEMAC_FEATURE_TX_CSUM (1 << 1)
345 #ifdef CONFIG_PPC_DCR
346 dcr_host_t sdma_dcrs;