From nobody Tue Dec 16 21:23:26 2025 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.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 206C8301474 for ; Fri, 7 Nov 2025 10:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511414; cv=none; b=dLdo0vecdp3QO3crz2cACyL8C41dDhk58NAbtGlnFMN8bX7YQbHlb2U3WDr4HMbMMnJHt64YBEiTxqJ74tdGMwPT0Q9f1hs6EYqXqXEPrqrXUN6NelcUU+TwTYREziqgD1pN49gZGjKSsT4GgphjRQ9Smt/5z4yXJmBVioLLjP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511414; c=relaxed/simple; bh=K0M4huHTF8pYZkozBSwLVKVKEWA1dg35V+LQyQdVoPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NdjVjyLX7s7WNXJ3nBmynY7/xC17iWOfgaViam2Ifs3Kh1nDbS4batGhBSyPLQePGbds8GVw4EV2utqPELaX9XYr9ateMWIMuurv7kOOLzM/xIHl8Ng8cRzh8BsT3O2+EJBj0vM79JiyKGLXWsy+QuoLn3RPWMO92zqx27bClP0= 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=hwvi2Eng; arc=none smtp.client-ip=209.85.221.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="hwvi2Eng" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-429eb7fafc7so437279f8f.2 for ; Fri, 07 Nov 2025 02:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511407; x=1763116207; 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=OoXhjM3n8aklniNH/R9pwQxtuIMJqJK8JAjjAoRefMo=; b=hwvi2Eng7mOZDGuVxdCl7eimkM2u64eXwnlgZuhGCWYcsY3CK2V0nw6rUcrU698xMp N6JshiQQw9yCzmhk8BaiGGjOMGyqmB6kJ5FMW4iwIQpyBKZ3gFTigOV2KM5He5i5UUPV 79HWwTBWuTuYtoezw1NGtgSqIPA0rRAWTcjsa4h38wfH5UML/T7QguL7zmvNlgEF1FVU mKxW9IckmPYBRjZKcn0RJp+oe4QpG3hoaX5A7WS6IR9ah4X9fGPwtlz8tXTqTi3frDxk LUcqPJ0h39VJB9GfgVnbVzPfT7gWfu+Xux/PMmTNcD+P8Hbgm+36+gxQ1ZSOrtxFrIf+ prrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511407; x=1763116207; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OoXhjM3n8aklniNH/R9pwQxtuIMJqJK8JAjjAoRefMo=; b=lJTyodJLSe0gpQ31qu8uE1CcPDNxanxqj5/D1AMweH6trbF7ruWBk4Qp3fszrFlT55 210MIrufT4eviAAdoJR0sywXpuZqcvLQLn63hffJz7j2wenmrnNw2EQGBxyBcBDH6OXz khJ4eAX0y28DMUIss3q0Lu2KYjNc+3pyYkr3EDwBu7sIdqmqqGMN8gR4gvD1ylJQFmJo stwvCQh3eUMsFct+guZe85BDzWqwFeOAqeSCJ7ioLqDVmHwkFyKD5BuRqheCbzi8co0l ASnDAiDjIAjEUyzetuJt6UU0UuBkm8XkONSDSlvIuPhJdHXOX/33q1LOwETbSCkC/cDS Py5w== X-Forwarded-Encrypted: i=1; AJvYcCX84TlWPOpKu47oV21WZmtWpUzFi207V6sNKfNqhOzTk2akrjQk3/fSYIUsXF0h6lSkM3pEkmEEEzwGZao=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3ylL3YeQnQADjsf2d5Zh1+ncshVcBb82ugoCgP2sigsdkKTCg EXgh81nQOS4QGnBAdtt4Ewwhn9eaO/YSakB1tZBAtoUYmXfx9zEfKElGWVwwHTA1zCw= X-Gm-Gg: ASbGncvBayw0bhw2HSkSUZ0o+p3wrwHX4VBkkemfm4r7TGeXzZYCWZ01gEQJjVpnJ8Q YCMbszZyk70GVmPQiPg2wwedn4Pwn54nL6pFhSByK3M9fwzAzZWEiBOJcQ4arm5p2sJFUBjuGnD aCe/mA4rP+pKep58Mo3U5jOl9VNgPAfqvCtXbdD1BZMu+a2Kr4UCWAAeZROiE+KIH9/lF+isoIC 3KDfD6OevtTOMN6eGfyeOdDNnsBj296mrS0ZVKdxpBvE6CbA4XgrKrLNXVOhxF7dmLevf8rjShh GKuuuspH4txh9GG6bzAZdTITIY2dhGs1FOrZNNdm5Dq6UUgekn7lmg8iRd7VgdCQANN9AZBWUGK oQf3ZNE4ZmhxeJWFdy1sftwFX+FoGE8vaFLP99w/uocqUHzlx2cogXI1BAbavQNF9ciwN X-Google-Smtp-Source: AGHT+IGDPsetAaoChxxA5kj12E+sV/VA6g0Yx2XkXfO65ms2g78LV93UlmVt2zPq8nTQnwYYi00Puw== X-Received: by 2002:a05:6000:615:b0:429:d350:802d with SMTP id ffacd0b85a97d-42aefb435eamr2108877f8f.45.1762511406805; Fri, 07 Nov 2025 02:30:06 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:06 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:51 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-1-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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=17785; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=z5XJublfpLEfnX6pyZmcHxmvUUo3i9PFFHeIhJNj3cM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBpDcomV5dMXsvOPE1lG55VKLJ9XKx7e59GS0yIv 1MuEwn/9PeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KJgAKCRARpy6gFHHX cmZUEACCYfa0yiTu+bSVOyRxPXJtCnfbr5F8n8fMY1XsM5cMWa7Z3XeyY7W6RCuXd7QoBR51e1H FPZuvZrWqVO5XxCoXmC21I1z7U5F48tgW84BoT642eyznIro9yPHmpNgjqtdirFSOn4G/8yjhV6 9mZ2A4YwAbeYC0Ee5dH4B6LTCjl8q5qiSyWBWgJHWIMF91BwInekj9T7nU0sTe6dFCgJwcGVRy7 taxocDPFg0Lvmmgn0bXVkYu9uHffsSH4CkGCm58Y5AijcDyN2y6By1jdNopKX+ODR4Wg/jRF1KR NHRnVvn151b1GagySR83+OGHWSBMhphWkX0dGGbddbMRKs7NPqNGUooe+unwsVHerAy7zNtVAKh HvOd0s0La3mkD5px+BJZp3UAhV4IFpl7JZ+M0TxOBVJuMNueauId59oiu6T0So3dTh3H81vBkwv YiQ/SsUdx3HZVYZADTFM7GXJ+Zs/H42GxLmSYUqOz5OzUafR+zTst874+ZtSESBrE3HcgokXU4z YUPl8B2e/45rW81Y94OGEVa/tFPI1MJWm10B23niamG8oaepvdDPFkqHE7DqrY6ZIuLjih/Z0N/ GxYMJLFubpJGO73z4P+ugnYXTc/xNVk04AkGpIYfPvpAdyfl/fzxzv3EYBz2ClmpG3gaRxrtQA/ YM0NrSyciwh7UOw== 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.yaml | 3 + .../bindings/net/qcom,sa8255p-ethqos.yaml | 98 ++++++++++++++++++= ++++ .../devicetree/bindings/net/renesas,rzn1-gmac.yaml | 3 + .../bindings/net/renesas,rzv2h-gbeth.yaml | 3 + .../devicetree/bindings/net/rockchip-dwmac.yaml | 3 + .../devicetree/bindings/net/snps,dwmac.yaml | 5 +- .../bindings/net/sophgo,cv1800b-dwmac.yaml | 3 + .../bindings/net/sophgo,sg2044-dwmac.yaml | 3 + .../bindings/net/starfive,jh7110-dwmac.yaml | 3 + .../devicetree/bindings/net/stm32-dwmac.yaml | 3 + .../devicetree/bindings/net/tesla,fsd-ethqos.yaml | 3 + .../devicetree/bindings/net/thead,th1520-gmac.yaml | 3 + .../bindings/net/toshiba,visconti-dwmac.yaml | 3 + MAINTAINERS | 1 + 24 files changed, 166 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac= .yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml index 23e92be33ac8609a16db530782989caed22a5730..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 91e8cd1db67b8e14961497a7254e6b01dc4e582a..c1b67cfa76d070d5e8349d5e92c= e6bc4bf2ab67c 100644 --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml @@ -83,6 +83,9 @@ properties: register - description: Offset of register controlling TX/RX clock delay =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.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/qcom,sa8255p-ethqos.yaml= b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23a7b2a210e20c947498e1a0dc6= b0e773af6e988 --- /dev/null +++ b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml @@ -0,0 +1,98 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/qcom,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 + maxItems: 3 + + power-domain-names: + items: + - const: core + - const: mdio + - const: serdes + + iommus: + maxItems: 1 + + dma-coherent: true + +required: + - compatible + - reg-names + - power-domains + - power-domain-names + +unevaluatedProperties: false + +examples: + - | + #include + + 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/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 58c7e3f678d8d4efe8a711c6fba0b01d9f2acdd4..09d47aa727964c04f2fa723dcf6= 43e5a6356f70b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21266,6 +21266,7 @@ L: netdev@vger.kernel.org L: linux-arm-msm@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml +F: Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c =20 QUALCOMM FASTRPC DRIVER --=20 2.51.0 From nobody Tue Dec 16 21:23:26 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 617C93191B2 for ; Fri, 7 Nov 2025 10:30:11 +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=1762511415; cv=none; b=Rj1tLDz+MIWyt7I4lV42BlbFDxxjsgfTpY9wWBkmFwnBMfQgUBVRlgMD+Kx23zHffkx147Cuthjjm/15YcYPfJdOsPdu4fA1odsjSSC0iYOk97w109Vw//spYeTifaSMN4bTh4oZl8URE6QAR3PJ8u7JIrncuzZUXb/V6K9xqv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511415; c=relaxed/simple; bh=NBuMo3fA0T+jYUYuxAjSnoU2gctigcAN7afLM+xxwVQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DkH0HqAfSJCzwb67/zZVQw9mw6iaXyg6Ib9uzYbFxH8Kn6eU3cgPJWijs++Kx21dxm7QohXYZo2rgSV92pJMzhgPrTV16K1rNkM9o9quhCGUXO1pzSqo5I2jfDFs8FbUW1+YnkdBR37PulD0qBU19Oy8BDnYPOYTg271nH7P6DY= 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=xTGGjj62; 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="xTGGjj62" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3f0ae439b56so364985f8f.3 for ; Fri, 07 Nov 2025 02:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511409; x=1763116209; 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=xTGGjj625Ktt1pRh7L7DUQU6VNYkb8RqVk/N9fZHWUrJcbemwQwjaRbMJUqm37K0kD Av4qPo6Oo+5/VSpGKU9q5oMeGJAlJd7/zX2eC/phF0FTCj6rnLErErbbYiQsfpz9g0LN emJdyKqVolhpCsugr4Z6Z+FJiT5Y883Ay0eIQmsBs0a1jcrjExtOlhnU1L20ATsPIu4z kQwXivsZi8W/E+Dq6S2Dp1f6tfBX1qd4lH9Cjq3mTgQ3DnA+BW2VSl4r+idS/FJs2yIr llVoJUR2tNFIIbiWJk+Rv9RyKp8QvyvYV2HyyNmDqBlRKp9fVnBc0V3ibluBmz3bCuYp ckzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511409; x=1763116209; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EeInQQFLiIKx9a2aZ0cucvmhXeQc/nRxrd1ryoO5rZk=; b=wFi+ppL0QjdRDoBbjZYooaWDqCcdiy8IpVnlRxrtsV8GKeRc1GKif9vjPNRIhNrCK9 znHEsz/KSM3d3HadNx8Chjy0thVTzscphfucnwVJM1GDLHk7EJxmbUBRbN9dRNGZa0iD fkOkKFnnDjU4slUIyxoHBB6DQKM8J5jDOG2HuysFO/xuFl/SN5BHkMjz+2+aygr3qweo jUMfDrUfQVgFJlVWVc18BYsV/aXxJmqF10z1dbuqlJZNHz0M+I82Oop+U4RmFki6B2fS SBePdv0Ifn8PaDVoWYlgWKofUL+XAAcjddyYVONpAIRv6a6QQH4WI1UpVSrVk0UY4ixp yGnw== X-Forwarded-Encrypted: i=1; AJvYcCUrKTASh+GBTBjMTv+oCucHuLP7/y2d6APwge/1U7vbH8YPhSS9ufBAg0M5+owqtUSvDxOtruhz8bd3h2U=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/lDUmQcu0R4w9eZ1CFgXFZ9TzZVLa1V1cxLMy+81jJzIEeyi7 3wUrrhPhCqlp8xG37omLhUkTlcaeZk1TehNXPfMTllFfKyoZvvYoUJdxdSW1+maZvSo= X-Gm-Gg: ASbGnctTGLmXSoFpCKdha0kvRWANaFMyqb/9lj6rnsiyEllVgEG+c7uFXEBj9CZku+0 b8R2y9NXSEEeJo7kn2/NoSfO2QFLHb2b4MX3/cyHAlltL91b81rTHMGhrgPfVy/WV9qU8OYMBhJ gNiuALg/vsRnloI7i2FosIIUVMp8zLFBGezgsTDOhdeJNwPd/+/BpwQt+saBjhitpV4wq+TccOn oAUiGcpGvIS89QquumgVjdNlE+Yr+ugTQpPt/eycrAtY4uJRd+coH2mqLjhIiybupNtS2OMjjwY eaPJvn0TFGMiRk++EkIJ1iotQLk4ja6uwFhL5+nhGk0uKXyaKx4M344OA20VTahj8VVvb9rxipl 9RIN6pfdkQdkR7/n3gtpQs87HzxyzY/qP4B4KJ4gIF0y31CL5pVzlOW4tW8kkVDRJzXf0teEAMv ZQGXA= X-Google-Smtp-Source: AGHT+IFWpZ4poiZ9SDXbV8ON2MHdizseFiZAt8VOLHhvPsXxDGeYll4+fwCN9jkQCS4Zle5ZwgVqIg== X-Received: by 2002:a05:6000:4285:b0:429:c774:dc08 with SMTP id ffacd0b85a97d-42ae5aebaf5mr2437383f8f.53.1762511409391; Fri, 07 Nov 2025 02:30:09 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:08 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:52 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-2-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcon0J86/ZOn2V7ZnaixLSQbUE+OOX0GyGHbN J0IncBZa6SJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KJwAKCRARpy6gFHHX ciIrEADVzOpNMnNgNcWPwGlAIVMHEpqCfHtBeXPJvQn07MHtxYl3U9LGnzv620nVLy60nQXmdAj pl3ZH62GP+XUvTaa+j/Z2gCKkYsYElWtU+zFXoq3HYslfFES+CnYlKKCUmQophJ5kf0OtQCt7fO 5abxCLdbNTLSvsEW8oVYqioJeULR4+HfOiPNUiahqO/7PrqApBkNAhtmqdbVH+Y/EeNbiYnOCf2 ZE6sCBDEzpxLPiYAwB0GUT6G6dzFKvCnBMKGLQ8w7g0Y2Ir6rZD+Un4BWa0CNrGKvNHwo5xO8bo nGfuSWFYUqibed/x5q6cbRcrqIv4AmIJq3gc7On4l7G7nPtxCppRhvhSChUmt0Gwl3nU7ag+EdT 9+tJ2dVjWe5HNxZ6uYIO5iCQkTDt3zHGuEI7sIwGGyMuQUb7feOaRdvBOk3Uzk12VujF7tf0KFh b+OPkxYIl6dR2V2vM6Iltg5uvz1odCEojGxY4X1ssONLOPT4Io72HgrU4Ic0feuQA8hwoch6sR/ FRi9jKn6EJVxMvcjNsmigzOuuZ657/JCBDLfzmcsTY+k/jtVm8lTErQTHQN+xZDKdPke/55kcro 7TpPf1P6vZKDWhTuWJQrIlPA/9Y2Tcn9d3fifuHIRnt/DqPTlrMScJeQkcUIZjtMw0xYQmGCR4I ViImRD8T6UC/KGg== 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 Tue Dec 16 21:23:26 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 5FB8431A04F for ; Fri, 7 Nov 2025 10:30:14 +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=1762511418; cv=none; b=lWQmb+YxRLGIRAmNre9E1e6Oq6C8XV16HJmxBbGmzFn3agj//OPZ++qTBPZAFWKE8+VRW6NdSNIrAMEOkOS1ylRpgJwJ/SoGZZnvYEkGCBytBILoQVGoWbgKWgDNhXKRaIUNePBYk6AwupCW7rCUYb2BEbiOV94KgebC0ZIhcFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511418; c=relaxed/simple; bh=yY8w0En7ifAOHnUc2TsFrwM8BU5vXAiE+eQSw5KxyCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UYeJTRW+jTCJmrivIAFJ4TcCTd9zsOKhaQAcMuX+CJP4X944dzoamkEpnqwJwPXkJkMFeUokYUCWtHPXPC7PelGwRKoblBQPYqmGMaFx1hMoAYZP0x62zcdx3zlkeXkAb8IXtGcQHZNAjIzKXdwQhB1Z672IgsJVIx3dF/e9diU= 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=Pvlim0wh; 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="Pvlim0wh" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3ee130237a8so358936f8f.0 for ; Fri, 07 Nov 2025 02:30:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511413; x=1763116213; 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=Pvlim0whzkUHtPAQ8tMk4qHNL1VvQ+laCzbUX6ubIi/KOENsmOal7/MqBZc1al7jlk 376ODofg40n8QH/ncfeWJz3hgP0E/ANhkhfuAaC8yB+1htX0HrTIA5LKJAeYoalU8Asg sjcCoUZQ4kMaBjyOg/hg0dig9kolfJdmbPkDr6tZK0KPtKxCvfhVvBoyLgEByVSw70+E lCFMWdZYqsBKqmi3ifFaojtObU4c+s09U7/amY7nkn5A1qDLpaig8yYeBNIlTuG7Tx9i R9bfUlwLFzd6QcBdrW8vf5pujxX3KQC/eC+LfURM26Gs1M4/bj/U0qaxQDIO7GpKL5da 8ceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511413; x=1763116213; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Y+bD9XMSY/PxNEVtej7SYELNOHLIlDJsCB53kL01eGk=; b=I4XPS4Fix0NSaJpbbhYc/WRE3guEuTc6znrpmvjxGgsNePl9COaocabYTsyE1YYh5H NQtWJssobja/iysTxNBkzl132LkNS8twXBq0r2Lcd/tl/DO/9q1P2cJyJbJa0YgXw03f LV4dQSKdPFkYS27++fsxCNBQpQVhPmD3eDXe4mjHK9P3RJKjXK5iMy3WVa/0JfbFa9hl fmQcLqFfUfONRxNYmz8fvSAF1kB3HDeqGI6mPG21Lcmvpc+1OxpPPOiyS+ZP16HGxM7W uGJ+JLcHxKoHoDmxHzAbOHKgOZgWNHvAWTU1sSM/bc8oWaWxSAw2mP+4HzkRXTD0xPVh uwtQ== X-Forwarded-Encrypted: i=1; AJvYcCVzBDsr9a5RoXhK+UEvYZXxMb1qRGJgT1vMCdHqDhRV0WzrxKh6a867mnlwkX/1ApPHcUyMQJ96wg1VxxA=@vger.kernel.org X-Gm-Message-State: AOJu0YycA2okoZq32SW1IQA2KfYSjabPmTQQlA0TaPbeKxLsZ1LdWtt6 /QYnVWY5PVIb38yku5GRVKRZzf6nVod8UUKRMwrne6MbLeQTwVbx6m8xV+KmYIliI1M= X-Gm-Gg: ASbGncsDqa7v238ZS4iegpOHDFhR7XCOI5MSJha/6gi0LBMqDKkMNuwGbwU2xOCernC KJKM//Mn5EeZIIGkFElk6FOChcFzTbBsbA5TJvEETUBsGRiJolH23FRCLpMF2IQTcCyDSmSRe2j 0FKnM/c297wkn3BwzMGK3HkWuHfsq694jjVxZp/MX1WNyuuIL13B8drXvypjHSgMyLjVKnT+kAU O7nUEmOkkpfmG1DJRi2oGM7RGJEu0aQgK/Yepj0IcEQzpN1MGTtNYeKpkY2U87lSLT+9Ps9l9OD tex4VaggT6e2Q5D9ChuKPgZVOt25AfR9uOr5im6rO9+PAClGKtzprgEsKkOXpeDigpNngA632qb nBtj4qyzE898rBp2UoszGbnMWzw0UH1U7hUMu9lSkfWaX6pfnlcI1apCEEbzzbxfxFYnUzgJaCe UnSbI= X-Google-Smtp-Source: AGHT+IERkMxY/OdgqWfaZ7AT7DwdB4UOki9h9A7muZP3Z616/ajyEOm8UxRI695/XTN9HnuI+cZyWg== X-Received: by 2002:a05:6000:2012:b0:427:8c85:a4ac with SMTP id ffacd0b85a97d-42aefb43605mr2064791f8f.47.1762511412542; Fri, 07 Nov 2025 02:30:12 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:11 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:53 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-3-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDconjyIV+fTbtiiEvLmwzz2XANDPioDzvoKtm cu4MX5qD8GJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KJwAKCRARpy6gFHHX chguD/48PDKdlDmcnZzg7JiW0mzCIguyJgTHeZLzPIFm5p89jeT2Xw9rJg2JOadHllTnAvDXe/U rvDQsGndzvsN+xzFpJ61PEzm5YAScMgZDW64C34/Cog5rNgiNs3vkk1gLmgscNeF3Cna5YA+RA5 BsXoQWCIq5UtEFkXesDvEfFmouRUOeTDINymGLKpCE65eO7kIWIQCZpYBDo6AnW06NlTq2DlOKQ Fdp3E4YMrkhab74JdTcn39x/INJvXk9K5y23XTeiGCMlvPmiqtmboUlQPDXdOIU3C8lUqWRkUTT 7xxipK88IcZ8YiSyegvj+0NLjo7dDc8AMkfyOkibQMiUh/K2t0tz7bIjKXZlNxdWPVJhkqswNyW R0evKvs6IKV+2Q71flHCD3rcRH0yK0gW7fA59gChceGBjLKGchAkERDHwwqrOpUqNy0WePVlsn8 rAUWS+/a13WqCZG7ZoL926vFHV/gx8tYhJhWbKsM+aXcbTkr7WgNPhL6O6LPGZg6LIPL3+052yp Eld9SE0yD3WZLc0ux9XwhoD9yRGy+e1dAMCzD8+Ghg/k5pxeRe7x5u5SfcOx2RTT0x4yr6yuL5d fGW0aKXSXdHWQw7ECZ/W67Bn6p5RJUhQVVzQNg5VS3/UwDyQK9uldBujAYSXuMLCQV77tfpiZfF FazfeeIRG8/+w/g== 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 Tue Dec 16 21:23:26 2025 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 B154730594F for ; Fri, 7 Nov 2025 10:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511422; cv=none; b=MyQvQQ8ODxWQVyk79u3OI+09wThPHdmtWJZNSzUbHY2KU8aqziEu3Gwn1H7RfhzKayCESPIHxLtSS99OjJc8clXrp3x+sheOJ8JBexwBfsiZ1bVvcUfGszRMpjc3g5vhMtR5HtZp5jXCWSyiWBYtxM3melElWMFg1qNXi7fshgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511422; c=relaxed/simple; bh=bf3B5kwYVwr169/W9UlPMIlu2CzILnodl9pD3IyD0h4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RLpHPv9/RnQRHPz1oH+x5Pa0By7bMaZ6yYr2YUCOL7EseeOzMbPNevOKZeeEjMSlPWOPlplEMdZkbkpBJzmW7sqV6K6SbDu1N89kgzSgR82ur5yx/7CNK+FoasDkeCM0v/YBXP585+UnrK2Zu6m8A72scH+7B34dnQvZvxFfpns= 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=QJ0e8sGB; arc=none smtp.client-ip=209.85.221.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="QJ0e8sGB" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-421851bcb25so285342f8f.2 for ; Fri, 07 Nov 2025 02:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511416; x=1763116216; 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=QJ0e8sGBpzCq8/7PYa5hWnasq1OpUSQq8q3h+GQVR8HBsVNFKTkcXbp1u9N0rrY1nz GfJc6DaVXFasnVij5U1nFFh2YOCx7f315wnEVGX9QjIig/VM6ZDhjkh5SLjnkT2DAd3p W0uxA7tp39jOEIpRjGmV/0cu7ocNV8OSuAfb+QijaD2c7h9pMnHRaORW/T3RNk/k8JgN PWwvXKtJLuhqgyrvXXZAzeiHseLJM90IXhwXUs3oFueNzlK7O5A1eh06hnRNYvGhLGUa onkdzjIYaFwq7MHtant+zyCNUgpMS3vXEY+mrcwV0FQ5xPy9HgqRFvbWkdfJIXj+Y5f/ YDyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511416; x=1763116216; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=6g7dsZ8u0SOZn4ZdglRbxzgGZbve11SxESJzoyiLLfA=; b=ESD3CNlmIWFsYmr2IEPFFlo0GWF0xzM837nwFtpMR/ottUULHG4ayA/qNSwgrZbuuf Lc0fbwAMNQ2TggFZnMWfS8+7+ho1N6p/mqlEPGspxe6Dr2/pZOFXAJ46zEMWs/LTpUNx iGfRXywwYj5FdHiA6fO5zBXc3Cr9QibU58v2QYd0AWQyVe4R3LJcpt8PCvk7kNJxR9gD FS7YDAanQUf2mGaGYCP6tbncyRV8BqPcSsaLZfJjRms0ZlebCrFa7fQx7pjl52Tv3ioa 2cytHvVAp3RiYfEfRh6Y1f9K+EajnaDvLQ9fHRYyC4SHpyVtsO15l9aJCKU82ONKB69x ypFw== X-Forwarded-Encrypted: i=1; AJvYcCU2fwMV3uTQTpkCcGhuXdBLsob2O3ZoEt0c7YOkpF3I84oyBdFqgSeidjSce0JJQDPnfbUnbuSDnKpoTX8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0oqfC3T7wHXP8Qpw9V8s9uBw3UEaSeSVjbjUAFlwxtoHCKED8 FUdQmN4oCPu6Od8uuPbUScagvbfPZABCmSs2Ua5e9qmNvKVqBsptsGe5p9SvWv3PZLE= X-Gm-Gg: ASbGncvJ+MGrYTnAWSLYt+w7/VLHks8bsHxOvaa0z8p2ZttAxH0UXgWA+JZXbzV26n0 lJW6E6HhMhyFT7TWZ1i97K8jg1EgmtO217d6Yb5mZdKbw9pa3juR7uuCIfe6BCdVPFfIVKIf0a4 wilqzj8SOXxYOYnHIKLPwfk4yG5Ri+1D4zD057OMzuhJdxAiC+s/WR2LQ4yKF3SD1xLnP0K+BQe ++7cgjtlRFcQBm6QUcg8BFcN9xff+g7G8FO5GQ6+ASj0wrRaGZ4MNYnPv9Q2Im6cl2Mrm7U8m2U cIgpUcw/5xK3dnIeFjscmDPxtXsnAxpc7fOfi7/Tobqt35o5XHLUHFmXorghVPM6zcwx0em5U+V ZyvkiMrcsQYRF/5+aq5xTFqk/lJ1UL2LphrGKcwBG1gg5vXxtjDq+vIbP5cwMDLi7SPL8 X-Google-Smtp-Source: AGHT+IGjWqT926NXSYOyJLRW80qfFEBsN3CZLG323CE3ZOxMO0Sltaq1d1IcpoU8pb1e3RtYjr7rzw== X-Received: by 2002:a5d:5d06:0:b0:429:b751:7916 with SMTP id ffacd0b85a97d-42ae5ae025dmr2131435f8f.45.1762511415568; Fri, 07 Nov 2025 02:30:15 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:14 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:54 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-4-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcool2zGWAFikwgtdjrvFAFi5YomqW8xImQ2T QXlmf8S3+2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KKAAKCRARpy6gFHHX cl2VEACqTpc4dL47ZWZ/SzyIHTYakk3glXirLn2ZL9SFZunoJCJoi6zwm+f+1+5VDZ6j9durf5v A9qeHYJm1gph+hLEmyn9e9tuPDqPfh1e4v/9Wu8jIY5XD/5yoVt9kwaQ0v91D3MYV9a0ErY6oU2 PYM1W8NkW5+lUs41TB6biM2HMQoa0VsHOa7lOdYt5nNUNhFiu0Qnu2/Z8t3GbLgSqqOCN3rFUel vC8iF8zUaiO8HgGEeuM+gRE7ZkLXWSg98xo+efB0A0VCEHCk3U3m6CGG/ayGpVlZtISZXa+l808 4C1h94xXu9ajAxFFRIKRsr2DemVtJMmpG8bQyTZKrxGy/otQ0jczkYY7fusKe/uMpiVvoJvLrAu opLOftH0kLcleHpiNL1mp5HU1qqcishRcrZrW/T+Ud8GqJ69lgED2cGP9QX9XSGNvsOx5HUOn/j 2q8/RwltyqNE4WAMZdZKV3FMANcxoA6GO01vGwR3O/RqRVwU90IX3/n6R45KrkLJA3TIKQwGDiF 8tVdjAAcgDPQf5MRhK5J8LxUi7VxtbFyXgp5XRdjkFcRUJRQELIFpAKefK55JACbcH48/pZNVUx tm5TTJUd/CyMRnyYEufOrm94X6z0/gh1HI+vszkSpwEWnZywOTfpkOFzWwtZSK0fz7f6qE5QTz7 OQIeaRCQnSdIlag== 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 Reviewed-by: Konrad Dybcio --- .../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 Tue Dec 16 21:23:26 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 D7A223090D2 for ; Fri, 7 Nov 2025 10:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511425; cv=none; b=jZNC7Rm3hQq2CeQ/s4gIQow7LBbsELF9lgX7kw8CMZYFTodOOvQkh7jHK7TJru9IrFyns5404c6lrUbwfXqV3WYacqDfYVtXjOufL4kQMVZiuQhYPQUE3n+eehFGVFQOCg5MSLzedOw4RSWZRlukHD+joa4KVCexD9DuAU0J23s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511425; c=relaxed/simple; bh=C6E2nfuOJyT6zEzejZLhVEYSKPR67hQomXuzQ9//N0I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BM5AZ25vX8ZGF4+Yvau21FL+1dgefKWo0OiHZbJz2n3BqHA3NacVA2uXp9PgQTNosiDDscsOz4+X6DUgYdTfpW9yu5WdKLTQaHx+ZmDFssVP76CBqLwuWi7UUK8tKPNvvsbyL0FFFY3XlIoVF7+dE02AeS/Mg1NMNYHCbV/ojyo= 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=r8IX/zLU; arc=none smtp.client-ip=209.85.128.48 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="r8IX/zLU" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4775638d819so3075235e9.1 for ; Fri, 07 Nov 2025 02:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511420; x=1763116220; 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=r8IX/zLU0rA5/PEaWR9R9f8AEBbtH0YE0CscYpqxYnvX6wqn/B8PCY1YwWgV4IedYV dgMJEX+OvWL6YNylKU/YB02iTsh/8Ncx8CiWZKY/2DXasHtDIq5n1U5EhO4GY3fcg7yi R/i+aPUAe8eJVHp+i0bwLjkU4vxhAGL3QkigXlsCyl3bzog2hJtCLmDZIwnnwaLaxCyD YL1TMKZlpm/vZhixZiaGGkrXp/i0NuUq7kOglWKUugGJ2XCALx39m0k6qM2g8cF/T3xc WOtwhyQ26V8NhS6CUYeSA3axdaWX/VBxTYS9TJDzHeggWnKYZc9pSiIe+3TyxzIprMmj uREA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511420; x=1763116220; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ohz6eJ3JY6PCTOt6pOm4PJLek87cyeexjL7soGZmZnQ=; b=HQU+TwaUO4lHVPAWNin/ZTEl9WiKm9ucErp5mIg/benHcV0PrzOLVbK3zKAxOGd7Vm 5Z4Kyn5qXktXU8MsfqumEwBloOgz+Qepylrh/GrFxVlO3QChQWuraW1sm27f4J4Uo7/k on6QTPPtveJcVIqNtGhHuTawMUg2d3gioZahBHV6Y1l0hBIW58ESGMimys/3hX68xgOe gvXKtyjem9WS7+az4fO07sjpnjZ0m+W635i3ZIcLrYXcVngh1oGKK+6jGkuLMOiuL1IY JuRygx14z3mvAv6tTbkUqyPDTWJqhBLS5K7BryBUw0CzhRrD0atitJOxIJkMNi0Mm1S1 fDgg== X-Forwarded-Encrypted: i=1; AJvYcCVKdjacUvhf+OT8dlOfEjhixq2tLeXHllruVnBtbdZQEr9sf1xQdEyviA+69z2c/HGBQiRoxhAfMusnkwo=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0K4jLUFyzGUAHOzpK0XZl3ioseNkwB4QyyipIDXdLxgp2ma4C EZST9+gCUaekpLGNaZc0VW6w+epRFCBNBylFRFSSFPXd/PPeXKSHQ5I5v9PCgOVBhgo= X-Gm-Gg: ASbGncsp89lo2dwCPlk37f7TDgDNhMd/zxtX5R6YNUVtZDoRYO3x7etOdwjSkTe5UQN 28scqXeqR4WX7Mn731u5SyXIYlRjSRxlfXWpXhd01peYeYrd6bHxE+6DN8/ftvS50kWS3DhtYdz meoQtTDuOdP8hr21fMw+//DOKtsRAx/pWXfoZWtyPxo6rPKyl25UIQgSqZ+sKLIvQF6jm4kGFb9 OXIGCDXeKhSd8tsE2yl8zKcymRAarXXPPF25EiryeFNHMiMK0pqYaBhVEY+Ubc3N2y3zxrY+uin RwzhfQfeNpycrQqPHFE2iOUiMd3yYa1sTZ/9GOXCdf5IycgmW53ERQSjmELItdQh/lNGvOFd7Qs 67/cV+ua4Q+fngwsa4qwmnwIBr6lQXIfM+RNNyxE4C6UaCLeF+yLO06LCTTlMx/HCamEA X-Google-Smtp-Source: AGHT+IFKea4oH8KFgwyHaSc2l6blpKP8GuUwPAJgJx/KeJrPkBTKpHrnLvxgE6v/f0QnXtYHee9P1g== X-Received: by 2002:a05:600c:4fd0:b0:477:641a:1402 with SMTP id 5b1f17b1804b1-4776bc8654cmr24454425e9.4.1762511419489; Fri, 07 Nov 2025 02:30:19 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:17 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:55 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-5-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcooKW8Y7IR9mSClISDLeDYYhK8iNiIaH/TPy fxuwujaev6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KKAAKCRARpy6gFHHX coQrD/4qTn+RVPw7hjcmgGU3/snDkcs3NDhDHvv/5Gw30fWDbq4JYVy7783sYOwPB85RJqY4S7e orJaF0tbCcwFjqBa5r8puEfO+0tE9C798uYzqB4byWlr6wBm4ZV6MDxHdHiFUueijk1GVKKDf6p g0vBL/7/QSHIP3uvzWFS0McUu8nUHMLyHlC4mDTBLNRh/CvqCrRhcCskFXvUwnq+mVRXz1wUxWz eDuRl3e2s3lfYQsM69iL9yBi0tU6BCfztIGXqBZZwjMcofQem0B48N8RmtBPROWrheeySK+WqZk OBM8gt2jphPBxF7VBTtiIk6NShAwzwpC4LOeJNfR7Iz4oMzbMZ1+sr+95ubeQz3fiF83h920czl MJwT3u6C5W6fr5f4J/BTXhnb2QIiyRdoOk2UI8S3GwfBO2JW8PjAMexz4jvF1bo1Y08k6rUB30B WQe+j+4ipBuswROPqGlXNHuAuYh0Ctt53cyQNyXmx2rv1Wz5rFkVXEI2ponYkRGvYXmUGdjCRCo EvX51dwNUgROqZCbihmyIjeymPgPQWSJnm27ZMUAE/b9wYySNcBPLTPheqUICJIZ4O+Gr8QFVWK TVRxJAFi0n4SyszGjUpLKWarMWT+htsRLk6A8LGgEbPjOumLm7HeK2SO6eVB8sCZ8rWG4snO4ZZ 6c8vSYyDBZkk7jg== 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 Tue Dec 16 21:23:26 2025 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 3EF16307499 for ; Fri, 7 Nov 2025 10:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511430; cv=none; b=VVCfwgJhHbBQX5J11Z1Lc4XWJEETrnYV7/TSPNCXjgvt9Cd1ZqHNOZ3CswYwub3hUwJeDzi0dZ0IoV1ekQtTDXt9pQJnsZ8Vtig7GnnW+tvnJj8R5ZqwNwsmoggIAMxBl80c53NBmkgINvNPxIxhe0nAP9e3a8Fd3M3s+ZKe2Wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511430; c=relaxed/simple; bh=RftDSrG8k9UKl5gPmTd6+qE6aIUSENSDbkOBTlUFJCs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sN8Ct+B4NiHJCdOyTXWmiasxuqjcGxu33puduoHbfiQnk0NLHw61epTew3WQ7p/GoD6Uu47DP/tbYCrs8E8O4PkB1vBuBF0Gik7EoJsZ72h5wiLi2sWmUIzv3ZfS0jquqXIrGDh8kyKAFG193GgI9Mf6ILdcBfEsbyqoD4wmw1g= 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=Sv2wfY4z; arc=none smtp.client-ip=209.85.221.45 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="Sv2wfY4z" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-429ce7e79f8so417690f8f.0 for ; Fri, 07 Nov 2025 02:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511423; x=1763116223; 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=Sv2wfY4zuVro84Dh+QyoPtRgpaC1hP8pw23l/vRoYw3ybfdPgQVz23lop5Wzrabrh7 aeGeZtL6kYIaNYwn/C1nnlqDtWfyK9t9+wPoiychoZoDeCEDIKOkAVQecPdFwiXXVnRq mV+xQ2JyhQ+4Wb1rlTzUgIbQsPN3QH1/sK6gR5zzjtET4WEEvK/Q4hg7nJQfD2dbcJOB DWjLQKDnCteML5cyHs5oO9qey0fT72DJtjsdoXSCDgOf9IB+waPagiXLgWdFfjT4PgnU e6wggkzDNidphFbYtxFZmxC+8YS+jL/vVyUSZMLqSPoNLrZ9UoZg8rSFpwhftWrOilIo j+Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511423; x=1763116223; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IW9Ne798a3XGNxpeP/XYKMinJIQLw0sjHAkXdXk9L6c=; b=OleJIIWIjIqe4z/Lj4pzoyaUwdPddEropkv4GHpGivkJvurkVQkgrAZG6CRF6yHHqf +d5ETjtbMmeetjXA52xA+tr46lywI6R//AKHTG4vMEpIwmVhysQZ4MXDx+1MvL5AL7E9 zKMY9P1vZmWYTFnrRjDSloOZXj8KY9pYunoGxFZePkbOlGBaL68mMfpD963ps0Iwm8bw ya8ojN9ySf4dR6pxF3Rn14ioSsyvzDYSAVcWNSJmrMZZ+PqHQBLCncRwemLvptcvChuC 8QnofZ9k+SXA/H2nskw9IF5dC6/arwzCDGtRR0XoxihB46J4wetqR68v0foU68r+O9bh 83Bg== X-Forwarded-Encrypted: i=1; AJvYcCXnEk9T7g/0mjsiVmvfKz5e3baatsJJWq3oHCOLxu/pLMOL1yWwjb2uRZNgRw9nS4gNUz+Gt5zQ/7foTG0=@vger.kernel.org X-Gm-Message-State: AOJu0YxyW0q95fcuGR0vwgX72M1rKFEK3Zhbs0Kut3fOv5MlBKw7jQTD Njf+ewXb7lK40iT69ovmz1Rx8yz0HJ4osagggZ1vfwS1RpS6+9s33eGoPzGU/YL+Qt8= X-Gm-Gg: ASbGncsJhhH/vx8mjz0XPH+UMoJTFNz2H1CyND3lJ0X415mq3GptNnNKLkZQPIfku4+ V+DOIZyS3Jz7/mK5rFtwuieFFvOzw87nGs3Ij6TNk8gvs2WUZ0w2LoIFyJ4ycEfNFfakWx4SzGk YDXCQ8Zdhjel3HHe6zbnp4Oxqu6XkZHO1V8udvLut7TrvhfRygaoCMBw/mNXYqAxmvhQ8MEWNog 5yB/ycWDcDpbw34Cs1kX27DE1Bs7C5bmCy23Ssr5LyBzb2P5nYEftDxnbAdjpzulvXLO+vxnAHu P0g/lg3cesmMvjYPxbHt+uC2F5bKQxGgNdSRoTSpkTA0K3BbjD1oqiiAzYdJEEIwcZO2HN8Fio9 vHjLGxc/MlZ8Au+FwqNUpgp23soNqGMdBKX9k4GuxIFWvTsS+C1heykGKw3k8VPUu9W0x X-Google-Smtp-Source: AGHT+IFpqCax/etL7YBonMLg2ghpNqRSdt4/QfKEmo1jIIOiobsAbC9IeCXpm6YbnXbm7t+dRlK3qQ== X-Received: by 2002:a05:6000:2281:b0:429:d0b8:3856 with SMTP id ffacd0b85a97d-42ae5ae9a85mr2017744f8f.51.1762511422545; Fri, 07 Nov 2025 02:30:22 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:21 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:56 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-6-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcooPdaWdkZYBpIqDN6krbrfnLAWwPEOzzFyR U1Tk5rFI3OJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KKAAKCRARpy6gFHHX ci1lD/4+AT7dU1HBmrr8PjQeodm6MvtLEav8Abl9riaivkbDRx15PVsGELihnHkbjdpg1MParOR b5KBKQ2oPDv6J/bHgN4t8VE4ajPD44Q4JRQRo4t8d8tQKhoqXcLB1/w2/CWKh+t8nl1U1wbg8b2 xT5YCI+0LsAmZiBv0rONgy5tcUPGjI5Ol5hSRnkDB6ayDtyuOHxoFyeu1qIbUBQ8KXeal6qnaSN A16vSNpYTiimlRmRi1PnCvzGiwsjMZhtQlKI0oHfvmHv0j5fuG5QZ2pXGOBRWcpXj7aMwEeZC8J 32lYUsK/Oe/n6ZACnmkb4Vd/wr4JkJmCZASlybIicztOmwJRlsWQFeEjRw46SQ9rwMI058nafVM RVVihMDiXfaZ7c+QJC4LArooLYL4rUON8trJWqttcHF1z5h8GUpf9vaHvLAnYxNzktDgPCRk6wB F8ia9vqeKgXzCPI1bwVkAK4ZoiNyVa4dj7fRhSXK5NEVMEDpjm/jz2sBNghesTlA8tygwv9RptM VVC3HfZU8u0JOHWbmxeV32AlfXZMZYW5XvatyZ7DvyPhSXkYpY98GrBYcBERLuoEsHgj0MQ89O+ yfWHtNssClSVg4Jhzj8jDDCu8cqLzl4xsOzKK/XhE0vD8O7Uk1koz0kKSjet1+BqJLlR+qnqvsI cIbKYkqiRTcRbIA== 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 Tue Dec 16 21:23:26 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 52A9531E0EA for ; Fri, 7 Nov 2025 10:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511431; cv=none; b=ml/N0ds9XyyFogesPfFtykGz43L7z4/SxpOfcCVzsOZhuxjlzMJc+8Hi22wS408wyQyDPsP2Mfta/uvoIrjixuoRPkg+I5wZ+htjmOWoTGB/BU8kBRNrpzX0xM3iwNADb5uT8B1u22Uxj4skAscVRMdaUDQCEu6pzu+80rW4H+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511431; c=relaxed/simple; bh=BTzIyLnQ2pVcjPzl4+AQTmQgi4C/R6FPWEbJ7GZ3dIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qUXVo12t0EuZoJv0fY10+A3IV2VwaEMrekhY2qwbvPch7eCika98XpB5g3mt+7MKonXnwrXFQt7pgb70bEM4x/qwiPlpI6/tP91uVFLT8BOZdI8iEYwXRIdGI5GskdGtB9bGANkLrDe0p7qXCK5fuqDFaV6zP69GYzRd+Z2nz+c= 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=hApn78O+; arc=none smtp.client-ip=209.85.128.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="hApn78O+" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-47112a73785so3562235e9.3 for ; Fri, 07 Nov 2025 02:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511426; x=1763116226; 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=hApn78O+cXcTB31x5Ha4XSlG8Nc268JYMhOoxokLg1eMV80/mWPTDs78F50z+kS7DS bGVjfvuPBI87DdhckB2X0TUPQBYjlwkBkLx9Ow+oqEEmBvSnCx9VO9Pa8n2ZH9cZATwK ZAd5UrUgwq8eS9naFy94aGvvfKVTAXsLP9vc7hX9Ua/Ugu6sHnjv/QSVmg7+sABu2mxf /zO6Ujb0GPB162/jgl8MGFsQK9QegRmOToO58VkQWsVHgHadivf5W4W6nP3AfTIucAf1 6KwrJPPao28Nf/a+iXxm44+6BGrSkelwsKwNIkjcm0tnvqSfgxn3X/Lxet3J2YRQXorq DqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511426; x=1763116226; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=A7G2ramQk2hxdGs1tmlSj6o/OfknwFPaFfxdjJIosVo=; b=NdaP8QlO0Jqe8TRIoV4zaK328N/99/viZeCz1sBM0ufwlJeykS1Wkgpj2UAsI6mXUi ZXAGumCFhAignpdTO+DQdTyo6vJWmj57Cw638mWsmysWGj9By/Rvk7BHvoC5lcgh12KA oZnAN4j1K3NdHox/jNtqwDEkzaEbPyH/JbPoG4JB3ibl1MGEmj2TnFyolLwmEAGaNCfj hlDwBLfrgubdz0He+S2FeXROjbbHWiLAePK90CM0oLWQ45EWsboOvD2a3mzTL6e4cO9N suGfP4W+SL14r9L/1S7IoqI2dWWxP+Y+A/QL1R+MOM01QFbbTqk9GeyAlkJjwS96D8/A De5g== X-Forwarded-Encrypted: i=1; AJvYcCWMCl5dXyoUnYKjshoNwiaPUpjNYaFExFhKZa1tqzKclAJfFdT6jEGUegebUKlJCjw2dvD8sgIay5VAC7g=@vger.kernel.org X-Gm-Message-State: AOJu0YzjPYGBjNRIQIIXrHN76rQyM/mh2DieY8Nwn5CN/1W5e8xBkBeP /1ZqHSZi/mTJWi5mYlpp6211KF390qpoktX/bOuJwOe7/SWRc3OLw7x4VmjoQU1xH3w= X-Gm-Gg: ASbGncslN3Ew03VghW8sGbJFWe7/2X6A8FsSmm7xlPi/7DhSp/tdwWRp56TcNFcUaSa qcGyA7ao6EVP5QK9MR8TkaiPumyHqu1B4c9fmSF7qikFDFqlqcWXaC4RMMKdQQzq9UUzMiyAJwL KiIjO4nmA+A+aVO2Hyxk8QMUZ6AK3v8Kzgn9L+I6c+xNz+avXfva3d08QkRewILLr8L3Vl0HXq3 8SmuXKxmDAiXjeDV8GXFEfheouXbeoeTyfh00YNBeMSlaUHJ+poXtqNWd1LkknpOGtlgMrB/Ujj +2TwwY1LsVDwHwaDdncbdb7SV+7DfCI1ALe24sTciOwzXP24U6HQvdQx4nKwobJ9Gx46JHDN8Bq OyHcsccv7Qj3NrlJxBgcdc3ZZV/nHutYK+UczPyPnGmUv/vcxEjOgwE+xa+SpSWyLzEq/TJjfKH GRZGw= X-Google-Smtp-Source: AGHT+IHIBx2tJqRLVHmEw90vFp0rp7ojXL3UXgjP5mQ5luFxcEaSq2ZhQysTlSzW77Ym94NwaGSiSA== X-Received: by 2002:a05:600c:4695:b0:476:d494:41d2 with SMTP id 5b1f17b1804b1-4776bd04cc9mr22964605e9.29.1762511425524; Fri, 07 Nov 2025 02:30:25 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:24 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:57 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-7-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcopMMZ8M5zQYmizMBW3totvKz7P+ctBnkiJX 04NgM1FS42JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KKQAKCRARpy6gFHHX ckX/EAC9NUTeuFc1Qq8u9nvzBzxll6MRRMehTj3Mt9pnQD7hqBrWvtqc1jkjY1i2hL6D8DqCTNM ADwHBwy0x5IGuvWAJgJBtkLFqjNVBn4RkdBeT+fgNbc065JK/E5gq7+k/5CFt5J/F+vtYIMdUn2 ACgjrXNcC1mGlubZtKqKfS7JYyF+ghRRLlL+Z6JFM77knoDS0e68XGH9wa9xSSur4rV1Z0dP0tL fugNnQ1QTejMfr7s8TEqIJUz4LUt9vj/mQK18PmZ/rCG5KRMU5elHEmQpzMMS5Hm4pJr/qghOW5 hLfCpdzX8hXSeBe4J1Tqbmaepw1sZH76HsiPITTMz4FMAfz1fMDewaqq7RTgZCv2owuCs19v5SO ekn0rEpj7GFrQARyyOJ4+BFtm1IM6NXNFoEOec6ol+AoYS3CgMjxn8f2bvBVp7/yoY+kT8yFc/b QPgf/DeZGqa+fiZNjmUE5h7gv50ss4MqfK4zDAjPeaMF24qClKLWvvrH45j7PiNQFpa4BTG6D69 r39IcYnucrELGDsODIPAKsBCAxWjQvw4XF7hlU7iYYvhCdUyyJPGAA5B+oKdpKV/zsULdmpSTQY gCuDCRrYfZkwiknvEqG20ltxDvZ66jVSUECOq7C2J0RA5MQwN1aNdvRTV4zOUcQkj0BojlaFihE yL6mFKj/t21Xc+w== 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 Tue Dec 16 21:23:26 2025 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 8C7C0320CB8 for ; Fri, 7 Nov 2025 10:30:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511436; cv=none; b=XW6RVEtegvscTsx4fStu4grtZmTPlJKxW1CJSIdtmq4wFKlcootiWwCYeEFEg7tiBciozjq9wY6dCkwz7Rd1rMfmaFPuWg3eNJKAVK6MBHYmuWZPNHE2e+Ew6yejk//ymzPqPxCklrZifxLBChb6DyN3l2WO+uP/4D3eZVaPeKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762511436; 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=WsgfwxNOLGett/4d8TZkPoGvszOIE2zKiYMOCdaMxc/W4BK6HVFdkaLMdmmvvegIf02QmEiFBVk8Co4lrmBvyEPhHMe+kNE3Fwz6M7+mX8gZHha4VLTktakmZbRiDGJTjzALiygFmYGCk35FiWIsNuCqHSdXJTA61K6240w33hc= 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=ry1ssCz7; arc=none smtp.client-ip=209.85.221.48 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="ry1ssCz7" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-429c8632fcbso385532f8f.1 for ; Fri, 07 Nov 2025 02:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1762511429; x=1763116229; 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=ry1ssCz773s8Z4U0wvtZwFRLc6/BMMziY2JGApBF4emYmiGnWT9XrfRUMqj5R+6IoR 1JSlzzLqtQtyuUxdQuZVj8dimj/mJTjAsG8iEZPZP6kZOrSdOxKw8er5kKbym6UQ2qRz cB3ULAcuVbG0X9fXGHlQW6mPyF6XP0UVVsBbZXJj/H72IzXehWC3jofDknqYatSNRRzt LBU17Mp/ohKoa8hVqc4GOxpIzkwiUrdmOUtJ55zBJSgJkBbyGu8qxyoK/ltQoAGVZbHf qbbhXeRuIgb+2iJu7+gYxU+Q4SsDBl+0g59IbobwgRWbC8cXLbdtt68FxX2tcN36G9sq dKkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762511429; x=1763116229; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=RYc8z4PcZ9T49QURApQLtXvrbC8JQdZPwHKl+MXpn3g=; b=lVcWmv/Elhv94okY447ZDMBxi5lwhNRd/wkn8MDthpv3qM0Xo86d5RvVCCuzdmjvAy auVR1vIinoONRQ6ziQ7WLSBQDqhIAddM5W9UNLvVJjaoDnmtWCHh76mD7QftOzo5UTOW bdEPHpM93O7xI4QHiEOGPKtLphq1D2//98Cj1rZ8a6VfnI6pf7ektKHI/34UPnKrH8C5 t27gibTgOK4GFLlM2SOKJtdl/Xs8eUqJBYfObcoGLqrVeatFoNQSSnWl3hNA5e7dpOkH VycJyyHVBWhk9J6E1V6f4dl6dEy8RlkLKOhzfnCZDhCSkwJX0Pwz7OGO5AUWzASTbnDa Dcew== X-Forwarded-Encrypted: i=1; AJvYcCUZ7XQ3+D9F18v4aSHVEG8naEnZTuYMX2GCDLraVTgBulRlFUUyzpImP+M0g0+FgyxoxZNOdY5072CLUE8=@vger.kernel.org X-Gm-Message-State: AOJu0YyeUD6E/gZZhkwm5cqsK/Q0RtfV7tLioRBRdOSqHQOO0JqO+o0P 3RenZ9ILAMy8WqnBiqrSyz8p6UE1X3Xeroc+D9VtYHdfU63Z1d1tzMvGGSkjIG/RwnU= X-Gm-Gg: ASbGncvcZ9lYn0FE9sRXzSxvtV96glfvhZXc/LH8R8ajgF0O+vUBRyMRl4DL3TPeHxB d2W8nvKo8NZwWfaHp49pBAWnRjPZNQMsSl6sYqlOJkSCdijBF2vahRBI0k+1tvq6we0uAjTNBnO zom00tCYjvKDrhkSu8VHZ9hbwj/WH1Bn6jQroiB8UzMngQU84JHisJQGWEexVYLvMQQrKVg3P/Q y+fjZsnSSA0vDkjTpc11NImX8s8/TqwPxl0/WqgtAF/wkkXTD0JJWOrdfhqOLWLYgD3OriGFzBk E5HJqU4uDWlwmAnTgIqWgdkSz9KpNDyY0ysp28X89Xsp7A57EjnI0cKX7a9MgBhFqIXpyjecoje 74ZAsMiUDRiw0sx8TO6N39NTEi+nr/f3MZfEU7BStdlismLR8tG7RdwG6kTZhTrbqgaytqodC5J 5v36M= X-Google-Smtp-Source: AGHT+IGHCdQ9ajnapOScJWZI+KsV/LX03TDZWK0O4DLpH0QpQ4fGpY024AasxrZPhFPuAZR31n7vFQ== X-Received: by 2002:a05:6000:4186:b0:429:ce0c:e661 with SMTP id ffacd0b85a97d-42aefb487b9mr1867191f8f.54.1762511428533; Fri, 07 Nov 2025 02:30:28 -0800 (PST) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:fb6d:2ee:af61:f551]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac67920fcsm4414864f8f.39.2025.11.07.02.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:30:27 -0800 (PST) From: Bartosz Golaszewski Date: Fri, 07 Nov 2025 11:29:58 +0100 Subject: [PATCH v5 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: <20251107-qcom-sa8255p-emac-v5-8-01d3e3aaf388@linaro.org> References: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@linaro.org> In-Reply-To: <20251107-qcom-sa8255p-emac-v5-0-01d3e3aaf388@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/ZANAwAKARGnLqAUcddyAcsmYgBpDcop7+3hvenxQNRjRvOmmTd+iqFzdV6nL4Oub NDvJyoOv76JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaQ3KKQAKCRARpy6gFHHX ckwWD/0TXAVqi9cGf/WOk/BynMq44/rEgm1KTtiNNIRCwnrtS8SZuLgo0yTdkjaZw5ggF+3old4 kqrCiTZbUzMqDKjaJohXVHo7GQr1RtJq94Oz41XCKDWpl8sGDHWHDyj1yia/PlG8k8x+2cwxX2i WHqX2YYlcoiau9cqXzsRCDODADlcP8rG0OgAwpzymdUUK43VIWsUjuJna3pYWnRUvDz/QS75ZwR Otw3IL/6ogvgoIHAQ3GhNOgtA2D9W7L4oTRBw6LhUb7FvH0ZWK18YETU9npttujGMAY/s5LGkxf JhoxusvgXg0E15V1AUOGDEqYEKWDtBvNWVNId9ZIdLI0E+gyDiPyg9LAiu2uBjL8pMF3yWUj7VQ sNYctNoqv2sMkYzPAnQzJwb34HZgQcQkuGIEgVGA0ZHoPJo+PuNl0lJXNPTMjn0xfjZl1pMjwOW s5tR2wpOIevc3AX6VWA9fx4lpqXNRqE1qXm2qtV3rQc8T214o9f3yRUV0LUwpCczn8KvoUSn+3z YZCVyOxQgRKt97wpfFeiR/KEdTx1OYrVtZomoqSLE1Abh+muMj6TocN6iejJgz1lT4ol9ZqYPpo mE7c/m5suZYi40YO+NhugpJSOixK5NuP+eSLVDgdv3nlKefNRxKX0jwEHmp+runydMD/40g0BE+ sVd2POP+HK9E3uQ== 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