diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-11-23 20:28:09 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-04-04 14:40:28 +0100 |
commit | 6a004f211017daa4d84836b6e2a6faeaa72ef4ba (patch) | |
tree | 4a7f02d1d4098c667c445a96ce22647db2d115bc | |
parent | 7d17be8738164241fc90928e1e6c6b2e06201c13 (diff) |
net: mvpp2: add phy_interface_t to LPI methods and validate it
Add the PHY interface mode to the LPI methods and validate that LPI
is being entered for a supported mode.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index dd76c1b7ed3a..c26e3b662474 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -6698,7 +6698,8 @@ static void mvpp2_mac_link_down(struct phylink_config *config, mvpp2_port_disable(port); } -static void mvpp2_mac_disable_tx_lpi(struct phylink_config *config) +static void mvpp2_mac_disable_tx_lpi(struct phylink_config *config, + phy_interface_t interface) { struct mvpp2_port *port = mvpp2_phylink_to_port(config); @@ -6706,12 +6707,16 @@ static void mvpp2_mac_disable_tx_lpi(struct phylink_config *config) MVPP2_GMAC_LPI_CTRL1_REQ_EN, 0); } -static int mvpp2_mac_enable_tx_lpi(struct phylink_config *config, u32 timer, +static int mvpp2_mac_enable_tx_lpi(struct phylink_config *config, + phy_interface_t interface, u32 timer, bool tx_clk_stop) { struct mvpp2_port *port = mvpp2_phylink_to_port(config); u32 ts, tw, lpi1, status; + if (interface != PHY_INTERFACE_MODE_SGMII) + return -EOPNOTSUPP; + status = readl(port->base + MVPP2_GMAC_STATUS0); if (status & MVPP2_GMAC_STATUS0_GMII_SPEED) { /* At 1G speeds, the timer resolution are 1us, and @@ -7118,7 +7123,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, } port->phylink = phylink; - mvpp2_mac_disable_tx_lpi(&port->phylink_config); + mvpp2_mac_disable_tx_lpi(&port->phylink_config, phy_mode); } else { dev_warn(&pdev->dev, "Use link irqs for port#%d. FW update required\n", port->id); port->phylink = NULL; |