Skip to content

Commit 890b791

Browse files
committed
Merge branch 'stmmac-next'
Giuseppe Cavallaro says: ==================== stmmac: review driver Koptions Recently many Koption options have been added to have new glue logic on several platforms. The main goal behind this work is to guarantee that the driver built fine on all the branches where it is present independently of which glue logic is selected. IMHO, it is better to remove all the not necessary Koption(s) that can hide build problems when something changes in the driver and especially when the DT compatibility allows us to manage all the platform data. I compiled the driver w/o any issue on net-next Git for: x86, arm and sh4. In case of there are build problems on some repos now it will be easy to catch them and cherry-pick patches from mainstream. For sure, do not hesitate to contact me in case of issue. Also this set removes STMMAC_DEBUG_FS and BUS_MODE_DA. The latter is useless and the former can be replaced by DEBUG_FS (always to make safe the build). V2: patch-set re-based on top of the latest updates for net-next ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 30349bd + 98fbebc commit 890b791

File tree

6 files changed

+16
-97
lines changed

6 files changed

+16
-97
lines changed

drivers/net/ethernet/stmicro/stmmac/Kconfig

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,56 +18,14 @@ config STMMAC_PLATFORM
1818
depends on STMMAC_ETH
1919
default y
2020
---help---
21-
This selects the platform specific bus support for
22-
the stmmac device driver. This is the driver used
23-
on many embedded STM platforms based on ARM and SuperH
24-
processors.
21+
This selects the platform specific bus support for the stmmac driver.
22+
This is the driver used on several SoCs:
23+
STi, Allwinner, Amlogic Meson, Altera SOCFPGA.
24+
2525
If you have a controller with this interface, say Y or M here.
2626

2727
If unsure, say N.
2828

29-
config 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-
39-
config 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-
49-
config 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-
60-
config 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-
7129
config STMMAC_PCI
7230
bool "STMMAC PCI bus support"
7331
depends on STMMAC_ETH && PCI
@@ -79,22 +37,4 @@ config STMMAC_PCI
7937
D1215994A VIRTEX FPGA board.
8038

8139
If unsure, say N.
82-
83-
config 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-
91-
config 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-
10040
endif

drivers/net/ethernet/stmicro/stmmac/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
obj-$(CONFIG_STMMAC_ETH) += stmmac.o
2-
stmmac-$(CONFIG_STMMAC_PLATFORM) += stmmac_platform.o
32
stmmac-$(CONFIG_STMMAC_PCI) += stmmac_pci.o
4-
stmmac-$(CONFIG_DWMAC_MESON) += dwmac-meson.o
5-
stmmac-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o
6-
stmmac-$(CONFIG_DWMAC_STI) += dwmac-sti.o
7-
stmmac-$(CONFIG_DWMAC_SOCFPGA) += dwmac-socfpga.o
3+
stmmac-$(CONFIG_STMMAC_PLATFORM) += stmmac_platform.o dwmac-meson.o \
4+
dwmac-sunxi.o dwmac-sti.o \
5+
dwmac-socfpga.o
86
stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
97
chain_mode.o dwmac_lib.o dwmac1000_core.o dwmac1000_dma.o \
108
dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \

drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
7070
if (mb)
7171
value |= DMA_BUS_MODE_MB;
7272

73-
#ifdef CONFIG_STMMAC_DA
74-
value |= DMA_BUS_MODE_DA; /* Rx has priority over tx */
75-
#endif
76-
7773
if (atds)
7874
value |= DMA_BUS_MODE_ATDS;
7975

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,13 @@ void stmmac_disable_eee_mode(struct stmmac_priv *priv);
137137
bool stmmac_eee_init(struct stmmac_priv *priv);
138138

139139
#ifdef CONFIG_STMMAC_PLATFORM
140-
#ifdef CONFIG_DWMAC_MESON
141140
extern const struct stmmac_of_data meson6_dwmac_data;
142-
#endif
143-
#ifdef CONFIG_DWMAC_SUNXI
144141
extern const struct stmmac_of_data sun7i_gmac_data;
145-
#endif
146-
#ifdef CONFIG_DWMAC_STI
147142
extern const struct stmmac_of_data stih4xx_dwmac_data;
148143
extern const struct stmmac_of_data stid127_dwmac_data;
149-
#endif
150-
#ifdef CONFIG_DWMAC_SOCFPGA
151144
extern const struct stmmac_of_data socfpga_gmac_data;
152-
#endif
153145
extern struct platform_driver stmmac_pltfr_driver;
146+
154147
static inline int stmmac_register_platform(void)
155148
{
156149
int err;

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
#include <linux/slab.h>
4545
#include <linux/prefetch.h>
4646
#include <linux/pinctrl/consumer.h>
47-
#ifdef CONFIG_STMMAC_DEBUG_FS
47+
#ifdef CONFIG_DEBUG_FS
4848
#include <linux/debugfs.h>
4949
#include <linux/seq_file.h>
50-
#endif /* CONFIG_STMMAC_DEBUG_FS */
50+
#endif /* CONFIG_DEBUG_FS */
5151
#include <linux/net_tstamp.h>
5252
#include "stmmac_ptp.h"
5353
#include "stmmac.h"
@@ -116,7 +116,7 @@ MODULE_PARM_DESC(chain_mode, "To use chain instead of ring mode");
116116

117117
static irqreturn_t stmmac_interrupt(int irq, void *dev_id);
118118

119-
#ifdef CONFIG_STMMAC_DEBUG_FS
119+
#ifdef CONFIG_DEBUG_FS
120120
static int stmmac_init_fs(struct net_device *dev);
121121
static void stmmac_exit_fs(void);
122122
#endif
@@ -1688,7 +1688,7 @@ static int stmmac_hw_setup(struct net_device *dev)
16881688
if (ret && ret != -EOPNOTSUPP)
16891689
pr_warn("%s: failed PTP initialisation\n", __func__);
16901690

1691-
#ifdef CONFIG_STMMAC_DEBUG_FS
1691+
#ifdef CONFIG_DEBUG_FS
16921692
ret = stmmac_init_fs(dev);
16931693
if (ret < 0)
16941694
pr_warn("%s: failed debugFS registration\n", __func__);
@@ -1866,7 +1866,7 @@ static int stmmac_release(struct net_device *dev)
18661866

18671867
netif_carrier_off(dev);
18681868

1869-
#ifdef CONFIG_STMMAC_DEBUG_FS
1869+
#ifdef CONFIG_DEBUG_FS
18701870
stmmac_exit_fs();
18711871
#endif
18721872

@@ -2453,7 +2453,7 @@ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
24532453
return ret;
24542454
}
24552455

2456-
#ifdef CONFIG_STMMAC_DEBUG_FS
2456+
#ifdef CONFIG_DEBUG_FS
24572457
static struct dentry *stmmac_fs_dir;
24582458
static struct dentry *stmmac_rings_status;
24592459
static struct dentry *stmmac_dma_cap;
@@ -2638,7 +2638,7 @@ static void stmmac_exit_fs(void)
26382638
debugfs_remove(stmmac_dma_cap);
26392639
debugfs_remove(stmmac_fs_dir);
26402640
}
2641-
#endif /* CONFIG_STMMAC_DEBUG_FS */
2641+
#endif /* CONFIG_DEBUG_FS */
26422642

26432643
static const struct net_device_ops stmmac_netdev_ops = {
26442644
.ndo_open = stmmac_open,

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,14 @@
3030
#include "stmmac.h"
3131

3232
static const struct of_device_id stmmac_dt_ids[] = {
33-
#ifdef CONFIG_DWMAC_MESON
33+
/* SoC specific glue layers should come before generic bindings */
3434
{ .compatible = "amlogic,meson6-dwmac", .data = &meson6_dwmac_data},
35-
#endif
36-
#ifdef CONFIG_DWMAC_SUNXI
3735
{ .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
38-
#endif
39-
#ifdef CONFIG_DWMAC_STI
4036
{ .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
4137
{ .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
4238
{ .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
4339
{ .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
44-
#endif
45-
#ifdef CONFIG_DWMAC_SOCFPGA
4640
{ .compatible = "altr,socfpga-stmmac", .data = &socfpga_gmac_data },
47-
#endif
48-
/* SoC specific glue layers should come before generic bindings */
4941
{ .compatible = "st,spear600-gmac"},
5042
{ .compatible = "snps,dwmac-3.610"},
5143
{ .compatible = "snps,dwmac-3.70a"},

0 commit comments

Comments
 (0)