* [PATCH net-next 1/9] dt-bindings: net: ti,dp83867: add supply properties
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-03 18:43 ` [PATCH net-next 2/9] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
` (8 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
The DP83867 PHY has four distinct power supplies:
VDDA2P5 -- 2.5V analog supply
VDD1P0 -- 1.0V digital supply
VDDA1P8 -- 1.8V analog supply
VDDIO -- I/O supply, which can be 3.3V or 2.5V or 1.8V
The DP83867E/IS/CS datasheet (section 8.3) describes two power supply
configurations - "two-supply" and "three-supply".
1. Two-Supply Configuration: VDDA2P5 and VDD1P0 connected, and the
VDDA1P8 pins are left unconnected.
2. Three-Supply Configuration: VDDA2P5, VDD1P0 and VDDA1P8 are all
connected.
VDDIO is a separate fourth supply present in both configurations. The
datasheet specifies that it can either be 1.8V or 2.5V or 3.3V.
Some embedded board design expose a GPIO-controlled regulator to control
any one or more of these supplies. Therefore, document all four of the
available supply properties.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
Documentation/devicetree/bindings/net/ti,dp83867.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.yaml b/Documentation/devicetree/bindings/net/ti,dp83867.yaml
index 4bc1f98fd9fe51260b767b0a1b8b7eaf974a9af9..e78f08ded3d0d449ab75bf33d814fd49587f8387 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.yaml
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.yaml
@@ -118,6 +118,20 @@ properties:
Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h for applicable
values.
+ vdda-2p5-supply:
+ description: 2.5V analog supply (connected to the VDDA2P5 pins).
+
+ vdd-1p0-supply:
+ description: 1.0V digital core supply (connected to the VDD1P0 pins).
+
+ vdda-1p8-supply:
+ description: 1.8V analog supply (connected to the VDDA1P8 pins).
+
+ vddio-supply:
+ description: |
+ I/O supply (connected to the VDDIO pins). The supply can be 1.8V,
+ 2.5V or 3.3V.
+
required:
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH net-next 2/9] net: phy: dp83867: add regulator supply management
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-09-03 18:43 ` [PATCH net-next 1/9] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-03 18:43 ` [PATCH net-next 3/9] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
` (7 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
Some embedded board designs use GPIO-controlled regulators for the
DP83867 power rails. Add dp83867_power_on() to enable all four supply
domains at probe time. Absent supplies are silently skipped, so boards
that do not describe them are unaffected.
When any supply is newly enabled the driver sleeps for 200 ms before
returning. This satisfies the post power-up stabilisation requirement
mentioned in section 6.6 of the DP83867E/IS/CS datasheet.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
drivers/net/phy/dp83867.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 88255e92b4cdbd6da2e2c1d10f9c72348d28dbc3..e03b39fd080d12afe0d02a53ffef2a6adf73cd9f 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -15,6 +15,7 @@
#include <linux/etherdevice.h>
#include <linux/bitfield.h>
#include <linux/nvmem-consumer.h>
+#include <linux/regulator/consumer.h>
#include <dt-bindings/net/ti-dp83867.h>
@@ -719,9 +720,40 @@ static int dp83867_resume(struct phy_device *phydev)
return 0;
}
+static int dp83867_power_on(struct phy_device *phydev)
+{
+ static const char * const supply_names[] = {
+ "vdda-2p5", "vdd-1p0", "vdda-1p8", "vddio",
+ };
+ struct device *dev = &phydev->mdio.dev;
+ u32 count = 0;
+ int i, ret;
+
+ for (i = 0; i < ARRAY_SIZE(supply_names); i++) {
+ ret = devm_regulator_get_enable_optional(dev, supply_names[i]);
+ if (!ret)
+ count++;
+ else if (ret != -ENODEV)
+ return dev_err_probe(dev, ret,
+ "failed to enable %s supply\n",
+ supply_names[i]);
+ }
+
+ /* Datasheet section 6.6 suggests a 200ms post power-up stabilization */
+ if (count)
+ fsleep(200000);
+
+ return 0;
+}
+
static int dp83867_probe(struct phy_device *phydev)
{
struct dp83867_private *dp83867;
+ int ret;
+
+ ret = dp83867_power_on(phydev);
+ if (ret)
+ return ret;
dp83867 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83867),
GFP_KERNEL);
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 2/9] net: phy: dp83867: add regulator supply management
2026-09-03 18:43 ` [PATCH net-next 2/9] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Applying power to the PHY with its reset line already deasserted violates the DP83867 hardware initialization sequence.
- [Medium] Unconditional 200ms boot delay per PHY on systems without regulator support (CONFIG_REGULATOR=n) or with already-enabled regulators.
--
commit c4d914d3e47d5ead4a045bf92dab75bb76e60c07
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: phy: dp83867: add regulator supply management
This commit adds regulator supply management to the DP83867 PHY driver,
enabling four supply domains at probe time. It also introduces a 200ms
sleep after powering on the supplies to satisfy the stabilization requirement
from the datasheet.
> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
> index 88255e92b4cdb..e03b39fd080d1 100644
> --- a/drivers/net/phy/dp83867.c
> +++ b/drivers/net/phy/dp83867.c
[ ... ]
> @@ -719,9 +720,40 @@ static int dp83867_resume(struct phy_device *phydev)
> return 0;
> }
>
> +static int dp83867_power_on(struct phy_device *phydev)
> +{
> + static const char * const supply_names[] = {
> + "vdda-2p5", "vdd-1p0", "vdda-1p8", "vddio",
> + };
> + struct device *dev = &phydev->mdio.dev;
> + u32 count = 0;
> + int i, ret;
> +
> + for (i = 0; i < ARRAY_SIZE(supply_names); i++) {
> + ret = devm_regulator_get_enable_optional(dev, supply_names[i]);
> + if (!ret)
> + count++;
[Severity: Medium]
Does this increment count even when devm_regulator_get_enable_optional()
returns 0 from the dummy API (for instance, when CONFIG_REGULATOR is not set),
or when the supplies were already enabled by the bootloader?
If so, could this cause an unintended and cumulative 200ms boot delay per PHY
on systems without regulator support, as count will be positive even if no
regulator actually changed state?
> + else if (ret != -ENODEV)
> + return dev_err_probe(dev, ret,
> + "failed to enable %s supply\n",
> + supply_names[i]);
> + }
> +
> + /* Datasheet section 6.6 suggests a 200ms post power-up stabilization */
> + if (count)
> + fsleep(200000);
> +
> + return 0;
> +}
> +
> static int dp83867_probe(struct phy_device *phydev)
> {
> struct dp83867_private *dp83867;
> + int ret;
> +
> + ret = dp83867_power_on(phydev);
[Severity: High]
Does calling dp83867_power_on() from dp83867_probe() result in power
being applied while the hardware reset line is already deasserted?
The core PHY framework unconditionally deasserts the hardware reset before the
driver's probe callback is executed:
phy_probe()
phy_device_reset(phydev, 0)
...
dp83867_probe()
dp83867_power_on()
Applying power to the DP83867 PHY while the RESET_N pin is deasserted (high)
violates the power-up sequence defined in section 6.6 of the datasheet, which
can lead to erratic behavior or initialization failure.
Should the driver assert phy_device_reset(phydev, 1) to hold the chip in
reset during the power ramp before enabling the regulators?
> + if (ret)
> + return ret;
>
> dp83867 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83867),
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=2
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 3/9] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-09-03 18:43 ` [PATCH net-next 1/9] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
2026-09-03 18:43 ` [PATCH net-next 2/9] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-03 18:43 ` [PATCH net-next 4/9] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
` (6 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
Shikra's EMAC requires two additional clocks for NOC interconnect
access (axi-noc, pcie-tile-axi-noc) beyond the standard four, and an
OPP table with required-opps to vote VDD_CX to SVS when the NOC clocks
are enabled.
Add qcom,shikra-ethqos to the compatible enum and use an if/else
block to constrain Shikra to exactly six clocks and require
operating-points-v2, while leaving existing compatibles unchanged.
Add the relevant compatible to the binding document for snps,dwmac as
well.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
.../devicetree/bindings/net/qcom,ethqos.yaml | 50 ++++++++++++++++++++--
.../devicetree/bindings/net/snps,dwmac.yaml | 2 +
2 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
index 423959cb928d945aa3e758a3c803d12bd61ec42b..ad2cc706fa74041486cd90c3d0eb1dde0acaa27c 100644
--- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
+++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
@@ -14,9 +14,6 @@ description:
dwmmac based Qualcomm ethernet devices which support Gigabit
ethernet (version v2.3.0 and onwards).
-allOf:
- - $ref: snps,dwmac.yaml#
-
properties:
compatible:
oneOf:
@@ -32,6 +29,7 @@ properties:
- qcom,qcs404-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos
+ - qcom,shikra-ethqos
- qcom,sm8150-ethqos
reg:
@@ -57,9 +55,11 @@ properties:
- const: sfty
clocks:
- maxItems: 4
+ minItems: 4
+ maxItems: 6
clock-names:
+ minItems: 4
items:
- const: stmmaceth
- const: pclk
@@ -67,6 +67,8 @@ properties:
- enum:
- rgmii
- phyaux
+ - const: axi-noc
+ - const: pcie-tile-axi-noc
iommus:
maxItems: 1
@@ -81,6 +83,11 @@ properties:
- const: cpu-mac
- const: mac-mem
+ operating-points-v2: true
+
+ opp-table:
+ type: object
+
phys: true
phy-names:
@@ -92,6 +99,41 @@ required:
- clock-names
- reg-names
+allOf:
+ - $ref: snps,dwmac.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,shikra-ethqos
+ then:
+ properties:
+ clocks:
+ minItems: 6
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: pclk
+ - const: ptp_ref
+ - const: rgmii
+ - const: axi-noc
+ - const: pcie-tile-axi-noc
+ required:
+ - operating-points-v2
+ else:
+ properties:
+ clocks:
+ maxItems: 4
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: pclk
+ - const: ptp_ref
+ - enum:
+ - rgmii
+ - phyaux
+
unevaluatedProperties: false
examples:
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 2449311c6d28ed3fbf8c92526ce8b872900653f4..6a1aea371c0b42ef71f90d89276e15159c3b3277 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -74,6 +74,7 @@ properties:
- qcom,qcs404-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos
+ - qcom,shikra-ethqos
- qcom,sm8150-ethqos
- renesas,r9a06g032-gmac
- renesas,r9a08g046-gbeth
@@ -632,6 +633,7 @@ allOf:
- qcom,qcs404-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos
+ - qcom,shikra-ethqos
- qcom,sm8150-ethqos
- snps,dwmac-4.00
- snps,dwmac-4.10a
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH net-next 4/9] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (2 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 3/9] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-05 11:10 ` Maxime Chevallier
2026-09-03 18:43 ` [PATCH net-next 5/9] net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass Mohd Ayaan Anwar
` (5 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
The return value is never checked by its sole caller and the speed
validation duplicates a check higher up the call stack. Convert to
void and remove the dead code.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index ac7d6d3e205a1ab5b391def879d6f1033a0961b6..44270c25d874f72e7f971757fec659d36468c315 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -371,9 +371,8 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
return 0;
}
-static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
+static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
{
- struct device *dev = ðqos->pdev->dev;
unsigned int prg_rclk_dly, loopback;
unsigned int phase_shift;
@@ -384,11 +383,6 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
/* Select RGMII, write 0 to interface select */
rgmii_clrmask(ethqos, RGMII_CONFIG_INTF_SEL, RGMII_IO_MACRO_CONFIG);
- if (speed != SPEED_1000 && speed != SPEED_100 && speed != SPEED_10) {
- dev_err(dev, "Invalid speed %d\n", speed);
- return -EINVAL;
- }
-
rgmii_setmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
if (speed == SPEED_1000) {
@@ -479,8 +473,6 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
rgmii_updatel(ethqos, RGMII_CONFIG_LOOPBACK_EN, loopback,
RGMII_IO_MACRO_CONFIG);
-
- return 0;
}
static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 4/9] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void
2026-09-03 18:43 ` [PATCH net-next 4/9] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
@ 2026-09-05 11:10 ` Maxime Chevallier
0 siblings, 0 replies; 19+ messages in thread
From: Maxime Chevallier @ 2026-09-05 11:10 UTC (permalink / raw)
To: Mohd Ayaan Anwar, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Davis, Andrew Lunn, Heiner Kallweit,
Russell King, Richard Cochran, Bjorn Andersson, Konrad Dybcio,
Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel
Hi,
On 9/3/26 20:43, Mohd Ayaan Anwar wrote:
> The return value is never checked by its sole caller and the speed
> validation duplicates a check higher up the call stack. Convert to
> void and remove the dead code.
>
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 5/9] net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (3 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 4/9] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-03 18:43 ` [PATCH net-next 6/9] net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes Mohd Ayaan Anwar
` (4 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
When "rgmii-id" is selected the PHY supplies both TX and RX delays, so
the MAC must not add its own. The driver currently falls through to the
generic DLL initialisation path which programs it to add a delay.
Power down the DLL and set DDR bypass mode for RGMII_ID, then program
the IO_MACRO via a new ethqos_rgmii_id_macro_init() helper. Also fix
ethqos_set_clk_tx_rate() to not double the clock rate in bypass mode at
100M/10M, and remove RGMII_ID from the phase-shift suppression in
ethqos_rgmii_macro_init() since RGMII_ID no longer reaches that path.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 67 +++++++++++++++++++++-
1 file changed, 64 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 44270c25d874f72e7f971757fec659d36468c315..67738c1598c50ade22f2d548a6d66911c348af51 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -67,6 +67,9 @@
/* SDC4_STATUS bits */
#define SDC4_STATUS_DLL_LOCK BIT(7)
+/* SDCC_USR_CTL bits */
+#define SDCC_USR_CTL_DDR_BYPASS BIT(30)
+
/* RGMII_IO_MACRO_CONFIG2 fields */
#define RGMII_CONFIG2_RSVD_CONFIG15 GENMASK(31, 17)
#define RGMII_CONFIG2_RGMII_CLK_SEL_CFG BIT(16)
@@ -183,7 +186,15 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
if (rate < 0)
return rate;
- return clk_set_rate(ethqos->link_clk, rate * 2);
+ /* Clock Rate Requirements:
+ * MAC added delay: 250/50/5 Mhz for 1G/100M/10M
+ * No MAC delay (DLL bypass): 250/25/2.5 Mhz for 1G/100M/10M
+ */
+ if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII ||
+ speed == SPEED_1000)
+ rate *= 2;
+
+ return clk_set_rate(ethqos->link_clk, rate);
}
static void
@@ -405,8 +416,7 @@ static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
RGMII_IO_MACRO_CONFIG2);
/* Determine if the PHY adds a 2 ns TX delay or the MAC handles it */
- if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID ||
- ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_TXID)
+ if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_TXID)
phase_shift = 0;
else
phase_shift = RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN;
@@ -475,6 +485,42 @@ static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
RGMII_IO_MACRO_CONFIG);
}
+static void ethqos_rgmii_id_macro_init(struct qcom_ethqos *ethqos, int speed)
+{
+ rgmii_clrmask(ethqos, RGMII_CONFIG2_TX_TO_RX_LOOPBACK_EN,
+ RGMII_IO_MACRO_CONFIG2);
+
+ if (speed == SPEED_1000)
+ rgmii_setmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
+ else
+ rgmii_clrmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
+ rgmii_setmask(ethqos, RGMII_CONFIG_BYPASS_TX_ID_EN, RGMII_IO_MACRO_CONFIG);
+ rgmii_clrmask(ethqos, RGMII_CONFIG_POS_NEG_DATA_SEL, RGMII_IO_MACRO_CONFIG);
+ rgmii_clrmask(ethqos, RGMII_CONFIG_PROG_SWAP, RGMII_IO_MACRO_CONFIG);
+
+ if (ethqos->has_emac_ge_3)
+ rgmii_clrmask(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL,
+ RGMII_IO_MACRO_CONFIG2);
+ else
+ rgmii_setmask(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL,
+ RGMII_IO_MACRO_CONFIG2);
+
+ rgmii_clrmask(ethqos, RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN,
+ RGMII_IO_MACRO_CONFIG2);
+
+ if (speed == SPEED_1000)
+ rgmii_clrmask(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, RGMII_IO_MACRO_CONFIG2);
+ else
+ rgmii_setmask(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, RGMII_IO_MACRO_CONFIG2);
+
+ if (ethqos->rgmii_config_loopback_en)
+ rgmii_setmask(ethqos, RGMII_CONFIG_LOOPBACK_EN, RGMII_IO_MACRO_CONFIG);
+ else
+ rgmii_clrmask(ethqos, RGMII_CONFIG_LOOPBACK_EN, RGMII_IO_MACRO_CONFIG);
+
+ rgmii_setmask(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_IO_MACRO_CONFIG2);
+}
+
static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
phy_interface_t interface, int speed,
unsigned int mode)
@@ -493,6 +539,21 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
ethqos_set_func_clk_en(ethqos);
+ /* For rgmii-id mode, the PHY should add the required delays.
+ * Therefore, power down the DLL and program it in bypass mode.
+ * Program the IO_MACRO as per the settings recommended by the
+ * programming guide for bypass mode. This will ensure that the
+ * MAC core doesn't add any additional delays.
+ */
+ if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
+ rgmii_setmask(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_HC_REG_DLL_CONFIG);
+ rgmii_setmask(ethqos, SDCC_USR_CTL_DDR_BYPASS, SDCC_USR_CTL);
+
+ ethqos_rgmii_id_macro_init(ethqos, speed);
+
+ return;
+ }
+
/* Initialize the DLL first */
/* Set DLL_RST */
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 5/9] net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass
2026-09-03 18:43 ` [PATCH net-next 5/9] net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ethqos_set_clk_tx_rate() fails to double the TX clock rate for RGMII_RXID and RGMII_TXID at 10M/100M speeds, breaking MAC-side delay hardware.
--
commit 0e659e67f69f5c33161dd3e01478dcbdaa1c7d6f
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass
This commit powers down the DLL and sets DDR bypass mode for RGMII_ID,
and introduces ethqos_rgmii_id_macro_init() to program the IO_MACRO. It
also updates ethqos_set_clk_tx_rate() to skip doubling the clock rate for
100M/10M in bypass mode.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
[ ... ]
> @@ -183,7 +186,15 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
> if (rate < 0)
> return rate;
>
> - return clk_set_rate(ethqos->link_clk, rate * 2);
> + /* Clock Rate Requirements:
> + * MAC added delay: 250/50/5 Mhz for 1G/100M/10M
> + * No MAC delay (DLL bypass): 250/25/2.5 Mhz for 1G/100M/10M
> + */
> + if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII ||
> + speed == SPEED_1000)
> + rate *= 2;
[Severity: High]
Does this conditional exclude PHY_INTERFACE_MODE_RGMII_TXID and
PHY_INTERFACE_MODE_RGMII_RXID from having their TX clock rate doubled at 10M
and 100M speeds?
If the device tree configures the PHY mode as rgmii-txid or rgmii-rxid,
those modes fall through to the non-bypass DLL initialization path in
ethqos_fix_mac_speed_rgmii().
Since this logic only explicitly checks for PHY_INTERFACE_MODE_RGMII, will
it result in the MAC DLL receiving half the expected clock frequency? Could
this break ethernet connectivity or cause data corruption for these
configurations at 10M and 100M?
> +
> + return clk_set_rate(ethqos->link_clk, rate);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=5
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 6/9] net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (4 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 5/9] net: stmmac: qcom-ethqos: fix RGMII_ID mode to use DLL bypass Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-03 18:43 ` [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
` (3 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
The qcom-ethqos driver is moving towards using "rgmii-id" together
with PHY-provided delays. However, existing DTBs use "rgmii" and
"rgmii-txid" and must remain supported for backwards compatibility.
Warn when either of these legacy PHY modes is used to encourage users
to migrate to updated DTBs using "rgmii-id".
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 67738c1598c50ade22f2d548a6d66911c348af51..2ca2f03de30174c9771fdc517c0e21e3b392ad76 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -554,6 +554,8 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
return;
}
+ dev_warn(dev, "legacy RGMII phy-mode detected; consider upgrading to a newer DTB\n");
+
/* Initialize the DLL first */
/* Set DLL_RST */
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 6/9] net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes
2026-09-03 18:43 ` [PATCH net-next 6/9] net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Deprecation warning causes kernel log spam on every link-up event
--
commit e45fa290281055cacebbbfec0d13fc25cf76f918
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes
The qcom-ethqos driver is moving towards using "rgmii-id" together
with PHY-provided delays. This commit warns when legacy PHY modes
are used to encourage users to migrate to updated DTBs.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 67738c1598c50..2ca2f03de3017 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -554,6 +554,8 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
> return;
> }
>
> + dev_warn(dev, "legacy RGMII phy-mode detected; consider upgrading to a newer DTB\n");
[Severity: Medium]
Is it possible for this warning to cause kernel log spam on every link-up
event?
This statement evaluates every time the link transitions to up, since
stmmac_mac_link_up() calls the priv->plat->fix_mac_speed() callback. If the
Ethernet link flaps, auto-negotiates repeatedly, or is reconnected
frequently, this could flood the kernel log.
Since the phy_mode is evaluated from a static device tree property, would
it be better to use dev_warn_once() here, or move the warning to the
probe path entirely?
> +
> /* Initialize the DLL first */
>
> /* Set DLL_RST */
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=6
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (5 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 6/9] net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-05 11:21 ` Maxime Chevallier
2026-09-03 18:43 ` [PATCH net-next 8/9] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
` (2 subsequent siblings)
9 siblings, 2 replies; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
On probe the RGMII link clock is initialised at SPEED_1000, which
translates to a 250 MHz source clock even when no PHY link is present,
drawing unnecessary power.
Initialise at SPEED_10 instead; fix_mac_speed updates the rate once
a link is established.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 2ca2f03de30174c9771fdc517c0e21e3b392ad76..4f9bef662c5796ce3cca64b19a595bcdbebbf336 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -814,7 +814,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
"Failed to get serdes phy\n");
ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface,
- SPEED_1000);
+ SPEED_10);
qcom_ethqos_set_sgmii_loopback(ethqos, true);
ethqos_set_func_clk_en(ethqos);
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
2026-09-03 18:43 ` [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
2026-09-05 11:21 ` Maxime Chevallier
1 sibling, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardware initialization ordering mismatch causes 1-second busy loop and RGMII DLL lock failure on first Gigabit link-up.
--
commit a0ec14dab79ed801bb626d58b6ec17e6c1024077
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
This patch changes the initial RGMII link clock to 10 Mbps (2.5 MHz) during
probe to save power before a PHY link is established.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 2ca2f03de3017..4f9bef662c579 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -814,7 +814,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
> "Failed to get serdes phy\n");
>
> ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface,
> - SPEED_1000);
> + SPEED_10);
[Severity: High]
The commit message states that fix_mac_speed updates the rate once a link is
established, but does fix_mac_speed actually update the rate?
Looking at stmmac_mac_link_up() in stmmac_main.c, it calls fix_mac_speed
before set_clk_tx_rate:
if (priv->plat->fix_mac_speed)
priv->plat->fix_mac_speed(priv->plat->bsp_priv, interface,
speed, mode);
...
if (priv->plat->set_clk_tx_rate) {
ret = priv->plat->set_clk_tx_rate(priv->plat->bsp_priv,
priv->plat->clk_tx_i,
interface, speed);
Because the initial clock is now SPEED_10, when a Gigabit link comes up,
ethqos_fix_mac_speed_rgmii() will wait for DLL lock while the clock is still
running at the slower rate:
/* wait for DLL LOCK */
if (read_poll_timeout_atomic(rgmii_readl, val,
val & SDC4_STATUS_DLL_LOCK,
1000, 1000000, true,
ethqos, SDC4_STATUS))
dev_err(dev, "Timeout while waiting for DLL lock\n");
Will this cause a 1-second timeout and fail to lock the DLL on the first
Gigabit link-up?
>
> qcom_ethqos_set_sgmii_loopback(ethqos, true);
> ethqos_set_func_clk_en(ethqos);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=7
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
2026-09-03 18:43 ` [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
@ 2026-09-05 11:21 ` Maxime Chevallier
1 sibling, 0 replies; 19+ messages in thread
From: Maxime Chevallier @ 2026-09-05 11:21 UTC (permalink / raw)
To: Mohd Ayaan Anwar, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Davis, Andrew Lunn, Heiner Kallweit,
Russell King, Richard Cochran, Bjorn Andersson, Konrad Dybcio,
Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel
Hi,
On 9/3/26 20:43, Mohd Ayaan Anwar wrote:
> On probe the RGMII link clock is initialised at SPEED_1000, which
> translates to a 250 MHz source clock even when no PHY link is present,
> drawing unnecessary power.
>
> Initialise at SPEED_10 instead; fix_mac_speed updates the rate once
> a link is established.
>
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 8/9] net: stmmac: qcom-ethqos: add per-platform NOC clock voting
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (6 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 7/9] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-03 18:43 ` [PATCH net-next 9/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-09-04 21:05 ` [PATCH net-next 0/9] " Mohd Ayaan Anwar
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
Some SoCs gate the EMAC's path to the System NOC behind dedicated clocks
that must be enabled before the DMA can reach memory. Add
ethqos_noc_clk_cfg and the corresponding fields in the driver-data and
runtime structs so each compatible can declare its own set with per-clock
rates. The clocks are acquired during probe and enabled/disabled
alongside the existing link clock in ethqos_clks_config().
No functional change for existing compatibles. This will help us when
we add support for Shikra.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 101 +++++++++++++++++++++
1 file changed, 101 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 4f9bef662c5796ce3cca64b19a595bcdbebbf336..a31541506a4c930c76374d7d8b7eceb6f51f37a7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -7,6 +7,7 @@
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
+#include <linux/pm_opp.h>
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -84,11 +85,18 @@
#define SGMII_10M_RX_CLK_DVDR 0x31
+#define ETHQOS_MAX_NOC_CLKS 3
+
struct ethqos_emac_por {
unsigned int offset;
unsigned int value;
};
+struct ethqos_noc_clk_cfg {
+ const char *id;
+ unsigned long rate;
+};
+
struct ethqos_emac_driver_data {
const struct ethqos_emac_por *rgmii_por;
unsigned int num_rgmii_por;
@@ -98,6 +106,8 @@ struct ethqos_emac_driver_data {
const char *link_clk_name;
struct dwmac4_addrs dwmac4_addrs;
bool needs_sgmii_loopback;
+ const struct ethqos_noc_clk_cfg *noc_clk_cfg;
+ unsigned int num_noc_clks;
};
struct qcom_ethqos {
@@ -112,6 +122,10 @@ struct qcom_ethqos {
bool rgmii_config_loopback_en;
bool has_emac_ge_3;
bool needs_sgmii_loopback;
+
+ struct clk_bulk_data noc_clks[ETHQOS_MAX_NOC_CLKS];
+ unsigned long noc_clk_rates[ETHQOS_MAX_NOC_CLKS];
+ int num_noc_clks;
};
static u32 rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset)
@@ -691,15 +705,51 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv,
static int ethqos_clks_config(void *priv, bool enabled)
{
struct qcom_ethqos *ethqos = priv;
+ unsigned int i;
int ret = 0;
if (enabled) {
+ if (ethqos->num_noc_clks) {
+ ret = dev_pm_opp_set_rate(ðqos->pdev->dev,
+ ethqos->noc_clk_rates[0]);
+ if (ret) {
+ dev_err(ðqos->pdev->dev,
+ "NOC OPP rate set failed: %d\n", ret);
+ return ret;
+ }
+
+ for (i = 1; i < ethqos->num_noc_clks; i++) {
+ ret = clk_set_rate(ethqos->noc_clks[i].clk,
+ ethqos->noc_clk_rates[i]);
+ if (ret) {
+ dev_err(ðqos->pdev->dev,
+ "NOC clock rate set failed: %d\n", ret);
+ dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
+ return ret;
+ }
+ }
+ }
+
ret = clk_prepare_enable(ethqos->link_clk);
if (ret) {
dev_err(ðqos->pdev->dev, "link_clk enable failed\n");
+ if (ethqos->num_noc_clks)
+ dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
return ret;
}
+ if (ethqos->num_noc_clks) {
+ ret = clk_bulk_prepare_enable(ethqos->num_noc_clks,
+ ethqos->noc_clks);
+ if (ret) {
+ dev_err(ðqos->pdev->dev,
+ "NOC clocks enable failed: %d\n", ret);
+ dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
+ clk_disable_unprepare(ethqos->link_clk);
+ return ret;
+ }
+ }
+
/* Enable functional clock to prevent DMA reset to timeout due
* to lacking PHY clock after the hardware block has been power
* cycled. The actual configuration will be adjusted once
@@ -708,7 +758,12 @@ static int ethqos_clks_config(void *priv, bool enabled)
qcom_ethqos_set_sgmii_loopback(ethqos, true);
ethqos_set_func_clk_en(ethqos);
} else {
+ if (ethqos->num_noc_clks)
+ clk_bulk_disable_unprepare(ethqos->num_noc_clks,
+ ethqos->noc_clks);
clk_disable_unprepare(ethqos->link_clk);
+ if (ethqos->num_noc_clks)
+ dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
}
return ret;
@@ -736,6 +791,46 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
}
+/* Some SoCs gate NOC access behind dedicated clocks. Acquire them here
+ * so ethqos_clks_config() can enable/disable them at runtime. The OPP
+ * table is used to propagate the required VDD_CX performance state via
+ * dev_pm_opp_set_rate().
+ */
+static int qcom_ethqos_init_noc_clks(struct qcom_ethqos *ethqos,
+ const struct ethqos_emac_driver_data *data)
+{
+ struct device *dev = ðqos->pdev->dev;
+ unsigned int i;
+ int ret;
+
+ if (!data->num_noc_clks)
+ return 0;
+
+ for (i = 0; i < data->num_noc_clks; i++) {
+ ethqos->noc_clks[i].id = data->noc_clk_cfg[i].id;
+ ethqos->noc_clk_rates[i] = data->noc_clk_cfg[i].rate;
+ }
+ ethqos->num_noc_clks = data->num_noc_clks;
+
+ ret = devm_clk_bulk_get(dev, ethqos->num_noc_clks, ethqos->noc_clks);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get NOC clocks\n");
+
+ ret = devm_pm_opp_set_clkname(dev, data->noc_clk_cfg[0].id);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to set OPP clock name\n");
+
+ ret = devm_pm_opp_of_add_table(dev);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to add OPP table\n");
+
+ ret = dev_pm_opp_set_rate(dev, data->noc_clk_cfg[0].rate);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to set initial NOC OPP rate\n");
+
+ return 0;
+}
+
static int qcom_ethqos_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -795,6 +890,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->has_emac_ge_3 = data->has_emac_ge_3;
ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback;
+ if (data->num_noc_clks) {
+ ret = qcom_ethqos_init_noc_clks(ethqos, data);
+ if (ret)
+ return ret;
+ }
+
ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii");
if (IS_ERR(ethqos->link_clk))
return dev_err_probe(dev, PTR_ERR(ethqos->link_clk),
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 8/9] net: stmmac: qcom-ethqos: add per-platform NOC clock voting
2026-09-03 18:43 ` [PATCH net-next 8/9] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [High] Incorrect power sequencing order in ethqos_clks_config() error path drops OPP performance state before disabling dependent clock.
- [Medium] Performance state (OPP vote) leaks if probe fails after qcom_ethqos_init_noc_clks().
Pre-existing issues:
- [High] Sleepable calls inside NOIRQ PM suspend phase (sleeping in atomic context).
--
commit 4d584908beed74d65a7bef91b593a47ddf6c4f85
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: stmmac: qcom-ethqos: add per-platform NOC clock voting
Some SoCs gate the EMAC's path to the System NOC behind dedicated clocks
that must be enabled before the DMA can reach memory. Add
ethqos_noc_clk_cfg and the corresponding fields in the driver-data and
runtime structs so each compatible can declare its own set with per-clock
rates.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 4f9bef662c579..a31541506a4c9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
[ ... ]
> @@ -708,7 +758,12 @@ static int ethqos_clks_config(void *priv, bool enabled)
> qcom_ethqos_set_sgmii_loopback(ethqos, true);
> ethqos_set_func_clk_en(ethqos);
> } else {
> + if (ethqos->num_noc_clks) {
> + ret = clk_bulk_prepare_enable(ethqos->num_noc_clks,
> + ethqos->noc_clks);
> + if (ret) {
> + dev_err(ðqos->pdev->dev,
> + "NOC clocks enable failed: %d\n", ret);
> + dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
> + clk_disable_unprepare(ethqos->link_clk);
> + return ret;
> + }
> + }
[Severity: High]
Does this error unwinding path invert the required hardware power sequence?
If clk_bulk_prepare_enable() fails, the code calls dev_pm_opp_set_rate() to
drop the OPP performance state before calling clk_disable_unprepare() on
the link_clk.
Should the dependent link_clk be disabled first to prevent hardware lockups
or brownouts while it is still running?
> /* Enable functional clock to prevent DMA reset to timeout due
> * to lacking PHY clock after the hardware block has been power
> * cycled. The actual configuration will be adjusted once
> @@ -708,7 +758,12 @@ static int ethqos_clks_config(void *priv, bool enabled)
> qcom_ethqos_set_sgmii_loopback(ethqos, true);
> ethqos_set_func_clk_en(ethqos);
> } else {
> + if (ethqos->num_noc_clks)
> + clk_bulk_disable_unprepare(ethqos->num_noc_clks,
> + ethqos->noc_clks);
> clk_disable_unprepare(ethqos->link_clk);
> + if (ethqos->num_noc_clks)
> + dev_pm_opp_set_rate(ðqos->pdev->dev, 0);
> }
>
> return ret;
[Severity: High]
This is a pre-existing issue, but ethqos_clks_config() is called from
stmmac_pltfr_noirq_suspend() (via pm_runtime_force_suspend() and
stmmac_runtime_suspend()), which runs with local interrupts disabled.
The existing code already called clk_disable_unprepare() which acquires the
sleepable CCF prepare_lock mutex, risking a deadlock or kernel panic when
sleeping in atomic context.
This patch adds more sleepable function calls here, such as
clk_bulk_disable_unprepare() and dev_pm_opp_set_rate() (which acquires
the opp_table->lock mutex).
Could these sleepable hardware power operations be moved to a sleepable
suspend phase?
[ ... ]
> @@ -736,6 +791,46 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
> netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
> }
>
> +/* Some SoCs gate NOC access behind dedicated clocks. Acquire them here
> + * so ethqos_clks_config() can enable/disable them at runtime. The OPP
> + * table is used to propagate the required VDD_CX performance state via
> + * dev_pm_opp_set_rate().
> + */
> +static int qcom_ethqos_init_noc_clks(struct qcom_ethqos *ethqos,
> + const struct ethqos_emac_driver_data *data)
> +{
> + struct device *dev = ðqos->pdev->dev;
> + unsigned int i;
> + int ret;
> +
> + if (!data->num_noc_clks)
> + return 0;
> +
> + for (i = 0; i < data->num_noc_clks; i++) {
> + ethqos->noc_clks[i].id = data->noc_clk_cfg[i].id;
> + ethqos->noc_clk_rates[i] = data->noc_clk_cfg[i].rate;
> + }
> + ethqos->num_noc_clks = data->num_noc_clks;
> +
> + ret = devm_clk_bulk_get(dev, ethqos->num_noc_clks, ethqos->noc_clks);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get NOC clocks\n");
> +
> + ret = devm_pm_opp_set_clkname(dev, data->noc_clk_cfg[0].id);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to set OPP clock name\n");
> +
> + ret = devm_pm_opp_of_add_table(dev);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to add OPP table\n");
> +
> + ret = dev_pm_opp_set_rate(dev, data->noc_clk_cfg[0].rate);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to set initial NOC OPP rate\n");
> +
> + return 0;
> +}
> +
> static int qcom_ethqos_probe(struct platform_device *pdev)
> {
> struct device_node *np = pdev->dev.of_node;
> @@ -795,6 +890,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
> ethqos->has_emac_ge_3 = data->has_emac_ge_3;
> ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback;
>
> + if (data->num_noc_clks) {
> + ret = qcom_ethqos_init_noc_clks(ethqos, data);
> + if (ret)
> + return ret;
> + }
> +
> ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii");
> if (IS_ERR(ethqos->link_clk))
> return dev_err_probe(dev, PTR_ERR(ethqos->link_clk),
[Severity: Medium]
If devm_clk_get() fails (e.g., returning -EPROBE_DEFER), does this leak the
performance state (OPP) vote?
qcom_ethqos_init_noc_clks() sets the initial rate via dev_pm_opp_set_rate(),
but there doesn't seem to be a devres cleanup action or manual unwind in the
error path of qcom_ethqos_probe() to drop the vote by calling
dev_pm_opp_set_rate(dev, 0).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=8
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 9/9] net: stmmac: qcom-ethqos: add Shikra EMAC support
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (7 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 8/9] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
@ 2026-09-03 18:43 ` Mohd Ayaan Anwar
2026-09-04 18:55 ` sashiko-bot
2026-09-04 21:05 ` [PATCH net-next 0/9] " Mohd Ayaan Anwar
9 siblings, 1 reply; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-03 18:43 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel, Mohd Ayaan Anwar
Shikra integrates two Qualcomm ETHQOS controllers based on the Synopsys
GMAC IP, similar to previous platforms. Register qcom,shikra-ethqos
backed by a new shikra_data descriptor that enables the three NOC clocks
required for DMA memory access (axi-noc, pcie-tile-axi-noc, stmmaceth)
all at 120 MHz, and the 36-bit DMA address width.
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index a31541506a4c930c76374d7d8b7eceb6f51f37a7..f96680456472d1fa7b72bd404c1ddc20e505f05c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -328,6 +328,36 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
},
};
+static const struct ethqos_noc_clk_cfg shikra_noc_clks[] = {
+ { "axi-noc", 120000000 },
+ { "pcie-tile-axi-noc", 120000000 },
+ { "stmmaceth", 120000000 },
+};
+
+static const struct ethqos_emac_driver_data shikra_data = {
+ .dma_addr_width = 36,
+ .has_emac_ge_3 = true,
+ .noc_clk_cfg = shikra_noc_clks,
+ .num_noc_clks = ARRAY_SIZE(shikra_noc_clks),
+ .rgmii_config_loopback_en = false,
+ .dwmac4_addrs = {
+ .dma_chan = 0x00008100,
+ .dma_chan_offset = 0x1000,
+ .mtl_chan = 0x00008000,
+ .mtl_chan_offset = 0x1000,
+ .mtl_ets_ctrl = 0x00008010,
+ .mtl_ets_ctrl_offset = 0x1000,
+ .mtl_txq_weight = 0x00008018,
+ .mtl_txq_weight_offset = 0x1000,
+ .mtl_send_slp_cred = 0x0000801c,
+ .mtl_send_slp_cred_offset = 0x1000,
+ .mtl_high_cred = 0x00008020,
+ .mtl_high_cred_offset = 0x1000,
+ .mtl_low_cred = 0x00008024,
+ .mtl_low_cred_offset = 0x1000,
+ },
+};
+
static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
{
struct device *dev = ðqos->pdev->dev;
@@ -957,6 +987,7 @@ static const struct of_device_id qcom_ethqos_match[] = {
{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
+ { .compatible = "qcom,shikra-ethqos", .data = &shikra_data},
{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
{ }
};
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH net-next 9/9] net: stmmac: qcom-ethqos: add Shikra EMAC support
2026-09-03 18:43 ` [PATCH net-next 9/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-09-04 18:55 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-09-04 18:55 UTC (permalink / raw)
To: Mohd Ayaan Anwar; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The PTP clock rate (`clk_ptp_rate`) is captured from the `stmmaceth` clock before its rate is updated to 120MHz, leading to incorrect PTP timestamp calculations if `ptp_ref` is omitted from the device tree.
--
commit 6df66dc49bfcbb8fca628cf4fea13cac0f605200
Author: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
net: stmmac: qcom-ethqos: add Shikra EMAC support
Shikra integrates two Qualcomm ETHQOS controllers based on the Synopsys
GMAC IP, similar to previous platforms. Register qcom,shikra-ethqos
backed by a new shikra_data descriptor that enables the three NOC clocks
required for DMA memory access (axi-noc, pcie-tile-axi-noc, stmmaceth)
all at 120 MHz, and the 36-bit DMA address width.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index a31541506a4c9..f96680456472d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -328,6 +328,36 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
> },
> };
>
> +static const struct ethqos_noc_clk_cfg shikra_noc_clks[] = {
> + { "axi-noc", 120000000 },
> + { "pcie-tile-axi-noc", 120000000 },
> + { "stmmaceth", 120000000 },
> +};
[Severity: Medium]
Since the stmmaceth clock frequency is being set to 120MHz here, could this
lead to an incorrect PTP clock rate if the ptp_ref clock is omitted from
the device tree?
In qcom_ethqos_probe(), devm_stmmac_probe_config_dt() is called before the
noc_clks are initialized. If ptp_ref is missing, the driver falls back to
caching the main clock's initial rate:
stmmac_platform.c:stmmac_probe_config_dt() {
...
plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "ptp_ref");
if (IS_ERR(plat->clk_ptp_ref)) {
plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk);
plat->clk_ptp_ref = NULL;
...
}
Later in qcom_ethqos_probe(), the noc_clks configuration updates the stmmaceth
clock to 120MHz. However, ethqos_ptp_clk_freq_config() returns early when
clk_ptp_ref is NULL, leaving the cached clk_ptp_rate at its original
boot-time value rather than 120MHz.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com?part=9
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support
2026-09-03 18:43 [PATCH net-next 0/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
` (8 preceding siblings ...)
2026-09-03 18:43 ` [PATCH net-next 9/9] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-09-04 21:05 ` Mohd Ayaan Anwar
9 siblings, 0 replies; 19+ messages in thread
From: Mohd Ayaan Anwar @ 2026-09-04 21:05 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
Maxime Coquelin
Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
linux-arm-kernel
On Fri, Sep 04, 2026 at 12:13:42AM +0530, Mohd Ayaan Anwar wrote:
> This series incorporates feedback from the RFC and adds the dt-bindings
> and driver changes required to enable Gigabit Ethernet support on the
> Qualcomm Shikra SoC. DTS changes will be sent out separately.
>
> The series has grown from the RFC and can be broadly divided into three
> areas: PHY power supply management, proper support for RGMII ID mode in
> the Qualcomm ETHQOS driver, and Shikra specific clock dependencies
> required for NOC access.
>
> 1. Shikra EVK boards use a GPIO-gated regulator for the DP83867 PHY
> power supply. Patches 1 and 2 add supply management to the DP83867
> driver so the PHY driver holds the regulator vote at probe. These
> changes are largely inspired by similar work done for the QCA8081 PHY:
> https://lore.kernel.org/netdev/20260605010022.968612-3-elder@riscstar.com/
>
> 2. The generic RGMII fixes from the RFC remain. As suggested, an
> additional patch now emits a warning (patch 6) when the legacy "rgmii"
> or "rgmii-txid" modes are detected. A new change (patch 7) now
> initialises the RGMII link clock at SPEED_10 on probe instead of
> SPEED_1000, dropping the unnecessary 250 MHz source before link up.
>
> 3. NOC clock voting (patch 8) now uses dev_pm_opp_set_rate() so the
> required VDD_CX performance state can be propagated through the clock
> controller. The Shikra binding (patch 3) is updated accordingly: an
> if/else block constrains Shikra to exactly six clocks and requires
> operating-points-v2.
>
> Testing:
> The following boards have been tested with this new (proper) handling
> for RGMII ID:
> - Shikra CQ/IQ variants (with the TI DP83867 PHY)
> - QCS615 Ride (with the Micrel KSZ9031 PHY)
> - Talos EVK (again with the Micrel KSZ9031 PHY)
> - Talos Lyra EVK (TI DP83867 PHY, this board also has a GPIO-gated
> regulator for the PHY power supply)
>
> Changes since RFC:
> - Two new patches add supply management for the DP83867, replacing
> the gpio-hog approach for PHY power -- Konrad, Andrew.
> - Use dev_pm_opp_set_rate() for the NOC AXI clock and require
> operating-points-v2 for Shikra -- Konrad.
> - Warn on legacy "rgmii"/"rgmii-txid" to encourage DTB migration --
> Andrew, Maxime.
> - Updated binding document for qcom,ethqos and snps,dwmac.
> - Drop the duplicate "axi" clock from Shikra's DT; use "axi-noc" and
> "pcie-tile-axi-noc" as the only additional clock-names.
> - Initialise RGMII link clock at SPEED_10 rather than SPEED_1000 on
> probe.
> - Link to RFC: https://lore.kernel.org/netdev/20260612-shikra_ethernet-v1-0-f0f4a1d19929@oss.qualcomm.com/
>
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Sashiko raised some valid concerns, I will update the series and send
out v2 shortly.
Ayaan
^ permalink raw reply [flat|nested] 19+ messages in thread