summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2026-02-23 12:34:51 +0300
committerJakub Kicinski <kuba@kernel.org>2026-02-25 04:43:23 +0300
commitb8ab32315e22c0ef2c466d4f5ef4de0b5852e735 (patch)
treeb38105cbe283600a81723a4bc2968cb4a6237cd6
parentb560938163db801d5ba27fa55a1aa68ccaf1ef2e (diff)
downloadlinux-b8ab32315e22c0ef2c466d4f5ef4de0b5852e735.tar.xz
net: stmmac: qcom-ethqos: use phy interface mode for inband
qcom-ethqos currently forces inband to be enabled for the Cisco SGMII speeds (1G, 100M and 10M) but not for 2500BASE-X (2.5G). Rather than using the speed to determine the forced inband state, use phylink's PHY interface mode which will switch between SGMII for the 10M, 100M and 1G speeds, and 2500BASE-X for 2.5G. 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/E1vuSL5-0000000AScX-2wuM@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index e2dd334ffd31..cd6d1660bdb2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -615,30 +615,26 @@ static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos,
switch (speed) {
case SPEED_2500:
- rgmii_setmask(ethqos, RGMII_CONFIG2_RGMII_CLK_SEL_CFG,
- RGMII_IO_MACRO_CONFIG2);
- ethqos_set_serdes_speed(ethqos, SPEED_2500);
- ethqos_pcs_set_inband(priv, false);
- break;
case SPEED_1000:
rgmii_setmask(ethqos, RGMII_CONFIG2_RGMII_CLK_SEL_CFG,
RGMII_IO_MACRO_CONFIG2);
- ethqos_set_serdes_speed(ethqos, SPEED_1000);
- ethqos_pcs_set_inband(priv, true);
break;
case SPEED_100:
- ethqos_set_serdes_speed(ethqos, SPEED_1000);
- ethqos_pcs_set_inband(priv, true);
break;
case SPEED_10:
rgmii_updatel(ethqos, RGMII_CONFIG_SGMII_CLK_DVDR,
FIELD_PREP(RGMII_CONFIG_SGMII_CLK_DVDR,
SGMII_10M_RX_CLK_DVDR),
RGMII_IO_MACRO_CONFIG);
- ethqos_set_serdes_speed(ethqos, SPEED_1000);
- ethqos_pcs_set_inband(priv, true);
break;
}
+
+ if (interface == PHY_INTERFACE_MODE_SGMII)
+ ethqos_set_serdes_speed(ethqos, SPEED_1000);
+ else
+ ethqos_set_serdes_speed(ethqos, SPEED_2500);
+
+ ethqos_pcs_set_inband(priv, interface == PHY_INTERFACE_MODE_SGMII);
}
static void ethqos_configure(struct qcom_ethqos *ethqos,