Skip to content

Commit bedf9b8

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: move xgmac specific phylink caps to dwxgmac2 core
Move the xgmac specific phylink capabilities to the dwxgmac2 support core. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1qZAXd-005pUP-JL@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f1dae3d commit bedf9b8

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ static void dwxgmac2_core_init(struct mac_device_info *hw,
4747
writel(XGMAC_INT_DEFAULT_EN, ioaddr + XGMAC_INT_EN);
4848
}
4949

50+
static void xgmac_phylink_get_caps(struct stmmac_priv *priv)
51+
{
52+
priv->phylink_config.mac_capabilities |= MAC_2500FD | MAC_5000FD |
53+
MAC_10000FD | MAC_25000FD |
54+
MAC_40000FD | MAC_50000FD |
55+
MAC_100000FD;
56+
}
57+
5058
static void dwxgmac2_set_mac(void __iomem *ioaddr, bool enable)
5159
{
5260
u32 tx = readl(ioaddr + XGMAC_TX_CONFIG);
@@ -1490,6 +1498,7 @@ static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_txq,
14901498

14911499
const struct stmmac_ops dwxgmac210_ops = {
14921500
.core_init = dwxgmac2_core_init,
1501+
.phylink_get_caps = xgmac_phylink_get_caps,
14931502
.set_mac = dwxgmac2_set_mac,
14941503
.rx_ipc = dwxgmac2_rx_ipc,
14951504
.rx_queue_enable = dwxgmac2_rx_queue_enable,
@@ -1551,6 +1560,7 @@ static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,
15511560

15521561
const struct stmmac_ops dwxlgmac2_ops = {
15531562
.core_init = dwxgmac2_core_init,
1563+
.phylink_get_caps = xgmac_phylink_get_caps,
15541564
.set_mac = dwxgmac2_set_mac,
15551565
.rx_ipc = dwxgmac2_rx_ipc,
15561566
.rx_queue_enable = dwxlgmac2_rx_queue_enable,

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,16 +1227,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
12271227
/* Get the MAC specific capabilities */
12281228
stmmac_mac_phylink_get_caps(priv);
12291229

1230-
if (priv->plat->has_xgmac) {
1231-
priv->phylink_config.mac_capabilities |= MAC_2500FD;
1232-
priv->phylink_config.mac_capabilities |= MAC_5000FD;
1233-
priv->phylink_config.mac_capabilities |= MAC_10000FD;
1234-
priv->phylink_config.mac_capabilities |= MAC_25000FD;
1235-
priv->phylink_config.mac_capabilities |= MAC_40000FD;
1236-
priv->phylink_config.mac_capabilities |= MAC_50000FD;
1237-
priv->phylink_config.mac_capabilities |= MAC_100000FD;
1238-
}
1239-
12401230
/* Half-Duplex can only work with single queue */
12411231
if (priv->plat->tx_queues_to_use > 1)
12421232
priv->phylink_config.mac_capabilities &=

0 commit comments

Comments
 (0)