net: stmmac: qcom-ethqos: pass phy interface mode to configs

Pass the current phylink phy interface mode to the RGMII and "SGMII"
configuration functions.

Reviewed-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vuSL0-0000000AScM-2TN0@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Russell King (Oracle) 2026-02-23 09:34:46 +00:00 committed by Jakub Kicinski
parent cd0aa65153
commit b560938163

View File

@ -100,7 +100,8 @@ struct ethqos_emac_driver_data {
struct qcom_ethqos {
struct platform_device *pdev;
void __iomem *rgmii_base;
void (*configure_func)(struct qcom_ethqos *ethqos, int speed);
void (*configure_func)(struct qcom_ethqos *ethqos,
phy_interface_t interface, int speed);
unsigned int link_clk_rate;
struct clk *link_clk;
@ -521,7 +522,8 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
return 0;
}
static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos, int speed)
static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos,
phy_interface_t interface, int speed)
{
struct device *dev = &ethqos->pdev->dev;
unsigned int i;
@ -605,7 +607,8 @@ static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
/* On interface toggle MAC registers gets reset.
* Configure MAC block for SGMII on ethernet phy link up
*/
static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos, int speed)
static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos,
phy_interface_t interface, int speed)
{
struct net_device *dev = platform_get_drvdata(ethqos->pdev);
struct stmmac_priv *priv = netdev_priv(dev);
@ -638,9 +641,10 @@ static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos, int speed)
}
}
static void ethqos_configure(struct qcom_ethqos *ethqos, int speed)
static void ethqos_configure(struct qcom_ethqos *ethqos,
phy_interface_t interface, int speed)
{
return ethqos->configure_func(ethqos, speed);
return ethqos->configure_func(ethqos, interface, speed);
}
static void ethqos_fix_mac_speed(void *priv, phy_interface_t interface,
@ -649,7 +653,7 @@ static void ethqos_fix_mac_speed(void *priv, phy_interface_t interface,
struct qcom_ethqos *ethqos = priv;
ethqos_update_link_clk(ethqos, speed);
ethqos_configure(ethqos, speed);
ethqos_configure(ethqos, interface, speed);
}
static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv)