Skip to content

Commit 5d1f3fe

Browse files
minimaxwelldavem330
authored andcommitted
net: stmmac: dwmac-sogfpga: use the lynx pcs driver
dwmac_socfpga re-implements support for the TSE PCS, which is identical to the already existing TSE PCS, which in turn is the same as the Lynx PCS. Drop the existing TSE re-implemenation and use the Lynx PCS instead, relying on the regmap-mdio driver to translate MDIO accesses into mmio accesses. Add a lynx_pcs reference in the stmmac's internal structure, and use .mac_select_pcs() to return the relevant PCS to be used. Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 196eec4 commit 5d1f3fe

8 files changed

Lines changed: 83 additions & 316 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ config DWMAC_SOCFPGA
158158
default ARCH_INTEL_SOCFPGA
159159
depends on OF && (ARCH_INTEL_SOCFPGA || COMPILE_TEST)
160160
select MFD_SYSCON
161+
select MDIO_REGMAP
162+
select REGMAP_MMIO
163+
select PCS_LYNX
161164
help
162165
Support for ethernet controller on Altera SOCFPGA
163166

drivers/net/ethernet/stmicro/stmmac/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ obj-$(CONFIG_DWMAC_IMX8) += dwmac-imx.o
3535
obj-$(CONFIG_DWMAC_TEGRA) += dwmac-tegra.o
3636
obj-$(CONFIG_DWMAC_VISCONTI) += dwmac-visconti.o
3737
stmmac-platform-objs:= stmmac_platform.o
38-
dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
38+
dwmac-altr-socfpga-objs := dwmac-socfpga.o
3939

4040
obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
4141
obj-$(CONFIG_DWMAC_INTEL) += dwmac-intel.o

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

Lines changed: 0 additions & 257 deletions
This file was deleted.

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/stmmac.h>
1717
#include <linux/phy.h>
1818
#include <linux/pcs/pcs-xpcs.h>
19+
#include <linux/pcs-lynx.h>
1920
#include <linux/module.h>
2021
#if IS_ENABLED(CONFIG_VLAN_8021Q)
2122
#define STMMAC_VLAN_TAG_USED
@@ -519,6 +520,7 @@ struct mac_device_info {
519520
const struct stmmac_tc_ops *tc;
520521
const struct stmmac_mmc_ops *mmc;
521522
struct dw_xpcs *xpcs;
523+
struct phylink_pcs *lynx_pcs; /* Lynx external PCS */
522524
struct mii_regs mii; /* MII register Addresses */
523525
struct mac_link link;
524526
void __iomem *pcsr; /* vpointer to device CSRs */

0 commit comments

Comments
 (0)