From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>, Frank Li <Frank.Li@nxp.com>,
imx@lists.linux.dev, Jakub Kicinski <kuba@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
Vinod Koul <vkoul@kernel.org>
Subject: [PATCH net-next 08/10] net: stmmac: qcom-ethqos: use phy interface mode for inband
Date: Mon, 23 Feb 2026 09:34:51 +0000 [thread overview]
Message-ID: <E1vuSL5-0000000AScX-2wuM@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aZwfAFJQcp9f0niI@shell.armlinux.org.uk>
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>
---
.../stmicro/stmmac/dwmac-qcom-ethqos.c | 18 +++++++-----------
1 file 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,
--
2.47.3
next prev parent reply other threads:[~2026-02-23 9:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 9:33 [PATCH net-next 00/10] net: stmmac: qcom-ethqos: cleanups and re-organise SerDes handling Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 01/10] net: stmmac: qcom-ethqos: rename "por" members to "rgmii_por" Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 02/10] net: stmmac: qcom-ethqos: remove register field value obfuscations Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 03/10] net: stmmac: qcom-ethqos: change ethqos_configure*() to return void Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 04/10] net: stmmac: qcom-ethqos: move qcom_ethqos_set_sgmii_loopback() up Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 05/10] net: stmmac: qcom-ethqos: move loopback disable to .mac_finish() Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 06/10] net: stmmac: pass interface mode into fix_mac_speed() method Russell King (Oracle)
2026-02-23 9:34 ` [PATCH net-next 07/10] net: stmmac: qcom-ethqos: pass phy interface mode to configs Russell King (Oracle)
2026-02-23 9:34 ` Russell King (Oracle) [this message]
2026-02-25 1:10 ` [PATCH net-next 08/10] net: stmmac: qcom-ethqos: use phy interface mode for inband Jakub Kicinski
2026-02-25 1:30 ` Russell King (Oracle)
2026-02-25 1:42 ` Jakub Kicinski
2026-02-23 9:34 ` [PATCH net-next 09/10] net: stmmac: qcom-ethqos: move SerDes speed configuration Russell King (Oracle)
2026-02-23 9:35 ` [PATCH net-next 10/10] net: stmmac: qcom-ethqos: convert to set_clk_tx_rate() method Russell King (Oracle)
2026-02-25 1:50 ` [PATCH net-next 00/10] net: stmmac: qcom-ethqos: cleanups and re-organise SerDes handling patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1vuSL5-0000000AScX-2wuM@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=Frank.Li@nxp.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mohd.anwar@oss.qualcomm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=s.hauer@pengutronix.de \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox