aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/Kconfig68
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/Makefile8
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h9
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c14
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c10
6 files changed, 16 insertions, 97 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index b02d4a3ffa37..33b85bae6c21 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -18,56 +18,14 @@ config STMMAC_PLATFORM
18 depends on STMMAC_ETH 18 depends on STMMAC_ETH
19 default y 19 default y
20 ---help--- 20 ---help---
21 This selects the platform specific bus support for 21 This selects the platform specific bus support for the stmmac driver.
22 the stmmac device driver. This is the driver used 22 This is the driver used on several SoCs:
23 on many embedded STM platforms based on ARM and SuperH 23 STi, Allwinner, Amlogic Meson, Altera SOCFPGA.
24 processors. 24
25 If you have a controller with this interface, say Y or M here. 25 If you have a controller with this interface, say Y or M here.
26 26
27 If unsure, say N. 27 If unsure, say N.
28 28
29config DWMAC_MESON
30 bool "Amlogic Meson dwmac support"
31 depends on STMMAC_PLATFORM && ARCH_MESON
32 help
33 Support for Ethernet controller on Amlogic Meson SoCs.
34
35 This selects the Amlogic Meson SoC glue layer support for
36 the stmmac device driver. This driver is used for Meson6 and
37 Meson8 SoCs.
38
39config DWMAC_SOCFPGA
40 bool "SOCFPGA dwmac support"
41 depends on STMMAC_PLATFORM && MFD_SYSCON && (ARCH_SOCFPGA || COMPILE_TEST)
42 help
43 Support for ethernet controller on Altera SOCFPGA
44
45 This selects the Altera SOCFPGA SoC glue layer support
46 for the stmmac device driver. This driver is used for
47 arria5 and cyclone5 FPGA SoCs.
48
49config DWMAC_SUNXI
50 bool "Allwinner GMAC support"
51 depends on STMMAC_PLATFORM && ARCH_SUNXI
52 default y
53 ---help---
54 Support for Allwinner A20/A31 GMAC ethernet controllers.
55
56 This selects Allwinner SoC glue layer support for the
57 stmmac device driver. This driver is used for A20/A31
58 GMAC ethernet controller.
59
60config DWMAC_STI
61 bool "STi GMAC support"
62 depends on STMMAC_PLATFORM && ARCH_STI
63 default y
64 ---help---
65 Support for ethernet controller on STi SOCs.
66
67 This selects STi SoC glue layer support for the stmmac
68 device driver. This driver is used on for the STi series
69 SOCs GMAC ethernet controller.
70
71config STMMAC_PCI 29config STMMAC_PCI
72 bool "STMMAC PCI bus support" 30 bool "STMMAC PCI bus support"
73 depends on STMMAC_ETH && PCI 31 depends on STMMAC_ETH && PCI
@@ -79,22 +37,4 @@ config STMMAC_PCI
79 D1215994A VIRTEX FPGA board. 37 D1215994A VIRTEX FPGA board.
80 38
81 If unsure, say N. 39 If unsure, say N.
82
83config STMMAC_DEBUG_FS
84 bool "Enable monitoring via sysFS "
85 default n
86 depends on STMMAC_ETH && DEBUG_FS
87 ---help---
88 The stmmac entry in /sys reports DMA TX/RX rings
89 or (if supported) the HW cap register.
90
91config STMMAC_DA
92 bool "STMMAC DMA arbitration scheme"
93 default n
94 ---help---
95 Selecting this option, rx has priority over Tx (only for Giga
96 Ethernet device).
97 By default, the DMA arbitration scheme is based on Round-robin
98 (rx:tx priority is 1:1).
99
100endif 40endif
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index 0533d0ba783d..034da704f22f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -1,10 +1,8 @@
1obj-$(CONFIG_STMMAC_ETH) += stmmac.o 1obj-$(CONFIG_STMMAC_ETH) += stmmac.o
2stmmac-$(CONFIG_STMMAC_PLATFORM) += stmmac_platform.o
3stmmac-$(CONFIG_STMMAC_PCI) += stmmac_pci.o 2stmmac-$(CONFIG_STMMAC_PCI) += stmmac_pci.o
4stmmac-$(CONFIG_DWMAC_MESON) += dwmac-meson.o 3stmmac-$(CONFIG_STMMAC_PLATFORM) += stmmac_platform.o dwmac-meson.o \
5stmmac-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o 4 dwmac-sunxi.o dwmac-sti.o \
6stmmac-$(CONFIG_DWMAC_STI) += dwmac-sti.o 5 dwmac-socfpga.o
7stmmac-$(CONFIG_DWMAC_SOCFPGA) += dwmac-socfpga.o
8stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \ 6stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
9 chain_mode.o dwmac_lib.o dwmac1000_core.o dwmac1000_dma.o \ 7 chain_mode.o dwmac_lib.o dwmac1000_core.o dwmac1000_dma.o \
10 dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \ 8 dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
index 0c2058a69fd2..59d92e811750 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
@@ -70,10 +70,6 @@ static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
70 if (mb) 70 if (mb)
71 value |= DMA_BUS_MODE_MB; 71 value |= DMA_BUS_MODE_MB;
72 72
73#ifdef CONFIG_STMMAC_DA
74 value |= DMA_BUS_MODE_DA; /* Rx has priority over tx */
75#endif
76
77 if (atds) 73 if (atds)
78 value |= DMA_BUS_MODE_ATDS; 74 value |= DMA_BUS_MODE_ATDS;
79 75
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index c3c40650b309..23aad9adef5a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -137,20 +137,13 @@ void stmmac_disable_eee_mode(struct stmmac_priv *priv);
137bool stmmac_eee_init(struct stmmac_priv *priv); 137bool stmmac_eee_init(struct stmmac_priv *priv);
138 138
139#ifdef CONFIG_STMMAC_PLATFORM 139#ifdef CONFIG_STMMAC_PLATFORM
140#ifdef CONFIG_DWMAC_MESON
141extern const struct stmmac_of_data meson6_dwmac_data; 140extern const struct stmmac_of_data meson6_dwmac_data;
142#endif
143#ifdef CONFIG_DWMAC_SUNXI
144extern const struct stmmac_of_data sun7i_gmac_data; 141extern const struct stmmac_of_data sun7i_gmac_data;
145#endif
146#ifdef CONFIG_DWMAC_STI
147extern const struct stmmac_of_data stih4xx_dwmac_data; 142extern const struct stmmac_of_data stih4xx_dwmac_data;
148extern const struct stmmac_of_data stid127_dwmac_data; 143extern const struct stmmac_of_data stid127_dwmac_data;
149#endif
150#ifdef CONFIG_DWMAC_SOCFPGA
151extern const struct stmmac_of_data socfpga_gmac_data; 144extern const struct stmmac_of_data socfpga_gmac_data;
152#endif
153extern struct platform_driver stmmac_pltfr_driver; 145extern struct platform_driver stmmac_pltfr_driver;
146
154static inline int stmmac_register_platform(void) 147static inline int stmmac_register_platform(void)
155{ 148{
156 int err; 149 int err;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 6f77a46c7e2c..a34754b6facb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -44,10 +44,10 @@
44#include <linux/slab.h> 44#include <linux/slab.h>
45#include <linux/prefetch.h> 45#include <linux/prefetch.h>
46#include <linux/pinctrl/consumer.h> 46#include <linux/pinctrl/consumer.h>
47#ifdef CONFIG_STMMAC_DEBUG_FS 47#ifdef CONFIG_DEBUG_FS
48#include <linux/debugfs.h> 48#include <linux/debugfs.h>
49#include <linux/seq_file.h> 49#include <linux/seq_file.h>
50#endif /* CONFIG_STMMAC_DEBUG_FS */ 50#endif /* CONFIG_DEBUG_FS */
51#include <linux/net_tstamp.h> 51#include <linux/net_tstamp.h>
52#include "stmmac_ptp.h" 52#include "stmmac_ptp.h"
53#include "stmmac.h" 53#include "stmmac.h"
@@ -116,7 +116,7 @@ MODULE_PARM_DESC(chain_mode, "To use chain instead of ring mode");
116 116
117static irqreturn_t stmmac_interrupt(int irq, void *dev_id); 117static irqreturn_t stmmac_interrupt(int irq, void *dev_id);
118 118
119#ifdef CONFIG_STMMAC_DEBUG_FS 119#ifdef CONFIG_DEBUG_FS
120static int stmmac_init_fs(struct net_device *dev); 120static int stmmac_init_fs(struct net_device *dev);
121static void stmmac_exit_fs(void); 121static void stmmac_exit_fs(void);
122#endif 122#endif
@@ -1688,7 +1688,7 @@ static int stmmac_hw_setup(struct net_device *dev)
1688 if (ret && ret != -EOPNOTSUPP) 1688 if (ret && ret != -EOPNOTSUPP)
1689 pr_warn("%s: failed PTP initialisation\n", __func__); 1689 pr_warn("%s: failed PTP initialisation\n", __func__);
1690 1690
1691#ifdef CONFIG_STMMAC_DEBUG_FS 1691#ifdef CONFIG_DEBUG_FS
1692 ret = stmmac_init_fs(dev); 1692 ret = stmmac_init_fs(dev);
1693 if (ret < 0) 1693 if (ret < 0)
1694 pr_warn("%s: failed debugFS registration\n", __func__); 1694 pr_warn("%s: failed debugFS registration\n", __func__);
@@ -1866,7 +1866,7 @@ static int stmmac_release(struct net_device *dev)
1866 1866
1867 netif_carrier_off(dev); 1867 netif_carrier_off(dev);
1868 1868
1869#ifdef CONFIG_STMMAC_DEBUG_FS 1869#ifdef CONFIG_DEBUG_FS
1870 stmmac_exit_fs(); 1870 stmmac_exit_fs();
1871#endif 1871#endif
1872 1872
@@ -2453,7 +2453,7 @@ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2453 return ret; 2453 return ret;
2454} 2454}
2455 2455
2456#ifdef CONFIG_STMMAC_DEBUG_FS 2456#ifdef CONFIG_DEBUG_FS
2457static struct dentry *stmmac_fs_dir; 2457static struct dentry *stmmac_fs_dir;
2458static struct dentry *stmmac_rings_status; 2458static struct dentry *stmmac_rings_status;
2459static struct dentry *stmmac_dma_cap; 2459static struct dentry *stmmac_dma_cap;
@@ -2638,7 +2638,7 @@ static void stmmac_exit_fs(void)
2638 debugfs_remove(stmmac_dma_cap); 2638 debugfs_remove(stmmac_dma_cap);
2639 debugfs_remove(stmmac_fs_dir); 2639 debugfs_remove(stmmac_fs_dir);
2640} 2640}
2641#endif /* CONFIG_STMMAC_DEBUG_FS */ 2641#endif /* CONFIG_DEBUG_FS */
2642 2642
2643static const struct net_device_ops stmmac_netdev_ops = { 2643static const struct net_device_ops stmmac_netdev_ops = {
2644 .ndo_open = stmmac_open, 2644 .ndo_open = stmmac_open,
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index db56fa7ce8f9..f4fe854f3ee3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -30,22 +30,14 @@
30#include "stmmac.h" 30#include "stmmac.h"
31 31
32static const struct of_device_id stmmac_dt_ids[] = { 32static const struct of_device_id stmmac_dt_ids[] = {
33#ifdef CONFIG_DWMAC_MESON 33 /* SoC specific glue layers should come before generic bindings */
34 { .compatible = "amlogic,meson6-dwmac", .data = &meson6_dwmac_data}, 34 { .compatible = "amlogic,meson6-dwmac", .data = &meson6_dwmac_data},
35#endif
36#ifdef CONFIG_DWMAC_SUNXI
37 { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data}, 35 { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
38#endif
39#ifdef CONFIG_DWMAC_STI
40 { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data}, 36 { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
41 { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data}, 37 { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
42 { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data}, 38 { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
43 { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data}, 39 { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
44#endif
45#ifdef CONFIG_DWMAC_SOCFPGA
46 { .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data }, 40 { .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data },
47#endif
48 /* SoC specific glue layers should come before generic bindings */
49 { .compatible = "st,spear600-gmac"}, 41 { .compatible = "st,spear600-gmac"},
50 { .compatible = "snps,dwmac-3.610"}, 42 { .compatible = "snps,dwmac-3.610"},
51 { .compatible = "snps,dwmac-3.70a"}, 43 { .compatible = "snps,dwmac-3.70a"},