xref: /openbmc/linux/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
14fa9c49fSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
27ac6653aSJeff Kirsher /*******************************************************************************
37ac6653aSJeff Kirsher   This is the driver for the GMAC on-chip Ethernet controller for ST SoCs.
47ac6653aSJeff Kirsher   DWC Ether MAC 10/100/1000 Universal version 3.41a  has been used for
57ac6653aSJeff Kirsher   developing this code.
67ac6653aSJeff Kirsher 
77ac6653aSJeff Kirsher   This contains the functions to handle the dma.
87ac6653aSJeff Kirsher 
97ac6653aSJeff Kirsher   Copyright (C) 2007-2009  STMicroelectronics Ltd
107ac6653aSJeff Kirsher 
117ac6653aSJeff Kirsher 
127ac6653aSJeff Kirsher   Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
137ac6653aSJeff Kirsher *******************************************************************************/
147ac6653aSJeff Kirsher 
157ac6653aSJeff Kirsher #include <asm/io.h>
167ac6653aSJeff Kirsher #include "dwmac1000.h"
177ac6653aSJeff Kirsher #include "dwmac_dma.h"
187ac6653aSJeff Kirsher 
dwmac1000_dma_axi(void __iomem * ioaddr,struct stmmac_axi * axi)19afea0365SGiuseppe Cavallaro static void dwmac1000_dma_axi(void __iomem *ioaddr, struct stmmac_axi *axi)
207ac6653aSJeff Kirsher {
21afea0365SGiuseppe Cavallaro 	u32 value = readl(ioaddr + DMA_AXI_BUS_MODE);
22afea0365SGiuseppe Cavallaro 	int i;
23afea0365SGiuseppe Cavallaro 
24afea0365SGiuseppe Cavallaro 	pr_info("dwmac1000: Master AXI performs %s burst length\n",
25afea0365SGiuseppe Cavallaro 		!(value & DMA_AXI_UNDEF) ? "fixed" : "any");
26afea0365SGiuseppe Cavallaro 
27afea0365SGiuseppe Cavallaro 	if (axi->axi_lpi_en)
28afea0365SGiuseppe Cavallaro 		value |= DMA_AXI_EN_LPI;
29afea0365SGiuseppe Cavallaro 	if (axi->axi_xit_frm)
30afea0365SGiuseppe Cavallaro 		value |= DMA_AXI_LPI_XIT_FRM;
31afea0365SGiuseppe Cavallaro 
326b3374cbSNiklas Cassel 	value &= ~DMA_AXI_WR_OSR_LMT;
33afea0365SGiuseppe Cavallaro 	value |= (axi->axi_wr_osr_lmt & DMA_AXI_WR_OSR_LMT_MASK) <<
34afea0365SGiuseppe Cavallaro 		 DMA_AXI_WR_OSR_LMT_SHIFT;
35afea0365SGiuseppe Cavallaro 
366b3374cbSNiklas Cassel 	value &= ~DMA_AXI_RD_OSR_LMT;
37afea0365SGiuseppe Cavallaro 	value |= (axi->axi_rd_osr_lmt & DMA_AXI_RD_OSR_LMT_MASK) <<
38afea0365SGiuseppe Cavallaro 		 DMA_AXI_RD_OSR_LMT_SHIFT;
39afea0365SGiuseppe Cavallaro 
40afea0365SGiuseppe Cavallaro 	/* Depending on the UNDEF bit the Master AXI will perform any burst
41afea0365SGiuseppe Cavallaro 	 * length according to the BLEN programmed (by default all BLEN are
42afea0365SGiuseppe Cavallaro 	 * set).
43afea0365SGiuseppe Cavallaro 	 */
44afea0365SGiuseppe Cavallaro 	for (i = 0; i < AXI_BLEN; i++) {
45afea0365SGiuseppe Cavallaro 		switch (axi->axi_blen[i]) {
46afea0365SGiuseppe Cavallaro 		case 256:
47afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN256;
48afea0365SGiuseppe Cavallaro 			break;
49afea0365SGiuseppe Cavallaro 		case 128:
50afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN128;
51afea0365SGiuseppe Cavallaro 			break;
52afea0365SGiuseppe Cavallaro 		case 64:
53afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN64;
54afea0365SGiuseppe Cavallaro 			break;
55afea0365SGiuseppe Cavallaro 		case 32:
56afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN32;
57afea0365SGiuseppe Cavallaro 			break;
58afea0365SGiuseppe Cavallaro 		case 16:
59afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN16;
60afea0365SGiuseppe Cavallaro 			break;
61afea0365SGiuseppe Cavallaro 		case 8:
62afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN8;
63afea0365SGiuseppe Cavallaro 			break;
64afea0365SGiuseppe Cavallaro 		case 4:
65afea0365SGiuseppe Cavallaro 			value |= DMA_AXI_BLEN4;
66afea0365SGiuseppe Cavallaro 			break;
67afea0365SGiuseppe Cavallaro 		}
68afea0365SGiuseppe Cavallaro 	}
69afea0365SGiuseppe Cavallaro 
70afea0365SGiuseppe Cavallaro 	writel(value, ioaddr + DMA_AXI_BUS_MODE);
71afea0365SGiuseppe Cavallaro }
72afea0365SGiuseppe Cavallaro 
dwmac1000_dma_init(void __iomem * ioaddr,struct stmmac_dma_cfg * dma_cfg,int atds)7350ca903aSNiklas Cassel static void dwmac1000_dma_init(void __iomem *ioaddr,
7424aaed0cSJose Abreu 			       struct stmmac_dma_cfg *dma_cfg, int atds)
75afea0365SGiuseppe Cavallaro {
76afea0365SGiuseppe Cavallaro 	u32 value = readl(ioaddr + DMA_BUS_MODE);
7789caaa2dSNiklas Cassel 	int txpbl = dma_cfg->txpbl ?: dma_cfg->pbl;
7889caaa2dSNiklas Cassel 	int rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl;
797ac6653aSJeff Kirsher 
808327eb65SDeepak SIKRI 	/*
81afea0365SGiuseppe Cavallaro 	 * Set the DMA PBL (Programmable Burst Length) mode.
82afea0365SGiuseppe Cavallaro 	 *
83afea0365SGiuseppe Cavallaro 	 * Note: before stmmac core 3.50 this mode bit was 4xPBL, and
848327eb65SDeepak SIKRI 	 * post 3.5 mode bit acts as 8*PBL.
858327eb65SDeepak SIKRI 	 */
864022d039SNiklas Cassel 	if (dma_cfg->pblx8)
87afea0365SGiuseppe Cavallaro 		value |= DMA_BUS_MODE_MAXPBL;
8889caaa2dSNiklas Cassel 	value |= DMA_BUS_MODE_USP;
8989caaa2dSNiklas Cassel 	value &= ~(DMA_BUS_MODE_PBL_MASK | DMA_BUS_MODE_RPBL_MASK);
9089caaa2dSNiklas Cassel 	value |= (txpbl << DMA_BUS_MODE_PBL_SHIFT);
9189caaa2dSNiklas Cassel 	value |= (rxpbl << DMA_BUS_MODE_RPBL_SHIFT);
927ac6653aSJeff Kirsher 
938327eb65SDeepak SIKRI 	/* Set the Fixed burst mode */
9450ca903aSNiklas Cassel 	if (dma_cfg->fixed_burst)
958327eb65SDeepak SIKRI 		value |= DMA_BUS_MODE_FB;
968327eb65SDeepak SIKRI 
97b9cde0a8SGiuseppe CAVALLARO 	/* Mixed Burst has no effect when fb is set */
9850ca903aSNiklas Cassel 	if (dma_cfg->mixed_burst)
99b9cde0a8SGiuseppe CAVALLARO 		value |= DMA_BUS_MODE_MB;
100b9cde0a8SGiuseppe CAVALLARO 
101c24602efSGiuseppe CAVALLARO 	if (atds)
102c24602efSGiuseppe CAVALLARO 		value |= DMA_BUS_MODE_ATDS;
103c24602efSGiuseppe CAVALLARO 
10450ca903aSNiklas Cassel 	if (dma_cfg->aal)
105afea0365SGiuseppe Cavallaro 		value |= DMA_BUS_MODE_AAL;
1067ac6653aSJeff Kirsher 
107afea0365SGiuseppe Cavallaro 	writel(value, ioaddr + DMA_BUS_MODE);
1088327eb65SDeepak SIKRI 
1097ac6653aSJeff Kirsher 	/* Mask interrupts by writing to CSR7 */
1107ac6653aSJeff Kirsher 	writel(DMA_INTR_DEFAULT_MASK, ioaddr + DMA_INTR_ENA);
11124aaed0cSJose Abreu }
1127ac6653aSJeff Kirsher 
dwmac1000_dma_init_rx(struct stmmac_priv * priv,void __iomem * ioaddr,struct stmmac_dma_cfg * dma_cfg,dma_addr_t dma_rx_phy,u32 chan)113*1d84b487SAndrew Halaney static void dwmac1000_dma_init_rx(struct stmmac_priv *priv,
114*1d84b487SAndrew Halaney 				  void __iomem *ioaddr,
11524aaed0cSJose Abreu 				  struct stmmac_dma_cfg *dma_cfg,
11606a80a7dSJose Abreu 				  dma_addr_t dma_rx_phy, u32 chan)
11724aaed0cSJose Abreu {
11824aaed0cSJose Abreu 	/* RX descriptor base address list must be written into DMA CSR3 */
11906a80a7dSJose Abreu 	writel(lower_32_bits(dma_rx_phy), ioaddr + DMA_RCV_BASE_ADDR);
12024aaed0cSJose Abreu }
12124aaed0cSJose Abreu 
dwmac1000_dma_init_tx(struct stmmac_priv * priv,void __iomem * ioaddr,struct stmmac_dma_cfg * dma_cfg,dma_addr_t dma_tx_phy,u32 chan)122*1d84b487SAndrew Halaney static void dwmac1000_dma_init_tx(struct stmmac_priv *priv,
123*1d84b487SAndrew Halaney 				  void __iomem *ioaddr,
12424aaed0cSJose Abreu 				  struct stmmac_dma_cfg *dma_cfg,
12506a80a7dSJose Abreu 				  dma_addr_t dma_tx_phy, u32 chan)
12624aaed0cSJose Abreu {
12724aaed0cSJose Abreu 	/* TX descriptor base address list must be written into DMA CSR4 */
12806a80a7dSJose Abreu 	writel(lower_32_bits(dma_tx_phy), ioaddr + DMA_TX_BASE_ADDR);
1297ac6653aSJeff Kirsher }
1307ac6653aSJeff Kirsher 
dwmac1000_configure_fc(u32 csr6,int rxfifosz)131f88203a2SVince Bridgers static u32 dwmac1000_configure_fc(u32 csr6, int rxfifosz)
132f88203a2SVince Bridgers {
133f88203a2SVince Bridgers 	csr6 &= ~DMA_CONTROL_RFA_MASK;
134f88203a2SVince Bridgers 	csr6 &= ~DMA_CONTROL_RFD_MASK;
135f88203a2SVince Bridgers 
136f88203a2SVince Bridgers 	/* Leave flow control disabled if receive fifo size is less than
137f88203a2SVince Bridgers 	 * 4K or 0. Otherwise, send XOFF when fifo is 1K less than full,
138f88203a2SVince Bridgers 	 * and send XON when 2K less than full.
139f88203a2SVince Bridgers 	 */
140f88203a2SVince Bridgers 	if (rxfifosz < 4096) {
141f88203a2SVince Bridgers 		csr6 &= ~DMA_CONTROL_EFC;
142f88203a2SVince Bridgers 		pr_debug("GMAC: disabling flow control, rxfifo too small(%d)\n",
143f88203a2SVince Bridgers 			 rxfifosz);
144f88203a2SVince Bridgers 	} else {
145f88203a2SVince Bridgers 		csr6 |= DMA_CONTROL_EFC;
146f88203a2SVince Bridgers 		csr6 |= RFA_FULL_MINUS_1K;
147f88203a2SVince Bridgers 		csr6 |= RFD_FULL_MINUS_2K;
148f88203a2SVince Bridgers 	}
149f88203a2SVince Bridgers 	return csr6;
150f88203a2SVince Bridgers }
151f88203a2SVince Bridgers 
dwmac1000_dma_operation_mode_rx(struct stmmac_priv * priv,void __iomem * ioaddr,int mode,u32 channel,int fifosz,u8 qmode)152*1d84b487SAndrew Halaney static void dwmac1000_dma_operation_mode_rx(struct stmmac_priv *priv,
153*1d84b487SAndrew Halaney 					    void __iomem *ioaddr, int mode,
154ab0204e3SJose Abreu 					    u32 channel, int fifosz, u8 qmode)
1557ac6653aSJeff Kirsher {
1567ac6653aSJeff Kirsher 	u32 csr6 = readl(ioaddr + DMA_CONTROL);
1577ac6653aSJeff Kirsher 
158ab0204e3SJose Abreu 	if (mode == SF_DMA_MODE) {
159ab0204e3SJose Abreu 		pr_debug("GMAC: enable RX store and forward mode\n");
160ab0204e3SJose Abreu 		csr6 |= DMA_CONTROL_RSF;
161ab0204e3SJose Abreu 	} else {
162ab0204e3SJose Abreu 		pr_debug("GMAC: disable RX SF mode (threshold %d)\n", mode);
163ab0204e3SJose Abreu 		csr6 &= ~DMA_CONTROL_RSF;
164ab0204e3SJose Abreu 		csr6 &= DMA_CONTROL_TC_RX_MASK;
165ab0204e3SJose Abreu 		if (mode <= 32)
166ab0204e3SJose Abreu 			csr6 |= DMA_CONTROL_RTC_32;
167ab0204e3SJose Abreu 		else if (mode <= 64)
168ab0204e3SJose Abreu 			csr6 |= DMA_CONTROL_RTC_64;
169ab0204e3SJose Abreu 		else if (mode <= 96)
170ab0204e3SJose Abreu 			csr6 |= DMA_CONTROL_RTC_96;
171ab0204e3SJose Abreu 		else
172ab0204e3SJose Abreu 			csr6 |= DMA_CONTROL_RTC_128;
173ab0204e3SJose Abreu 	}
174ab0204e3SJose Abreu 
175ab0204e3SJose Abreu 	/* Configure flow control based on rx fifo size */
176ab0204e3SJose Abreu 	csr6 = dwmac1000_configure_fc(csr6, fifosz);
177ab0204e3SJose Abreu 
178ab0204e3SJose Abreu 	writel(csr6, ioaddr + DMA_CONTROL);
179ab0204e3SJose Abreu }
180ab0204e3SJose Abreu 
dwmac1000_dma_operation_mode_tx(struct stmmac_priv * priv,void __iomem * ioaddr,int mode,u32 channel,int fifosz,u8 qmode)181*1d84b487SAndrew Halaney static void dwmac1000_dma_operation_mode_tx(struct stmmac_priv *priv,
182*1d84b487SAndrew Halaney 					    void __iomem *ioaddr, int mode,
183ab0204e3SJose Abreu 					    u32 channel, int fifosz, u8 qmode)
184ab0204e3SJose Abreu {
185ab0204e3SJose Abreu 	u32 csr6 = readl(ioaddr + DMA_CONTROL);
186ab0204e3SJose Abreu 
187ab0204e3SJose Abreu 	if (mode == SF_DMA_MODE) {
18883d7af64SGiuseppe CAVALLARO 		pr_debug("GMAC: enable TX store and forward mode\n");
1897ac6653aSJeff Kirsher 		/* Transmit COE type 2 cannot be done in cut-through mode. */
1907ac6653aSJeff Kirsher 		csr6 |= DMA_CONTROL_TSF;
1917ac6653aSJeff Kirsher 		/* Operating on second frame increase the performance
192ceb69499SGiuseppe CAVALLARO 		 * especially when transmit store-and-forward is used.
193ceb69499SGiuseppe CAVALLARO 		 */
1947ac6653aSJeff Kirsher 		csr6 |= DMA_CONTROL_OSF;
1957ac6653aSJeff Kirsher 	} else {
196ab0204e3SJose Abreu 		pr_debug("GMAC: disabling TX SF (threshold %d)\n", mode);
1977ac6653aSJeff Kirsher 		csr6 &= ~DMA_CONTROL_TSF;
1987ac6653aSJeff Kirsher 		csr6 &= DMA_CONTROL_TC_TX_MASK;
1997ac6653aSJeff Kirsher 		/* Set the transmit threshold */
200ab0204e3SJose Abreu 		if (mode <= 32)
2017ac6653aSJeff Kirsher 			csr6 |= DMA_CONTROL_TTC_32;
202ab0204e3SJose Abreu 		else if (mode <= 64)
2037ac6653aSJeff Kirsher 			csr6 |= DMA_CONTROL_TTC_64;
204ab0204e3SJose Abreu 		else if (mode <= 128)
2057ac6653aSJeff Kirsher 			csr6 |= DMA_CONTROL_TTC_128;
206ab0204e3SJose Abreu 		else if (mode <= 192)
2077ac6653aSJeff Kirsher 			csr6 |= DMA_CONTROL_TTC_192;
2087ac6653aSJeff Kirsher 		else
2097ac6653aSJeff Kirsher 			csr6 |= DMA_CONTROL_TTC_256;
2107ac6653aSJeff Kirsher 	}
2117ac6653aSJeff Kirsher 
2127ac6653aSJeff Kirsher 	writel(csr6, ioaddr + DMA_CONTROL);
2137ac6653aSJeff Kirsher }
2147ac6653aSJeff Kirsher 
dwmac1000_dump_dma_regs(struct stmmac_priv * priv,void __iomem * ioaddr,u32 * reg_space)215*1d84b487SAndrew Halaney static void dwmac1000_dump_dma_regs(struct stmmac_priv *priv,
216*1d84b487SAndrew Halaney 				    void __iomem *ioaddr, u32 *reg_space)
2177ac6653aSJeff Kirsher {
2187ac6653aSJeff Kirsher 	int i;
219fbf68229SLABBE Corentin 
220f4458b92SThor Thayer 	for (i = 0; i < NUM_DWMAC1000_DMA_REGS; i++)
22177b0d361SThor Thayer 		if ((i < 12) || (i > 17))
222fbf68229SLABBE Corentin 			reg_space[DMA_BUS_MODE / 4 + i] =
223fbf68229SLABBE Corentin 				readl(ioaddr + DMA_BUS_MODE + i * 4);
2247ac6653aSJeff Kirsher }
2257ac6653aSJeff Kirsher 
dwmac1000_get_hw_feature(void __iomem * ioaddr,struct dma_features * dma_cap)226075da584SHerve Codina static int dwmac1000_get_hw_feature(void __iomem *ioaddr,
227f10a6a35SAlexandre TORGUE 				    struct dma_features *dma_cap)
228e7434821SGiuseppe CAVALLARO {
229f10a6a35SAlexandre TORGUE 	u32 hw_cap = readl(ioaddr + DMA_HW_FEATURE);
230f10a6a35SAlexandre TORGUE 
231075da584SHerve Codina 	if (!hw_cap) {
232075da584SHerve Codina 		/* 0x00000000 is the value read on old hardware that does not
233075da584SHerve Codina 		 * implement this register
234075da584SHerve Codina 		 */
235075da584SHerve Codina 		return -EOPNOTSUPP;
236075da584SHerve Codina 	}
237075da584SHerve Codina 
238f10a6a35SAlexandre TORGUE 	dma_cap->mbps_10_100 = (hw_cap & DMA_HW_FEAT_MIISEL);
239f10a6a35SAlexandre TORGUE 	dma_cap->mbps_1000 = (hw_cap & DMA_HW_FEAT_GMIISEL) >> 1;
240f10a6a35SAlexandre TORGUE 	dma_cap->half_duplex = (hw_cap & DMA_HW_FEAT_HDSEL) >> 2;
241f10a6a35SAlexandre TORGUE 	dma_cap->hash_filter = (hw_cap & DMA_HW_FEAT_HASHSEL) >> 4;
242f10a6a35SAlexandre TORGUE 	dma_cap->multi_addr = (hw_cap & DMA_HW_FEAT_ADDMAC) >> 5;
243f10a6a35SAlexandre TORGUE 	dma_cap->pcs = (hw_cap & DMA_HW_FEAT_PCSSEL) >> 6;
244f10a6a35SAlexandre TORGUE 	dma_cap->sma_mdio = (hw_cap & DMA_HW_FEAT_SMASEL) >> 8;
245f10a6a35SAlexandre TORGUE 	dma_cap->pmt_remote_wake_up = (hw_cap & DMA_HW_FEAT_RWKSEL) >> 9;
246f10a6a35SAlexandre TORGUE 	dma_cap->pmt_magic_frame = (hw_cap & DMA_HW_FEAT_MGKSEL) >> 10;
247f10a6a35SAlexandre TORGUE 	/* MMC */
248f10a6a35SAlexandre TORGUE 	dma_cap->rmon = (hw_cap & DMA_HW_FEAT_MMCSEL) >> 11;
249f10a6a35SAlexandre TORGUE 	/* IEEE 1588-2002 */
250f10a6a35SAlexandre TORGUE 	dma_cap->time_stamp =
251f10a6a35SAlexandre TORGUE 	    (hw_cap & DMA_HW_FEAT_TSVER1SEL) >> 12;
252f10a6a35SAlexandre TORGUE 	/* IEEE 1588-2008 */
253f10a6a35SAlexandre TORGUE 	dma_cap->atime_stamp = (hw_cap & DMA_HW_FEAT_TSVER2SEL) >> 13;
254f10a6a35SAlexandre TORGUE 	/* 802.3az - Energy-Efficient Ethernet (EEE) */
255f10a6a35SAlexandre TORGUE 	dma_cap->eee = (hw_cap & DMA_HW_FEAT_EEESEL) >> 14;
256f10a6a35SAlexandre TORGUE 	dma_cap->av = (hw_cap & DMA_HW_FEAT_AVSEL) >> 15;
257f10a6a35SAlexandre TORGUE 	/* TX and RX csum */
258f10a6a35SAlexandre TORGUE 	dma_cap->tx_coe = (hw_cap & DMA_HW_FEAT_TXCOESEL) >> 16;
259f10a6a35SAlexandre TORGUE 	dma_cap->rx_coe_type1 = (hw_cap & DMA_HW_FEAT_RXTYP1COE) >> 17;
260f10a6a35SAlexandre TORGUE 	dma_cap->rx_coe_type2 = (hw_cap & DMA_HW_FEAT_RXTYP2COE) >> 18;
261f10a6a35SAlexandre TORGUE 	dma_cap->rxfifo_over_2048 = (hw_cap & DMA_HW_FEAT_RXFIFOSIZE) >> 19;
262f10a6a35SAlexandre TORGUE 	/* TX and RX number of channels */
263f10a6a35SAlexandre TORGUE 	dma_cap->number_rx_channel = (hw_cap & DMA_HW_FEAT_RXCHCNT) >> 20;
264f10a6a35SAlexandre TORGUE 	dma_cap->number_tx_channel = (hw_cap & DMA_HW_FEAT_TXCHCNT) >> 22;
265f10a6a35SAlexandre TORGUE 	/* Alternate (enhanced) DESC mode */
266f10a6a35SAlexandre TORGUE 	dma_cap->enh_desc = (hw_cap & DMA_HW_FEAT_ENHDESSEL) >> 24;
267075da584SHerve Codina 
268075da584SHerve Codina 	return 0;
269e7434821SGiuseppe CAVALLARO }
270e7434821SGiuseppe CAVALLARO 
dwmac1000_rx_watchdog(struct stmmac_priv * priv,void __iomem * ioaddr,u32 riwt,u32 queue)271*1d84b487SAndrew Halaney static void dwmac1000_rx_watchdog(struct stmmac_priv *priv,
272*1d84b487SAndrew Halaney 				  void __iomem *ioaddr, u32 riwt, u32 queue)
27362a2ab93SGiuseppe CAVALLARO {
27462a2ab93SGiuseppe CAVALLARO 	writel(riwt, ioaddr + DMA_RX_WATCHDOG);
27562a2ab93SGiuseppe CAVALLARO }
27662a2ab93SGiuseppe CAVALLARO 
2777ac6653aSJeff Kirsher const struct stmmac_dma_ops dwmac1000_dma_ops = {
278495db273SGiuseppe Cavallaro 	.reset = dwmac_dma_reset,
2797ac6653aSJeff Kirsher 	.init = dwmac1000_dma_init,
28024aaed0cSJose Abreu 	.init_rx_chan = dwmac1000_dma_init_rx,
28124aaed0cSJose Abreu 	.init_tx_chan = dwmac1000_dma_init_tx,
282afea0365SGiuseppe Cavallaro 	.axi = dwmac1000_dma_axi,
2837ac6653aSJeff Kirsher 	.dump_regs = dwmac1000_dump_dma_regs,
284ab0204e3SJose Abreu 	.dma_rx_mode = dwmac1000_dma_operation_mode_rx,
285ab0204e3SJose Abreu 	.dma_tx_mode = dwmac1000_dma_operation_mode_tx,
2867ac6653aSJeff Kirsher 	.enable_dma_transmission = dwmac_enable_dma_transmission,
2877ac6653aSJeff Kirsher 	.enable_dma_irq = dwmac_enable_dma_irq,
2887ac6653aSJeff Kirsher 	.disable_dma_irq = dwmac_disable_dma_irq,
2897ac6653aSJeff Kirsher 	.start_tx = dwmac_dma_start_tx,
2907ac6653aSJeff Kirsher 	.stop_tx = dwmac_dma_stop_tx,
2917ac6653aSJeff Kirsher 	.start_rx = dwmac_dma_start_rx,
2927ac6653aSJeff Kirsher 	.stop_rx = dwmac_dma_stop_rx,
2937ac6653aSJeff Kirsher 	.dma_interrupt = dwmac_dma_interrupt,
294e7434821SGiuseppe CAVALLARO 	.get_hw_feature = dwmac1000_get_hw_feature,
29562a2ab93SGiuseppe CAVALLARO 	.rx_watchdog = dwmac1000_rx_watchdog,
2967ac6653aSJeff Kirsher };
297