* [PATCH RESEND net-next v6 1/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 11:48 ` Lad, Prabhakar
2026-01-12 10:15 ` [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties Bartosz Golaszewski
` (5 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski,
Krzysztof Kozlowski
From: Bartosz Golaszewski <brgl@kernel.org>
Describe the firmware-managed variant of the QCom DesignWare MAC. As the
properties here differ a lot from the HLOS-managed variant, lets put it
in a separate file. Since we need to update the maximum number of power
domains, let's update existing bindings referencing the top-level
snps,dwmac.yaml and limit their maxItems for power-domains to 1.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Romain Gantois <romain.gantois@bootlin.com> # For RZ/N1
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
.../bindings/net/allwinner,sun7i-a20-gmac.yaml | 3 +
.../bindings/net/altr,socfpga-stmmac.yaml | 3 +
.../bindings/net/amlogic,meson-dwmac.yaml | 3 +
.../devicetree/bindings/net/eswin,eic7700-eth.yaml | 3 +
.../devicetree/bindings/net/intel,dwmac-plat.yaml | 3 +
.../bindings/net/loongson,ls1b-gmac.yaml | 3 +
.../bindings/net/loongson,ls1c-emac.yaml | 3 +
.../devicetree/bindings/net/nxp,dwmac-imx.yaml | 3 +
.../devicetree/bindings/net/nxp,lpc1850-dwmac.yaml | 3 +
.../devicetree/bindings/net/nxp,s32-dwmac.yaml | 3 +
.../devicetree/bindings/net/qcom,ethqos.yaml | 3 +
.../bindings/net/qcom,sa8255p-ethqos.yaml | 98 ++++++++++++++++++++++
.../devicetree/bindings/net/renesas,rzn1-gmac.yaml | 3 +
.../bindings/net/renesas,rzv2h-gbeth.yaml | 3 +
.../devicetree/bindings/net/rockchip-dwmac.yaml | 3 +
.../devicetree/bindings/net/snps,dwmac.yaml | 5 +-
.../bindings/net/sophgo,cv1800b-dwmac.yaml | 3 +
.../bindings/net/sophgo,sg2044-dwmac.yaml | 3 +
.../bindings/net/starfive,jh7110-dwmac.yaml | 3 +
.../devicetree/bindings/net/stm32-dwmac.yaml | 3 +
.../devicetree/bindings/net/tesla,fsd-ethqos.yaml | 3 +
.../devicetree/bindings/net/thead,th1520-gmac.yaml | 3 +
.../bindings/net/toshiba,visconti-dwmac.yaml | 3 +
MAINTAINERS | 1 +
24 files changed, 166 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
index 23e92be33ac8609a16db530782989caed22a5730..b12632545673b2ad0148a677f45a7447309a43cd 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
@@ -40,6 +40,9 @@ properties:
description:
PHY regulator
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
index fc445ad5a1f1ac490e921696d6f7ca83d15de459..448e617cddc4cda8dbc77e83324495ffd5dfb9be 100644
--- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
+++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
@@ -140,6 +140,9 @@ properties:
- description: offset of the control register
- description: shift within the control register
+ power-domains:
+ maxItems: 1
+
patternProperties:
"^mdio[0-9]$":
type: object
diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
index 5c91716d1f21e617543b03c5a90b993f8aee053c..9c9cc3ef384da0270489c21b3426572ea46d9499 100644
--- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
@@ -158,6 +158,9 @@ properties:
interrupt-names:
const: macirq
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
index 91e8cd1db67b8e14961497a7254e6b01dc4e582a..c1b67cfa76d070d5e8349d5e92ce6bc4bf2ab67c 100644
--- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
+++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
@@ -83,6 +83,9 @@ properties:
register
- description: Offset of register controlling TX/RX clock delay
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
index 62c1da36a2b5a29290e5e01be87c48158c4adf89..e41851931b947559c89b0cd6f4756f71046f9594 100644
--- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
+++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
@@ -47,6 +47,9 @@ properties:
interrupt-names:
const: macirq
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- clocks
diff --git a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
index c4f3224bad387b87a5b4a3049dabd75f2c4bd42f..c9a131b8d8304c41559a416b324df749c0a87d14 100644
--- a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
@@ -66,6 +66,9 @@ properties:
- mii
- rgmii-id
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
index 99001b940b8361f69bb917617f857ee99f4b3fa5..49db18423dd807683b9bb297978f5da8ea6cee3d 100644
--- a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
+++ b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
@@ -65,6 +65,9 @@ properties:
- mii
- rmii
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
index e5db346beca9649be4f97727b78fda8973095912..b240c76e7dd5254d0c3752610c4aa848a3c3d65b 100644
--- a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
+++ b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
@@ -83,6 +83,9 @@ properties:
description:
To select RMII reference clock from external.
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- clocks
diff --git a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
index 05acd9bc7616356e68090ebdd4df20e42f70dd7e..f61188ab0dbe3c0cec5b10f7a65dfaff4dc3898f 100644
--- a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
@@ -51,6 +51,9 @@ properties:
items:
- const: stmmaceth
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
index 2b8b74c5feec8378750358e1b9335cc2c2762bb6..716407a750796ff27e8fbcdb75267f3922ef64f5 100644
--- a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
@@ -52,6 +52,9 @@ properties:
- const: rx
- const: ptp_ref
+ power-domains:
+ maxItems: 1
+
required:
- clocks
- clock-names
diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
index 423959cb928d945aa3e758a3c803d12bd61ec42b..ef520f8105773e22c0536ff419dad55fe316e1bd 100644
--- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
+++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
@@ -86,6 +86,9 @@ properties:
phy-names:
const: serdes
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- clocks
diff --git a/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..72bb764c0ca046e0df4bbffe6c323850f5231787
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/qcom,sa8255p-ethqos.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Ethernet ETHQOS device (firmware managed)
+
+maintainers:
+ - Bjorn Andersson <andersson@kernel.org>
+ - Konrad Dybcio <konradybcio@kernel.org>
+ - Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+
+description:
+ dwmmac based Qualcomm ethernet devices which support Gigabit
+ ethernet (version v2.3.0 and onwards) with clocks, interconnects, etc.
+ managed by firmware
+
+allOf:
+ - $ref: snps,dwmac.yaml#
+
+properties:
+ compatible:
+ const: qcom,sa8255p-ethqos
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: stmmaceth
+ - const: rgmii
+
+ interrupts:
+ items:
+ - description: Combined signal for various interrupt events
+ - description: The interrupt that occurs when HW safety error triggered
+
+ interrupt-names:
+ items:
+ - const: macirq
+ - const: sfty
+
+ power-domains:
+ minItems: 3
+ maxItems: 3
+
+ power-domain-names:
+ items:
+ - const: core
+ - const: mdio
+ - const: serdes
+
+ iommus:
+ maxItems: 1
+
+ dma-coherent: true
+
+required:
+ - compatible
+ - reg-names
+ - power-domains
+ - power-domain-names
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ ethernet: ethernet@7a80000 {
+ compatible = "qcom,sa8255p-ethqos";
+ reg = <0x23040000 0x10000>,
+ <0x23056000 0x100>;
+ reg-names = "stmmaceth", "rgmii";
+
+ iommus = <&apps_smmu 0x120 0x7>;
+
+ interrupts = <GIC_SPI 946 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 782 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq", "sfty";
+
+ dma-coherent;
+
+ snps,tso;
+ snps,pbl = <32>;
+ rx-fifo-depth = <16384>;
+ tx-fifo-depth = <16384>;
+
+ phy-handle = <ðernet_phy>;
+ phy-mode = "2500base-x";
+
+ snps,mtl-rx-config = <&mtl_rx_setup1>;
+ snps,mtl-tx-config = <&mtl_tx_setup1>;
+
+ power-domains = <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>;
+ power-domain-names = "core", "mdio", "serdes";
+ };
diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
index 16dd7a2631abf6fb7dc8e0c90755ab1e81915b38..ed0d10a19ca4c47c05f6873c64b0537b90acd15a 100644
--- a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
@@ -44,6 +44,9 @@ properties:
phandle pointing to a PCS sub-node compatible with
renesas,rzn1-miic.yaml#
+ power-domains:
+ maxItems: 1
+
required:
- compatible
diff --git a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
index bd53ab300f5003ea1f951d3957cefc702301217a..bc5054b05f6d7f1bcd5cd8640deb89293d9f69a6 100644
--- a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
+++ b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
@@ -123,6 +123,9 @@ properties:
Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml#
(Refer RZ/T2H portion in the DT-binding file)
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
index d17112527dab0a5104ffaf2627fdcb73603d5db7..ef82ff2a2884d994c5ae6c98e0b3483b56dda653 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
@@ -121,6 +121,9 @@ properties:
phy-supply:
description: PHY regulator
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- clocks
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index dd3c72e8363e70d101ed2702e2ea3235ee38e2a0..312d1bbc2ad1051520355039f5587381cbd1e01c 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -71,6 +71,7 @@ properties:
- loongson,ls7a-dwmac
- nxp,s32g2-dwmac
- qcom,qcs404-ethqos
+ - qcom,sa8255p-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos
- qcom,sm8150-ethqos
@@ -180,7 +181,8 @@ properties:
- const: ahb
power-domains:
- maxItems: 1
+ minItems: 1
+ maxItems: 3
mac-mode:
$ref: ethernet-controller.yaml#/properties/phy-connection-type
@@ -643,6 +645,7 @@ allOf:
- ingenic,x1830-mac
- ingenic,x2000-mac
- qcom,qcs404-ethqos
+ - qcom,sa8255p-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos
- qcom,sm8150-ethqos
diff --git a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
index b89456f0ef830991135bd17626da98661429596c..e78cbf594c695204040a53ab1e367daa9e12246b 100644
--- a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
@@ -49,6 +49,9 @@ properties:
reset-names:
const: stmmaceth
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
index e8d3814db0e94fdcd0f3ab2a9fa8bab972a97ab5..845e2c67d20037496bb1eec6eb73c99cde74e944 100644
--- a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
@@ -52,6 +52,9 @@ properties:
interrupt-names:
maxItems: 1
+ power-domains:
+ maxItems: 1
+
resets:
maxItems: 1
diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
index 313a15331661208a1fa64386739d87a4f11b7e20..8a68c6d7b5c6d6629a780d002299d767088def77 100644
--- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
@@ -71,6 +71,9 @@ properties:
The argument one is the offset of phy mode selection, the
argument two is the shift of phy mode selection.
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
index 987254900d0da7aab81237f20b1540ad8a17bd21..29b878079ff0c1a0ef95fc63f2035f478ee039b2 100644
--- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
@@ -121,6 +121,9 @@ properties:
minItems: 1
maxItems: 2
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- clocks
diff --git a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
index dd7481bb16e59982c26c1a54ae82b8cff85fdfe0..ad635529d676ed6b752ab3bde5152d5cbddcb519 100644
--- a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
+++ b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
@@ -67,6 +67,9 @@ properties:
- rgmii-rxid
- rgmii-txid
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
index b3492a9aa4effa73fadf92a63a76ba8bb65a8769..c859f8bb5d582af8b8782f2f89ab5e6ee3d7a46c 100644
--- a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
@@ -78,6 +78,9 @@ properties:
items:
- const: macirq
+ power-domains:
+ maxItems: 1
+
required:
- clocks
- clock-names
diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
index f0f32e18fc8550e6f63b87b60a095972453836c9..efa39eab0256a1102b01872bd848749788c9b4e8 100644
--- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
@@ -48,6 +48,9 @@ properties:
interrupt-names:
const: macirq
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
diff --git a/MAINTAINERS b/MAINTAINERS
index ecae8a5e33cce6f2cb883c1b14b7908e71dbfb5d..6c3bd060f68df8813e9f64d6e6f9f1f98d4131af 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21523,6 +21523,7 @@ L: netdev@vger.kernel.org
L: linux-arm-msm@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml
+F: Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
QUALCOMM FASTRPC DRIVER
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH RESEND net-next v6 1/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems
2026-01-12 10:15 ` [PATCH RESEND net-next v6 1/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
@ 2026-01-12 11:48 ` Lad, Prabhakar
0 siblings, 0 replies; 16+ messages in thread
From: Lad, Prabhakar @ 2026-01-12 11:48 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski, linux-arm-msm, devicetree, linux-kernel,
netdev, linux-stm32, linux-arm-kernel, Drew Fustini, linux-sunxi,
linux-amlogic, linux-mips, imx, linux-renesas-soc, linux-rockchip,
sophgo, linux-riscv, Krzysztof Kozlowski
On Mon, Jan 12, 2026 at 10:16 AM Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> wrote:
>
> From: Bartosz Golaszewski <brgl@kernel.org>
>
> Describe the firmware-managed variant of the QCom DesignWare MAC. As the
> properties here differ a lot from the HLOS-managed variant, lets put it
> in a separate file. Since we need to update the maximum number of power
> domains, let's update existing bindings referencing the top-level
> snps,dwmac.yaml and limit their maxItems for power-domains to 1.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> Reviewed-by: Romain Gantois <romain.gantois@bootlin.com> # For RZ/N1
> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
> .../bindings/net/allwinner,sun7i-a20-gmac.yaml | 3 +
> .../bindings/net/altr,socfpga-stmmac.yaml | 3 +
> .../bindings/net/amlogic,meson-dwmac.yaml | 3 +
> .../devicetree/bindings/net/eswin,eic7700-eth.yaml | 3 +
> .../devicetree/bindings/net/intel,dwmac-plat.yaml | 3 +
> .../bindings/net/loongson,ls1b-gmac.yaml | 3 +
> .../bindings/net/loongson,ls1c-emac.yaml | 3 +
> .../devicetree/bindings/net/nxp,dwmac-imx.yaml | 3 +
> .../devicetree/bindings/net/nxp,lpc1850-dwmac.yaml | 3 +
> .../devicetree/bindings/net/nxp,s32-dwmac.yaml | 3 +
> .../devicetree/bindings/net/qcom,ethqos.yaml | 3 +
> .../bindings/net/qcom,sa8255p-ethqos.yaml | 98 ++++++++++++++++++++++
> .../devicetree/bindings/net/renesas,rzn1-gmac.yaml | 3 +
> .../bindings/net/renesas,rzv2h-gbeth.yaml | 3 +
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> #
For RZ/V2H
Cheers,
Prabhakar
> .../devicetree/bindings/net/rockchip-dwmac.yaml | 3 +
> .../devicetree/bindings/net/snps,dwmac.yaml | 5 +-
> .../bindings/net/sophgo,cv1800b-dwmac.yaml | 3 +
> .../bindings/net/sophgo,sg2044-dwmac.yaml | 3 +
> .../bindings/net/starfive,jh7110-dwmac.yaml | 3 +
> .../devicetree/bindings/net/stm32-dwmac.yaml | 3 +
> .../devicetree/bindings/net/tesla,fsd-ethqos.yaml | 3 +
> .../devicetree/bindings/net/thead,th1520-gmac.yaml | 3 +
> .../bindings/net/toshiba,visconti-dwmac.yaml | 3 +
> MAINTAINERS | 1 +
> 24 files changed, 166 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
> index 23e92be33ac8609a16db530782989caed22a5730..b12632545673b2ad0148a677f45a7447309a43cd 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
> @@ -40,6 +40,9 @@ properties:
> description:
> PHY regulator
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> index fc445ad5a1f1ac490e921696d6f7ca83d15de459..448e617cddc4cda8dbc77e83324495ffd5dfb9be 100644
> --- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> +++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml
> @@ -140,6 +140,9 @@ properties:
> - description: offset of the control register
> - description: shift within the control register
>
> + power-domains:
> + maxItems: 1
> +
> patternProperties:
> "^mdio[0-9]$":
> type: object
> diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> index 5c91716d1f21e617543b03c5a90b993f8aee053c..9c9cc3ef384da0270489c21b3426572ea46d9499 100644
> --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> @@ -158,6 +158,9 @@ properties:
> interrupt-names:
> const: macirq
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> index 91e8cd1db67b8e14961497a7254e6b01dc4e582a..c1b67cfa76d070d5e8349d5e92ce6bc4bf2ab67c 100644
> --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> @@ -83,6 +83,9 @@ properties:
> register
> - description: Offset of register controlling TX/RX clock delay
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> index 62c1da36a2b5a29290e5e01be87c48158c4adf89..e41851931b947559c89b0cd6f4756f71046f9594 100644
> --- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> +++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> @@ -47,6 +47,9 @@ properties:
> interrupt-names:
> const: macirq
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - clocks
> diff --git a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
> index c4f3224bad387b87a5b4a3049dabd75f2c4bd42f..c9a131b8d8304c41559a416b324df749c0a87d14 100644
> --- a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
> +++ b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml
> @@ -66,6 +66,9 @@ properties:
> - mii
> - rgmii-id
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
> index 99001b940b8361f69bb917617f857ee99f4b3fa5..49db18423dd807683b9bb297978f5da8ea6cee3d 100644
> --- a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml
> @@ -65,6 +65,9 @@ properties:
> - mii
> - rmii
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
> index e5db346beca9649be4f97727b78fda8973095912..b240c76e7dd5254d0c3752610c4aa848a3c3d65b 100644
> --- a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
> +++ b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
> @@ -83,6 +83,9 @@ properties:
> description:
> To select RMII reference clock from external.
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - clocks
> diff --git a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
> index 05acd9bc7616356e68090ebdd4df20e42f70dd7e..f61188ab0dbe3c0cec5b10f7a65dfaff4dc3898f 100644
> --- a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml
> @@ -51,6 +51,9 @@ properties:
> items:
> - const: stmmaceth
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
> index 2b8b74c5feec8378750358e1b9335cc2c2762bb6..716407a750796ff27e8fbcdb75267f3922ef64f5 100644
> --- a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
> @@ -52,6 +52,9 @@ properties:
> - const: rx
> - const: ptp_ref
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - clocks
> - clock-names
> diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> index 423959cb928d945aa3e758a3c803d12bd61ec42b..ef520f8105773e22c0536ff419dad55fe316e1bd 100644
> --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> @@ -86,6 +86,9 @@ properties:
> phy-names:
> const: serdes
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - clocks
> diff --git a/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..72bb764c0ca046e0df4bbffe6c323850f5231787
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
> @@ -0,0 +1,98 @@
> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/qcom,sa8255p-ethqos.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Ethernet ETHQOS device (firmware managed)
> +
> +maintainers:
> + - Bjorn Andersson <andersson@kernel.org>
> + - Konrad Dybcio <konradybcio@kernel.org>
> + - Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> +
> +description:
> + dwmmac based Qualcomm ethernet devices which support Gigabit
> + ethernet (version v2.3.0 and onwards) with clocks, interconnects, etc.
> + managed by firmware
> +
> +allOf:
> + - $ref: snps,dwmac.yaml#
> +
> +properties:
> + compatible:
> + const: qcom,sa8255p-ethqos
> +
> + reg:
> + maxItems: 2
> +
> + reg-names:
> + items:
> + - const: stmmaceth
> + - const: rgmii
> +
> + interrupts:
> + items:
> + - description: Combined signal for various interrupt events
> + - description: The interrupt that occurs when HW safety error triggered
> +
> + interrupt-names:
> + items:
> + - const: macirq
> + - const: sfty
> +
> + power-domains:
> + minItems: 3
> + maxItems: 3
> +
> + power-domain-names:
> + items:
> + - const: core
> + - const: mdio
> + - const: serdes
> +
> + iommus:
> + maxItems: 1
> +
> + dma-coherent: true
> +
> +required:
> + - compatible
> + - reg-names
> + - power-domains
> + - power-domain-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + ethernet: ethernet@7a80000 {
> + compatible = "qcom,sa8255p-ethqos";
> + reg = <0x23040000 0x10000>,
> + <0x23056000 0x100>;
> + reg-names = "stmmaceth", "rgmii";
> +
> + iommus = <&apps_smmu 0x120 0x7>;
> +
> + interrupts = <GIC_SPI 946 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 782 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "macirq", "sfty";
> +
> + dma-coherent;
> +
> + snps,tso;
> + snps,pbl = <32>;
> + rx-fifo-depth = <16384>;
> + tx-fifo-depth = <16384>;
> +
> + phy-handle = <ðernet_phy>;
> + phy-mode = "2500base-x";
> +
> + snps,mtl-rx-config = <&mtl_rx_setup1>;
> + snps,mtl-tx-config = <&mtl_tx_setup1>;
> +
> + power-domains = <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>;
> + power-domain-names = "core", "mdio", "serdes";
> + };
> diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> index 16dd7a2631abf6fb7dc8e0c90755ab1e81915b38..ed0d10a19ca4c47c05f6873c64b0537b90acd15a 100644
> --- a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> +++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
> @@ -44,6 +44,9 @@ properties:
> phandle pointing to a PCS sub-node compatible with
> renesas,rzn1-miic.yaml#
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
>
> diff --git a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
> index bd53ab300f5003ea1f951d3957cefc702301217a..bc5054b05f6d7f1bcd5cd8640deb89293d9f69a6 100644
> --- a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
> +++ b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
> @@ -123,6 +123,9 @@ properties:
> Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml#
> (Refer RZ/T2H portion in the DT-binding file)
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> index d17112527dab0a5104ffaf2627fdcb73603d5db7..ef82ff2a2884d994c5ae6c98e0b3483b56dda653 100644
> --- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> @@ -121,6 +121,9 @@ properties:
> phy-supply:
> description: PHY regulator
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - clocks
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index dd3c72e8363e70d101ed2702e2ea3235ee38e2a0..312d1bbc2ad1051520355039f5587381cbd1e01c 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -71,6 +71,7 @@ properties:
> - loongson,ls7a-dwmac
> - nxp,s32g2-dwmac
> - qcom,qcs404-ethqos
> + - qcom,sa8255p-ethqos
> - qcom,sa8775p-ethqos
> - qcom,sc8280xp-ethqos
> - qcom,sm8150-ethqos
> @@ -180,7 +181,8 @@ properties:
> - const: ahb
>
> power-domains:
> - maxItems: 1
> + minItems: 1
> + maxItems: 3
>
> mac-mode:
> $ref: ethernet-controller.yaml#/properties/phy-connection-type
> @@ -643,6 +645,7 @@ allOf:
> - ingenic,x1830-mac
> - ingenic,x2000-mac
> - qcom,qcs404-ethqos
> + - qcom,sa8255p-ethqos
> - qcom,sa8775p-ethqos
> - qcom,sc8280xp-ethqos
> - qcom,sm8150-ethqos
> diff --git a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
> index b89456f0ef830991135bd17626da98661429596c..e78cbf594c695204040a53ab1e367daa9e12246b 100644
> --- a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml
> @@ -49,6 +49,9 @@ properties:
> reset-names:
> const: stmmaceth
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> index e8d3814db0e94fdcd0f3ab2a9fa8bab972a97ab5..845e2c67d20037496bb1eec6eb73c99cde74e944 100644
> --- a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> @@ -52,6 +52,9 @@ properties:
> interrupt-names:
> maxItems: 1
>
> + power-domains:
> + maxItems: 1
> +
> resets:
> maxItems: 1
>
> diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> index 313a15331661208a1fa64386739d87a4f11b7e20..8a68c6d7b5c6d6629a780d002299d767088def77 100644
> --- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> @@ -71,6 +71,9 @@ properties:
> The argument one is the offset of phy mode selection, the
> argument two is the shift of phy mode selection.
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> index 987254900d0da7aab81237f20b1540ad8a17bd21..29b878079ff0c1a0ef95fc63f2035f478ee039b2 100644
> --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> @@ -121,6 +121,9 @@ properties:
> minItems: 1
> maxItems: 2
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - clocks
> diff --git a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
> index dd7481bb16e59982c26c1a54ae82b8cff85fdfe0..ad635529d676ed6b752ab3bde5152d5cbddcb519 100644
> --- a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
> +++ b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml
> @@ -67,6 +67,9 @@ properties:
> - rgmii-rxid
> - rgmii-txid
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
> index b3492a9aa4effa73fadf92a63a76ba8bb65a8769..c859f8bb5d582af8b8782f2f89ab5e6ee3d7a46c 100644
> --- a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
> +++ b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
> @@ -78,6 +78,9 @@ properties:
> items:
> - const: macirq
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - clocks
> - clock-names
> diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> index f0f32e18fc8550e6f63b87b60a095972453836c9..efa39eab0256a1102b01872bd848749788c9b4e8 100644
> --- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> @@ -48,6 +48,9 @@ properties:
> interrupt-names:
> const: macirq
>
> + power-domains:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ecae8a5e33cce6f2cb883c1b14b7908e71dbfb5d..6c3bd060f68df8813e9f64d6e6f9f1f98d4131af 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -21523,6 +21523,7 @@ L: netdev@vger.kernel.org
> L: linux-arm-msm@vger.kernel.org
> S: Maintained
> F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> +F: Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml
> F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
>
> QUALCOMM FASTRPC DRIVER
>
> --
> 2.47.3
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 1/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 13:44 ` Andrew Lunn
2026-01-12 10:15 ` [PATCH RESEND net-next v6 3/7] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Bartosz Golaszewski
` (4 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski
From: Bartosz Golaszewski <brgl@kernel.org>
In order to drop the dependency on CONFIG_OF, convert all device property
getters from OF-specific to generic device properties and stop pulling
in any linux/of.h symbols.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +-
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 907fe2e927f015542b6a7228eae9a6c6945be3ac..1310312e3e099841da89d2f19b138b4459ecb504 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -135,7 +135,7 @@ config DWMAC_MESON
config DWMAC_QCOM_ETHQOS
tristate "Qualcomm ETHQOS support"
default ARCH_QCOM
- depends on OF && (ARCH_QCOM || COMPILE_TEST)
+ depends on ARCH_QCOM || COMPILE_TEST
help
Support for the Qualcomm ETHQOS core.
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 0826a7bd32ff55bef62f8fda4e3eaef64facdb5d..457748e5781231680b64382fa73e195cf7473924 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018-19, Linaro Limited
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
@@ -723,7 +723,6 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
static int qcom_ethqos_probe(struct platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node;
const struct ethqos_emac_driver_data *data;
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
@@ -774,7 +773,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->mac_base = stmmac_res.addr;
- data = of_device_get_match_data(dev);
+ data = device_get_match_data(dev);
ethqos->por = data->por;
ethqos->num_por = data->num_por;
ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en;
@@ -811,9 +810,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
if (ethqos->has_emac_ge_3)
plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
plat_dat->pmt = 1;
- if (of_property_read_bool(np, "snps,tso"))
+ if (device_property_present(dev, "snps,tso"))
plat_dat->flags |= STMMAC_FLAG_TSO_EN;
- if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
+ if (device_is_compatible(dev, "qcom,qcs404-ethqos"))
plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
if (data->dma_addr_width)
plat_dat->host_dma_width = data->dma_addr_width;
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties
2026-01-12 10:15 ` [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties Bartosz Golaszewski
@ 2026-01-12 13:44 ` Andrew Lunn
2026-01-13 12:36 ` Bartosz Golaszewski
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Lunn @ 2026-01-12 13:44 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski, linux-arm-msm, devicetree, linux-kernel,
netdev, linux-stm32, linux-arm-kernel, Drew Fustini, linux-sunxi,
linux-amlogic, linux-mips, imx, linux-renesas-soc, linux-rockchip,
sophgo, linux-riscv
On Mon, Jan 12, 2026 at 11:15:41AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <brgl@kernel.org>
>
> In order to drop the dependency on CONFIG_OF, convert all device property
> getters from OF-specific to generic device properties and stop pulling
> in any linux/of.h symbols.
Is the intention to read these properties from ACPI tables?
If so, it would be nice to document these properties in
Documentation/firmware-guide/acpi/dsd.
> - if (of_property_read_bool(np, "snps,tso"))
> + if (device_property_present(dev, "snps,tso"))
> plat_dat->flags |= STMMAC_FLAG_TSO_EN;
Do you actually need this in the ACPI binding? Is there a reason not
to just hard code it enabled? You don't need to worry about backwards
compatibility here, because this is the first ACPI device.
> - if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
> + if (device_is_compatible(dev, "qcom,qcs404-ethqos"))
> plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
What is your target hardware? Will qcom,qcs404-ethqos every use ACPI?
Maybe this should actually stay as of_device_is_compatible, to make it
clear this is an device tree only device? There is no need to mess up
the ACPI binding with things which will never actually use ACPI.
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties
2026-01-12 13:44 ` Andrew Lunn
@ 2026-01-13 12:36 ` Bartosz Golaszewski
2026-01-13 22:05 ` Andrew Lunn
0 siblings, 1 reply; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-13 12:36 UTC (permalink / raw)
To: Andrew Lunn
Cc: Bartosz Golaszewski, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Richard Cochran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin, Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro,
Jose Abreu, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Matthew Gerlach, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Keguang Zhang, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Jan Petrous, s32,
Romain Gantois, Lad Prabhakar, Heiko Stuebner, Chen Wang,
Inochi Amaoto, Emil Renner Berthing, Minda Chen, Drew Fustini,
Guo Ren, Fu Wei, Nobuhiro Iwamatsu, Geert Uytterhoeven,
Magnus Damm, Maxime Ripard, Shuang Liang, Zhi Li, Shangjuan Wei,
G. Jaya Kumaran, Clark Wang, Linux Team, Frank Li, David Wu,
Samin Guo, Christophe Roullier, Swathi K S, linux-arm-msm,
devicetree, linux-kernel, netdev, linux-stm32, linux-arm-kernel,
Drew Fustini, linux-sunxi, linux-amlogic, linux-mips, imx,
linux-renesas-soc, linux-rockchip, sophgo, linux-riscv
On Mon, Jan 12, 2026 at 2:45 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Mon, Jan 12, 2026 at 11:15:41AM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <brgl@kernel.org>
> >
> > In order to drop the dependency on CONFIG_OF, convert all device property
> > getters from OF-specific to generic device properties and stop pulling
> > in any linux/of.h symbols.
>
> Is the intention to read these properties from ACPI tables?
>
No. Other than a couple property getters which can use the fwnode
abstraction, there's nothing here that requires the OF dependence.
Bartosz
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties
2026-01-13 12:36 ` Bartosz Golaszewski
@ 2026-01-13 22:05 ` Andrew Lunn
2026-01-14 15:51 ` Bartosz Golaszewski
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Lunn @ 2026-01-13 22:05 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Bartosz Golaszewski, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Richard Cochran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin, Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro,
Jose Abreu, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Matthew Gerlach, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Keguang Zhang, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Jan Petrous, s32,
Romain Gantois, Lad Prabhakar, Heiko Stuebner, Chen Wang,
Inochi Amaoto, Emil Renner Berthing, Minda Chen, Drew Fustini,
Guo Ren, Fu Wei, Nobuhiro Iwamatsu, Geert Uytterhoeven,
Magnus Damm, Maxime Ripard, Shuang Liang, Zhi Li, Shangjuan Wei,
G. Jaya Kumaran, Clark Wang, Linux Team, Frank Li, David Wu,
Samin Guo, Christophe Roullier, Swathi K S, linux-arm-msm,
devicetree, linux-kernel, netdev, linux-stm32, linux-arm-kernel,
Drew Fustini, linux-sunxi, linux-amlogic, linux-mips, imx,
linux-renesas-soc, linux-rockchip, sophgo, linux-riscv
On Tue, Jan 13, 2026 at 01:36:53PM +0100, Bartosz Golaszewski wrote:
> On Mon, Jan 12, 2026 at 2:45 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Mon, Jan 12, 2026 at 11:15:41AM +0100, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <brgl@kernel.org>
> > >
> > > In order to drop the dependency on CONFIG_OF, convert all device property
> > > getters from OF-specific to generic device properties and stop pulling
> > > in any linux/of.h symbols.
> >
> > Is the intention to read these properties from ACPI tables?
> >
>
> No. Other than a couple property getters which can use the fwnode
> abstraction, there's nothing here that requires the OF dependence.
So what is the need for not using OF? Why do you want this patch?
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties
2026-01-13 22:05 ` Andrew Lunn
@ 2026-01-14 15:51 ` Bartosz Golaszewski
0 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-14 15:51 UTC (permalink / raw)
To: Andrew Lunn
Cc: Bartosz Golaszewski, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Richard Cochran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin, Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro,
Jose Abreu, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Matthew Gerlach, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Keguang Zhang, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Jan Petrous, s32,
Romain Gantois, Lad Prabhakar, Heiko Stuebner, Chen Wang,
Inochi Amaoto, Emil Renner Berthing, Minda Chen, Drew Fustini,
Guo Ren, Fu Wei, Nobuhiro Iwamatsu, Geert Uytterhoeven,
Magnus Damm, Maxime Ripard, Shuang Liang, Zhi Li, Shangjuan Wei,
G. Jaya Kumaran, Clark Wang, Linux Team, Frank Li, David Wu,
Samin Guo, Christophe Roullier, Swathi K S, linux-arm-msm,
devicetree, linux-kernel, netdev, linux-stm32, linux-arm-kernel,
Drew Fustini, linux-sunxi, linux-amlogic, linux-mips, imx,
linux-renesas-soc, linux-rockchip, sophgo, linux-riscv
On Tue, Jan 13, 2026 at 11:06 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Tue, Jan 13, 2026 at 01:36:53PM +0100, Bartosz Golaszewski wrote:
> > On Mon, Jan 12, 2026 at 2:45 PM Andrew Lunn <andrew@lunn.ch> wrote:
> > >
> > > On Mon, Jan 12, 2026 at 11:15:41AM +0100, Bartosz Golaszewski wrote:
> > > > From: Bartosz Golaszewski <brgl@kernel.org>
> > > >
> > > > In order to drop the dependency on CONFIG_OF, convert all device property
> > > > getters from OF-specific to generic device properties and stop pulling
> > > > in any linux/of.h symbols.
> > >
> > > Is the intention to read these properties from ACPI tables?
> > >
> >
> > No. Other than a couple property getters which can use the fwnode
> > abstraction, there's nothing here that requires the OF dependence.
>
> So what is the need for not using OF? Why do you want this patch?
>
We've had a higher-level abstraction for OF nodes for years now. Since
I'm already touching the driver, it makes sense to switch to using it,
as OF-centric APIs are not recommended in new code even if it's an
OF-only driver.
Bartosz
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH RESEND net-next v6 3/7] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 1/7] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 2/7] net: stmmac: qcom-ethqos: use generic device properties Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 4/7] net: stmmac: qcom-ethqos: split power management fields into a separate structure Bartosz Golaszewski
` (3 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski,
Konrad Dybcio
From: Bartosz Golaszewski <brgl@kernel.org>
As the first step in enabling power domain support in the driver, we'll
split the device match data and runtime data structures into their
general and power-management-specific parts. To allow that: first wrap
the emac driver data in another layer which will later be expanded.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 51 ++++++++++++++++------
1 file changed, 37 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 457748e5781231680b64382fa73e195cf7473924..e0f0eca943420e24dad4e506e12bbb1eb731b8f5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -97,6 +97,10 @@ struct ethqos_emac_driver_data {
bool needs_sgmii_loopback;
};
+struct ethqos_emac_match_data {
+ const struct ethqos_emac_driver_data *drv_data;
+};
+
struct qcom_ethqos {
struct platform_device *pdev;
void __iomem *rgmii_base;
@@ -225,6 +229,10 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = {
.has_emac_ge_3 = false,
};
+static const struct ethqos_emac_match_data emac_qcs404_data = {
+ .drv_data = &emac_v2_3_0_data,
+};
+
static const struct ethqos_emac_por emac_v2_1_0_por[] = {
{ .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40C01343 },
{ .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642C },
@@ -241,6 +249,10 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
.has_emac_ge_3 = false,
};
+static const struct ethqos_emac_match_data emac_sm8150_data = {
+ .drv_data = &emac_v2_1_0_data,
+};
+
static const struct ethqos_emac_por emac_v3_0_0_por[] = {
{ .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40c01343 },
{ .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642c },
@@ -273,6 +285,10 @@ static const struct ethqos_emac_driver_data emac_v3_0_0_data = {
},
};
+static const struct ethqos_emac_match_data emac_sc8280xp_data = {
+ .drv_data = &emac_v3_0_0_data,
+};
+
static const struct ethqos_emac_por emac_v4_0_0_por[] = {
{ .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40c01343 },
{ .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642c },
@@ -308,6 +324,10 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
},
};
+static const struct ethqos_emac_match_data emac_sa8775p_data = {
+ .drv_data = &emac_v4_0_0_data,
+};
+
static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
{
struct device *dev = ðqos->pdev->dev;
@@ -723,7 +743,8 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
static int qcom_ethqos_probe(struct platform_device *pdev)
{
- const struct ethqos_emac_driver_data *data;
+ const struct ethqos_emac_driver_data *drv_data;
+ const struct ethqos_emac_match_data *data;
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
struct device *dev = &pdev->dev;
@@ -774,13 +795,15 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->mac_base = stmmac_res.addr;
data = device_get_match_data(dev);
- ethqos->por = data->por;
- ethqos->num_por = data->num_por;
- ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en;
- ethqos->has_emac_ge_3 = data->has_emac_ge_3;
- ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback;
+ drv_data = data->drv_data;
+
+ ethqos->por = drv_data->por;
+ ethqos->num_por = drv_data->num_por;
+ ethqos->rgmii_config_loopback_en = drv_data->rgmii_config_loopback_en;
+ ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3;
+ ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback;
- ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii");
+ ethqos->link_clk = devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii");
if (IS_ERR(ethqos->link_clk))
return dev_err_probe(dev, PTR_ERR(ethqos->link_clk),
"Failed to get link_clk\n");
@@ -808,14 +831,14 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config;
plat_dat->core_type = DWMAC_CORE_GMAC4;
if (ethqos->has_emac_ge_3)
- plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
+ plat_dat->dwmac4_addrs = &drv_data->dwmac4_addrs;
plat_dat->pmt = 1;
if (device_property_present(dev, "snps,tso"))
plat_dat->flags |= STMMAC_FLAG_TSO_EN;
if (device_is_compatible(dev, "qcom,qcs404-ethqos"))
plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
- if (data->dma_addr_width)
- plat_dat->host_dma_width = data->dma_addr_width;
+ if (drv_data->dma_addr_width)
+ plat_dat->host_dma_width = drv_data->dma_addr_width;
if (ethqos->serdes_phy) {
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
@@ -830,10 +853,10 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
}
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,sm8150-ethqos", .data = &emac_v2_1_0_data},
+ { .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data},
+ { .compatible = "qcom,sa8775p-ethqos", .data = &emac_sa8775p_data},
+ { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_sc8280xp_data},
+ { .compatible = "qcom,sm8150-ethqos", .data = &emac_sm8150_data},
{ }
};
MODULE_DEVICE_TABLE(of, qcom_ethqos_match);
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RESEND net-next v6 4/7] net: stmmac: qcom-ethqos: split power management fields into a separate structure
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
` (2 preceding siblings ...)
2026-01-12 10:15 ` [PATCH RESEND net-next v6 3/7] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 5/7] net: stmmac: qcom-ethqos: split power management context into a separate struct Bartosz Golaszewski
` (2 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski
From: Bartosz Golaszewski <brgl@kernel.org>
Now that we have a separate wrapper for device match data, let's extend
this structure with a pointer to the structure containing fields related
to power-management only. This is done because a device may have the
same device settings but different power management mode (e.g.: firmware
vs manual).
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 19 ++++++++++++++++---
1 file changed, 16 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 e0f0eca943420e24dad4e506e12bbb1eb731b8f5..54458ff5c9108a6255b38677f4de973511b5176d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -91,14 +91,18 @@ struct ethqos_emac_driver_data {
unsigned int num_por;
bool rgmii_config_loopback_en;
bool has_emac_ge_3;
- const char *link_clk_name;
u32 dma_addr_width;
struct dwmac4_addrs dwmac4_addrs;
bool needs_sgmii_loopback;
};
+struct ethqos_emac_pm_data {
+ const char *link_clk_name;
+};
+
struct ethqos_emac_match_data {
const struct ethqos_emac_driver_data *drv_data;
+ const struct ethqos_emac_pm_data *pm_data;
};
struct qcom_ethqos {
@@ -303,7 +307,6 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
.num_por = ARRAY_SIZE(emac_v4_0_0_por),
.rgmii_config_loopback_en = false,
.has_emac_ge_3 = true,
- .link_clk_name = "phyaux",
.needs_sgmii_loopback = true,
.dma_addr_width = 36,
.dwmac4_addrs = {
@@ -324,8 +327,13 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
},
};
+static const struct ethqos_emac_pm_data emac_sa8775p_pm_data = {
+ .link_clk_name = "phyaux",
+};
+
static const struct ethqos_emac_match_data emac_sa8775p_data = {
.drv_data = &emac_v4_0_0_data,
+ .pm_data = &emac_sa8775p_pm_data,
};
static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
@@ -744,11 +752,13 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
static int qcom_ethqos_probe(struct platform_device *pdev)
{
const struct ethqos_emac_driver_data *drv_data;
+ const struct ethqos_emac_pm_data *pm_data;
const struct ethqos_emac_match_data *data;
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
struct device *dev = &pdev->dev;
struct qcom_ethqos *ethqos;
+ const char *clk_name;
int ret, i;
ret = stmmac_get_platform_resources(pdev, &stmmac_res);
@@ -796,6 +806,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
data = device_get_match_data(dev);
drv_data = data->drv_data;
+ pm_data = data->pm_data;
+ clk_name = pm_data && pm_data->link_clk_name ?
+ pm_data->link_clk_name : "rgmii";
ethqos->por = drv_data->por;
ethqos->num_por = drv_data->num_por;
@@ -803,7 +816,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3;
ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback;
- ethqos->link_clk = devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii");
+ ethqos->link_clk = devm_clk_get(dev, clk_name);
if (IS_ERR(ethqos->link_clk))
return dev_err_probe(dev, PTR_ERR(ethqos->link_clk),
"Failed to get link_clk\n");
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RESEND net-next v6 5/7] net: stmmac: qcom-ethqos: split power management context into a separate struct
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
` (3 preceding siblings ...)
2026-01-12 10:15 ` [PATCH RESEND net-next v6 4/7] net: stmmac: qcom-ethqos: split power management fields into a separate structure Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 6/7] net: stmmac: qcom-ethqos: define a callback for setting the serdes speed Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
6 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski
From: Bartosz Golaszewski <brgl@kernel.org>
With match data split into general and power-management sections, let's
now do the same with runtime device data.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 46 ++++++++++++----------
1 file changed, 25 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 54458ff5c9108a6255b38677f4de973511b5176d..856fa2c7c896ea3068ac38d9ee71b4173edce80b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -105,17 +105,21 @@ struct ethqos_emac_match_data {
const struct ethqos_emac_pm_data *pm_data;
};
+struct ethqos_emac_pm_ctx {
+ struct clk *link_clk;
+ unsigned int link_clk_rate;
+ struct phy *serdes_phy;
+};
+
struct qcom_ethqos {
struct platform_device *pdev;
void __iomem *rgmii_base;
void __iomem *mac_base;
int (*configure_func)(struct qcom_ethqos *ethqos, int speed);
- unsigned int link_clk_rate;
- struct clk *link_clk;
- struct phy *serdes_phy;
- int serdes_speed;
+ struct ethqos_emac_pm_ctx pm;
phy_interface_t phy_mode;
+ int serdes_speed;
const struct ethqos_emac_por *por;
unsigned int num_por;
@@ -193,9 +197,9 @@ ethqos_update_link_clk(struct qcom_ethqos *ethqos, int speed)
rate = rgmii_clock(speed);
if (rate > 0)
- ethqos->link_clk_rate = rate * 2;
+ ethqos->pm.link_clk_rate = rate * 2;
- clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate);
+ clk_set_rate(ethqos->pm.link_clk, ethqos->pm.link_clk_rate);
}
static void
@@ -616,7 +620,7 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos, int speed)
static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed)
{
if (ethqos->serdes_speed != speed) {
- phy_set_speed(ethqos->serdes_phy, speed);
+ phy_set_speed(ethqos->pm.serdes_phy, speed);
ethqos->serdes_speed = speed;
}
}
@@ -683,23 +687,23 @@ static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv)
struct qcom_ethqos *ethqos = priv;
int ret;
- ret = phy_init(ethqos->serdes_phy);
+ ret = phy_init(ethqos->pm.serdes_phy);
if (ret)
return ret;
- ret = phy_power_on(ethqos->serdes_phy);
+ ret = phy_power_on(ethqos->pm.serdes_phy);
if (ret)
return ret;
- return phy_set_speed(ethqos->serdes_phy, ethqos->serdes_speed);
+ return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed);
}
static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *priv)
{
struct qcom_ethqos *ethqos = priv;
- phy_power_off(ethqos->serdes_phy);
- phy_exit(ethqos->serdes_phy);
+ phy_power_off(ethqos->pm.serdes_phy);
+ phy_exit(ethqos->pm.serdes_phy);
}
static int ethqos_clks_config(void *priv, bool enabled)
@@ -708,7 +712,7 @@ static int ethqos_clks_config(void *priv, bool enabled)
int ret = 0;
if (enabled) {
- ret = clk_prepare_enable(ethqos->link_clk);
+ ret = clk_prepare_enable(ethqos->pm.link_clk);
if (ret) {
dev_err(ðqos->pdev->dev, "link_clk enable failed\n");
return ret;
@@ -721,7 +725,7 @@ static int ethqos_clks_config(void *priv, bool enabled)
*/
ethqos_set_func_clk_en(ethqos);
} else {
- clk_disable_unprepare(ethqos->link_clk);
+ clk_disable_unprepare(ethqos->pm.link_clk);
}
return ret;
@@ -816,9 +820,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3;
ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback;
- ethqos->link_clk = devm_clk_get(dev, clk_name);
- if (IS_ERR(ethqos->link_clk))
- return dev_err_probe(dev, PTR_ERR(ethqos->link_clk),
+ ethqos->pm.link_clk = devm_clk_get(dev, clk_name);
+ if (IS_ERR(ethqos->pm.link_clk))
+ return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk),
"Failed to get link_clk\n");
ret = ethqos_clks_config(ethqos, true);
@@ -829,9 +833,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
if (ret)
return ret;
- ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes");
- if (IS_ERR(ethqos->serdes_phy))
- return dev_err_probe(dev, PTR_ERR(ethqos->serdes_phy),
+ ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes");
+ if (IS_ERR(ethqos->pm.serdes_phy))
+ return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy),
"Failed to get serdes phy\n");
ethqos->serdes_speed = SPEED_1000;
@@ -853,7 +857,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
if (drv_data->dma_addr_width)
plat_dat->host_dma_width = drv_data->dma_addr_width;
- if (ethqos->serdes_phy) {
+ if (ethqos->pm.serdes_phy) {
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RESEND net-next v6 6/7] net: stmmac: qcom-ethqos: define a callback for setting the serdes speed
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
` (4 preceding siblings ...)
2026-01-12 10:15 ` [PATCH RESEND net-next v6 5/7] net: stmmac: qcom-ethqos: split power management context into a separate struct Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 10:15 ` [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
6 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski
From: Bartosz Golaszewski <brgl@kernel.org>
Ahead of adding support for firmware driven power management, let's
allow different ways of setting the PHY speed. To that end create a
callback with a single implementation for now, that will be extended
later.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 9 ++++++++-
1 file changed, 8 insertions(+), 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 856fa2c7c896ea3068ac38d9ee71b4173edce80b..8ba57bba3f2eebe9e44964f9e6c7c67e46ccb02d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -120,6 +120,7 @@ struct qcom_ethqos {
struct ethqos_emac_pm_ctx pm;
phy_interface_t phy_mode;
int serdes_speed;
+ int (*set_serdes_speed)(struct qcom_ethqos *ethqos);
const struct ethqos_emac_por *por;
unsigned int num_por;
@@ -617,11 +618,16 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos, int speed)
return 0;
}
+static int ethqos_set_serdes_speed_phy(struct qcom_ethqos *ethqos)
+{
+ return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed);
+}
+
static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed)
{
if (ethqos->serdes_speed != speed) {
- phy_set_speed(ethqos->pm.serdes_phy, speed);
ethqos->serdes_speed = speed;
+ ethqos->set_serdes_speed(ethqos);
}
}
@@ -838,6 +844,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy),
"Failed to get serdes phy\n");
+ ethqos->set_serdes_speed = ethqos_set_serdes_speed_phy;
ethqos->serdes_speed = SPEED_1000;
ethqos_update_link_clk(ethqos, SPEED_1000);
ethqos_set_func_clk_en(ethqos);
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p
2026-01-12 10:15 [PATCH RESEND net-next v6 0/7] net: stmmac: qcom-ethqos: add support for SCMI power domains Bartosz Golaszewski
` (5 preceding siblings ...)
2026-01-12 10:15 ` [PATCH RESEND net-next v6 6/7] net: stmmac: qcom-ethqos: define a callback for setting the serdes speed Bartosz Golaszewski
@ 2026-01-12 10:15 ` Bartosz Golaszewski
2026-01-12 13:54 ` Andrew Lunn
2026-01-12 18:00 ` [RESEND,net-next,v6,7/7] " Jakub Kicinski
6 siblings, 2 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-12 10:15 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski
Cc: linux-arm-msm, devicetree, linux-kernel, netdev, linux-stm32,
linux-arm-kernel, Drew Fustini, linux-sunxi, linux-amlogic,
linux-mips, imx, linux-renesas-soc, linux-rockchip, sophgo,
linux-riscv, Bartosz Golaszewski, Bartosz Golaszewski
From: Bartosz Golaszewski <brgl@kernel.org>
Extend the driver to support a new model - sa8255p. Unlike the
previously supported variants, this one's power management is done in
the firmware using SCMI. This is modeled in linux using power domains so
add support for them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
.../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 234 ++++++++++++++++++---
1 file changed, 209 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 8ba57bba3f2eebe9e44964f9e6c7c67e46ccb02d..54f8ef3cfd7d55a89920c94d4ba13c331d51d26c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -7,6 +7,8 @@
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/phy/phy.h>
+#include <linux/pm_opp.h>
+#include <linux/pm_domain.h>
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -81,6 +83,13 @@
#define SGMII_10M_RX_CLK_DVDR 0x31
+enum ethqos_pd_selector {
+ ETHQOS_PD_CORE = 0,
+ ETHQOS_PD_MDIO,
+ ETHQOS_PD_SERDES,
+ ETHQOS_NUM_PDS,
+};
+
struct ethqos_emac_por {
unsigned int offset;
unsigned int value;
@@ -98,6 +107,9 @@ struct ethqos_emac_driver_data {
struct ethqos_emac_pm_data {
const char *link_clk_name;
+ bool use_domains;
+ struct dev_pm_domain_attach_data pd;
+ unsigned int clk_ptp_rate;
};
struct ethqos_emac_match_data {
@@ -111,13 +123,20 @@ struct ethqos_emac_pm_ctx {
struct phy *serdes_phy;
};
+struct ethqos_emac_pd_ctx {
+ struct dev_pm_domain_list *pd_list;
+};
+
struct qcom_ethqos {
struct platform_device *pdev;
void __iomem *rgmii_base;
void __iomem *mac_base;
int (*configure_func)(struct qcom_ethqos *ethqos, int speed);
- struct ethqos_emac_pm_ctx pm;
+ union {
+ struct ethqos_emac_pm_ctx pm;
+ struct ethqos_emac_pd_ctx pd;
+ };
phy_interface_t phy_mode;
int serdes_speed;
int (*set_serdes_speed)(struct qcom_ethqos *ethqos);
@@ -341,6 +360,25 @@ static const struct ethqos_emac_match_data emac_sa8775p_data = {
.pm_data = &emac_sa8775p_pm_data,
};
+static const char * const emac_sa8255p_pd_names[] = {
+ "core", "mdio", "serdes"
+};
+
+static const struct ethqos_emac_pm_data emac_sa8255p_pm_data = {
+ .pd = {
+ .pd_flags = PD_FLAG_NO_DEV_LINK,
+ .pd_names = emac_sa8255p_pd_names,
+ .num_pd_names = ETHQOS_NUM_PDS,
+ },
+ .use_domains = true,
+ .clk_ptp_rate = 230400000,
+};
+
+static const struct ethqos_emac_match_data emac_sa8255p_data = {
+ .drv_data = &emac_v4_0_0_data,
+ .pm_data = &emac_sa8255p_pm_data,
+};
+
static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
{
struct device *dev = ðqos->pdev->dev;
@@ -407,6 +445,28 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
return 0;
}
+static int qcom_ethqos_domain_on(struct qcom_ethqos *ethqos,
+ enum ethqos_pd_selector sel)
+{
+ struct device *dev = ethqos->pd.pd_list->pd_devs[sel];
+ int ret;
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ dev_err(ðqos->pdev->dev,
+ "Failed to enable the power domain for %s\n",
+ dev_name(dev));
+ return ret;
+}
+
+static void qcom_ethqos_domain_off(struct qcom_ethqos *ethqos,
+ enum ethqos_pd_selector sel)
+{
+ struct device *dev = ethqos->pd.pd_list->pd_devs[sel];
+
+ pm_runtime_put_sync(dev);
+}
+
static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
{
struct device *dev = ðqos->pdev->dev;
@@ -623,6 +683,13 @@ static int ethqos_set_serdes_speed_phy(struct qcom_ethqos *ethqos)
return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed);
}
+static int ethqos_set_serdes_speed_pd(struct qcom_ethqos *ethqos)
+{
+ struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES];
+
+ return dev_pm_opp_set_level(dev, ethqos->serdes_speed);
+}
+
static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed)
{
if (ethqos->serdes_speed != speed) {
@@ -712,6 +779,28 @@ static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *priv)
phy_exit(ethqos->pm.serdes_phy);
}
+static int qcom_ethqos_pd_serdes_powerup(struct net_device *ndev, void *priv)
+{
+ struct qcom_ethqos *ethqos = priv;
+ struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES];
+ int ret;
+
+ ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES);
+ if (ret < 0)
+ return ret;
+
+ return dev_pm_opp_set_level(dev, ethqos->serdes_speed);
+}
+
+static void qcom_ethqos_pd_serdes_powerdown(struct net_device *ndev, void *priv)
+{
+ struct qcom_ethqos *ethqos = priv;
+ struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES];
+
+ dev_pm_opp_set_level(dev, 0);
+ qcom_ethqos_domain_off(ethqos, ETHQOS_PD_SERDES);
+}
+
static int ethqos_clks_config(void *priv, bool enabled)
{
struct qcom_ethqos *ethqos = priv;
@@ -742,6 +831,68 @@ static void ethqos_clks_disable(void *data)
ethqos_clks_config(data, false);
}
+static void ethqos_disable_serdes(void *data)
+{
+ struct qcom_ethqos *ethqos = data;
+
+ qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES);
+}
+
+static int ethqos_pd_clks_config(void *priv, bool enabled)
+{
+ struct qcom_ethqos *ethqos = priv;
+ int ret = 0;
+
+ if (enabled) {
+ ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO);
+ if (ret < 0) {
+ dev_err(ðqos->pdev->dev,
+ "Failed to enable the MDIO power domain\n");
+ return ret;
+ }
+
+ ethqos_set_func_clk_en(ethqos);
+ } else {
+ qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO);
+ }
+
+ return ret;
+}
+
+static int qcom_ethqos_pd_init(struct device *dev, void *priv)
+{
+ struct qcom_ethqos *ethqos = priv;
+ int ret;
+
+ /*
+ * Enable functional clock to prevent DMA reset after timeout due
+ * to no PHY clock being enabled after the hardware block has been
+ * power cycled. The actual configuration will be adjusted once
+ * ethqos_fix_mac_speed() is called.
+ */
+ ethqos_set_func_clk_en(ethqos);
+
+ ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_CORE);
+ if (ret)
+ return ret;
+
+ ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO);
+ if (ret) {
+ qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void qcom_ethqos_pd_exit(struct device *dev, void *data)
+{
+ struct qcom_ethqos *ethqos = data;
+
+ qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO);
+ qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE);
+}
+
static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
{
struct plat_stmmacenet_data *plat_dat = priv->plat;
@@ -782,8 +933,6 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
"dt configuration failed\n");
}
- plat_dat->clks_config = ethqos_clks_config;
-
ethqos = devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL);
if (!ethqos)
return -ENOMEM;
@@ -825,28 +974,67 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
ethqos->rgmii_config_loopback_en = drv_data->rgmii_config_loopback_en;
ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3;
ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback;
+ ethqos->serdes_speed = SPEED_1000;
- ethqos->pm.link_clk = devm_clk_get(dev, clk_name);
- if (IS_ERR(ethqos->pm.link_clk))
- return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk),
- "Failed to get link_clk\n");
+ if (pm_data && pm_data->use_domains) {
+ ethqos->set_serdes_speed = ethqos_set_serdes_speed_pd;
- ret = ethqos_clks_config(ethqos, true);
- if (ret)
- return ret;
+ ret = devm_pm_domain_attach_list(dev, &pm_data->pd,
+ ðqos->pd.pd_list);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to attach power domains\n");
- ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos);
- if (ret)
- return ret;
+ plat_dat->clks_config = ethqos_pd_clks_config;
+ plat_dat->serdes_powerup = qcom_ethqos_pd_serdes_powerup;
+ plat_dat->serdes_powerdown = qcom_ethqos_pd_serdes_powerdown;
+ plat_dat->exit = qcom_ethqos_pd_exit;
+ plat_dat->init = qcom_ethqos_pd_init;
+ plat_dat->clk_ptp_rate = pm_data->clk_ptp_rate;
- ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes");
- if (IS_ERR(ethqos->pm.serdes_phy))
- return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy),
- "Failed to get serdes phy\n");
+ ret = qcom_ethqos_pd_init(dev, ethqos);
+ if (ret)
+ return ret;
+
+ ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to enable the serdes power domain\n");
+
+ ret = devm_add_action_or_reset(dev, ethqos_disable_serdes, ethqos);
+ if (ret)
+ return ret;
+ } else {
+ ethqos->set_serdes_speed = ethqos_set_serdes_speed_phy;
+
+ ethqos->pm.link_clk = devm_clk_get(dev, clk_name);
+ if (IS_ERR(ethqos->pm.link_clk))
+ return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk),
+ "Failed to get link_clk\n");
+
+ ret = ethqos_clks_config(ethqos, true);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos);
+ if (ret)
+ return ret;
+
+ ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes");
+ if (IS_ERR(ethqos->pm.serdes_phy))
+ return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy),
+ "Failed to get serdes phy\n");
+
+ ethqos_update_link_clk(ethqos, SPEED_1000);
+
+ plat_dat->clks_config = ethqos_clks_config;
+ plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config;
+
+ if (ethqos->pm.serdes_phy) {
+ plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
+ plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown;
+ }
+ }
- ethqos->set_serdes_speed = ethqos_set_serdes_speed_phy;
- ethqos->serdes_speed = SPEED_1000;
- ethqos_update_link_clk(ethqos, SPEED_1000);
ethqos_set_func_clk_en(ethqos);
plat_dat->bsp_priv = ethqos;
@@ -864,11 +1052,6 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
if (drv_data->dma_addr_width)
plat_dat->host_dma_width = drv_data->dma_addr_width;
- if (ethqos->pm.serdes_phy) {
- plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
- plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown;
- }
-
/* Enable TSO on queue0 and enable TBS on rest of the queues */
for (i = 1; i < plat_dat->tx_queues_to_use; i++)
plat_dat->tx_queues_cfg[i].tbs_en = 1;
@@ -878,6 +1061,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
static const struct of_device_id qcom_ethqos_match[] = {
{ .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data},
+ { .compatible = "qcom,sa8255p-ethqos", .data = &emac_sa8255p_data},
{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_sa8775p_data},
{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_sc8280xp_data},
{ .compatible = "qcom,sm8150-ethqos", .data = &emac_sm8150_data},
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p
2026-01-12 10:15 ` [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
@ 2026-01-12 13:54 ` Andrew Lunn
2026-01-13 12:38 ` Bartosz Golaszewski
2026-01-12 18:00 ` [RESEND,net-next,v6,7/7] " Jakub Kicinski
1 sibling, 1 reply; 16+ messages in thread
From: Andrew Lunn @ 2026-01-12 13:54 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Richard Cochran, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro, Jose Abreu,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Matthew Gerlach,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Keguang Zhang, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jan Petrous, s32, Romain Gantois, Lad Prabhakar,
Heiko Stuebner, Chen Wang, Inochi Amaoto, Emil Renner Berthing,
Minda Chen, Drew Fustini, Guo Ren, Fu Wei, Nobuhiro Iwamatsu,
Geert Uytterhoeven, Magnus Damm, Maxime Ripard, Shuang Liang,
Zhi Li, Shangjuan Wei, G. Jaya Kumaran, Clark Wang, Linux Team,
Frank Li, David Wu, Samin Guo, Christophe Roullier, Swathi K S,
Bartosz Golaszewski, linux-arm-msm, devicetree, linux-kernel,
netdev, linux-stm32, linux-arm-kernel, Drew Fustini, linux-sunxi,
linux-amlogic, linux-mips, imx, linux-renesas-soc, linux-rockchip,
sophgo, linux-riscv
On Mon, Jan 12, 2026 at 11:15:46AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <brgl@kernel.org>
>
> Extend the driver to support a new model - sa8255p. Unlike the
> previously supported variants, this one's power management is done in
> the firmware using SCMI. This is modeled in linux using power domains so
> add support for them.
> static const struct of_device_id qcom_ethqos_match[] = {
> { .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data},
> + { .compatible = "qcom,sa8255p-ethqos", .data = &emac_sa8255p_data},
Is this device being probed via DT or ACPI?
Andrew
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p
2026-01-12 13:54 ` Andrew Lunn
@ 2026-01-13 12:38 ` Bartosz Golaszewski
0 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2026-01-13 12:38 UTC (permalink / raw)
To: Andrew Lunn
Cc: Bartosz Golaszewski, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Richard Cochran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin, Alexandre Torgue, Vinod Koul, Giuseppe Cavallaro,
Jose Abreu, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Matthew Gerlach, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Keguang Zhang, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Jan Petrous, s32,
Romain Gantois, Lad Prabhakar, Heiko Stuebner, Chen Wang,
Inochi Amaoto, Emil Renner Berthing, Minda Chen, Drew Fustini,
Guo Ren, Fu Wei, Nobuhiro Iwamatsu, Geert Uytterhoeven,
Magnus Damm, Maxime Ripard, Shuang Liang, Zhi Li, Shangjuan Wei,
G. Jaya Kumaran, Clark Wang, Linux Team, Frank Li, David Wu,
Samin Guo, Christophe Roullier, Swathi K S, linux-arm-msm,
devicetree, linux-kernel, netdev, linux-stm32, linux-arm-kernel,
Drew Fustini, linux-sunxi, linux-amlogic, linux-mips, imx,
linux-renesas-soc, linux-rockchip, sophgo, linux-riscv
On Mon, Jan 12, 2026 at 2:55 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Mon, Jan 12, 2026 at 11:15:46AM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <brgl@kernel.org>
> >
> > Extend the driver to support a new model - sa8255p. Unlike the
> > previously supported variants, this one's power management is done in
> > the firmware using SCMI. This is modeled in linux using power domains so
> > add support for them.
>
> > static const struct of_device_id qcom_ethqos_match[] = {
> > { .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data},
> > + { .compatible = "qcom,sa8255p-ethqos", .data = &emac_sa8255p_data},
>
> Is this device being probed via DT or ACPI?
>
On the sa8255p it's probed via DT but all its resources are managed in
firmware over SCMI.
Bartosz
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [RESEND,net-next,v6,7/7] net: stmmac: qcom-ethqos: add support for sa8255p
2026-01-12 10:15 ` [PATCH RESEND net-next v6 7/7] net: stmmac: qcom-ethqos: add support for sa8255p Bartosz Golaszewski
2026-01-12 13:54 ` Andrew Lunn
@ 2026-01-12 18:00 ` Jakub Kicinski
1 sibling, 0 replies; 16+ messages in thread
From: Jakub Kicinski @ 2026-01-12 18:00 UTC (permalink / raw)
To: bartosz.golaszewski
Cc: Jakub Kicinski, jbrunet, linux-stm32, devicetree, neil.armstrong,
unicorn_wang, andrew+netdev, vkoul, peppe.cavallaro,
jernej.skrabec, samin.guo, david.wu, christophe.roullier,
linux-amlogic, linux-riscv, martin.blumenstingl, robh, linux-imx,
andersson, joabreu, s32, swathi.ks, konradybcio, krzk+dt,
keguang.zhang, kernel, romain.gantois, brgl, sophgo, netdev,
xiaoning.wang, imx, dfustini, davem, jan.petrous, magnus.damm,
lizhi2, linux-sunxi, linux-mips, vineetha.g.jaya.kumaran,
matthew.gerlach, wefu, geert+renesas, edumazet, linux-kernel,
Frank.Li, conor+dt, mripard, linux-arm-kernel, kernel,
linux-renesas-soc, alexandre.torgue, inochiama, minda.chen,
s.hauer, nobuhiro.iwamatsu.x90, prabhakar.mahadev-lad.rj, fustini,
richardcochran, pabeni, shawnguo, wens, heiko, guoren,
weishangjuan, mcoquelin.stm32, khilman, festevam, liangshuang,
krzysztof.kozlowski, linux-arm-msm, konrad.dybcio, linux-rockchip,
samuel
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least pausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: stmmac: qcom-ethqos: add support for sa8255p
This commit adds support for the SA8255P SoC which uses power domains
managed via SCMI firmware, rather than the traditional clock/phy-based
power management used by other variants.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 8ba57bba3f2e..54f8ef3cfd7d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
[ ... ]
> +static void ethqos_disable_serdes(void *data)
> +{
> + struct qcom_ethqos *ethqos = data;
> +
> + qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES);
^^
Should this be qcom_ethqos_domain_off() instead of qcom_ethqos_domain_on()?
This function is registered as a cleanup action via devm_add_action_or_reset()
to undo the qcom_ethqos_domain_on(ETHQOS_PD_SERDES) call during probe. Using
domain_on here would increment the PM runtime usage counter again rather than
decrementing it. The serdes power domain would never be properly turned off
on driver removal.
Compare with qcom_ethqos_pd_serdes_powerdown() which correctly uses
qcom_ethqos_domain_off().
> +}
[ ... ]
> +static int qcom_ethqos_pd_init(struct device *dev, void *priv)
> +{
> + struct qcom_ethqos *ethqos = priv;
> + int ret;
> +
> + /*
> + * Enable functional clock to prevent DMA reset after timeout due
> + * to no PHY clock being enabled after the hardware block has been
> + * power cycled. The actual configuration will be adjusted once
> + * ethqos_fix_mac_speed() is called.
> + */
> + ethqos_set_func_clk_en(ethqos);
> +
> + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_CORE);
> + if (ret)
> + return ret;
> +
> + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO);
> + if (ret) {
> + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE);
> + return ret;
> + }
> +
> + return 0;
> +}
[ ... ]
> if (pm_data && pm_data->use_domains) {
> ethqos->set_serdes_speed = ethqos_set_serdes_speed_pd;
>
> + ret = devm_pm_domain_attach_list(dev, &pm_data->pd,
> + ðqos->pd.pd_list);
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "Failed to attach power domains\n");
> +
> + plat_dat->clks_config = ethqos_pd_clks_config;
> + plat_dat->serdes_powerup = qcom_ethqos_pd_serdes_powerup;
> + plat_dat->serdes_powerdown = qcom_ethqos_pd_serdes_powerdown;
> + plat_dat->exit = qcom_ethqos_pd_exit;
> + plat_dat->init = qcom_ethqos_pd_init;
^^^^^^^^^^^^^^^^^^^^^^^
> + plat_dat->clk_ptp_rate = pm_data->clk_ptp_rate;
> +
> + ret = qcom_ethqos_pd_init(dev, ethqos);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is qcom_ethqos_pd_init() being called twice?
It is assigned to plat_dat->init above, and then called directly here. Later,
devm_stmmac_pltfr_probe() -> stmmac_pltfr_probe() -> stmmac_dvr_probe() will
call plat_dat->init() again (see stmmac_main.c stmmac_dvr_probe function).
Each call to qcom_ethqos_pd_init() increments the PM runtime usage counter
for ETHQOS_PD_CORE and ETHQOS_PD_MDIO via pm_runtime_resume_and_get(). With
two calls, the refcount would be 2 for each domain, but qcom_ethqos_pd_exit()
only decrements once per domain. This would leave the power domains with a
dangling reference.
Perhaps the direct call to qcom_ethqos_pd_init() here should be removed, and
let stmmac_dvr_probe() invoke it through the plat_dat->init callback?
> + if (ret)
> + return ret;
[ ... ]
^ permalink raw reply [flat|nested] 16+ messages in thread