From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 993682F3614 for ; Tue, 4 Nov 2025 13:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261753; cv=none; b=RC8j0BoCCKLvCMd0N+6q0pKa8u6zUjthv8F90Pb9DQM8qenZTzjJ8VqMaYmI82rhobc2YWppdORL/wjDXmhIkOHJOQWVcypcEAKPvrdY3xVEc1cE7lQNPCSsmIVC63q8hPHW7/3JDmpxq1Z5KGW1r029jxz+kcmPyHqLyq25Ysk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261753; c=relaxed/simple; bh=wI24P3bpU3oKbctMDdHY1B5Jk69UPoyzc5R8z/MGK5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aYhdBg8mQInJfXvnGliUJNshgn9/ORqTK5kPelAX+AES+5gG9VGQBLoQ+5qJ7NT3n+oFExerPoZShPxBvP4MdJYyMmye6HzVCQZck5I6ADR5GydFTG65SmAL9k4Ii6mD676Xc2BS8BtqDJIuOC5N73/Mtk3QGLMIrSp5Bwu7FuE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=rIetUbn/; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="rIetUbn/" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-429b9b6ce96so3654999f8f.3 for ; Tue, 04 Nov 2025 05:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261749; x=1762866549; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZTDGhezMtpnOxY/vEkALECRfOxvf0QgQ+FMdglXMfgk=; b=rIetUbn/UGOudMJFr5F+DF3yQbUBrrCJWzoqmH8RWRvB/n+EMV5tSL/4owf9IMAEFM tICYTWAgxV2+sMU34R6KGVJFJT6E6QerzJX2DuF/wnTewuZo0LyPW+PeszsLr8SQ/F1X 4+PKLGqPvfZ29n1Qhm8ya9Sl2COFFZPXgJFQu4BzfOFQqD1BYgDA8hjgTX6cGMvwfpcm k9RDs4DLyhOgDZWbI6KBeW3c3w8v/bhM8uCNnts/O+smfzIy5Rs8604zyO3hVFSvVLpv ylsZk1K3+7XTPWwuYcg2NsxadSyVXwF3U6myFAw8oTsw0VSE2eMirDS/D8xTQHP9zyKQ IPbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261749; x=1762866549; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZTDGhezMtpnOxY/vEkALECRfOxvf0QgQ+FMdglXMfgk=; b=nWRPXibuYek2ldi3vQyLgNUfMmQGkH99PN3j7sWfS4Esnib0NHQ9q/sZPs86XKxCQq 1ssZv7KR6AO3WsoDbuJ4Q4FlyVK/6+sa/teFr7FYdNIK0oukX8izOcVSWCDMiMSaO8fp 7VsGzodi8d8oiPQnV0aL9PSFwUsmJzbORZfpcSYrlFiUQI1uUf/U2GuTnWk9TNVtLnSz DtTFOMsAiE/2vesJ6vQrt4RLCMU1q3XyFi7b/AFKUs1D75NA586sFmCVivj8gypT2Ue9 L5uM89L8o8eB05KMP/zoKlKyDiP/ZAACoC3UqjrcgDxGssajO9QGrNUETSsKfpvgvcKY QLJw== X-Forwarded-Encrypted: i=1; AJvYcCXZSHT3BjEx4502GuAta8NQAbPM5PKiG4H9n3XSSW6bPrAiibAJwQw2NkY9dKBGIQ1IgnhinDe7q/nxGQc=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz8e+YwGtUzieprdULaXO7BPqmfTGrECfWbewtrVa/641EdAr/ iQQUFY2X1gVkZq/rPiAQXCgwI/G8xLscRlmP9dtGuQqjqkt4sR4atexkmpctlvNC5q4= X-Gm-Gg: ASbGnculGQX3WMViR5i+xCIZV4jcfXTdyykQJ9he0nXrDMt4/jJ7KvvMRHw9Lhq05UE 4CICONEPwRistMKVNU/VXvczCkyPzRO4IvBnt7EZIYiVaQgOqCcwD7uPMbWlY4pKMdQKlZuScM2 cwnpiToHEVcQ98a32ZItBoAndZelTzK3F75LRclswsgL3queZhpMnY5aO/PhjQhp4rnpDu5ggYX G1LnVOZqA4+wxxVIKSSX08CnMs/9DFf57aUrNIKovnzX1IDNxE/Ox9SEleR31Pqp8FGhC+q6SAu VsvSx8EUmrPLRojqY66RovO8sE3hxq884qr729SVBEBZRKl+qjd2qbdoMyNX7flXLk6ZOySHMTY upIi+peTEjC4aJX3nGgMslA6gtlOR1+14wxzgAojM1aZKEQfl/sbVOVuP+8hz65xfDjsftA== X-Google-Smtp-Source: AGHT+IFB7QJGakrSk2exVQWMepkD7xJRRgSX0F+M04AqQoFuTMWtzweqLgbd8qtx/kctUp4DzDT9pA== X-Received: by 2002:a5d:584e:0:b0:429:c4bb:fbca with SMTP id ffacd0b85a97d-429c4bbff0bmr11884272f8f.18.1762261748359; Tue, 04 Nov 2025 05:09:08 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:07 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:52 +0100 Subject: [PATCH v4 1/8] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-1-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=17771; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=O34pIu2ph2wSCu9zU4iKNIQpSiJHt3zeTmWHkv19sa4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrs5EuKK9s0C92rvWCtcps1baRLXO04Ran5A eT3G1PC5OmJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67AAKCRARpy6gFHHX cozrD/91TAkfxYjlYUrMF54pW5bQOGllt41GIpMwOs5SVNUolNxxrHWGajqc3UAdhaGSGaO6Hsw oEgFxk3l56Q3xrucEAhTFabosy3Joq4xCTU4/hLvtK5AreTIpsyd0Bgf7vk8xFGbJEu+3E6EyIm Cv+d9SybKFKKOvvQtwl0GHbi4iUEnf/SCSzYTyiwZ0Ks5eIJYrQ0DsP81cuhzfSSN5JWbnumkfh ofp3GHUI+q818FlrNOCGmK0j5rM5FxY7b+r9STPuDBRED+NZgpkKM1LPcertIdyGbbZq2280Opa L2fdQniftuIPrVcy7zfgB70D81jewIzEG82/+KBYylXsCrsxr21cfuBEBKXS2BFK2llTzCXAhis fkmC2R8aAkwQf8S5QnptQlzU+XG4KVvueSWUBdh2J/oRQEpl9IOUxP/5C4Qnn8f3aoLm7pfKdGt nJN6jt4D9icbblW/REG+JPU8H5I7vT1sXixfO1C7unCntpfI3EohKYc2ACqNSLAT+Bqnuuygpv5 RGU3camxHlShAWeniwOKAvNkw9s61jUZl6Nz9PE3/Ra2ndo6AVVck5uDWx8uwq+QZ1TYK9r1h5b lWFWMNuBZUqPW8STxE7nIiIt/z/ijz9M1MBf8KtxCUQFHf48IdDIOQZi2gllFKeMZ4NadcEx4VK KaZ8YCO1kyPti4A== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- .../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-scmi.yaml | 97 ++++++++++++++++++= ++++ .../devicetree/bindings/net/qcom,ethqos.yaml | 3 + .../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, 165 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..b12632545673b2ad0148a677f45= a7447309a43cd 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 =20 + 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..448e617cddc4cda8dbc77e83324= 495ffd5dfb9be 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 =20 + 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..9c9cc3ef384da0270489c21b342= 6572ea46d9499 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 =20 + 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 9ddbfe219ae2ed675149fe7f2e50b71a117941d4..a5ff7abb1cdfd859a087eb75140= 59722f979f3f6 100644 --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml @@ -81,6 +81,9 @@ properties: High-Speed Peripheral device needed to configure clock selection, clock low-power mode and clock delay. =20 + 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..e41851931b947559c89b0cd6f47= 56f71046f9594 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 =20 + 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..c9a131b8d8304c41559a416b324= df749c0a87d14 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 =20 + 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..49db18423dd807683b9bb297978= f5da8ea6cee3d 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 =20 + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml b/Doc= umentation/devicetree/bindings/net/nxp,dwmac-imx.yaml index e5db346beca9649be4f97727b78fda8973095912..b240c76e7dd5254d0c3752610c4= aa848a3c3d65b 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. =20 + 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..f61188ab0dbe3c0cec5b10f7a65= dfaff4dc3898f 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 =20 + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Doc= umentation/devicetree/bindings/net/nxp,s32-dwmac.yaml index 2b8b74c5feec8378750358e1b9335cc2c2762bb6..716407a750796ff27e8fbcdb752= 67f3922ef64f5 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 =20 + power-domains: + maxItems: 1 + required: - clocks - clock-names diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml b/= Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ff70d785d326f39a8fe5698759c= 56ab2cb7f7eef --- /dev/null +++ b/Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/qcom,ethqos-scmi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Ethernet ETHQOS device (firmware managed) + +maintainers: + - Bjorn Andersson + - Konrad Dybcio + - Bartosz Golaszewski + +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 trigge= red + + interrupt-names: + items: + - const: macirq + - const: sfty + + power-domains: + minItems: 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 + + ethernet: ethernet@7a80000 { + compatible =3D "qcom,sa8255p-ethqos"; + reg =3D <0x23040000 0x10000>, + <0x23056000 0x100>; + reg-names =3D "stmmaceth", "rgmii"; + + iommus =3D <&apps_smmu 0x120 0x7>; + + interrupts =3D , + ; + interrupt-names =3D "macirq", "sfty"; + + dma-coherent; + + snps,tso; + snps,pbl =3D <32>; + rx-fifo-depth =3D <16384>; + tx-fifo-depth =3D <16384>; + + phy-handle =3D <ðernet_phy>; + phy-mode =3D "2500base-x"; + + snps,mtl-rx-config =3D <&mtl_rx_setup1>; + snps,mtl-tx-config =3D <&mtl_tx_setup1>; + + power-domains =3D <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>; + power-domain-names =3D "core", "mdio","serdes"; + }; diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Docum= entation/devicetree/bindings/net/qcom,ethqos.yaml index 423959cb928d945aa3e758a3c803d12bd61ec42b..ef520f8105773e22c0536ff419d= ad55fe316e1bd 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 =20 + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b= /Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml index 16dd7a2631abf6fb7dc8e0c90755ab1e81915b38..ed0d10a19ca4c47c05f6873c64b= 0537b90acd15a 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# =20 + power-domains: + maxItems: 1 + required: - compatible =20 diff --git a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml= b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml index bd53ab300f5003ea1f951d3957cefc702301217a..bc5054b05f6d7f1bcd5cd8640de= b89293d9f69a6 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) =20 + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Do= cumentation/devicetree/bindings/net/rockchip-dwmac.yaml index d17112527dab0a5104ffaf2627fdcb73603d5db7..ef82ff2a2884d994c5ae6c98e0b= 3483b56dda653 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 =20 + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Docume= ntation/devicetree/bindings/net/snps,dwmac.yaml index dd3c72e8363e70d101ed2702e2ea3235ee38e2a0..312d1bbc2ad1051520355039f55= 87381cbd1e01c 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 =20 power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 =20 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.yam= l b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml index b89456f0ef830991135bd17626da98661429596c..e78cbf594c695204040a53ab1e3= 67daa9e12246b 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 =20 + 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 ce21979a2d9a438adb1e59d1a479bc6c1961bdca..e124cfc9bd90e37cf950e3576fc= 8030361ce6a11 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 =20 + power-domains: + maxItems: 1 + resets: maxItems: 1 =20 diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.ya= ml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml index 313a15331661208a1fa64386739d87a4f11b7e20..8a68c6d7b5c6d6629a780d00229= 9d767088def77 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. =20 + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Docum= entation/devicetree/bindings/net/stm32-dwmac.yaml index 987254900d0da7aab81237f20b1540ad8a17bd21..29b878079ff0c1a0ef95fc63f20= 35f478ee039b2 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 =20 + 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..ad635529d676ed6b752ab3bde51= 52d5cbddcb519 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 =20 + 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..c859f8bb5d582af8b8782f2f89a= b5e6ee3d7a46c 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 =20 + power-domains: + maxItems: 1 + required: - clocks - clock-names diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.y= aml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml index f0f32e18fc8550e6f63b87b60a095972453836c9..efa39eab0256a1102b01872bd84= 8749788c9b4e8 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 =20 + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/MAINTAINERS b/MAINTAINERS index 38383f9d8a31e28c64447032d1052827dd5d3ea5..67175e31be5ac94d9e590f48e0d= 97b1cbbf69b83 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21232,6 +21232,7 @@ M: Vinod Koul L: netdev@vger.kernel.org L: linux-arm-msm@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c =20 --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93E032F532F for ; Tue, 4 Nov 2025 13:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261757; cv=none; b=Jt/NELT+ojjjnb6IwRlF1w963RpnKniQThnn1SR5m5CqgdJCs0Ghl+OtU4e+UZgAMh5wIK6xo724dr3Bn37U1/JS+j2XoptOUGjJ8loDERv2w6tUWnUDgW86H0uY8T05Bi88nS6sGnsGpeCvfc4BNZx/X4GJI51/0hD7HnQi+2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261757; c=relaxed/simple; bh=NBuMo3fA0T+jYUYuxAjSnoU2gctigcAN7afLM+xxwVQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sMeDwMNAndk9F0OSFkJr5julLkQq12Z7kOVhA4xo+n+LBdsUsx+K3V2Z/HFlu+ZKvIO8eGC6+SJCdISZit/+5S8v+tHECxDAmC0ms0e4dPvqEATX+Ub9RZ9tewgtbgL7qRDFmySZIo9SR5pRlAo2ryo6nfpQ6YekBI33E6O+Wyw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=DeLLo5xm; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="DeLLo5xm" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-429bcddad32so3279174f8f.3 for ; Tue, 04 Nov 2025 05:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261752; x=1762866552; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EeInQQFLiIKx9a2aZ0cucvmhXeQc/nRxrd1ryoO5rZk=; b=DeLLo5xm3OAR2rej3QloNmz9nAd9jIHTeVHP+jDZuzzNROyLeAkscZbuMojt6U951+ JUxck4L8IsY7dur6fFmGzij1hdT0F1CgoWglVZok4QuKBU93FgLr+yOilVto6i4paSq3 kEcW6QEI+mLK8plhwwWuIFX7JcyCtc2kJdmSiefpfn59s27BFI0ZRPi/RSnzIiUFHf2q 2hHdT3J9uHB+fnfG0x8Eea4kTyxi6ab3C9Kk6Co0fdYgTLrsgLjVisurjo7lx2ZNJ3Ty 8IQjMQCfZ8gzCtCNEGGTTCKs6F8nnnvYKojFYKlHqT3AeTAmXGIpahZzRhn7zUbD5xuW kyzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261752; x=1762866552; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EeInQQFLiIKx9a2aZ0cucvmhXeQc/nRxrd1ryoO5rZk=; b=hTfCvo6Lw09SXxOi/TCLfyFvAPoo+YOln7ww91kEF6YqdljzL2s7ZfXF8PV7QK4Y4/ 0G97Tg0WViXYw7YWIZgbbqsgjkDgiSp6i4XtLtTsqJyJR6ZSixGI/zurszE9PtJLa3ry SNzQFfHeZbXuI1Ty5aWfViWri2mH6XLArqVSnnLoC4iN1lHZ6Cc0JvSUrL7Vhe5M1nxC GY33T+pNgxKYcbotC5xMIr0iYgIntPMHUIGjzNE90sDb6alUASRChJgb2kobXo9WJZY0 iYyJ+mNA/DpfJm702Pi4kPEYi6UkedtDxZoUDqXkx2uIgy2nwCBB+VG8QYjhK8ZM2QhR nJRQ== X-Forwarded-Encrypted: i=1; AJvYcCXEOLW88n7I1ydBPLRjSRoP4w/Y2F1s3P8qTVSpw2Py6oM1Glq81X1I4+gOfgkNUmn/lMwzf4ZG+cPXd9I=@vger.kernel.org X-Gm-Message-State: AOJu0YwujepHGBavngcshPPI2BRfenDJOv73gNE+FATK7hi7slVnTApB p4qf3+UN2Jr1y8TT1tKuckqM/jQGCPfCgNaWd+AsBsOmUnEuWbiAuEUi8K4YotfO9Gw= X-Gm-Gg: ASbGncvJqtluB9Eo5Xf29LSm+05fvx1Ryyn1OQxLsEUTVEvcLX7ove51JAOU4Hdjtg6 LNSpNZxYKGIN/sSTMfKO8yUl1Bc72X/yq/AgEhSjOrUWqeShdJbMZVtZePFFjMj75jeOsCf8JBL g9u0IttCK13SM+3AInVDHbLfQkCUInluj3Dt1mMYaLYG+uzZLyUixjJrjg5I9Ja7PDiznR8+nRZ mel9MrOBQ/8k+c6HWm6wn566C3zbHxcj6FRx8qTOAFFGNw//sqQn2YU4Xhv820ET9E2IMMg33zk xHIIwFZPaB7Ebby/gbVc8S+dKiclFr96UlI4CFtG5u0g4M0/9+IGWIEseHP9HVS9Ezc9jJdfE/3 BJ7g46ywDJTzLrxqNHLsoZSsY4uWfOsCzGWbzeo5EoXeUh4ylns/Tp+hikNj+V7YwdiNCKQ== X-Google-Smtp-Source: AGHT+IEazXC1/4e+3C9LIKFv0ME+i45XzCYX35RlKHJ+lvSQy9CFk/4mRB0TKiPc1PmCBPTWdT7aKw== X-Received: by 2002:a5d:5f87:0:b0:429:d565:d7b0 with SMTP id ffacd0b85a97d-429d565da79mr4914264f8f.40.1762261751551; Tue, 04 Nov 2025 05:09:11 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:10 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:53 +0100 Subject: [PATCH v4 2/8] net: stmmac: qcom-ethqos: use generic device properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-2-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2896; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=POv+vDF2xSPchjLMqtdcREByAr5wVSRC/4xfmqCj4bM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrsfPxny4b8sz641T3T8EFvMTQx5kwO1QGOR 8pb8GTd+BeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67AAKCRARpy6gFHHX cnqVD/97NywmsMZe+hTiJ7jxCsNyrWnMcFO+7cIL2RPel3gou8gIXIQsX7ETeIUDtcJzTZ1KqSm agsydioe3Mk2/PKY0XdQxNxEpMu65rEETgcwAzTyKgoU/GZTN7LqKeqxXx3S8aUCDiwGkjQifN8 X2v8MajyRTcRmY6D54ypAgNEnFYJkeXukrUxi75A6NLw5DrkAJXiElFKV8Tfmc35UABzpEhoqVE T88M2BP+jZLRswE6QrLutFh322QPaF+UjIRKHUaSw4FFBTZTy5aDvugwNG/kaGN3HopwyUXjCRf ErGV9fj5k1xKzd0LYxkqFzXGd+anLTeceuPdxnQBJJS1WQStSlyRM8YM9o7iyG6Vpn9AwHwPQOX IG1GY+EPViR2egEOTkA05k9276NPSpxVnYXxSiEq5Qbk35L4ZJDO96QF/G7uILkWr5coGWSSms/ P4UoZRGYq4KVQ/m8Q+r5upzCzXVqfEDAyKuhITS4g84ORbRJEezl5MXDte+IYVB+qcRrWEmXjBz 8g60W21TaM8AfbRDvZtWVjkNzCIlUv68U1HsXEpCg7dJiPHZYMpZeM6sgFYNYCONcr/XTMwTODa ar4PeVg5WExRCx2+/p2gUOp1THWngsIY51xRK43VP8GvryZCHp/WVW7HF7s7bCwOHAoLr0/70vM g1Xe3JNSs8RSY5w== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- 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/ethe= rnet/stmicro/stmmac/Kconfig index 87c5bea6c2a243f3be998b2c3935bc1dc23bfe22..22d0eaab35eaffac0bca58f8625= ecc5c955b6631 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. =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 1a616a71c36ace29a74a0aa23fc8173443aa49a5..8578a2df8cf0d1d8808bcf7e7b5= 7c93eb14c87db 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 =20 +#include #include -#include #include #include #include @@ -748,7 +748,6 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_pr= iv *priv) =20 static int qcom_ethqos_probe(struct platform_device *pdev) { - struct device_node *np =3D pdev->dev.of_node; const struct ethqos_emac_driver_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; @@ -799,7 +798,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) =20 ethqos->mac_base =3D stmmac_res.addr; =20 - data =3D of_device_get_match_data(dev); + data =3D device_get_match_data(dev); ethqos->por =3D data->por; ethqos->num_por =3D data->num_por; ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_en; @@ -836,9 +835,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; plat_dat->pmt =3D 1; - if (of_property_read_bool(np, "snps,tso")) + if (device_property_present(dev, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; - if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) + if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->dma_addr_width) plat_dat->host_dma_width =3D data->dma_addr_width; --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40B1A2F6178 for ; Tue, 4 Nov 2025 13:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261759; cv=none; b=o2eyixqPbEwd3M4hdU71tm+X63VXx6cLfqR8oZVPD8Z2fUpjiBcJXOFuR1JKrSK4LL3WIPptDDoO4KfRSYpyka+Cjq2j0LnTQmQJ3rSHOrqlfpdx5I87hFEGRaAhtCV4cPg7uCLNsnsl13hCrYv0PVTXRpnHKY0bx4QIcBHIWEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261759; c=relaxed/simple; bh=yY8w0En7ifAOHnUc2TsFrwM8BU5vXAiE+eQSw5KxyCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FnD1u9Oz2Ij0S8/nTzqa21rLNKnJhiEQmzHoYX4+j4vqv3VXGFCdCCWbAzCDg5tCp/saxO+xgYfZBwjMjUAuYbEhctkA7XG+7FKmmk9IgTfp5c4p20AKs9kciVOu0z/iR3VTV4M+Zlal7dz4QfwTi7qGMFShSCf0cOK79n66+Zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=ruj8tv7u; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ruj8tv7u" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-429c8632fcbso2447164f8f.1 for ; Tue, 04 Nov 2025 05:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261755; x=1762866555; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Y+bD9XMSY/PxNEVtej7SYELNOHLIlDJsCB53kL01eGk=; b=ruj8tv7u/Ec9qvRFG0vGLJgjrek20XxBe2shKzhC4gB4HyjwHNT0zKlJpMobbh8mKj lKWZj2MyJkp0kI2amfMjsYM2dbqTqdpfHXo+tBeSiG3iwssz+7TisCyNa71lN0Oh/WZA lVnNWk3k6YrtJ8TSi9B6H2p1k/C4EPWmTV81nCH9ETaY6DxvrlNLB8reYJ68X6kknFBC u6OsTGurh1PzS9Yy2d3zk4IpTyP0bFxm3RFxYcIHpkpHerXVJGlbWNciPPnEDZ0gKdY0 FTA1XuqbCw23QFtP+Pkk1h+Er4DKkUy1no380eqcCsZrUrN/SKKdeL+J5chx2TMJtUcO q3DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261755; x=1762866555; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y+bD9XMSY/PxNEVtej7SYELNOHLIlDJsCB53kL01eGk=; b=lZb06+nw4wfZy4/Yfv6foYndwyaoYkmHD4aziEvxhUqfwLCBJPFtFy1J/F773L6Mxg pkyxFVOjuB9AJATcbDVHgubIHP3shUU0nsN4XP5b/u0TQxAtAtT7PY+wfnmdklhIm9Nu EeG95JkuJEoCXAovd8/V6at49tUhdABtFSf3ylw+kz4sDKmipOmT6sya17wAjjStotTc GbaWAGHPqCxaF/tsneK/eoUtdLnYC9y+Qk4X2u0tvu6zv65rICNX4LgdeNYV7BEZ85bf wlBXgJ5k0Am2oKvOKuA0Cw+8DMjrRh0plv6b32FAmsAID9R9oVjBVpFUHpWTVjtFfPSI 9uyg== X-Forwarded-Encrypted: i=1; AJvYcCVQ3W9r0pK1UwneMXiw9SvNevabFYygrwemeRRz0sO+9YWb6LKwvjphBWSCZ0tYXgXSGdkQY8klBJxOHMk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2hhK5u2aSBd8Y7lfta5tZuimXpurs4ZbxsPcmFP4zB9mZk9VI M69L0Nb+1RNZ7bwUd0Jup/5nBEe/GfzInfFGQC4CYWtl7uNS/vSufOWaF4+leOfxZvk= X-Gm-Gg: ASbGncvI3zY9wMLn5qWyv/2Fjjq+zTFRR6g5YKVEVBF3hXAuq/+k6HCV3+U5q0VqGhb pzNMTUk8ExMxSsZDS6oeNtsMs/5SHBYBJ6+K44fySpXCKHgfqa10mqk/rpymBulilhVt+79JYmS 74maSoZuQ0TGfsxxR+o7AI77B56Ba2MzKwUYWZbboa1BiEmIK/9lVj2kvLB7JF1G/Wk1o+i9k0w MHxCdNZh1w3pNhlXafPRMqBMWxKyNgbG0EHqQo+ws9pq6FTwDWwc73JcDj7vRn1aK9vT5eW7V7L sGNBww21FyGk2JuSsaknqzFb4CqlU0Pz9S2nqDEJX/ia1cGpqSyY4s9P9V+cx6bC54ATrBc1jNm 8zWXMGHtosQgIK1gDu86fs31itoJPCUUn7HIj9gPHmALdaNICpcvWy9Ep84CNGFabKZp+9D6WNj 3gcbl+ X-Google-Smtp-Source: AGHT+IE9zk6mUyeMrPCGURPH5oFLkbzGYKtQvQUpX+mRV+CSiZEUcYKWUiZRVDA25BouoHB69mkSLQ== X-Received: by 2002:a5d:5d0a:0:b0:429:d742:87f4 with SMTP id ffacd0b85a97d-429d7428a5dmr6172167f8f.11.1762261755321; Tue, 04 Nov 2025 05:09:15 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:13 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:54 +0100 Subject: [PATCH v4 3/8] net: stmmac: qcom-ethqos: improve typing in devres callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-3-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1037; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=/4v1a8QAtlU1YFnwlRQMWe0GMJqjCY4EA0FHsr43o1A=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrtQQMHHYMvRDKmcuOzena2zyxcsRk8Cq4Li n8c+fyXskKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67QAKCRARpy6gFHHX cu+sD/9xqcE1M8JRojXs6tNYxWwtB8fmuax3h76PbWJVTattQarQZMV+C6Dw0VjQrSSv0tEQhEJ GUsV70G8JQ7xE4b6MVOmV3Sgzx9hOs4BQCaLek8iBxlwKJ5vo3rbHJMR5K+2Uj+UgUOP2nskA6Z wd3yen9nsBOVyMs7ac9WQzSOPcgeNfxQedMUSvgTbyBR0GcS2CIy89UjHn+zj7Gx2ijsVuLffPd LlxsS8x/QR7QsISJ1ZeyK2515q0yW6X3TBOoKytSgJ8SroZZDX1i1hb+Z6+KhzUbWFSA67ONvkP DsVx1s/4rwloM3QXDV5SG+jc8DQBfeMiSh7tK8l8Ac7DTitkG3s4mmpz9X0dVr73UxVhMMJSYOA LT6fUEV/zpijp7Jj8GXy5EVwpRWGkVm3wj+KOKGoNoDyHDGVfPaMnaAwVaS4WzAl+hjuEgwhhYa ZYRh8qU/FZ3xHQN5JSspjIfCcrBVGbeA06m9w6MrkiOkHbh/o4PxhTGNyHcYf5DYBo56XPyVpkJ LIKcRLbinjavRjNPsp3TsIa872kJloDivMLAPXL08r7gnxp3Ndwyh8zIqDY6sbPG1/0rHrGcvJs IyCz8vr671iiry6UrE2hD3ISMBOM9TDY55vysMSVanhHHypdlq69f60xwNgklQfxHUAVO75i58L BqRbsnIAl52oHoQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski It's bad practice to just directly pass void pointers to functions which expect concrete types. Make it more clear what type ethqos_clks_config() expects. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 8578a2df8cf0d1d8808bcf7e7b57c93eb14c87db..8493131ca32f5c6ca7e1654da0b= bf4ffa1eefa4e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -726,7 +726,9 @@ static int ethqos_clks_config(void *priv, bool enabled) =20 static void ethqos_clks_disable(void *data) { - ethqos_clks_config(data, false); + struct qcom_ethqos *ethqos =3D data; + + ethqos_clks_config(ethqos, false); } =20 static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CACE2FABF9 for ; Tue, 4 Nov 2025 13:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261774; cv=none; b=ilUvzHy3G1vrI5qugt+789BFtW/QGHHqPZb3DxOIOCwaajeB5rvcVpREqUY+BtONmSpD6xjpb2RFGi8ViKL6+LPExJ91GRjwm5dQ6vZEgUDZQDMMLVuvSIlxUAcvGTYLTGcPsE855DiZV6fQtWIZeSa+eLGYw+CJ2wErVDlBALI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261774; c=relaxed/simple; bh=bf3B5kwYVwr169/W9UlPMIlu2CzILnodl9pD3IyD0h4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EdEQzj/JFeC1CFEma4ffWu1qf+yNhmYjxiGRYSOgCEiWvyddnWSl4Ov63rPtSOeESTVwuwSNWWm/LcefrZOPY/EOEKIA0mIzvvQL6lx9PWx7N8PBUJJm+RHI+E71WP2nStO8py/3VtvBJXNlxEXGsJ9NEgN6A9VQ4k3Szc2yhAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=eE3tATwB; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="eE3tATwB" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4774f41628bso11379645e9.0 for ; Tue, 04 Nov 2025 05:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261769; x=1762866569; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6g7dsZ8u0SOZn4ZdglRbxzgGZbve11SxESJzoyiLLfA=; b=eE3tATwBJ2TcDjRBZGY3K0Ds1/h4/UEKoNPBZb+46dYMmi+ttxr7DJCX1DVmv9NV5U FxA+YyWZS50ghHRmIHrdaH6g6PWAiHiw3wDMUCBv23ue/EHr/bgLuHSeN/ZRyhCNkT/4 +clG7rkwsl8ej/0joCa46adSq8gByHFpcreqG3CQgdI7JAOUSgeW7bkICKL4SQym38yh FJdsjIeNwupWBrXiOyqyhJg5FqfwB8+Rnt7cWYV+UAjtzo6/QxZQ+MX5g+imBdKlppjq AseAhgUeCnHLmMLiI8R+sVjNTQkCjTw7/cWmxffJ46NUmHIe0K99ulZoc8CLNgNZY/nx obYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261769; x=1762866569; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6g7dsZ8u0SOZn4ZdglRbxzgGZbve11SxESJzoyiLLfA=; b=xIZiJkF2VUXtnAma4bI28PDZ5bSbf/wGDagtivS31C/mj14M8WwGl5wcmahUwBeIaU gDC5RbzMhmXa0zyt6YsDcJCGTO5DNukg5Kg9ubKXJDXt5+Dt46OV207pbKh87Wp6emnp ookEt0Inl+1Y8O2P22Eyj7cYV1yXRLba3pg/a/ln5gvkw+VkqE33aiaRINUpp9TOVn8t eY7YgbuABRvjRdFGcqJ8LBmcttoR9km3eRQYvjoJjdYYqSAanL1wt40HexybGGBjl12w AxgoB+83k5C8p/AwWGMe46TJVhzvENgMItqJevhzAtRDA2/3IHWyG/vImxYeW24dDxSo MvSw== X-Forwarded-Encrypted: i=1; AJvYcCUOodS1+ZeHY6ZFFFghAVN3ilbxEJOhOU/Gk404gd0gQw0VTjarEl5idaXvZpBJ7Vd5Fsl/Q8dDdOC/V60=@vger.kernel.org X-Gm-Message-State: AOJu0YxX8KRmn3zgl4sv6UAdYI0Y9nOUKVXItcWSAyrYBlZU6d67Hv7F WLE1h3u8GKCqzcX9E7aj0xXbFZok8BXINvEAL2fnJ8NoWomEZRpn3p6hMxswETfYwk8= X-Gm-Gg: ASbGncukdL112eYS3BYURZZ67x9eyH3SCt0algSaPr9SPCerrUhd6Tz/9GkJMrF1are 5RjF/DpByXLSqww5xzoUhA48xTOGkWvj4k9Ei79Y6SPFcD+HpnpKuYLeDqAYy7AO6SnfEN/k2ik Nj8+kkdjcL90j5VwydkEeCg1vzLTqvjRDl+QtNpO0gnl4SpLPQvyZBG209cYILx9+l9kNoJftck 9GODOp4zD7eFa6oiq7th0yCFanbWGMuPMe1hq/R0t/CBj7ZluF+nkT7UoBv3dPMdsSEUoqV9ejc dIdaTIE6q5f4HEwPdkcCZJ3Z6Euz6m5UQNApjCsIw0ddFC698KVMqACCnXPeYuUDOu8dGxTdspp j5L74mUIzGvAJr5Z1NuuUJHSr/RTpu9Zc0JoOE1Z96w1pLX9E73kdIAgM+R3K4aWMf+Vnmw== X-Google-Smtp-Source: AGHT+IHlxOoZ7XT18Vfvo/agko5vs85w5rmhUqZJanFIi/Ov8ICdgLA4arr6qqZL3+QQYmU0g/EvZw== X-Received: by 2002:a05:6000:2082:b0:429:cff0:1929 with SMTP id ffacd0b85a97d-429dbcf3cebmr3258016f8f.29.1762261767675; Tue, 04 Nov 2025 05:09:27 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:19 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:55 +0100 Subject: [PATCH v4 4/8] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-4-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5646; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=FNtfWUOF4aoHZQXzUDVa1raYDkAAFgkdXVleG8nnhtM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrtSGh3xeSD73y28qW6sUz2LCQZ1x8oxw6JE fCMYH3pXYKJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67QAKCRARpy6gFHHX cmFRD/9LIoa+4RVvj1jMsRAZr0/STyyV46NfgKs3xsOc2YEHRAOz2IvLEFMPEMLqGj35lZVCPH9 jSRQFfOKzF3nMtH4xjV+Cu4LwiaQXQE28lacAeiJV8FD9Rr+XOXXHX8Df3qgei9pQZuEJt0uVkA HGEhoQvCaamAtctMzCIKPxswzYgQgcm8KTsDBVkzcosF51LvOUGM3FU5AsMSTJ+y5EYbl79fmQO abIWx1tVli4V8gDjjPI9lvvUDrFDLMWvKV1+4NLJDXP3WG9L3ZtqcReQEeppHQNo7eNh8vK51dG 9mYIWUmoSSjdt9U01SFnNuJi4L7iH8fwfXfUXUP/8ySl2NSjbnmRFsXlTNh/F8eLnrP5HnQ7GAr lKbOKr0Gm5PxGJihrQIPoYClyEsmvSqkQzH85jCCbGK2CMEXliO9skRMOMzzmNMVHXQ5A7FDWjH Z7GnY4CHNagb6JYWOcYgXoqtlBh0LMp6KakWtYUs27PIoya8RT79KggmxQbICmRIorN3qe5vlp+ wwkxd1TdsI43sAz4xSAxc/GoWdCaR8tXJ5Gsfbqj6uvhuKjlMlMQc9e2edLCuyibRZ6ZvLxaXTO QGBkyWgH37pg6K7DXvtn+mg8uVLIttlIbPNO2NQRWJRlIYs4y5Kkh6fO/AG5Mfq8pSTnTRGgrd/ IiSxjqDYR86AsmA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- .../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/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 8493131ca32f5c6ca7e1654da0bbf4ffa1eefa4e..9cafe101049d5412d649b3beaca= 350c497ffc981 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; }; =20 +struct ethqos_emac_match_data { + const struct ethqos_emac_driver_data *drv_data; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; @@ -214,6 +218,10 @@ static const struct ethqos_emac_driver_data emac_v2_3_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_qcs404_data =3D { + .drv_data =3D &emac_v2_3_0_data, +}; + static const struct ethqos_emac_por emac_v2_1_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40C01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642C }, @@ -230,6 +238,10 @@ static const struct ethqos_emac_driver_data emac_v2_1_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_sm8150_data =3D { + .drv_data =3D &emac_v2_1_0_data, +}; + static const struct ethqos_emac_por emac_v3_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -262,6 +274,10 @@ static const struct ethqos_emac_driver_data emac_v3_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sc8280xp_data =3D { + .drv_data =3D &emac_v3_0_0_data, +}; + static const struct ethqos_emac_por emac_v4_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -297,6 +313,10 @@ static const struct ethqos_emac_driver_data emac_v4_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sa8775p_data =3D { + .drv_data =3D &emac_v4_0_0_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev =3D ðqos->pdev->dev; @@ -750,7 +770,8 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_pr= iv *priv) =20 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 =3D &pdev->dev; @@ -801,13 +822,15 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) ethqos->mac_base =3D stmmac_res.addr; =20 data =3D device_get_match_data(dev); - ethqos->por =3D data->por; - ethqos->num_por =3D data->num_por; - ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_en; - ethqos->has_emac_ge_3 =3D data->has_emac_ge_3; - ethqos->needs_sgmii_loopback =3D data->needs_sgmii_loopback; + drv_data =3D data->drv_data; =20 - ethqos->link_clk =3D devm_clk_get(dev, data->link_clk_name ?: "rgmii"); + ethqos->por =3D drv_data->por; + ethqos->num_por =3D drv_data->num_por; + ethqos->rgmii_config_loopback_en =3D drv_data->rgmii_config_loopback_en; + ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; + ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; + + ethqos->link_clk =3D 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"); @@ -835,14 +858,14 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; plat_dat->core_type =3D DWMAC_CORE_GMAC4; if (ethqos->has_emac_ge_3) - plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; + plat_dat->dwmac4_addrs =3D &drv_data->dwmac4_addrs; plat_dat->pmt =3D 1; if (device_property_present(dev, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; - if (data->dma_addr_width) - plat_dat->host_dma_width =3D data->dma_addr_width; + if (drv_data->dma_addr_width) + plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 if (ethqos->serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; @@ -857,10 +880,10 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) } =20 static const struct of_device_id qcom_ethqos_match[] =3D { - { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_v2_3_0_data}, - { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_v4_0_0_data}, - { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_v3_0_0_data}, - { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_v2_1_0_data}, + { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_qcs404_data}, + { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_sa8775p_data}, + { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_sc8280xp_data}, + { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_sm8150_data}, { } }; MODULE_DEVICE_TABLE(of, qcom_ethqos_match); --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C6E32FB629 for ; Tue, 4 Nov 2025 13:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261779; cv=none; b=ed3HamwfasF5b3+0szXW70ZDBTYc3vDE6icco/PtpobF2QToVYox6Iy5p6vC0IzTNZOGsEWYSipcMT7EYjP0BJrcmp7xJ/Plxq2HJZ+1qhyqU6sXdAct6koagX1h5q808B3HStA49A+M5em9ve+ElbEuyCdycwFADr8QNZhBpeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261779; c=relaxed/simple; bh=C6E2nfuOJyT6zEzejZLhVEYSKPR67hQomXuzQ9//N0I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aWMcdtlkqvqdIrSwNtr/QLvRPjzthba/WWJswqv/42B9xOvq6owA5/8AzDh5PY5HExyl0uk5FpmeDg0owkUg5/XnF8R/Wq5SQVne7v8OF8lqTvquZh9VTeVJkz8XtRTlcZ5HFCQXTSl8x26DFOAFB/tNZuJDLkmPj7aaNk3CFBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=JA0NsdHg; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="JA0NsdHg" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-477442b1de0so18084855e9.1 for ; Tue, 04 Nov 2025 05:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261773; x=1762866573; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ohz6eJ3JY6PCTOt6pOm4PJLek87cyeexjL7soGZmZnQ=; b=JA0NsdHgym0ynAqOaWRsupm5z6khZXEtU9LTAQlmNJC5mFiRiMQ4yn85KVpVsHlLAC 51SKkZwX64Lbj1k6CJPckAuYlbOMH6f3gouaLa4Ep7b55fduDvbWIhEhJglKBaoNeoex f2Kkod1f5BnWttoIKOo/Ptr8tnbfVbn55CLzsExyCrjNVz4Q0cxlYypdm9gIXSW6c8R7 JBOviS/SHlG9xSaKWm59zbg7YlIRXMnoH14KviaL9izgwVfwTWH4D/ZMdogxOgESfZ74 MeoI9nt0ZooxPkaWTkaUn7L0ZhK8tDazbu60HJ5b/TkKAk6/0ozke/95ghBQP8XGNRkv 8BgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261773; x=1762866573; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ohz6eJ3JY6PCTOt6pOm4PJLek87cyeexjL7soGZmZnQ=; b=xKObjr4YsRpE4voSjryKtqvAdYSDGoLM26BLWYlhKLbbuBbrD+28fR3CWb59ifZF0D wAyJzTJGlhcbgpBey++BTlm5p9DIGqUAR7GvZVTG8J2MRGGMop0xBSuZEE+eUvEZxnlD F7NklYoW/KcelbR8EFCUvsbSUE0B6Fas766lIHozEdabg5BbCFd1BM9Pn1Vc+APJ0h8U tCZAT3svOatxE02vX3txHeXqT7ynb2UHsToPr6tcILwuG52EDdnCrnmhUNQkukOTcqDt JYkN1cuQDiwW6MlpIpIg+yxDxSlFkTJey+eUm3zXVK7nuBiqPZhgmZF/Tug7XX12I6tV FNmA== X-Forwarded-Encrypted: i=1; AJvYcCXcLl5yOT/dUTMthhKoQjnU5deX9HEERC9Un4vRZt+uiYviYOpyE1MBmlXg4TxNgQNWl6IGErC2B7+7Lic=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6sfRAs27N20Kk7dgiVgUms1/Yx532Fgk2KBLXr/YsqA9bDbas 2ayGGT2+uqhMvxKtUUhtoRRQ9KIKzGer+LfPltYagB5nHI88NIzKYC8O/Gu3o5thjuY= X-Gm-Gg: ASbGnctAdf6zzPtfBQi5dlvKyr1pZTLp1Ox/gyLMF8eOo4bEZe8roBeECwle9MCOG1g sI0tDGbbqtlwOId1jukXppG80jqMRD3apQPJchBFnsTSlSE4Umst+IRRs7JjVSDjXxxmrH1e/Dx IXe5LeCXnsp5CVaSzQFzS0k2NZOPfL10egPzEEPbpPJTZ0JWSS7jMakwnMSHmj9YYrUpzJzcAIF tmpbbYLXYvqGYuQwDqSgvPVIoae1KyL6MMXq/tmlsFxVf0Fx1VafRGB6+1XlhNNU0lnYj+XEW/I K6PUsbrfse89yhiG1z4Q31dnHQGT/gZlfrO5tLD8T+JN2UH2t0xwvye5NCCdA8TpqQXZ5ubsxHk l/UC+1FdeDnB6nEmzzonEbWXgdk1Fr6hA69CkI4Yzek4SbNV9mJErn7u8jW6G7KJigl4iTA== X-Google-Smtp-Source: AGHT+IHLeJTkz3Z9JUhRNQIdfiIz3zju/KKqwii1AcstjAWBhNyTLGOcii2tELicylV8dY7OWKqeQQ== X-Received: by 2002:a05:600c:3485:b0:471:13dd:bae7 with SMTP id 5b1f17b1804b1-4773bfb51f8mr122528535e9.30.1762261773214; Tue, 04 Nov 2025 05:09:33 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:29 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:56 +0100 Subject: [PATCH v4 5/8] net: stmmac: qcom-ethqos: split power management fields into a separate structure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-5-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3440; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=GhJny0rrOhbWO9GcfNfulcQ1HGUq/SGEEOh5ESB4E5E=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrt1PXYHKJt2IulJ2CyvGw0mRwafmetNOR2Y 5zJmQ+uGwGJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67QAKCRARpy6gFHHX crVLEADE2sKmE+cnYe6vd8MrSPmBXpfZ48+xv9duA0AFvw0Jl0TIVags+e1ih+VNlrPKVQkDN1E 4hvIVk5690c3a7nxPof8XwbSvHgwyqCuAu9+rR2qjl3J010XvLAjdjJQBWKUQXOhLWDomWEEHNG mgCVEHSsM8vWjKT7puhWaGverUX8oMQ1aMQt8wHHcbw0YpWz7QEI8oAduybvItGU0SS2C3tLaH7 Jd3Eab4GHdc1anBVlXj9a71lYduzL4icKt6e2gR3cn7pTAfGEeDU8K3aXwXYyiUKaMHlDPO3AsK Fr+ivt8c63rfdqbPTHNjeQLAf64hx+XfXcg4DvlUImNOjGESEoJiE0fxuMaz2citgMG246tCSYU C5uLvQbjLqchzLfNPDaA2QihiKOQmHRRkGKcqFqk5Xhw46XlYCItAnlkMKm71+2tkb+xswW9NAN iwi2Tba4S6v9um/tsCcXu4R2gRT46lYwFGNHj3ndHgtdafKm3jGsLmiEDYuX6n5HPZkxm/1qQCr HjlYxUxuRoFDhUZ7MxewBMebBxObzXfWGg01dynSHvIzFBogam2kDjrtSCOYxEiXq7ZdTExPbzK z+l9sZSchK0d1c8tZffhQ/6KlCSXT79aF5UfiQJj6KCvGC5x8i7+YLETdMQ//TKcwS11rR7IXeL MYJ/8y8lkrz6tPA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- .../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/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 9cafe101049d5412d649b3beaca350c497ffc981..1f00556bbad997e2ec76b521cff= e2eb14fabb79e 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; }; =20 +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; }; =20 struct qcom_ethqos { @@ -292,7 +296,6 @@ static const struct ethqos_emac_driver_data emac_v4_0_0= _data =3D { .num_por =3D ARRAY_SIZE(emac_v4_0_0_por), .rgmii_config_loopback_en =3D false, .has_emac_ge_3 =3D true, - .link_clk_name =3D "phyaux", .needs_sgmii_loopback =3D true, .dma_addr_width =3D 36, .dwmac4_addrs =3D { @@ -313,8 +316,13 @@ static const struct ethqos_emac_driver_data emac_v4_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_pm_data emac_sa8775p_pm_data =3D { + .link_clk_name =3D "phyaux", +}; + static const struct ethqos_emac_match_data emac_sa8775p_data =3D { .drv_data =3D &emac_v4_0_0_data, + .pm_data =3D &emac_sa8775p_pm_data, }; =20 static int ethqos_dll_configure(struct qcom_ethqos *ethqos) @@ -771,11 +779,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 =3D &pdev->dev; struct qcom_ethqos *ethqos; + const char *clk_name; int ret, i; =20 ret =3D stmmac_get_platform_resources(pdev, &stmmac_res); @@ -823,6 +833,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) =20 data =3D device_get_match_data(dev); drv_data =3D data->drv_data; + pm_data =3D data->pm_data; + clk_name =3D pm_data && pm_data->link_clk_name ? + pm_data->link_clk_name : "rgmii"; =20 ethqos->por =3D drv_data->por; ethqos->num_por =3D drv_data->num_por; @@ -830,7 +843,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; =20 - ethqos->link_clk =3D devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii"= ); + ethqos->link_clk =3D 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"); --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4C052FC874 for ; Tue, 4 Nov 2025 13:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261783; cv=none; b=nxVnALuxpxGxpHUuleupIjOa+pBi74anTq8musEK777Gtm/q5INNYU7IN7fVcrr5o6ln1uL4q7GBgYN9Piaz4gsknCLQVYNVy01V67/o4ZENV0zLEewPdKRhevARjWrOw5muF+9N5Om4ypgacGYb4FnWRogPOmPdD25scrBM4M4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261783; c=relaxed/simple; bh=RftDSrG8k9UKl5gPmTd6+qE6aIUSENSDbkOBTlUFJCs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LDakZ+jBIy/EA+3h4Dhy9YKORsqOzOFmw1q1q8vCsCtq8L+q0OEuh4jLcfpYdjuOVUHSFVLa5Xi48ds9CUX/jdd8xqeFhAPhUSO9uKYBjkZzITL0vl61gMEtYccfnnYb4EAf3qNLTCDZcYS1Hve1gnhPxWhH6+TNcBjpRYR4J7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=x8K7UrOp; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="x8K7UrOp" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-477563bcbbcso3239705e9.0 for ; Tue, 04 Nov 2025 05:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261778; x=1762866578; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IW9Ne798a3XGNxpeP/XYKMinJIQLw0sjHAkXdXk9L6c=; b=x8K7UrOpTDxCZJbbNK1cq94rR0B+9gkb58crMCXOtuerzKPdl7QSNeezMcWf9GB1Q+ Fy0bqBzpuIlwUspFFDKerK+678BBCMyIZxPPbwSOlOXI7N/g/0SjlSRb8xUc0pWRYrBe 9yoUSaMe5hGa9lULwPlsPDk72gPSJCxz6f4yivpIoGmHgd1jGCpF3nnGpemU/OewoIhd ddLGkUHXPjJhO4H++GnYCNxr7wqCLlb31OE65ZOJ3uWRANnvoNa/zh/ZoBAe4Icv+aCr HhBaJ7JYEWYR5TQycg1XFOkYDIrUw5Mthfn/XqdNMDdMpY8DqvpCroIorMKfgWxeQ/Na rVlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261778; x=1762866578; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IW9Ne798a3XGNxpeP/XYKMinJIQLw0sjHAkXdXk9L6c=; b=v65+he6bOrrHxAyqlUAQcNuDhNoqg1YYj7F+JKQbSTYmOiq/yPk3MUL8Q3jEXuw/WC CkX+cPhxtedeGP0rdSfiJYWPjaMvXYY+6RTU83l2T7Ops68p3JqQ8ZAOIXqAq8MXUXov GcMj5EAHQn/7MGdhj0Zkt+Up+DK8ezkuPDdC23uVMwuFh7E7pd/f7PtxBFmXdZbKQBcL c86SMudtNVH8qWc0VLxM1xV50bRjnJiGUhYwzAPQdO211lMBsc8GqWxiRHueEx14mMaK SsDo6h+ED423/IhATM8Go2vrZrRf86yumvi0pDhD5nksH5tPEUGxUQjBcvB4kt3tXeVl WTyg== X-Forwarded-Encrypted: i=1; AJvYcCXND7DIkt4haPDNntaJ1txAnCQ0aVuka20Pgz0IArW6u9Siwk1pHdnJVRhWSkFqSJ4spEzZD18+70jlyM4=@vger.kernel.org X-Gm-Message-State: AOJu0YwBZ7kb7kTvaEym/A830WHyIMdim/tQkCqIUcuDE9t9RsYvs3/3 D9kwwZGRDj4rRbe24bWiEMl6L7GzD9SmuytilAPg375MIKLkctlY77uhJHSahitv1Hk= X-Gm-Gg: ASbGncsX81yxEpWaill5nP0VICwggbcrE0OwnB3CJMTLQGGaeIzw7UUqb4Fe2gD8cMh ONQkddfNRKvjNbUvz5+dkOx38a5vmPkUmyqr5NGff0dqo4xg+e4zjjvCvVf1Tl0ZSK7lqgBuyKG Lvzl7kTb5fM785V4tGtOhgtNpJEwujkxBcbAPevrXZ9bKpQB1fSvAfhJPTubEig951MfvuZD2kv E6x9dFfOSJtg1CU7hnlE2SfLeSsIUN7xl3vZgKuEwjvAsj9fsIcdLivRQD0QTxl77Ri0EQHWdyD vVuRnM9x98efag/qb6hGBt7XMRua6i0AQbea1MnGStZh5G1GkRQqJIdRWTNsfrl0X+KMf7ngt+B +wMdBSiQ4toG9x502L99iyRNhKdRxznuYjwbTfLJHL5Fw0xawislE482abJ1TExU+nu8Jaw== X-Google-Smtp-Source: AGHT+IG1GvRdz1G4OVuTzfGg2rW2umU84ydK8m7ey6D7UWi4H5D+BCD/zY38vh6KQiL9kxoSITMbLQ== X-Received: by 2002:a05:600c:3b0f:b0:46e:4a60:ea2c with SMTP id 5b1f17b1804b1-477308a897dmr149553725e9.37.1762261777808; Tue, 04 Nov 2025 05:09:37 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:35 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:57 +0100 Subject: [PATCH v4 6/8] net: stmmac: qcom-ethqos: split power management context into a separate struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-6-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4943; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=ywDusXCc0OEyB5wkP2D4YZe7bremgDjiZGqRKKOTVlo=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrtclrVDAlMIr4bBijfyWznJtGzxJmoLoxKY +2FL+/n8aeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67QAKCRARpy6gFHHX ctIBEAC2l+TiXa3iP8a5AInCFJWKNapCdwbhYWx13UqtZMBgW57BQKI3iEtjlqAPNohvqcgOctk 0JUeVMqskmHXPpKwwqXRPXzoNcJlfipAmbpDAzCKW5iALUWMCiaFodgqdz97ML0c0AyT/PoLbrw XiUG6dk5NJ0tD5FL0E0tOGhQEcTv0llsBYVuwRBVNSih7rrSmLIzNECL0arhuok0qFj4R2v5YYX 1F0ol9gnXR7+OMae+CNJUSmao4IGbk1uotH7t5QQAnw9hroGg2dCtNdzX/pesedZR4OGaP/R9P9 2tAq63d7pcOZUdwrvoSiBCdncHK5IqlM43kBDojNWhirTdjWhHKVgPJn72ZjZzQ7FD5MRJqRyAw e+7OtVgHYukGRDwG2OaXWZbBnxVInaIOoniDe1GCRgIgS6mM2rw0CetFQSWGQ3ZG2acoLvkh4lV 9vBPdvoIfSzZTY2R+MEUJIqGRK5HYHu6mxbtEr8fck31gHO8MRyW/lu6YFC8hdbUDrGuz3rtkx+ G8Vv10l2V7R/fjBI+kdB5yBACw0w79wQbFLyjvw5hdCrT1B4TmqCWuLT8twrdUZaIxTGPsrbImt pd1NcGf7YFp3IasjD5uizb7PejGV/SG8p8rUuiN1q6g/l9/Tz2nFK6/zrSv9zmEvgLcfXLWWEBD LXjn9oDxsxIrmnQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- .../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/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 1f00556bbad997e2ec76b521cffe2eb14fabb79e..09f122062dec87aa11804af2769= ddff4964e6596 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; }; =20 +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); =20 - 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; =20 const struct ethqos_emac_por *por; unsigned int num_por; @@ -181,9 +185,9 @@ ethqos_update_link_clk(struct qcom_ethqos *ethqos, int = speed) =20 rate =3D rgmii_clock(speed); if (rate > 0) - ethqos->link_clk_rate =3D rate * 2; + ethqos->pm.link_clk_rate =3D rate * 2; =20 - clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate); + clk_set_rate(ethqos->pm.link_clk, ethqos->pm.link_clk_rate); } =20 static void @@ -639,7 +643,7 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *e= thqos, int speed) static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) { if (ethqos->serdes_speed !=3D speed) { - phy_set_speed(ethqos->serdes_phy, speed); + phy_set_speed(ethqos->pm.serdes_phy, speed); ethqos->serdes_speed =3D speed; } } @@ -708,23 +712,23 @@ static int qcom_ethqos_serdes_powerup(struct net_devi= ce *ndev, void *priv) struct qcom_ethqos *ethqos =3D priv; int ret; =20 - ret =3D phy_init(ethqos->serdes_phy); + ret =3D phy_init(ethqos->pm.serdes_phy); if (ret) return ret; =20 - ret =3D phy_power_on(ethqos->serdes_phy); + ret =3D phy_power_on(ethqos->pm.serdes_phy); if (ret) return ret; =20 - return phy_set_speed(ethqos->serdes_phy, ethqos->serdes_speed); + return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed); } =20 static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *pr= iv) { struct qcom_ethqos *ethqos =3D priv; =20 - phy_power_off(ethqos->serdes_phy); - phy_exit(ethqos->serdes_phy); + phy_power_off(ethqos->pm.serdes_phy); + phy_exit(ethqos->pm.serdes_phy); } =20 static int ethqos_clks_config(void *priv, bool enabled) @@ -733,7 +737,7 @@ static int ethqos_clks_config(void *priv, bool enabled) int ret =3D 0; =20 if (enabled) { - ret =3D clk_prepare_enable(ethqos->link_clk); + ret =3D clk_prepare_enable(ethqos->pm.link_clk); if (ret) { dev_err(ðqos->pdev->dev, "link_clk enable failed\n"); return ret; @@ -746,7 +750,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); } =20 return ret; @@ -843,9 +847,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; =20 - ethqos->link_clk =3D 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 =3D 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"); =20 ret =3D ethqos_clks_config(ethqos, true); @@ -856,9 +860,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (ret) return ret; =20 - ethqos->serdes_phy =3D 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 =3D 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"); =20 ethqos->serdes_speed =3D SPEED_1000; @@ -880,7 +884,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (drv_data->dma_addr_width) plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 - if (ethqos->serdes_phy) { + if (ethqos->pm.serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; } --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE295301709 for ; Tue, 4 Nov 2025 13:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261787; cv=none; b=sCdz++/5Ifz/Camn9scPT/fQewDHUim/smXvCOQCvZBzemSCc5puEIfqx7ih7T8n/7KdQZ1pvoJ/tfj9LwrUq0stEu0x2SjfgTzpRvYqw7iF/xH/uqBkVEuRSJ4CPvIVDyW9W7gCESDHt10G67tWmxhJbwfTaINLeplVL/lshMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261787; c=relaxed/simple; bh=BTzIyLnQ2pVcjPzl4+AQTmQgi4C/R6FPWEbJ7GZ3dIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=myRoAgqIlnkWNIQuiJ22pHzVuZcJgXN4raXsFIPsJ4VtAgG92MKAo06s5IKbIf7zLG22M4oyEfypZmqmEZbXjbaeEs1TVVzxxlVD0Avy5ZcbkIZ1m+eOiZ4y8KNV5H/BPlXguIHA/6TpJYUID7iZh89M9kwb4H0DxFyQcUPfNNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=eIQ4aQU4; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="eIQ4aQU4" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-429bcddad32so3279672f8f.3 for ; Tue, 04 Nov 2025 05:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261783; x=1762866583; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=A7G2ramQk2hxdGs1tmlSj6o/OfknwFPaFfxdjJIosVo=; b=eIQ4aQU4lrDt7RuL1IxOlCZkG2kQ47xUb2Qx2IvOxMr1gZlPTRY11Hos5FwOEJHlU5 y30WLzAT+r+4uLcs2+Njng0KcBdoH3ZfjvriegoQHbEtV/Xwb9HvoubS3p9YRs50LP0I X7LAthXbZbzEwfUEEvUSPKoEULbgGIEQe+yFYCEAY+pY2m7eDLdhhunM+yZ3yMx/6PEe 87h6Fm2eHQ72KIFvsCZu14nra2ku2z7975B2Hc7EpaFdNCg9vIlYFw9snkXNA8OokkYB mnn8xocdNonkrKcihsN/eeQ/qARef1MNVFuNYXQmsUrZtiyAYsGWMuFKIhdI6vghnO1H 0Xww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261783; x=1762866583; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A7G2ramQk2hxdGs1tmlSj6o/OfknwFPaFfxdjJIosVo=; b=wbmHRuHFm4eHP4Z05kBZDbjxZoshQoKSl6QRnhP2a7O4EATu46/QdSB6rqN1ZVa2w4 EosDPXs42tFDSj3Apc8U3yPrdwmEilO1ZICwf+f3uLXd9oZJc8rAwOkQL9dczY+ASqh8 YgPx4Z54KOth08OXwTSCCly/vDxn9zYtNsA8PalPPfozZXjY2K9N6shT/+X1fCfrnF2y /9ATEZB0Hybi7W/X2kcmg8UsOlYNsDTELRgEpG472yK3CTHF6KTsdfh8/P8Jy0c2VISK L4pvmHmW5845kpu8EU/fuO2zeBg6nzXfX2nyJhfIom30dixqMSUlSTNmvM82Cr18DMeJ wSaA== X-Forwarded-Encrypted: i=1; AJvYcCUJQActjhmj/pq9NDpPabmWOYn+yNA1qGZ0sY3M3wKc9OGKppgg2M5kiPqWHMHIN18cWhkURdL1k1Z8IT4=@vger.kernel.org X-Gm-Message-State: AOJu0Yyx+HuSEmjvs2dSQm1l1N5yXbanvYDZNeY4CnbGL2e3zb/deTvA tUAXh1wZarQKOIETKqPfWHV5c/nlN+k9/vTYPAnW5VbGkx5BwyO85pP3wcXD2g4p26k= X-Gm-Gg: ASbGncvNc6Ddh5+m0pbgukmpANzujZ7JbHo7FqON7UMbtXvb9X6LXcXw7AcYeHyjlNE IVIBo9GB7YniudAXti6Le6tEW9SHKvsyhcPOWl9Eoz2FTwRa5mAPZoxy6RtgdfG/dnMaXmuk0eX 3NcBrBIe1jcWjDMC2dsggJlmgxCISMEfje9m6AwllaIsQc45HRXDZ6VrxRqdyCYVxQYVCY3zYFu LUTdxt9TinYO3ezwfkmMRLIZJk5J2wTfqwHTxfWAhRk9nBciVzszFRaUp4XahN86sM8jRWyOZoh TRMuuBwrGR91QkDg8pG5bmCc8+ncnAsREt25wwBFBXvYUqTkAlaTXiQpafpONviZMhpfCktC3Ke Q+w+sHWAEDUIMG1jLK5EC2O60mBcPHKhBzpzyifEEri8u1nU2wEewyv400LYbiena/+6nqQ== X-Google-Smtp-Source: AGHT+IGt39/RFIYRQsWApaQS4QlJBSyR/bfENK9HcdGp1Eg6T4YSk8jvmlZ1WO8dgmB5bkvcm4+SQA== X-Received: by 2002:a05:6000:26cf:b0:429:c6a7:4cdc with SMTP id ffacd0b85a97d-429c6a74ff1mr11008945f8f.50.1762261782582; Tue, 04 Nov 2025 05:09:42 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:39 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:58 +0100 Subject: [PATCH v4 7/8] net: stmmac: qcom-ethqos: define a callback for setting the serdes speed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-7-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1914; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=Yczz6nmRkpIoGqMAKNVvyF3zmCEkrzboH4PyVFVc9jM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfrucVA2CeMFxPGfABXbkXXyqSC5jmN8LI8mD yCNOJ0bLhOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67gAKCRARpy6gFHHX ciBqD/0XNJFi5uHJB6d9F1X9w/Akoe2fxdrPp29/FzIfuLlu4+eNY+P8ZHWXvGT21CWTBHzyLRu e0CXNLnV1f4a1wGZEvwBVVfisgS/M5avHcSEdAfYOIYk0DcbJfKIrYhpJprz/82G+ujPgLdl/kn TaYBe32VUyJHFGX0s+6ZMEQZDKgAQ2R73og7Zw/AckjDePp2xiiEb11GU8ckU6wwQtG0GEURGh5 TFXn2h7JLMGoElSLJlJFYz/1ZBC9CQqcX8WPjpHcIOHDClY5dmoMJ0E/A/nsdOVC+1eS4HwkZtf hy9I8tBtPs/FIb4xoVM5zQbLtNu5pfkWYl0IL/lcMyRYfV51YrMG+As1VTo0lemfPcVLtf75muB sthcpgvGIFJ8q3uxmA6DmoCAA9zeUYYSOpR8Uv182IqbYfaAnhLGu/XIuLcivlPoi3eFqMWCSq9 nTgIrvu5OVCSrQ7GXx6POR0ysJ1GJa7axDRNaThJUimC07hyobjKOtejPjjH6MC5zAeIOgAZXA6 WdPsoVGTqwtOeotmc2KOOZQnWeEPyo//Hd33noVu8pQBWmSLyXgsa3uIpmDbkeJP/bRuUA5BfNp 0D78mPjyDVvKS3gSyXyjG1KXrnjeuov9V3NvOVzkiMghcYQTB9IMUjf//vqgCNmlotmEnX2mptx QZ5kuabKK8e7LFQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- 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/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 09f122062dec87aa11804af2769ddff4964e6596..446f06b591a0b70992c7a431b56= cf88c1b6718fd 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); =20 const struct ethqos_emac_por *por; unsigned int num_por; @@ -640,11 +641,16 @@ static int ethqos_configure_rgmii(struct qcom_ethqos = *ethqos, int speed) return 0; } =20 +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 !=3D speed) { - phy_set_speed(ethqos->pm.serdes_phy, speed); ethqos->serdes_speed =3D speed; + ethqos->set_serdes_speed(ethqos); } } =20 @@ -865,6 +871,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), "Failed to get serdes phy\n"); =20 + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_phy; ethqos->serdes_speed =3D SPEED_1000; ethqos_update_link_clk(ethqos, SPEED_1000); ethqos_set_func_clk_en(ethqos); --=20 2.51.0 From nobody Fri Dec 19 09:25:40 2025 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB77313543 for ; Tue, 4 Nov 2025 13:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261793; cv=none; b=MfKTiQeOsmMDvJr/7ng12D6vE9UNEsHMiUCoqHLceSND77X17es5rgJYAEPeS9MCHPAWi1zJ5jH811RvMB8dtWfnllAlEyh69xCZ8tsuJMp6xy34vHBeYT4CWPSdJTNiHbGRxEFqu7iOGDiMt+dqSLW7e4jYtHFoxeENX4tGVJo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762261793; c=relaxed/simple; bh=gEzNn/jOktAUjBhwkJimsV4dFL+5O/s4EfBdKgdkB0Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iZIukEKoT5Ts6Xp9lgPv5+ntsHSdJEOvTFyHsqqMR7jOoMuGHzXvVvXk+sc+wpTdUsiW8jChHrwfF0g9Py7qMDy7iVaK/dlE+y7dHtimNvzoQ0ie39wS7lpB2xfqolGVewh9IzcvODlexsXeHmoPDQFKNkF7YXcQt9ImkB1fRu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=VqzyAvWl; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="VqzyAvWl" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3ee15b5435bso3999699f8f.0 for ; Tue, 04 Nov 2025 05:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762261788; x=1762866588; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RYc8z4PcZ9T49QURApQLtXvrbC8JQdZPwHKl+MXpn3g=; b=VqzyAvWldIiENzjKi7fEAbnLRaL8oIQSYKK1QDnOmHEYk0N+Y3qHVJxNKNURuV3MMB NfOijLdjQpAFidhQ5nvqF0acovQBe9YRta88QopfhkYawyzXsq3kdiaAh1l3SqfKSAvD tVlqYfkGVo9WXhtqzmwMn5WIjHsfLA9tJGaBePLJrgX4GWLzU14aNr9wgu1azggqApyv QkWl64I2Rm1qekw+ZEToVhEi306a1Ek+sHhyMYVTgxH1+BZy8z6lHMHNiyy73QHkq0ND 2pe5NORJZaZ+76Oga2dFWMFyMAp5ouAI76LGKF63L2is0q7T4y98hDpsOuPabDEFvXut U5pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762261788; x=1762866588; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RYc8z4PcZ9T49QURApQLtXvrbC8JQdZPwHKl+MXpn3g=; b=XUedJ6H8mPGNgUHaCmLLDxSrIHVcrmwCn6QadZ6L65hRtK76xh2G17cNdRkT+JcUMN yYO/T7vN6N7Ix2FLybn1WNB1n7m//l3ByerZUD37TECeI+d5z8JyKIJUx/dA7P5jaPO3 V3XLYscdhQOODLiEaMpGWMCaLGo1ovhdp89+H53s3gi4HyLMMygGHNUEVZe9RcDeTuo5 4jgJnaUTCpWJrPvl957B0yi5F3RgpCD6ZLWyGybe4eMUarccIA/LZy9JdkzhwlG+dqkN ZKdt7azEN465UlI4PRmiWP//4iyg4TNoSrYSZ7C4wPCkLlSXPONomor3RbAvoJiFoS2f BVrQ== X-Forwarded-Encrypted: i=1; AJvYcCUdwWb6xtk9pRG08aZYFEmzfuuDttI+42C9hi7vDbrAHq+j2iq1s/8GWmMBsxbwxN97skXdwigIjpTB3n8=@vger.kernel.org X-Gm-Message-State: AOJu0YwabTqXjdtaUCz2Om0cbnalN/CrJgQ2/SLVb/FGxuyglaMSnIBc DTw2CrdRhhp6Ucgn9gJCmjJipODBf07ulWXJd97bzF+RytfwTeD8ZYLgXlqBxdmGGEA= X-Gm-Gg: ASbGncuz4LJQtf0IJHnMqOd0zradg/fa5nU4Zb+YEEeQGR7I/bl6V5ShvfTX8gP7dLM M8sdbnqyrikLihH5Sg5JBKwpdQq+25E2UTlxPZ87LEsvX6S5AKZfufoYjekvXguG7ti6Lcea2V6 uEFIDjHUYc3cFFkKfS8uuqw1grz8okFbcm7PS1tWfZ8MKezm2TDyI7ZNuBzvtoETYa7XApW55OH t+It6OVxfvMoiQI8AdGbtF9Z2sJiVF+8XB3M+qcZL46JAZmK6phcdMumiEdjp3CiGLQye7QXUo9 ps98iaPnNQ7POy0OWiw/mbsgKNYYRfgarwskdvEHwtp0+cTy4+NxztPvOadjJU/HQv6g4/MQO3i kxTmkE/yytfykwAQRFgmXebD0sdzA6m+CNIiYLz7ldgH3d4usQJf4MHog0gJIDNdrSfZLPg== X-Google-Smtp-Source: AGHT+IHPpON6LYi1/Q8aXjFmURJbxcrY+l8z8FiJePOjNwnG1FKRukzxqD0pp8zNbhw6M6VPHhOkIg== X-Received: by 2002:a05:6000:26d2:b0:429:c5db:f50f with SMTP id ffacd0b85a97d-429c5dbf6a0mr11233740f8f.29.1762261787616; Tue, 04 Nov 2025 05:09:47 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:9ea1:7ab7:4748:cae3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc18efd3sm4554431f8f.5.2025.11.04.05.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 05:09:44 -0800 (PST) From: Bartosz Golaszewski Date: Tue, 04 Nov 2025 14:08:59 +0100 Subject: [PATCH v4 8/8] net: stmmac: qcom-ethqos: add support for sa8255p Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-qcom-sa8255p-emac-v4-8-f76660087cea@linaro.org> References: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> In-Reply-To: <20251104-qcom-sa8255p-emac-v4-0-f76660087cea@linaro.org> 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@nxp.com, 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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10753; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=kH82UvTkPA4Owu7n7V2nTB+oPAmR25mANNr93utn74g=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpCfruh2gxdJgmTj0+zkkuyG+w1M/56xqsarn41 ZPBYWNIMjSJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQn67gAKCRARpy6gFHHX cpVyD/9ixuat3AHDNJC0PRiJjI8ZBWoFYNK/GFnKGpGV8mOyZ5RhoCXvb4J0XxCRz2iT82+Uypr 6q7xVZOjreOOIh4AG/HaRxse/Kxf1I9mX9n7a+AHRs8bWm1D3gA7lMwsIBIWpjIU0augIyfnfv5 LV0F81QwFLiqfSlt9xEW7GW/b81xrKeQhHd03uJPfnWJvxMeif9h7W4cz50cup4Tnpt2FcHMgYi 87taXwWIl19DKQaTpkNh+/cjPDBJpQm/nGOM0DDLt3tGbXK2HMGRZmvo61I+Z9UnzonFleCTzsm hPGn+Om6M+wVvSJL3T8+iSEmTd5bEc8V+fG8zVghoU41QJ3RqKh9DwhlfA8XOECUGUm3+5uXUU2 qQYgktGE2BgGqrrQUKlWqckXbAbARIqPpBZrGplyhXDZ7fv4xSOzTKAHrWIRsmSKETMaG2mcXhG Hvkvz3ZNWRzRmZDD/9W3WM/+fDq+tVQ3agdy7NlzXByyBYA6N/dAa2IM1JEKpBUYAGBfSoLpWzn gAA6WBPYiTrPEU8iLAyfgMSy/XoxjIriTBnhWWwAewPhtKghcFCdGUAAZClSE90dXutgvWi3CUy iXU472N6z9/ZyUHsOSkq2TqXcftMJQZCT7j6itABU18ESw6vDKLSYyDmbdmJ8sbNxPhPES4G4ff b6NU77t5VkvaKRQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski 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 --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 230 +++++++++++++++++= +--- 1 file changed, 201 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 446f06b591a0b70992c7a431b56cf88c1b6718fd..d2922b4fb4bad1bb8dd77f1feaa= 7a260b97f0ae8 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 #include #include +#include +#include =20 #include "stmmac.h" #include "stmmac_platform.h" @@ -81,6 +83,13 @@ =20 #define SGMII_10M_RX_CLK_DVDR 0x31 =20 +enum ethqos_pd_selector { + ETHQOS_PD_CORE =3D 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 { =20 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; }; =20 struct ethqos_emac_match_data { @@ -111,13 +123,20 @@ struct ethqos_emac_pm_ctx { struct phy *serdes_phy; }; =20 +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); =20 - 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); @@ -330,6 +349,25 @@ static const struct ethqos_emac_match_data emac_sa8775= p_data =3D { .pm_data =3D &emac_sa8775p_pm_data, }; =20 +static const char * const emac_sa8255p_pd_names[] =3D { + "core", "mdio", "serdes" +}; + +static const struct ethqos_emac_pm_data emac_sa8255p_pm_data =3D { + .pd =3D { + .pd_flags =3D PD_FLAG_NO_DEV_LINK, + .pd_names =3D emac_sa8255p_pd_names, + .num_pd_names =3D ETHQOS_NUM_PDS, + }, + .use_domains =3D true, + .clk_ptp_rate =3D 230400000, +}; + +static const struct ethqos_emac_match_data emac_sa8255p_data =3D { + .drv_data =3D &emac_v4_0_0_data, + .pm_data =3D &emac_sa8255p_pm_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev =3D ðqos->pdev->dev; @@ -411,6 +449,28 @@ static int ethqos_dll_configure(struct qcom_ethqos *et= hqos) return 0; } =20 +static int qcom_ethqos_domain_on(struct qcom_ethqos *ethqos, + enum ethqos_pd_selector sel) +{ + struct device *dev =3D ethqos->pd.pd_list->pd_devs[sel]; + int ret; + + ret =3D 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 =3D 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 =3D ðqos->pdev->dev; @@ -646,6 +706,13 @@ static int ethqos_set_serdes_speed_phy(struct qcom_eth= qos *ethqos) return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed); } =20 +static int ethqos_set_serdes_speed_pd(struct qcom_ethqos *ethqos) +{ + struct device *dev =3D 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 !=3D speed) { @@ -737,6 +804,27 @@ static void qcom_ethqos_serdes_powerdown(struct net_de= vice *ndev, void *priv) phy_exit(ethqos->pm.serdes_phy); } =20 +static int qcom_ethqos_pd_serdes_powerup(struct net_device *ndev, void *pr= iv) +{ + struct qcom_ethqos *ethqos =3D priv; + struct device *dev =3D ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + int ret; + + ret =3D 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 =3D priv; + + /* TODO set level */ + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_SERDES); +} + static int ethqos_clks_config(void *priv, bool enabled) { struct qcom_ethqos *ethqos =3D priv; @@ -769,6 +857,61 @@ static void ethqos_clks_disable(void *data) ethqos_clks_config(ethqos, false); } =20 +static int ethqos_pd_clks_config(void *priv, bool enabled) +{ + struct qcom_ethqos *ethqos =3D priv; + int ret =3D 0; + + if (enabled) { + ret =3D 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 platform_device *pdev, void *priv) +{ + struct qcom_ethqos *ethqos =3D 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 =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_CORE); + if (ret) + return ret; + + ret =3D 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 platform_device *pdev, void *data) +{ + struct qcom_ethqos *ethqos =3D 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 =3D priv->plat; @@ -809,8 +952,6 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) "dt configuration failed\n"); } =20 - plat_dat->clks_config =3D ethqos_clks_config; - ethqos =3D devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL); if (!ethqos) return -ENOMEM; @@ -852,28 +993,63 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) ethqos->rgmii_config_loopback_en =3D drv_data->rgmii_config_loopback_en; ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; - - ethqos->pm.link_clk =3D 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 =3D ethqos_clks_config(ethqos, true); - if (ret) - return ret; - - ret =3D devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); - if (ret) - return ret; - - ethqos->pm.serdes_phy =3D 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->set_serdes_speed =3D ethqos_set_serdes_speed_phy; ethqos->serdes_speed =3D SPEED_1000; - ethqos_update_link_clk(ethqos, SPEED_1000); + + if (pm_data && pm_data->use_domains) { + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_pd; + + ret =3D 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 =3D ethqos_pd_clks_config; + plat_dat->serdes_powerup =3D qcom_ethqos_pd_serdes_powerup; + plat_dat->serdes_powerdown =3D qcom_ethqos_pd_serdes_powerdown; + plat_dat->exit =3D qcom_ethqos_pd_exit; + plat_dat->init =3D qcom_ethqos_pd_init; + plat_dat->clk_ptp_rate =3D pm_data->clk_ptp_rate; + + ret =3D qcom_ethqos_pd_init(pdev, ethqos); + if (ret) + return ret; + + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable the serdes power domain\n"); + } else { + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_phy; + + ethqos->pm.link_clk =3D 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 =3D ethqos_clks_config(ethqos, true); + if (ret) + return ret; + + ret =3D devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); + if (ret) + return ret; + + ethqos->pm.serdes_phy =3D 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 =3D ethqos_clks_config; + plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; + + if (ethqos->pm.serdes_phy) { + plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; + plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; + } + } + ethqos_set_func_clk_en(ethqos); =20 plat_dat->bsp_priv =3D ethqos; @@ -891,11 +1067,6 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) if (drv_data->dma_addr_width) plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 - if (ethqos->pm.serdes_phy) { - plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; - plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; - } - /* Enable TSO on queue0 and enable TBS on rest of the queues */ for (i =3D 1; i < plat_dat->tx_queues_to_use; i++) plat_dat->tx_queues_cfg[i].tbs_en =3D 1; @@ -905,6 +1076,7 @@ static int qcom_ethqos_probe(struct platform_device *p= dev) =20 static const struct of_device_id qcom_ethqos_match[] =3D { { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_qcs404_data}, + { .compatible =3D "qcom,sa8255p-ethqos", .data =3D &emac_sa8255p_data}, { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_sa8775p_data}, { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_sc8280xp_data}, { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_sm8150_data}, --=20 2.51.0