From patchwork Mon Mar 16 12:05:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 170 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A32763932C3 for ; Mon, 16 Mar 2026 12:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662743; cv=none; b=MRACBlSaVbk4NcyQi38/d6mRmq+0GmtBm7pjgRj1cUf22aGACBz/FDWJO/DDw++N1NKLcMRuxV+7IatxWaPSwXyAl+2mp+aV4hq292LBtsskCnTTl/khv9WYKlb5luhUicg7D0tJshnMMux0d06IzD8B6xy18k4t7HwG3u2hO6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662743; c=relaxed/simple; bh=QeQzSpM/ALvtNOVC5ECrItYYMnyNz4rmHTX+lHP7r8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DFaM/8GlyDNXUgabmML6fKXhm2xkf7ROgWcmZigdmFb7Cg0rYfkFGbIUCWPSMigO4AAVrhML93+ethqxMj14j7Byjlu/veUA4SawJHeVoupnnVqlVjQoZUGDs29Z2DXoW2uJzCOqX6WUoccgAlWB17VuV3Ue5bIs1oQR7SV2tQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XPIewUjI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ShU77t2V; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XPIewUjI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ShU77t2V" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GBkcce323597 for ; Mon, 16 Mar 2026 12:05:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= r84jAi+Jc/xYWc2ZNl4ydeJweo09sodAD7hZ5L4nPBQ=; b=XPIewUjIRN52qXZK U+O6HXU6EKbjuzimQpyIyJP1nztfQo2FVB7q9Bt40Hd5SRtN9oc8sOzXu5z1NZgW +kwnNgMgWJGpcQOdgT9hdQI64+L6OEBLuWKFwG+VyK+gqK8CcIUPOApXaEj5Wpsr geZZyNhbgt5tF4f4LyXGubsCPPjq44kI/zp2I48NlhIFde1GP09oX9hzPXysb5z3 m/buxr3GyVvlm/OkBsDAbBo5sJTBwpTxQ6MIBJ2F+ZKskMh0Y7lqdg7WEewfD5zt G3FUOc5f7WmRbePY6HOfg+6Jk5JNlwN7HVLgpVdqKeXHOnNAy9iM83B+l4d0u4yz RzOPDw== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cw03qns0c-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:39 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-56b8ee02d06so4404520e0c.3 for ; Mon, 16 Mar 2026 05:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662738; x=1774267538; darn=lists.linux.dev; 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=r84jAi+Jc/xYWc2ZNl4ydeJweo09sodAD7hZ5L4nPBQ=; b=ShU77t2VQu9XULgnUPtF15hfx75ogdzxwisZNfhCwDDEVd0UE8QjVGz9x/7CROeKfw R46SCXoslvQUF8/vKQ+vHe/UHMblg/LF2+LC4bT4CKQO6ung9XN4gv8P4JGhdbMo3YTN 9I17pfanNHMYgJxtZ2WNoYF4IT1fKZetuMAaehBWNBj6wcICrizIzYNIqrpON+thOm1o KKPtWDYOPlmPlEHHaIWY5yPKrLkUGhs7OHRGpfG+Lv9jRhp4hUCVuyIpdbgoj3WojoR3 0X+7qJCl9+4pqqKyXqp0u0rfOB8feXFEnsH1fr/ZXmgOsrF27x6oaXYAqZK/vjyolGF6 rEMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662738; x=1774267538; 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=r84jAi+Jc/xYWc2ZNl4ydeJweo09sodAD7hZ5L4nPBQ=; b=tGHt1GGxWFcQKNA4tHuaBU7/PKa5qmCyI4AvofAMlaN3vvTl1W+A2r1Nf87NkRkW7M 4KeYlw6pDYuRHVtL40R9Rhp2NmieY76oOMuk4YdtcgqsJnTXmPV7Cqp/z+UfS8AmWv0l 3Ddd01NQCC3rMSfc4KwyqEsHioEVAyiPHm7s3JUyynu3JkKb5FFun2j9f6orkYKDfE5E QrKeadwQqNrwY9qga9a9W35c3Q9ha2dJnnLbLHcHx4DNcPQKZ6NOKjl2GDsh3Q55OPs5 nEDhgA+c9vnrBwEN2roUf0nilYj3rddpVzkmxBIi1Ms6FuhLDNHsOaRdOR/LT2zvL3xM HJfQ== X-Forwarded-Encrypted: i=1; AJvYcCUiUJHhY7EN4vG61qMRI78ML+Qy3+TXmgOBN8ciWpw4KUw0735lwVPkqHRuqvmxHwG9DzM=@lists.linux.dev X-Gm-Message-State: AOJu0YyBxbi44+VEKhut+6O2GmsGUKnSwzPHgt1yW7YH7PoaTERcj7sw s0T+8tAhr0iiD3StSEv6CaY5NfHcz13SHih0GXJCXvkDJedcftC7Om2/MGYst27J7eOUlMuPQSP Wd2E23lq6ST/jiePcgnBK5g/GvK9M4fUMhuo6eItLC+SfusdbqcZ/Uk0= X-Gm-Gg: ATEYQzwvDjSA8tgve6FMn9EkJXAukJwLROBQ6uc/gRpF39d3bbPAq0XdXuOteu82Qo2 Gb/fhI6MuH8pl9h5yk2IGeyf6Jr8ByPO2AarjyC2wNDmPd9b51oW9WYy+dBOjGNF0F4pAWXKpk+ VyfH54timjcFYht7srT3c3th1lE9w2vd9sJyPQchS4DRtuYoXZ2sZdza6Zn7k04NEDGD/gksoWu Mlbqqs4JX5ecrOZARmncYRhbVF8qgVF4tsrioK0tYdJBZy45CFtCbvuWpcSLm39Rz6cLr31RVv0 y/nplXoSJi1ndYdu6ThILx9Qf5ZH/+1U8PJBZ4d1yp2uSoZuzV0xxvuc/fD87DXo+fMlvNM3wWN iYvjh4Vu80MrmpqdUhR64QSiXp8cAhz+t74AD/R8wjQVyx6uCTqo= X-Received: by 2002:a05:6102:512c:b0:5ff:bd9d:b1f2 with SMTP id ada2fe7eead31-6020e20921dmr5996368137.3.1773662737716; Mon, 16 Mar 2026 05:05:37 -0700 (PDT) X-Received: by 2002:a05:6102:512c:b0:5ff:bd9d:b1f2 with SMTP id ada2fe7eead31-6020e20921dmr5996353137.3.1773662737135; Mon, 16 Mar 2026 05:05:37 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:36 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:06 +0100 Subject: [PATCH net-next v9 1/6] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-1-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski , Martin Blumenstingl , Krzysztof Kozlowski , Lad Prabhakar X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=18077; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=8Zt9EsEBECwbIfMS/ovWp3RUBY3x90LFTDDCSqbuoXg=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IEetOdj+wAUVqAn9uMCcPfwZzmmP/WOMvM8 O7WJY/eLRSJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyBAAKCRAFnS7L/zaE w9BtD/4yTpWsuX2XyAqRtDF6pJ/CjGZ9Pd7zgkhvnX1EL6VOf4VLUMUd6PaMVJZkHxHQ22FvhFa NcOhmezIHuvYXTSNmm6waibwqwMc8BFpBcssG/97zjqXFaPTMhuKyDl0DzsZt0TIDYcN1xfk/CH VKTmB1VwL3txgoe7o7zyPVBoNqkmnp4+OthaloYq4AqEPcJs3/6LXHc3Cao3wKjgxJMSGQ1e4BM GHdk7X1GyP4yZXHQhDg7X2NamVyMzgF4vd9jGg/wjKOF7MhMI80qyE/qhzB7D03gtlxNN3n4OFK L+ryXlIBgyMuZMTaiAha32KH7i6aM+8YhAeNXNbaIkyhElNvaoqxxsw/W4VnWmf0wJTU5KMCSag Zd3BO8T06BtQluUHKU7LcyOIK37ejgafT/8gND6u9DsIvQ6/JeKdo/1/S2dLDaiE5W4CjLmTb8T QVxKraoTAXGIUE9pwLdzMNGnJ7zN3HWc4eFaPXIfBR9q5f7gwrjaD2rLIH8x7lsL/x/SPO8/1wu y9BzQQMHxF/CWup7u+E3tFnz4+6XHaXduZGLbB3Cpm7mjBeWMW9AWqJyEzL5GstoVvZ44QtD1TK LKazS2LhxFzhzx7B0Z3hpeN7bOMBpDE/O5jnxSbUHWHF3gtoKzTTh2CID9iDKIRPsJgRqskrmVH bQGiBDjZT7yvoHQ== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: 6Q42TsM9QOBhK1-6fqV7vWK1LS8EFYws X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfX56s3SKI+EJck 55Cm/wbLmz/ZSCaO3pKOBcmDX/+CLQPcnwcv1FrSQ0QPXviML4b5y3hMYLY0fggtYAG45K/N7sR dmA1JtAAKGVjjesLhYRe7uveVZsUoNSK7TYGvhl5YZuNBLbjFDaZ5V4BzKmk2Yje3PIppmhfLDD Mn5ncvrAJQgalGgdBYFqyDh8tqBqX9xlWWNqs6QCWin6kKE7BCv5lMy0meeJ06E+8mlVsK3BIO+ wl2KnWhKfwHepHfOqO6YYZ4TWAfNtMZJlCwi6n7e8zZkogo/N8jIXYvnSLDOnKTSf1eZshV+m1X t8QYhkMvOw2cbz3MGLTeuJvG7D7vB5TqCz1V9h0plr7oMvzc6hgSpePaPp0gMhmnTvMo2sC0flW vVYGWxm7270vnLL1KGHAos39u+LJEi+dSNACrbdGqUrDudF9SV76bHx+icQBdibOhd+iKHglgbm BaeUq3xDtmBKOXcJPbg== X-Proofpoint-ORIG-GUID: 6Q42TsM9QOBhK1-6fqV7vWK1LS8EFYws X-Authority-Analysis: v=2.4 cv=ZbQQ98VA c=1 sm=1 tr=0 ts=69b7f213 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=gEfo2CItAAAA:8 a=KKAkSRfTAAAA:8 a=mK_AVkanAAAA:8 a=EUspDBNiAAAA:8 a=yC-0_ovQAAAA:8 a=VwQbUJbxAAAA:8 a=aDaa4yMnCzVJehp5dXUA:9 a=QEXdDO2ut3YA:10 a=vmgOmaN-Xu0dpDh8OwbV:22 a=sptkURWiP4Gy88Gu7hUp:22 a=cvBusfyB2V15izCimMoJ:22 a=3gWm3jAn84ENXaBijsEo:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 Reviewed-by: Martin Blumenstingl Reviewed-by: Krzysztof Kozlowski Reviewed-by: Lad Prabhakar 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..b12632545673b2ad0148a677f45a7447309a43cd 100644 --- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml +++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml @@ -40,6 +40,9 @@ properties: description: PHY regulator + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml index fc445ad5a1f1ac490e921696d6f7ca83d15de459..448e617cddc4cda8dbc77e83324495ffd5dfb9be 100644 --- a/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml +++ b/Documentation/devicetree/bindings/net/altr,socfpga-stmmac.yaml @@ -140,6 +140,9 @@ properties: - description: offset of the control register - description: shift within the control register + power-domains: + maxItems: 1 + patternProperties: "^mdio[0-9]$": type: object diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml index 5c91716d1f21e617543b03c5a90b993f8aee053c..9c9cc3ef384da0270489c21b3426572ea46d9499 100644 --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml @@ -158,6 +158,9 @@ properties: interrupt-names: const: macirq + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml index 91e8cd1db67b8e14961497a7254e6b01dc4e582a..c1b67cfa76d070d5e8349d5e92ce6bc4bf2ab67c 100644 --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml @@ -83,6 +83,9 @@ properties: register - description: Offset of register controlling TX/RX clock delay + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml index 62c1da36a2b5a29290e5e01be87c48158c4adf89..e41851931b947559c89b0cd6f4756f71046f9594 100644 --- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml +++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml @@ -47,6 +47,9 @@ properties: interrupt-names: const: macirq + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml index c4f3224bad387b87a5b4a3049dabd75f2c4bd42f..c9a131b8d8304c41559a416b324df749c0a87d14 100644 --- a/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml +++ b/Documentation/devicetree/bindings/net/loongson,ls1b-gmac.yaml @@ -66,6 +66,9 @@ properties: - mii - rgmii-id + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml index 99001b940b8361f69bb917617f857ee99f4b3fa5..49db18423dd807683b9bb297978f5da8ea6cee3d 100644 --- a/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml +++ b/Documentation/devicetree/bindings/net/loongson,ls1c-emac.yaml @@ -65,6 +65,9 @@ properties: - mii - rmii + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml index e5db346beca9649be4f97727b78fda8973095912..b240c76e7dd5254d0c3752610c4aa848a3c3d65b 100644 --- a/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml +++ b/Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml @@ -83,6 +83,9 @@ properties: description: To select RMII reference clock from external. + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml index 05acd9bc7616356e68090ebdd4df20e42f70dd7e..f61188ab0dbe3c0cec5b10f7a65dfaff4dc3898f 100644 --- a/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/nxp,lpc1850-dwmac.yaml @@ -51,6 +51,9 @@ properties: items: - const: stmmaceth + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml index 1b2934f3c87ca21ec67369fc34b3234cc3d9d60c..aa8772e77385ff265510a5d53b5c9e7e9ced086a 100644 --- a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml @@ -64,6 +64,9 @@ properties: - const: rx - const: ptp_ref + power-domains: + maxItems: 1 + required: - clocks - clock-names diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml index 423959cb928d945aa3e758a3c803d12bd61ec42b..ef520f8105773e22c0536ff419dad55fe316e1bd 100644 --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml @@ -86,6 +86,9 @@ properties: phy-names: const: serdes + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml new file mode 100644 index 0000000000000000000000000000000000000000..72bb764c0ca046e0df4bbffe6c323850f5231787 --- /dev/null +++ b/Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml @@ -0,0 +1,98 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/qcom,sa8255p-ethqos.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Ethernet ETHQOS device (firmware managed) + +maintainers: + - Bjorn Andersson + - 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 triggered + + interrupt-names: + items: + - const: macirq + - const: sfty + + power-domains: + minItems: 3 + maxItems: 3 + + power-domain-names: + items: + - const: core + - const: mdio + - const: serdes + + iommus: + maxItems: 1 + + dma-coherent: true + +required: + - compatible + - reg-names + - power-domains + - power-domain-names + +unevaluatedProperties: false + +examples: + - | + #include + + ethernet: ethernet@7a80000 { + compatible = "qcom,sa8255p-ethqos"; + reg = <0x23040000 0x10000>, + <0x23056000 0x100>; + reg-names = "stmmaceth", "rgmii"; + + iommus = <&apps_smmu 0x120 0x7>; + + interrupts = , + ; + interrupt-names = "macirq", "sfty"; + + dma-coherent; + + snps,tso; + snps,pbl = <32>; + rx-fifo-depth = <16384>; + tx-fifo-depth = <16384>; + + phy-handle = <ðernet_phy>; + phy-mode = "2500base-x"; + + snps,mtl-rx-config = <&mtl_rx_setup1>; + snps,mtl-tx-config = <&mtl_tx_setup1>; + + power-domains = <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>; + power-domain-names = "core", "mdio", "serdes"; + }; diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml index 16dd7a2631abf6fb7dc8e0c90755ab1e81915b38..ed0d10a19ca4c47c05f6873c64b0537b90acd15a 100644 --- a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml +++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml @@ -44,6 +44,9 @@ properties: phandle pointing to a PCS sub-node compatible with renesas,rzn1-miic.yaml# + power-domains: + maxItems: 1 + required: - compatible diff --git a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml index 2125b5ddf73dadd8b0d372e83a6b5c4624f5e648..8338834f49cd21df6c697a1f52a8b195c0208c23 100644 --- a/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml +++ b/Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml @@ -154,6 +154,9 @@ properties: Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml# (Refer RZ/T2H portion in the DT-binding file) + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml index 80c252845349c4533deff85b052157984d0e2f23..3ec3f6dc2a125908ba98f20b1120311de8967954 100644 --- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml @@ -123,6 +123,9 @@ properties: phy-supply: description: PHY regulator + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 38bc34dc4f09b75f8f78ffa383f7e5ae6be9fb72..9d48ff4623895d93d63e710c6cc1c4c88671bb16 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 @@ -183,7 +184,8 @@ properties: - const: ahb power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 mac-mode: $ref: ethernet-controller.yaml#/properties/phy-connection-type @@ -646,6 +648,7 @@ allOf: - ingenic,x1830-mac - ingenic,x2000-mac - qcom,qcs404-ethqos + - qcom,sa8255p-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos diff --git a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml index b89456f0ef830991135bd17626da98661429596c..e78cbf594c695204040a53ab1e367daa9e12246b 100644 --- a/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/sophgo,cv1800b-dwmac.yaml @@ -49,6 +49,9 @@ properties: reset-names: const: stmmaceth + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml index e8d3814db0e94fdcd0f3ab2a9fa8bab972a97ab5..845e2c67d20037496bb1eec6eb73c99cde74e944 100644 --- a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml @@ -52,6 +52,9 @@ properties: interrupt-names: maxItems: 1 + power-domains: + maxItems: 1 + resets: maxItems: 1 diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml index 313a15331661208a1fa64386739d87a4f11b7e20..8a68c6d7b5c6d6629a780d002299d767088def77 100644 --- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml @@ -71,6 +71,9 @@ properties: The argument one is the offset of phy mode selection, the argument two is the shift of phy mode selection. + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml index 987254900d0da7aab81237f20b1540ad8a17bd21..29b878079ff0c1a0ef95fc63f2035f478ee039b2 100644 --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml @@ -121,6 +121,9 @@ properties: minItems: 1 maxItems: 2 + power-domains: + maxItems: 1 + required: - compatible - clocks diff --git a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml index dd7481bb16e59982c26c1a54ae82b8cff85fdfe0..ad635529d676ed6b752ab3bde5152d5cbddcb519 100644 --- a/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml +++ b/Documentation/devicetree/bindings/net/tesla,fsd-ethqos.yaml @@ -67,6 +67,9 @@ properties: - rgmii-rxid - rgmii-txid + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml index b3492a9aa4effa73fadf92a63a76ba8bb65a8769..c859f8bb5d582af8b8782f2f89ab5e6ee3d7a46c 100644 --- a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml +++ b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml @@ -78,6 +78,9 @@ properties: items: - const: macirq + power-domains: + maxItems: 1 + required: - clocks - clock-names diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml index f0f32e18fc8550e6f63b87b60a095972453836c9..efa39eab0256a1102b01872bd848749788c9b4e8 100644 --- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml @@ -48,6 +48,9 @@ properties: interrupt-names: const: macirq + power-domains: + maxItems: 1 + required: - compatible - reg diff --git a/MAINTAINERS b/MAINTAINERS index 4efaa76a0e6da830438661d2e5eb5095e4eb5020..9269975a7c76a23a9ac9a1106dbb357d8c75c3c4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21760,6 +21760,7 @@ L: netdev@vger.kernel.org L: linux-arm-msm@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml +F: Documentation/devicetree/bindings/net/qcom,sa8255p-ethqos.yaml F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c QUALCOMM FASTRPC DRIVER From patchwork Mon Mar 16 12:05:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 168 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EAC339448D for ; Mon, 16 Mar 2026 12:05:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662745; cv=none; b=Gt/7a9SpGl2xf5IWeT6Ge3dnZZjc7ZENQv+hmLAMlqsjvO4Ar8xE2OfhCa5wlVKueluoW9ld6qYCLNmCEPR+ixsWoMmFSTu96Syium3+mAWXXz6/d4qJzu5BJXmne8u3ZOuqiFLvutZhM3wT+SUeB1+4MbFj4aP86JP6wr/eQcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662745; c=relaxed/simple; bh=fytWPLtdtjzkuEYgxEMp+BkUR1djTquvDROUJYOj9Wc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i92i0Z1PDeZ3NRPwlmbKLwlZnjgw1H8AwamL63ipZQX/XNZQbUIYqlHsN/I+Qublt2vGPRftY1CabgR3FhcpmYFsNEGKN8ZE8/GENIsqz0LgXvu5zlmBvlx+kIV2bTNFs6W2QTHK5oXvdIkrPu+jBbo8QOoejTg/OY/cZOUcs4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=H4wv/95r; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=L2+P4qKk; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="H4wv/95r"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="L2+P4qKk" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GBnZ9O3777662 for ; Mon, 16 Mar 2026 12:05:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= MQeKaS1EcNd0vqbL+A1AzKnmVR3EcoRi15Y0S03BedU=; b=H4wv/95rrUsxz06z XjZDabTjstrwrld8qqGBx7o9FhrFh9lLj64r9yIhp7SulFg0ah0OVK2lNdJo5BJb 3VNvJyiwQrdfrrcduR3enqHHG5yyMJJ8UiBZQc/k+NoPVFQqkRlazRQgWfG4bhkI OrremG8TeJvjQdPx0MSGJerW1cljot/cuo8C9jKfG4IKtkHPNv+yLIgjvKlKD3+x K1ekrm1WWPsob2i8QxZn2cv4dbLG1kb/dn0PNgwqgymSuwp70bJimSH81kuMNCqd x3liWepGHSUprMSU4EFkhdow/DIh1HN2h8miO/oB9c+pztNVBKDEvrhRkTGv7rxH x3leDg== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cw0y7wf03-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:41 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50911c94db1so280116711cf.0 for ; Mon, 16 Mar 2026 05:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662741; x=1774267541; darn=lists.linux.dev; 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=MQeKaS1EcNd0vqbL+A1AzKnmVR3EcoRi15Y0S03BedU=; b=L2+P4qKk1hL3AVyoIyy3IOMBvNYkFhh3v+Qp3vHQn4w3DTkKx0/nCoCVNdVAWeRGC6 /qhOgdukDlIua6W0ZPS3H0AKNvahIuxrNnN6dhjAteHUr7MGAEKiYcM9UkKdxgJXlrb2 DI+OYv6SHZ7gCx2ywIM/dR9ilkmWtuIUkymys+Z48BGJhbhBiI8O+W5ZJ8u0/MfyEGHQ 6iw6iQkSIl3umT3ROZ1qSsqSyGnizfpwm3xgXpKmL/pddimqQxaSZZNPAVAZjnoHILDm /iOklPv+1zJHVwfhSa94RdpfcvUpj1OAAt+3l7p+QLmWlZ6Rwh1e6RxMON+23UnIwJvz nCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662741; x=1774267541; 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=MQeKaS1EcNd0vqbL+A1AzKnmVR3EcoRi15Y0S03BedU=; b=DE76KHy2+ZoiKkETTPW94TEbcWM86jtQ/AvTJT/sMziStfCI7NEvPBGq9HifUuhEYg IsbJvyqGbdknmn0zFqLkrkNWLE60JRggrKpAVKCoUvJrPDDj1hM/oJBitddAOhcNudRT 2E6i7K3XCrrUupbVbsYJA1Onrm2itxN3IxhjyUECKE6wuNzoivWRnfPJ4sEJZXgAY0L3 wXSCXUBI7LMRALFJRmfyH1wNXio5vdDUUQubLYTg6KFZKZqqjWJIjsYaeRBJRtVlx9z4 d9lzqLUp1AeCYh6X1BQrXdYEfhHAJbNbmWyTCbXXll0bwAB5iDfmTWDON6JEPU8dLrVb KFTQ== X-Forwarded-Encrypted: i=1; AJvYcCV6Q3eQK8aMdmWOy+0eb5BPN+i/L1PO0OLjNhV5hxUJQPymw7sDscR0OaJlR6uHgYAS9Go=@lists.linux.dev X-Gm-Message-State: AOJu0YyXVkUpVJW6KuhDGUji0o0Ex/8848t+S0pxhW9Qillgm9uTWXng Fp70K+AJGVnb5pwoEoBDPcTPl5zPm1WPkBczBHqpfJ4GmHwuIlxZuXufiTh0tfkcgq1adW32IFV k4ZxAPUNGE9Nx5iIq4aM05GKKWv5P0WHS2/BjK1XXiUyPJA9OnQEDbUo= X-Gm-Gg: ATEYQzzLjo+FqgZHw1VkMCx+lMgM2RTJM7LZhr3YFRZ80msxuWgq1+zD0SDhe9ON0Er eNA3rq4XOAtTkTWwKk0zY4D8oGVVyC0w8CdNP9ovorPMhojSFH+M8zhKx9A/STWmV8v7+7IlpUQ noCfCU/9eEHhCYRrn/+oe0BJJOCluslK+E9TMeEdSJYcle8iaJiu0ATy+JJH8A0Cz+W8txc2Nmi 53NhDT74xpmieLa5pHnGj53Vazx7X7mntFmIFJbv2QQNwcOH6kAJs9jvRZR2KA0bd6gMAUVngUR iQQUlqzSOJwDUKDUNw/8S0jLRiq+TnPnsFCKbPeEBJwwJNU1k9sigQCu1QXiwd1Tohg/mMOGHE0 +nu0+Fcgj+ZuU/AWt9b2RETgpjqBzmo+RYUzUOxMMjJ7i/C3RT6s= X-Received: by 2002:a05:622a:2d3:b0:509:1dc8:e9e7 with SMTP id d75a77b69052e-50957e4fc81mr163339081cf.51.1773662740832; Mon, 16 Mar 2026 05:05:40 -0700 (PDT) X-Received: by 2002:a05:622a:2d3:b0:509:1dc8:e9e7 with SMTP id d75a77b69052e-50957e4fc81mr163338181cf.51.1773662740311; Mon, 16 Mar 2026 05:05:40 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:39 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:07 +0100 Subject: [PATCH net-next v9 2/6] net: stmmac: qcom-ethqos: use generic device properties Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-2-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3061; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=5Z1ERLj9DtpkY3L9fjZNwikcGQ6rrwgdETD/VN6J+aQ=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IFzbQYI6vHh10CWsGJxMAjU0/ZVzCDhmnBV hivu5A91MCJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyBQAKCRAFnS7L/zaE w+vkD/9pL4X60sTfNeueDAukikraft0MIkL45kt3+a5pxve09qNywhg0oeLh4dAFFxzl/3y3ygo OV5VLkaq4s+pu2o3D5FlAa5wo7IoNsIeq4G3e/Y+q6EtUxNr2S9cW4q07a6CIHrtsGfZ49CwCHb nWRa3QH26koOR6cJF79Pv03TAaFkwJ2WErO6PewlTlOms5WE0JribiYsa4Df+SiNuiYk+MkSEmg 3PlwJimIrLg+aH1c/QXxgJTyLQaFQaXrS4FTN/whate7IH1V3xgu89R4cBJlZEe+jy/UrWTzRLI 2S/VS+3k775MJSVm7J+ZK++RN2RrRNM16Hfx960Ad7TH4oWAb4jgN6AwddKq+Dv0DULyxNww0Av deZ+XLCsbuRPo35wWbWQXrXqcXTfKf+fVyfrxazAWSzDItD+koyKBbV8GDisw6CLh3mblz0CtMC tzljCNXp88Z47y4Dn2EqKYDi3vEN7paUWrQwgjasVdBQ+GGt+6LgK9vNgTTQfdQI0tMY1bB9++Y Ts/PtMbAzkoD33fmhFu2YWOqYwr2hUje2ZMka7iD12jnWDnw0etKgiudbhCmD9Ja9Z3ZLbQ0RXq BV2qJjOUElCAYNYsZdEk5pWDtDVr2bp0fEZJolbUok4gFTto+dlAK4iV5NI6GepT7xqDLZNQl0/ oGeX7UmdRX824bA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: byp9hyGxUf6Dp6iyYHvuEpwRIZ83McbK X-Proofpoint-ORIG-GUID: byp9hyGxUf6Dp6iyYHvuEpwRIZ83McbK X-Authority-Analysis: v=2.4 cv=D9xK6/Rj c=1 sm=1 tr=0 ts=69b7f215 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=AGkLNbZTeN-MX8W9OO4A:9 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfXyvmXu47KEiDt qHeAv9rMXuwaohnjNQ7+QncakelTZWloJjc71/f4CLiXZm99YbNwh0ta1F3koXid+PrA3LSiBsp xM54Iprk+TA8Afyfvw2mkoTPn5JJmk3jZ2JWdywCsTdd+Y6HbSqh5Tb1sY5gfq9+7nTCui6X3RG Up4rB+VIFBtm0cJgwexkvcJf1axHP63Kzp3nf+kSXuMzHQ33iS4yOAw/iYYKPhGMKLmD+1SFao9 7XSSWn0WbcJ5UDRLxEBvA9HI661G8fvyfZaOI/slL43Dz4SJyDlTHKjxJq0wdvyEYt9m9vqiXPm OywAhOrT6GzfRJc0XS9e+MFB+GHKRV2fDkq5EYNUMco9Z7wBokXeMsXYpAkD8wXScF5/BZHaic/ 1p2Q3FWZ681gJ4NCsF3feQMqJYrGzqbzjwcqtzl/q7tIOZzABCqIRkOaQYSIAowLZWxdxO9zTK6 JVytglXeozokYLjpbRg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 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/ethernet/stmicro/stmmac/Kconfig index 07088d03dbab5bd1abf66e9460613b839c1d565e..e2af4fdd654340d618477ed87d3889dbb9aab456 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -135,7 +135,7 @@ config DWMAC_MESON config DWMAC_QCOM_ETHQOS tristate "Qualcomm ETHQOS support" default ARCH_QCOM - depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on ARCH_QCOM || COMPILE_TEST help Support for the Qualcomm ETHQOS core. diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 3ccf20fdf52a8ec4649b43ade8ee7b85d613e1c5..66fd2ed2c2c8428694c07d89220d0e1608546791 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2018-19, Linaro Limited +#include #include -#include #include #include #include @@ -728,7 +728,6 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) static int qcom_ethqos_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; const struct ethqos_emac_driver_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; @@ -778,7 +777,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(ethqos->rgmii_base), "Failed to map rgmii resource\n"); - data = of_device_get_match_data(dev); + data = device_get_match_data(dev); ethqos->rgmii_por = data->rgmii_por; ethqos->num_rgmii_por = data->num_rgmii_por; ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; @@ -818,9 +817,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs = &data->dwmac4_addrs; plat_dat->pmt = true; - if (of_property_read_bool(np, "snps,tso")) + if (device_property_present(dev, "snps,tso")) plat_dat->flags |= STMMAC_FLAG_TSO_EN; - if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) + if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->dma_addr_width) plat_dat->host_dma_width = data->dma_addr_width; From patchwork Mon Mar 16 12:05:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 169 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D63339479F for ; Mon, 16 Mar 2026 12:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662748; cv=none; b=SuFPWVeiDwkivOjlqQMxLL5cBeKThIWSnSD4dL66RPGYHSI0iWlTFOB/w4zqd1GW1BNSEUwR3HccUmngPSR7WxpHCzdTeECeXz/V1nuNppmxfnwOavxlLZgX5ZWbhBtbTo+1ohhXmlTHfvuTOQdnge7TA0R6ARnfzBplBJvf1/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662748; c=relaxed/simple; bh=fbNtS/uHH7i+GRvFL8DqLP7cyjy46QeuA5MPj1IWrU0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AKK2EbmCXOoHQLtnRmfRNruMzVv/O23q39X9ddD205bF1/ozjh+gwOmxQQ3OuPF69tnpL9TQg1BP+sLE2J2NdMmYhI1EMoyf371q69NyOWsovfLtr4whFU5fz02Yf3ejSqIySQsLiKPaCIM8IXMi6RU+Q7drttcBZhHf2YOksP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=bqbKE/Ta; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hQMAiZTN; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="bqbKE/Ta"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hQMAiZTN" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GBf3gf323582 for ; Mon, 16 Mar 2026 12:05:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= KMyUU4KR43zZozuK55Bh2YheZBvjhnscd/dIXb/Z85s=; b=bqbKE/TausygwjMR pXQ2QX4j3/v27dLfoyVIfPX9g1cYvRop9VAcxVW/zgev2JGsOYMcVUGoqBtVMEp4 HGvD0rSeQoQZGDPofVKLbhnbD/TdM5zSarJphqPMGtrQ7ud7UkKlglWkGOpVHZDp vtZPgvBkGZIL40HP9Mq1bzF/QR50SX4VqKMndn011TqAiaegYylMqbxAWv66M7yR G5zxJhBWzlRvmPjIjaMwBbOVcQvEhQx5HoSp6N9B70L9kxStO+M90ZJbS0WYptJH z87YxR48Xf6KphArdlCfx1cwCJXC8DxLAuEpEjXZ4dVz8W/R+08ggYxA6Ve851Zg vRW8dg== Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cw03qns19-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:44 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-94ea747d58eso4350539241.2 for ; Mon, 16 Mar 2026 05:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662744; x=1774267544; darn=lists.linux.dev; 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=KMyUU4KR43zZozuK55Bh2YheZBvjhnscd/dIXb/Z85s=; b=hQMAiZTNQ3HHNVabjvHDOaRN6TDOhCqeVSPQY5Rq7Knk7K4f9Sfh9Q+0LTS5GV6Z1c pFSwYoujRGlB1IOCAncOSZs81z3ylLb5fU2DlpKGdvINzgL6TJFsgEF7u3hI3UShcABq exGdc2VLnH2RMulI0OSHGi2i9YCARWSMKHjovu43laysCFhTo4D64M69FdcVw1Gox+9s oRJpNSFlm45Qv2I28/WmaHjVmQVFMlB5X4hzBNX6owwhOCjonSexOTCJ5sEsVzaLNytS vMbFMYpkdEWhw9v95qLQaE+OSibENJM1W9ZDTXV35lU6cq1hKoDIqq3LJw9w2vzvwbZU Eljw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662744; x=1774267544; 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=KMyUU4KR43zZozuK55Bh2YheZBvjhnscd/dIXb/Z85s=; b=D0zi38URmeYCJ3hZR86mVBnKqjqUx0lyC4pMe9gIhII3IDFzyeEP5kX4tD15l4eIzR pyTrbLTEwo+oEGNH30zyonFJ9lbKB0y9qfWKyKdqjWbC1XYtv658D11MsLfKbl0CoIfG vxEKnVjqbAJ4x0PyVz9dWNWJB8zc72gKMh2THeA4JqgZ4xxBpCpbh/CeSJtV3XAIRXlE jpQ0pseABib29xRTA6m24kM0IipNAn15rsx63vRfVglTf11GLKWewW4NHEa4Dh68I1Fo 3d0eVbnkZxd2Tm2d9j5LegWC2Fr4H91mWGfTdnGpJPyaK0YZpXTmEpDvgrgCagj0RIMs P7wg== X-Forwarded-Encrypted: i=1; AJvYcCUAaFHruBQGf5P5nPN0HUTiYDAvuik6broKr6S6uAN8ifCMYhTa7nTmaK8TKOxmtERGVS4=@lists.linux.dev X-Gm-Message-State: AOJu0YzpL44BiRDvgj8tdwK2UizqdO4AqIW61Zoj37fq64ZeAjAEbh0V kOAoCHzgTWz8CzgDBaPHpJmgY3Ab4cqYgnq6F6X2X6R9ol880eocMk7x/03W1S20ATeFmZPmRHh Znqqn1C529UMe13wPJE2Cx0yrn+BF8KQB1pkaYCNyfnlhOO+1X644yA0= X-Gm-Gg: ATEYQzzE9uOI3cbE2viNx3lWpaPDKP2Z1fLM3pWE7J3K0nb+MAJOnwkOOEOBhnOCo/X Ie/9OdyYbyJQsUdaHdQXbeoLIuHNBwBdk9SPllgtZv8MC45yAa1ArH1tZpjlSuEqUTNwzfJohvj ItASSbeQcaWBab/35LIHqLpisnldMqh4yTmNrZClVOk0tMGIiTpbZAo9DuHdyKYbyc7bIit//G0 QrK2h7BXiS5i69Lc5sz1VuLGBr9yJhxjSqcw64EJypOPcV1swVMsio3LQQVg267rOnLy7gZAyOm 2NP3Z1+YQ2HAJAGcPwx9bQGQkYtOD6Ud8INERt+oWZ0igciJJ9L/sWvsRkkSLU/vztm7BENKG3M KJfOKoHxsQXyqno2oI5ZrOiWBlhfgDsZ7LWWe6qdXzDO4XHsYmig= X-Received: by 2002:a05:6102:dd2:b0:5ff:219b:497a with SMTP id ada2fe7eead31-6020e1aa7e9mr4589831137.3.1773662743715; Mon, 16 Mar 2026 05:05:43 -0700 (PDT) X-Received: by 2002:a05:6102:dd2:b0:5ff:219b:497a with SMTP id ada2fe7eead31-6020e1aa7e9mr4589815137.3.1773662743239; Mon, 16 Mar 2026 05:05:43 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:42 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:08 +0100 Subject: [PATCH net-next v9 3/6] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-3-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5840; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=QEjA6ztNoVJqA2fzdic1acw7AfUASpMj8dS/VFE3Oks=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IGiOkgQG00O6yLrjBHMqTdoAG75F1dhJnlu Lzf54ETAY2JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyBgAKCRAFnS7L/zaE w/NXD/0WYnQvTwYnvGFZ3tZr0XsqU4FEWJx9KsbJOyfL1o10P2IF+tEBWRR3H+MAqxoQVwNanY6 hvTBiTIkSuWmeK0hbtihq3ezWr93j3vu6iZSXfCBxjs0eQ6v6FZtHMg6IAhkrne8u9MQCVSopwH Rve4qYdPMW2EX0okqbsmSvxK7pG5MnMo0JCrOVs95H4tOzH+Q2qGjQXnhTsaY89//IS4I9BbyW2 PS+bbn8qDXRLVYu5v1LbS1eQMElYQn6yGoWNGmQ4nZg4DAUSs2oLP85k533GObc2dHy4nHpvyRu 1mga1B3kSsERLkShcBERg64YOOWxBWUkZZFqIrBjYe5rXiP4zwGs8k9IzsYsDntFMlKX1khQAgm WIaxTDbktidDuqkO17AOraRLdCD5dziT+0OAl8oazGrHrbXiyRICbqLQF2aqQGZqEiCzNDE4mNF aRo4Mbyvg73vpHCcXKA+URZGgR+orz90M+w8HWPtIumOLT7KuUaxIhrJ8MQ3wqEBcqvdnuJUnmw JCFfSzqvHWm3D2jL6Z2Ms0hTXxj7plPjtrSZG3HOm4apQi2vVhebQW6bHVlZoLU2MbcszBf7q6M qIpC9Si0bbE6+0bas+VDfiwncRNY997gkgjiAWrNy9KGy8GX/Fvbz1rxy9JZpVf12eHBqlzM2Yd 1j0Glhm9rpoPZ5w== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: GLtydRZNE8GqzkzGkSBPUH464JHbcPN1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfX814i46u1NC2L 3Z2JgOu7+PNPOXQgp2OajXE3UYE2dkVbopMp31LFU97moratIJ3q6wiGyQGATwiB+G/hAAnbEQI uS6FYbvEP6dQHYGUC2GwEcs4HYVY2EH0lqDs6e9w9b1gREYKf7m0oePFrJTR55ScCZCy2bhOm2a ju93gmOmTEuYM/GyBQQtklkw8XKkDKOswHVozD7dnUsnSyPaerWAU7zgkQcyhYRqhIO7tZI2Goi XZ1GcXjj5qF8Ny5Cvrb6ymRoPENylz8g6VWV9eQTqr5K9jyBVJl2xEoM2VMYlTqmxNc7ktcCnpW 67aY7x3kwaheufMxaQfTbySqwdaGyGRprghD7WufiljitsWg+gpIm975OcjnJdSdf7S2VqW7yb9 cxp7+NcpO3wzXJB7uSZ8lz08PE/JZAXRVYfMPuGUf3/VJtVZ49ndPnb2v831XMnAjwcQmAPSnDc Oj1uh3umqHyTBxbrZ6g== X-Proofpoint-ORIG-GUID: GLtydRZNE8GqzkzGkSBPUH464JHbcPN1 X-Authority-Analysis: v=2.4 cv=ZbQQ98VA c=1 sm=1 tr=0 ts=69b7f218 cx=c_pps a=R6oCqFB+Yf/t2GF8e0/dFg==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=fYgtqwV50X64hY7jBhMA:9 a=QEXdDO2ut3YA:10 a=TD8TdBvy0hsOASGTdmB-:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 52 +++++++++++++++------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 66fd2ed2c2c8428694c07d89220d0e1608546791..8fda6c128117d7f5b1dece68c919f2a09a511210 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -97,6 +97,10 @@ struct ethqos_emac_driver_data { bool needs_sgmii_loopback; }; +struct ethqos_emac_match_data { + const struct ethqos_emac_driver_data *drv_data; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; @@ -223,6 +227,10 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = { .has_emac_ge_3 = false, }; +static const struct ethqos_emac_match_data emac_qcs404_data = { + .drv_data = &emac_v2_3_0_data, +}; + static const struct ethqos_emac_por emac_v2_1_0_por[] = { { .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40C01343 }, { .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642C }, @@ -239,6 +247,10 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = { .has_emac_ge_3 = false, }; +static const struct ethqos_emac_match_data emac_sm8150_data = { + .drv_data = &emac_v2_1_0_data, +}; + static const struct ethqos_emac_por emac_v3_0_0_por[] = { { .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40c01343 }, { .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642c }, @@ -271,6 +283,10 @@ static const struct ethqos_emac_driver_data emac_v3_0_0_data = { }, }; +static const struct ethqos_emac_match_data emac_sc8280xp_data = { + .drv_data = &emac_v3_0_0_data, +}; + static const struct ethqos_emac_por emac_v4_0_0_por[] = { { .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40c01343 }, { .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642c }, @@ -306,6 +322,10 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = { }, }; +static const struct ethqos_emac_match_data emac_sa8775p_data = { + .drv_data = &emac_v4_0_0_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev = ðqos->pdev->dev; @@ -728,7 +748,8 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) static int qcom_ethqos_probe(struct platform_device *pdev) { - const struct ethqos_emac_driver_data *data; + const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_match_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev = &pdev->dev; @@ -778,13 +799,14 @@ static int qcom_ethqos_probe(struct platform_device *pdev) "Failed to map rgmii resource\n"); data = device_get_match_data(dev); - ethqos->rgmii_por = data->rgmii_por; - ethqos->num_rgmii_por = data->num_rgmii_por; - ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; - ethqos->has_emac_ge_3 = data->has_emac_ge_3; - ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback; - - ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii"); + drv_data = data->drv_data; + ethqos->rgmii_por = drv_data->rgmii_por; + ethqos->num_rgmii_por = drv_data->num_rgmii_por; + ethqos->rgmii_config_loopback_en = drv_data->rgmii_config_loopback_en; + ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3; + ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback; + + ethqos->link_clk = devm_clk_get(dev, 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"); @@ -815,14 +837,14 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config; plat_dat->core_type = DWMAC_CORE_GMAC4; if (ethqos->has_emac_ge_3) - plat_dat->dwmac4_addrs = &data->dwmac4_addrs; + plat_dat->dwmac4_addrs = &drv_data->dwmac4_addrs; plat_dat->pmt = true; if (device_property_present(dev, "snps,tso")) plat_dat->flags |= STMMAC_FLAG_TSO_EN; if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; - if (data->dma_addr_width) - plat_dat->host_dma_width = data->dma_addr_width; + if (drv_data->dma_addr_width) + plat_dat->host_dma_width = drv_data->dma_addr_width; if (ethqos->serdes_phy) { plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; @@ -837,10 +859,10 @@ static int qcom_ethqos_probe(struct platform_device *pdev) } static const struct of_device_id qcom_ethqos_match[] = { - { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data}, - { .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data}, - { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data}, - { .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data}, + { .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data}, + { .compatible = "qcom,sa8775p-ethqos", .data = &emac_sa8775p_data}, + { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_sc8280xp_data}, + { .compatible = "qcom,sm8150-ethqos", .data = &emac_sm8150_data}, { } }; MODULE_DEVICE_TABLE(of, qcom_ethqos_match); From patchwork Mon Mar 16 12:05:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 167 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A15A3395240 for ; Mon, 16 Mar 2026 12:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662750; cv=none; b=mrEyO0Qixelkt6MD9KADP+sDaL2LvhNOkJjZmaHnB1bRbrurpZrzpPZr7S4vhOgIRejrR0htn2lIvozA3U0VcSuByvBN/tHMaP+r5LHUBpRnhFLbfEr2I7z5E2KEn7QNExdlMBFf4Ajzu3wnMx/I9AQXQ8zDAnsHcfli4rRqE2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662750; c=relaxed/simple; bh=XhgTnkFPN/kAnMEKzRTRMtvjC9Al1B8l8RFwI+TZLZY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dyZvnGrJMbQHJv44G/mwMjfzGSqpE1pyp8v8K8wJoZA9iykmIkCUNQ0Rdl1Rvvh5ay3C0FqBLoLPqwj1xdEBzZB652hg1Ob1T3g+Yp5VV3dl5zunJjh39hTeIj81Gb/sz+PXVhl7z5C7O/Qk12GWCbWgHqv9ZmpuUcDMnq+XnP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=pWohj5Ok; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QAv2Fntf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="pWohj5Ok"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QAv2Fntf" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GBftlT323708 for ; Mon, 16 Mar 2026 12:05:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 7uFBMrySSyg762knrQZ8WDLYNBJTFUwiXUIQ+8VU9Pg=; b=pWohj5OkCVNuv7KM pcX5zRTmSz08iVsJofRQs6bshQLQOoRtpVo4lt8OkgAS5ytGeomQdtnbgsPIiIjE ebJrpv4eUbRhpGq0/3EUn8YCcQ91EVjqhf7ZTrl90Qalv8kApiAh4odcD3x57ZHJ Mjq31SyWQ8X1hOGqhwS4sO/S6myNJlE+8H+s7cmrd6r90P9WAQDG1+e9UJsJtWVI ktUPr8OwQB25pm0mwGJWu/tWEvISYqHcd4OCSLRPbJd455OKBtz/7JzyJQ69+iSo qKmqtxT7zahYK/zpcr4qYMp4NuYoYpLDeUGACcMr5TDyf/wFuXDao1hUUuj10fCy rD5kJw== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cw03qns1u-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:47 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cd7fc27cf7so2659501685a.1 for ; Mon, 16 Mar 2026 05:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662747; x=1774267547; darn=lists.linux.dev; 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=7uFBMrySSyg762knrQZ8WDLYNBJTFUwiXUIQ+8VU9Pg=; b=QAv2Fntf1qdmnatHWoOGMC/OE0cLC6BXaTCr9FAk8otPIFDIPiyBR3Jl7P/CDvziq6 uMdWEDCxZVD79ZSiq7XjQCF6ST02I4aL2/s+JDWLoZk8V90hYM3xR1DvNu0DV7JbUwQX JIEMlDVDmYAeQGWd0+u0gNd6WzgynHxZZOnhbddHP1e1XbJS2zNba803zIdtbMONJpM+ kYGNu5ctNWMxH7M/ppSe0StrZ0Te8kmKkScHHaBpZKYOP6EE0l3o/tpvaVih7Tx6oMj/ c5u4DWxhZ0/q0SKPl8pEdVNwzpXy8AlCYX+qvnYe0Ne8dWi5vde3PaQVv2QvBxz1edct p+Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662747; x=1774267547; 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=7uFBMrySSyg762knrQZ8WDLYNBJTFUwiXUIQ+8VU9Pg=; b=DiNX+jKtaTAlIcY0KNybj8dbZSUdIFpx8srmEC8Til1meLnv78OZy4FkJcR0yPJN78 nVkxTnLhiNc5/4OMcNnzRCTGArBQ9EUh3ej8582VyeXI8MkU0tx1W6ZgrscbUCjKyZWH 6kUYZtlBQQX302C8mje/MyJPQJ5ZgAU/2S9NmJMJNUZ/gW/u13iBFVyKS0sjaAo0f/3m /916Z1EYJhNXO6HsVgni/N1YYPeUCZNldKD1T95f17PcIauwGaozU/2HKHy0FTX69/p4 /OrKbOnS1gz0BnKciPrLik9WA/wVuoYaQXBxuUDBhixBrq8QEHpdx1A6WMcwrgNsN1IH 6j2A== X-Forwarded-Encrypted: i=1; AJvYcCXnDVNnBAV/++6LcDEg22TP4gs7ojKsUekuqxxo08B3Hw/endJgVJ1EWGs8Red01KHyq9U=@lists.linux.dev X-Gm-Message-State: AOJu0YxTcKe4ixloLZC9KLlW4wInDvsinv/Vt/jJfcvgAkmFIR09dlBL CHmA5ps3UxMMsovO3NNKMfHr21YB7RKlUrZRsJHf/igVyppeQITBbt7VDiTs77FOC54PYoWSfso 64e5Im1Kxm7Jhrj88pPdOT5Bn7hTzxxSFP0nEY5AST8J7jradDcNlmsY= X-Gm-Gg: ATEYQzy+TKugO84g6iQWTrpkJ1ITCyeAVjooRgNDbcq30rihWiDsGaXWA5ohqqxiI0q 9SMytTQSuOwWp3cA9/sWL1X3X2ROTEpp3plw5m0SnAwb7gs8NcupbFsa3c2xUIcxKhkHqecUBvO YJTNlKJpDXOpsfkY5SPeHXuhNRwc+UNG2Oos05EgcdCdY5WbESPgwEoAA7SUgwQzhKYnj9vHa8H faMrpwgS5jqGryJqi9tyMMBOmbvox2RGNKEBFVrPfWV/ghzIF/CnGAIT9Mn2F9KpSsex2LHEzqh +oy7UPb8zm59M3szWYIL+8kKgtCp/27v7LeIGAzwCYmJj7OgEIP6J8Mu3tO0GRDxm4HCrI6sTsT xd3xlY8acjPah0lhILr515IhXpgcRRwJWajDu3QqJcYuF2s81FHA= X-Received: by 2002:a05:620a:40ca:b0:8c6:abc5:f169 with SMTP id af79cd13be357-8cdb5ba0d89mr1602660785a.73.1773662746684; Mon, 16 Mar 2026 05:05:46 -0700 (PDT) X-Received: by 2002:a05:620a:40ca:b0:8c6:abc5:f169 with SMTP id af79cd13be357-8cdb5ba0d89mr1602654885a.73.1773662746194; Mon, 16 Mar 2026 05:05:46 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:45 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:09 +0100 Subject: [PATCH net-next v9 4/6] net: stmmac: qcom-ethqos: split power management fields into a separate structure Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-4-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3509; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=hJGGsrAtahyuAplrTDgGRPmhh8bkkO/cgS9bRedR9Qk=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IH7+UzksxcBqpQnoVfm94yesTehZL6KZa/o zJAXvOazA6JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyBwAKCRAFnS7L/zaE w0DvD/4kVc12bfMNOItY55yvgMugKA5cgssCjAAELIhilzqsOtLF+QTcauo3L1I4XkAxCeu8HnT YLVxoD5YyVO1KrDNdPN/7uMPGxXLeHm4YFHm56SH134R5E35bQmIJQphjvYQ4rPyafNHeIocA+M gTNt5zmtV9Lgg+dKckIxkmpgzdM5u7IeAONHtRFKLUK96ZdEJeqqx4qUq0x0RNMayO5tg4B/tyb qPozJZ0U0fzmcKSUV+vaNUgjWVw87V+bRr1UmREmSNLBjUxehepEZr8meRGeGbL2lZPcyovttRK YPgjYDgYAs1nqUbvw3SEW4h9pYidZpJR5x+rNeLZLJ4hkd5ranw/yW4/aHyJKNfYzS+NnXkR2nj AMUO0C/1KBeZ5/9Ij0f7zR5jVSCA0142W2M6reVXXATjqjnmfwYrplfZHqkhQ31cGReOb+/+rhH 2SO/4iApf3mkTtyd9q/vNkisn3oyvw7aonZ0zIrVOYSeo+EiCPPC3cFe6biaAl6QQwWSVOR1Q4h fTlX8TjeiplK96fSAqsISmDmbgtxtfjj+4ZG2Fa5cloAnl6uW3rT/AXDzEvU9rxosWdvI/R7QWz O1Y5TdzAK9dlH/v3NPiseZjs31VVohvZU4FQdkq8oPp5+SUaFvTBjgLGoCfbdY3eNpCl0O4aayy Y7sbsvP+AHLWnMA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: a7nVFWNcrDwbcgT_xR4kgKFlREBT2KZJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfXwX8VQPDCjovF J1JJ+rPppHpS3iBY87uenoC9r9zTkyCJU0Sny4uFoGIOWxusDKBWHwVktEtRU0N/YYwPiE20Mi3 XHx5qHk+RcNRMju1gBlpcunOLz016ynZJNBxQv/f4kuteiO6rg1aiWenNC5Hwq5HxLih7IWZmuU bEsQQtW7VhXa6CHrjLfZk3mP4pHLVndr4lfeMJe8ZkQulE5amHSTWe/ddltDBuUJJsBKUdXGzc/ Msvh8MTRnbJC/FbMl9jqDW8xIMbEEwCV+nxWycXZUM1zEPFmikakf6IQItCV+m5nMKplxDINj56 ziY8F4dN7QVAfMAaT1nSEbW8rliCoe0Jr6w++O20WZ9VSyFqWtM0vaA9rI/QTc4NPj5jVImCVYR QNL71NCYaG2vkHwcmgu0vrD0uS66eN7IX1sOeflfcM4t32PyjElJtKe2uicnHqwzZ+d6zAqbmNZ OA78EAtNz4H3XH7QL+g== X-Proofpoint-ORIG-GUID: a7nVFWNcrDwbcgT_xR4kgKFlREBT2KZJ X-Authority-Analysis: v=2.4 cv=ZbQQ98VA c=1 sm=1 tr=0 ts=69b7f21b cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=KCp3k1edx3YIq9yPN_4A:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 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/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 8fda6c128117d7f5b1dece68c919f2a09a511210..cbfae18773c1193cd640f07824f5a66d68f9634b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -92,13 +92,17 @@ struct ethqos_emac_driver_data { bool rgmii_config_loopback_en; bool has_emac_ge_3; u8 dma_addr_width; - const char *link_clk_name; struct dwmac4_addrs dwmac4_addrs; bool needs_sgmii_loopback; }; +struct ethqos_emac_pm_data { + const char *link_clk_name; +}; + struct ethqos_emac_match_data { const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_pm_data *pm_data; }; struct qcom_ethqos { @@ -301,7 +305,6 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = { .num_rgmii_por = ARRAY_SIZE(emac_v4_0_0_por), .rgmii_config_loopback_en = false, .has_emac_ge_3 = true, - .link_clk_name = "phyaux", .needs_sgmii_loopback = true, .dma_addr_width = 36, .dwmac4_addrs = { @@ -322,8 +325,13 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = { }, }; +static const struct ethqos_emac_pm_data emac_sa8775p_pm_data = { + .link_clk_name = "phyaux", +}; + static const struct ethqos_emac_match_data emac_sa8775p_data = { .drv_data = &emac_v4_0_0_data, + .pm_data = &emac_sa8775p_pm_data, }; static int ethqos_dll_configure(struct qcom_ethqos *ethqos) @@ -749,11 +757,13 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) static int qcom_ethqos_probe(struct platform_device *pdev) { const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_pm_data *pm_data; const struct ethqos_emac_match_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev = &pdev->dev; struct qcom_ethqos *ethqos; + const char *clk_name; int ret, i; ret = stmmac_get_platform_resources(pdev, &stmmac_res); @@ -800,13 +810,16 @@ static int qcom_ethqos_probe(struct platform_device *pdev) data = device_get_match_data(dev); drv_data = data->drv_data; + pm_data = data->pm_data; + clk_name = pm_data && pm_data->link_clk_name ? pm_data->link_clk_name : "rgmii"; + ethqos->rgmii_por = drv_data->rgmii_por; ethqos->num_rgmii_por = drv_data->num_rgmii_por; ethqos->rgmii_config_loopback_en = drv_data->rgmii_config_loopback_en; ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback; - ethqos->link_clk = devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii"); + ethqos->link_clk = devm_clk_get(dev, clk_name); if (IS_ERR(ethqos->link_clk)) return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), "Failed to get link_clk\n"); From patchwork Mon Mar 16 12:05:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 166 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CBF63947A0 for ; Mon, 16 Mar 2026 12:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662753; cv=none; b=HtSfziy4wZ1qEksCZDy+T+N6VovL/IiFh+zI1UtN+2CdzxrjlE3fUk2evySZYzwnS1kdt+fLjxyDFLG7ZnsyaVGiYHCKQnGBYxrjYSIrzBRJyOVd5Bkoa7fWwvth8Lja+DiTkZQLnGIolNJCmZSnejSN4xcPSn7D2QnNcHCLABk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662753; c=relaxed/simple; bh=cUDrs1O/XO11AhOC23rnXsi1wxL7UD1u0mwnarp3gg8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rVDViPX6J2oRnzhLWOxwJbr9GJx93ohfhFl78U8MxvZli4OrLzD1ueMblNV1SV8gTKTlv8oRdQ7ZntNOMxku6veyvkTrUpuDO8l1kaw1WUw422JFhd5vhjwQydu/BlDmp+IAsxB4DJCgwIvEDKgJI4TgT35JhpHH+B6BKXyVwvQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=pNpSDV9M; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=EvP4I9ws; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="pNpSDV9M"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="EvP4I9ws" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GBmLZF1066807 for ; Mon, 16 Mar 2026 12:05:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JRiiX4zWYpuwYrXgVU9TJdiqt0ihuqsNqrMiVyK6xfI=; b=pNpSDV9MYHjH3m3u W7UJ4st4HocJne8A1SEc7ryGYtLWqc2ksDPxIIL8M5//pxk215liAyLNcy6s3rUm WxmB+GGDGQBY0CiGaZMn2odOdtBYFlsaXMRHH1/KdTLCkBgXU+g3KEg4PlzTLwjc nC9Osf8wm9qC+95l7Er9+lkZmEhPJFJDevy28b/NZSRPHEUGvW5bLLeI1UmUBkp7 FUua8LMPEdG/hIlids8UzCfJAkdURCLRvfCaOTfbNI3hVwRE9ijGhwFQ8pDoz0qR mEvmP7ycgXvD5srBvNdgPAgFNPytbw6wI5IyshwlY/4gBOQpNVgf/i07Q0zuReMc rqOVpQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cw027dqmg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:50 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50900e9803aso302657251cf.2 for ; Mon, 16 Mar 2026 05:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662750; x=1774267550; darn=lists.linux.dev; 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=JRiiX4zWYpuwYrXgVU9TJdiqt0ihuqsNqrMiVyK6xfI=; b=EvP4I9ws+nOd97QqEnHZo87r/vOjaWRgS9YoTIfBS8ZTSyWpaB9e8KJkRL27yHvNw3 HFl5hiu2SzoabXGAM6NV6sDG699jw3bd2p/bZPXAyo63SrEpr+kzptXBK+zJNc1WHBca ReMVHLsmM3j/z/CaW6t26LSAbxb6Fnw3DV9NWkpxS2Qt01/UEmjMcjhqOPXlr+7hulBW +DndH7SWgO7dg32YjO+x1yDFIwsTVv6RKVV5UDm9k+RplsRBdUBtQ23VbtJrihLeNDMg OZS7g93+Pg/2N9VVV4BrPTYQYMCjTip9pZ+P1uQDt8yxPQV04NKOlT0Hx0yyaF6NX1tU B1Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662750; x=1774267550; 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=JRiiX4zWYpuwYrXgVU9TJdiqt0ihuqsNqrMiVyK6xfI=; b=WBccPOCmh6i+nCLpoZOJDelnQ29W66En2Axetwto9VgPW7Uaj4YYvymR9OfZ8idFwg Spavuy1nnkSf8jU7HnsNKyKNoTdPa5AHhDU2rXA8PGnXF+NDMQrhH8u+a8AJ31ddcgBF z8Q8Nnt+uPR9L3RsAtVJNizEgZzSpi4Wp6P9wQXgMgJW/BMQmg6cwx5xNDtAgN2bWzde 82QBZzwhMXXpBtoaG2RbYCR4cHrYnTRyJM9mxvouOXoTzylFBNFTv5XEBh6nuT1zrHnQ wCn3HMF9cslXnfqGRb73D+ylZYLWV+Kq0OMYD4SoDsCNQm9ARUXfM/H+W9JTXXejIjij Bktg== X-Forwarded-Encrypted: i=1; AJvYcCW93zoDyJgrJNEQkPMec+lZgIcweEvlZ3HTrw+zEQDkpGFYCF6uAx7o/N3FtKfPtPDCXb8=@lists.linux.dev X-Gm-Message-State: AOJu0YzAwp2xQoLXqIB/fB1YO0/4ZUd1KcEO0EOFeXFKpiXoI4yDB9w4 KsK6KMTdg5elFNgc5RMzmQLiRwL7l/ChvUhqCaLHvxhmGnwkUpPH1DKRdlCYXrfkkTdN6MxQHCw S/Ypn4xObgbiumofq8aCODdoRqIHXN6O4bmf/qZG/ZjlOJttMHAYVSPo= X-Gm-Gg: ATEYQzzVxXvslPMcE10XRWMF3TIGoGLzXFBHghQvg4DVtPZiw/pM946f+yBbdGTveVv s2OTaM1hccZ6Rgwe/55NgMM0nitktmX+F1HPBxMK1uXE8eBwP7uaekLc/5yDq7TBxqr9o3ScRYX R1fdGukP1pa/yKgcPZcdOt9gMiF2A2mMh/kHBg/MAw5m8OnyxlsLl1/rds6TqgT9LgqFgNfLWFB xwWbRxecKUiumxUeV7VuuAdh37WEadZBxG0ZhfnFFSBysToJMvVZ0qtRIG54OlcQfU8JufgMYGH d3hgYHlsHd/770QKYL3gMsOprRKgaD2fTfxESzeCf0G46yZQm2CguvZCAbV3n2h8ErTKUTBvoBX bL32CLM5EGTafazUQ1sNQlSOg18kCnzLfC9mWGKiNLqr+OyNRYRQ= X-Received: by 2002:ac8:7c4c:0:b0:509:3f5d:4fb6 with SMTP id d75a77b69052e-50957ba7484mr165093921cf.14.1773662749682; Mon, 16 Mar 2026 05:05:49 -0700 (PDT) X-Received: by 2002:ac8:7c4c:0:b0:509:3f5d:4fb6 with SMTP id d75a77b69052e-50957ba7484mr165093061cf.14.1773662749103; Mon, 16 Mar 2026 05:05:49 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:48 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:10 +0100 Subject: [PATCH net-next v9 5/6] net: stmmac: qcom-ethqos: split power management context into a separate struct Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-5-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4863; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=FNVr79Fi6sLZ+qldLv+chKiF5qjCh0lSqoNC0bsdcWI=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IIT8poUkTMwCdDoAqbmTNuqoN3k68JOFFxl RLzfgKVKIWJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyCAAKCRAFnS7L/zaE w0K2D/4rDGSTW0SD1QyIyyfWah8lyX6rA5A9XyFngToSBN703DgZMDNxYkUeXeaO/SjXmif2Rcm OObzFgkf7GTijwxglaizo6Y/hywgBI7dMmaVNl9j2+5oF3++AMNlfsr/AT2s3bQtpgKEmyipQ6c 9aDRKwIipEeGEratxlc6mHDPicA7dXVwKDrzk67depSo/fuJjnCim5/FHA/QBySqVcNcLH3D218 Rssqe4ejGkZcv0TQgFjh2zBBAWNSqpHIxNenriZBsY6dR9pH76Uzm12ESxwaCrY7/z2QG43RO3Y N91qkaKLR0a9FI9tXbRhbmHKd8tNojtRsSu2n4jF+i8QvsMhm2WTlLBSnHjDhesrLrcES9fkM+N VnrWOh622GFNqlRI7X+3D1YxkjoJz1xVic/3EOypyDur1VbMk18dFaYPmhgMTfEO41ivU2CHqgR XlYuo6VLOjn5/8FVaimtnNGGHf21jpTXVVrK8e9WSojBwnRN0FfYtRLm90dB5FKFfaotMb+Spfz BuAIY3gGvycrCxyhL8y4mFQdPdhmsQiGBkCSUXsWFh+JeD0RbqCD3juKRHCepuzDEvS8lTdrJ/J ZgaFYz2x7XAp7j7NA53BEhQH7ojIeBiULr4X7eXdvolOLzeqa8fqp/sr/icnIetgM9z/F/5Y5If 4DQ1nQx0YViO78g== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: s49ItH-og-eULWHq4KCcQ6_rv7OyuoRL X-Proofpoint-ORIG-GUID: s49ItH-og-eULWHq4KCcQ6_rv7OyuoRL X-Authority-Analysis: v=2.4 cv=AqXjHe9P c=1 sm=1 tr=0 ts=69b7f21e cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=TTAMOEIJuQy2Ho-tp7YA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfX1VOK5I5bSIH9 tZMfXSdY+37IYkSFQ5H+T8VuFA9QU0sFSCdFk7MwtyTD4/VZ4+fOb49xPkPEsbBUhi3vof6xtjW lYU4AXh93MYznrfIRbOFus2r48xytVjz7NtDwXeq8Ieq2OOZde2BOPZM4FZh+7xKOUOfcbo6y3k 3zFJ9Iku1u6nFWrc1a/rXiJCGVAcbQaKZRcMVypBFjE4V6iirynMjwqmVe7mCmyba2X0HmyADIF 57GbkEFGxHyeKcCOVvE/GCez3sDslk3Dl9sx3i5cF6thI05dVMUXbvn67fVKdHnxmJnYijGSZbc Otxum49O1Nh2wsJq+86/J5/bGGDJh1hHZPoa3NOwadGObk5FvhI0CChWqvJ8/1PYnDiGERlHqFH l1+C6aqxMFdJ7/s+uqmN4iJHIMJQ7um32afJE8IeIj9pZW9txhd2xXdPGZVmjL7UN4rRacdeMlC pdudBfGw49SQhVqZgjA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 40 ++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index cbfae18773c1193cd640f07824f5a66d68f9634b..f32ff0d9ce513d8270c8db9c549a79778549df59 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -105,14 +105,18 @@ struct ethqos_emac_match_data { const struct ethqos_emac_pm_data *pm_data; }; +struct ethqos_emac_pm_ctx { + struct clk *link_clk; + struct phy *serdes_phy; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; void (*configure_func)(struct qcom_ethqos *ethqos, phy_interface_t interface, int speed); - struct clk *link_clk; - struct phy *serdes_phy; + struct ethqos_emac_pm_ctx pm; phy_interface_t phy_mode; const struct ethqos_emac_por *rgmii_por; @@ -194,7 +198,7 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i, if (rate < 0) return rate; - return clk_set_rate(ethqos->link_clk, rate * 2); + return clk_set_rate(ethqos->pm.link_clk, rate * 2); } static void @@ -670,13 +674,13 @@ static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv) struct qcom_ethqos *ethqos = priv; int ret; - ret = phy_init(ethqos->serdes_phy); + ret = phy_init(ethqos->pm.serdes_phy); if (ret) return ret; - ret = phy_power_on(ethqos->serdes_phy); + ret = phy_power_on(ethqos->pm.serdes_phy); if (ret) - phy_exit(ethqos->serdes_phy); + phy_exit(ethqos->pm.serdes_phy); return ret; } @@ -685,8 +689,8 @@ static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *priv) { struct qcom_ethqos *ethqos = priv; - phy_power_off(ethqos->serdes_phy); - phy_exit(ethqos->serdes_phy); + phy_power_off(ethqos->pm.serdes_phy); + phy_exit(ethqos->pm.serdes_phy); } static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv, @@ -700,7 +704,7 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv, if (interface == PHY_INTERFACE_MODE_SGMII || interface == PHY_INTERFACE_MODE_2500BASEX) - ret = phy_set_mode_ext(ethqos->serdes_phy, PHY_MODE_ETHERNET, + ret = phy_set_mode_ext(ethqos->pm.serdes_phy, PHY_MODE_ETHERNET, interface); return ret; @@ -712,7 +716,7 @@ static int ethqos_clks_config(void *priv, bool enabled) int ret = 0; if (enabled) { - ret = clk_prepare_enable(ethqos->link_clk); + ret = clk_prepare_enable(ethqos->pm.link_clk); if (ret) { dev_err(ðqos->pdev->dev, "link_clk enable failed\n"); return ret; @@ -726,7 +730,7 @@ static int ethqos_clks_config(void *priv, bool enabled) qcom_ethqos_set_sgmii_loopback(ethqos, true); ethqos_set_func_clk_en(ethqos); } else { - clk_disable_unprepare(ethqos->link_clk); + clk_disable_unprepare(ethqos->pm.link_clk); } return ret; @@ -819,9 +823,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback; - ethqos->link_clk = devm_clk_get(dev, clk_name); - if (IS_ERR(ethqos->link_clk)) - return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), + ethqos->pm.link_clk = devm_clk_get(dev, clk_name); + if (IS_ERR(ethqos->pm.link_clk)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), "Failed to get link_clk\n"); ret = ethqos_clks_config(ethqos, true); @@ -832,9 +836,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ret) return ret; - ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes"); - if (IS_ERR(ethqos->serdes_phy)) - return dev_err_probe(dev, PTR_ERR(ethqos->serdes_phy), + ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes"); + if (IS_ERR(ethqos->pm.serdes_phy)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), "Failed to get serdes phy\n"); ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, @@ -859,7 +863,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (drv_data->dma_addr_width) plat_dat->host_dma_width = drv_data->dma_addr_width; - if (ethqos->serdes_phy) { + if (ethqos->pm.serdes_phy) { plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown; } From patchwork Mon Mar 16 12:05:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 165 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8120396D27 for ; Mon, 16 Mar 2026 12:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662756; cv=none; b=hbEGqL5S6dlDPE4qVUmMxa7Jk3zd1Zgjm4tRfeyhmVfScBAinsZ4lzJu6c8aPiFQhaPeMCtfVfCENAnpXT+ZkF2kHKLA8zk4ciIJ/Oj0g883I4v5KpOz6p6vZp4rjK8qVGKdFmiPpRcmNOB80ilfHWbC5KTG/cGhBYqdGpbC/5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773662756; c=relaxed/simple; bh=3YX99yDiykq8wht5jhlxLD9GqcQlDRrqtioZ2YaSMF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N+gQsbYeuFHFIX/89O2PVn6BitEOLzhF3ptPoyMl4YoezK7Et+yzuX4+O4AlZiJmTf/0LqYcmgwMLEuYJOQh6+ONF7PTsDKw89y5pgciZ8OVXm3M2aoegtKKrEqUsh/JdVEZquFWm6u6kLm8JLmzFBfbezCvqRo4jqxs4Cen1FA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DiiJI7TK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VOTeUJ4b; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DiiJI7TK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VOTeUJ4b" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62G7n3d3042125 for ; Mon, 16 Mar 2026 12:05:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 3Q2i+GiHSpXUMk/5V2t9vb8q95gvl7L2wScFZUzHsU8=; b=DiiJI7TKYsl/asr/ N/JfRDO2M01wuYZAzzpQc5i3937R/w7NEZsJyBtmu8pAlNIOAnvZkzjKNM0D6HWx J/SkNiURIL9RYjA4cxgi8gPutHaIOyrwT4oert+DTpagGL+wNJwpatt8S2Q3AiSU dAbWJPf8SFC4yCm3IePE4F9FqI/Bu77h5wC1q6mQTSnHPv0+iEE8eYRCllXmPoKS 4dw9PwEqt5VwhzYt1cm4iFow9JMBzTj+L/7bcrszUs2HaVdGssKCJzAAMlbqW3tv FTSgrC9sH4QGm0WdvHXle7GB/KKG51blTXrzuupJYGJlXX5s8k1Ei4OVLTaZksEI fChHbA== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cxdt8113d-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 12:05:53 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-5091782ab06so669253551cf.0 for ; Mon, 16 Mar 2026 05:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773662753; x=1774267553; darn=lists.linux.dev; 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=3Q2i+GiHSpXUMk/5V2t9vb8q95gvl7L2wScFZUzHsU8=; b=VOTeUJ4bFogu2rn8IzQcmZNZgtMRzMd5EiHP0VUNTJiR9kqzyRu93G3cwSEMvGZxME fdOneOFcFmZkpDk1oHzoful1MpunpO6JC5VMQu88+6IJUnh/+xkNsqAgpo6E/I6X+qbF 5n3TY0PFu50MBSdhoz7UKOxu3XMg6q+M76g+AzuOeqWZRiuKUwRYjfJi9a7ztlOIjhVN rRquN7l5SkLtCePrCmj2C7ZUyYhwEwWs/XHgylashJ3Glx9Nn8ACv1X8xgeufxcEfplc I7lInjxvqpOC+KB1HNFfyvBWXh/nt/gN6JMak/SBIwQC0GqPum1WgSbdJ2IKE1kd+Mh/ pxNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773662753; x=1774267553; 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=3Q2i+GiHSpXUMk/5V2t9vb8q95gvl7L2wScFZUzHsU8=; b=e0eEtTEFAZwqowVQKhtbsGdn4Tu7kZmFESfTtlltY3VIQQ6hT9O9vYIV1OINKo0tbF Xx0prIrK4Rd5OlefycRNaJjDwg0+BtNCAanGHD4rf+YIymnxAxjUlVu/D0bpjgg/rJsm Z4swHEeAY8cfy5WMk5a9gn5YA3j+kTKGKPbu3MkuvPH5N8NMNo9fkIbsm+uHukgTkax9 tuZ/BQyym4Uv4f8II+zdj6qjTxwRs92O/iL6td9Do5u37LuMC3N5s0kD6zZnWXpMO4ZL nxmaWEnyWKkTWi3DUE4atLvRhBdOzcXWw6Vx7uHUgeYkI8icBFPE3rHozSGNILN89LKj 6mQQ== X-Forwarded-Encrypted: i=1; AJvYcCXRf6DBK13d6NsnGlvdbRmxpS9u2coyudox6c9NiLGFqDhRlpFSXAwYHi55AOdMWQL0YSw=@lists.linux.dev X-Gm-Message-State: AOJu0YzyzUGO8Wqq5abELJvX0zCdQaGuWt9GvzDObO72gr8+t4JZJ3sZ OC0idpYW27DuXzxrOQg310SCCfqOBHuQJtAxuHNxjejpck7YaUi5RJgViC1SuRLL6y2wlCnzUxH YMj4EMwTDVGSUB2OFK2RXaoi+VQG+HfCa/uqCqMPgog1LeBmjCj/ZYsE= X-Gm-Gg: ATEYQzwBEYE4HbW5dlij7jwszMLLxd3sFEXvUpX3ejDn39rjGMiNLiZjlDEs4jeP7iM euAI1ZgrYFO9ztA98QR2LZ4sNBPttzXByEG7QAgeXFa1yvy+VqoC5h+xqNtgkncTuA+DoP7u8VN 9FvUyoq93XGwUBTznFV9QrYuynhnAPjU7nmeyvrxgOjUGGWmwWtV4F8fpR+ya6zkcVhsBRVQEOe S/PbwHpy1LQxejLCvK1DxgqqBnhjXAxDHxhw7SKvipxMVqDN3Gql94bONB3aaw53ff+CDbK0wNV 0TeLSFIoxCGquxhagD7q9jvRtq4LiVEmnv/4/gIHaccTsmaEcF3wzVcjaNWTJohOIC8KCJAF1EN CUiYfO2rraLcOU9t/wSnPv+TnhP85JL+AgDzoZ75+KcQmLk46A+8= X-Received: by 2002:a05:622a:1a87:b0:509:4091:affe with SMTP id d75a77b69052e-50957e28510mr177055001cf.69.1773662752819; Mon, 16 Mar 2026 05:05:52 -0700 (PDT) X-Received: by 2002:a05:622a:1a87:b0:509:4091:affe with SMTP id d75a77b69052e-50957e28510mr177054061cf.69.1773662752125; Mon, 16 Mar 2026 05:05:52 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:45fe:3ba6:f90:d951]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe2273d9sm46468513f8f.34.2026.03.16.05.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 05:05:51 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 16 Mar 2026 13:05:11 +0100 Subject: [PATCH net-next v9 6/6] net: stmmac: qcom-ethqos: add support for sa8255p Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260316-qcom-sa8255p-emac-v9-6-c58934e76ff2@oss.qualcomm.com> References: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> In-Reply-To: <20260316-qcom-sa8255p-emac-v9-0-c58934e76ff2@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec 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, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=13278; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=3YX99yDiykq8wht5jhlxLD9GqcQlDRrqtioZ2YaSMF4=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpt/IJ7rps1mNZ7g5+PtadnJ3zPqa8dZ5z8b1NM e93budJrwaJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCabfyCQAKCRAFnS7L/zaE w20aEACpr9Y5Mk9Y78w0JYOWY5EpyvYX64sAyRDk53Y/JZzT5eAJlA76MTbgXZazP0dSuplyMrl eNfL+lKHJjmmI7486O+1g+ssbkDsKho584IWcU123YWfedeQqx17wZInirnIDfs4pqxXmrpH6Yq 9Jy5hIcBcH683eDUvfE2Lijkj5mq1TLaOnAdOWhkfjoG/sJZcf9pfxuYBmv5pT+hoIwbcvLs1gI AqV3AK4fFChTr3ZKGCmm0rCwcsFcg0gvhMuDYJVpeNcmlhYiwsbVDV/vw4Wydee5T5TIP2zr1dq Hp54ivBPauz5qQLFVoZRIWe9Sey4Q8qygliJtvxsRs1iVlDYeMcgtu0BYh5ciOxk//ff0SR8UhM 3gX5fpmdZo/mghcQSBV5782lUT3+2hVpQPFBu9kUqaFb68woTyUsemzbQDBHzPFeOD1Y6WOOe6u YlKNYBt+5dgczOr8pLX2pbMIuknsyFyNgQf+eV5X98ygZAzeYYEnpmTRRgIZn4CjfRiJ3EXaqkE /SZH91kPPmFBuX7Fg3lqVv/M428y3FdhSamclYfPyP5MJiu1Z+MaPVZdQtVJYuG9QPYI0wyLlJI HpClWHw0yUsrHWsxodAYIt2gKXwH0Ok8N1TrhJM0Oukpg16c5h5uvEAx6gM0NIovFvO5mIIKAFV boBC1OelpOx/7yA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: xoCywJU6DvsfMwwDSFynU3QdcdrkcgO- X-Authority-Analysis: v=2.4 cv=CKInnBrD c=1 sm=1 tr=0 ts=69b7f221 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=eSQ9y_BssGCL3sbXkzsA:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: xoCywJU6DvsfMwwDSFynU3QdcdrkcgO- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5MiBTYWx0ZWRfX9WH7l45RGvCJ 08LZ+QBRRNiscI+SZG85maEnoH5Hir5rPSjjEL9tP2+vyelI5HYd5HLnl3H9gSs4cL3Oa80Eyir UhuUZ/o29A4rn+7eVtzK6oq9e1JDkC9nAZ1P2urX8Dq9Cwq8DzPU6NGFQ3jE0sI++xVuZxv7mAZ lxgHvYQRsFuTWDEkEG1eniXYfblwyJM1YpPVx9si5AbPlSNveJT2mMMu2ipOBLAinF501HgZOp9 EOBt9iCDZw2FhHvOPB4mjF8NnGZThPlbv/i0H7KOKEmhcENY77L4Rm6mDo7pr2nk/bD1A9p2+m4 70Gjv4cGofg/O2BMsPtKi+JeRa2B0ctT9R/pMeF80QrSqiU7xrLRoc+JWK6fuWPavSY/4l9w1Tp jDRZ6NNBwQYVO3MkI2BuETO4idRclUNLLIQG+2aX/AcLeMdPvuHsJ2PSWA1e46+49ZRf9v5kfvt GGr5gShu8P6FLfIMBUw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 phishscore=0 priorityscore=1501 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160092 Status: O 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 Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 301 ++++++++++++++++++--- 1 file changed, 262 insertions(+), 39 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index f32ff0d9ce513d8270c8db9c549a79778549df59..09ce80b446cbac8bf85d974a3d6517e037b049c1 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 #include "stmmac.h" #include "stmmac_platform.h" @@ -81,6 +83,13 @@ #define SGMII_10M_RX_CLK_DVDR 0x31 +enum ethqos_pd_selector { + ETHQOS_PD_CORE = 0, + ETHQOS_PD_MDIO, + ETHQOS_PD_SERDES, + ETHQOS_NUM_PDS, +}; + struct ethqos_emac_por { unsigned int offset; unsigned int value; @@ -98,6 +107,9 @@ struct ethqos_emac_driver_data { struct ethqos_emac_pm_data { const char *link_clk_name; + bool use_domains; + struct dev_pm_domain_attach_data pd; + unsigned int clk_ptp_rate; }; struct ethqos_emac_match_data { @@ -110,13 +122,21 @@ struct ethqos_emac_pm_ctx { struct phy *serdes_phy; }; +struct ethqos_emac_pd_ctx { + struct dev_pm_domain_list *pd_list; + int serdes_level; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; void (*configure_func)(struct qcom_ethqos *ethqos, phy_interface_t interface, int speed); - struct ethqos_emac_pm_ctx pm; + union { + struct ethqos_emac_pm_ctx pm; + struct ethqos_emac_pd_ctx pd; + }; phy_interface_t phy_mode; const struct ethqos_emac_por *rgmii_por; @@ -338,6 +358,25 @@ static const struct ethqos_emac_match_data emac_sa8775p_data = { .pm_data = &emac_sa8775p_pm_data, }; +static const char * const emac_sa8255p_pd_names[] = { + "core", "mdio", "serdes" +}; + +static const struct ethqos_emac_pm_data emac_sa8255p_pm_data = { + .pd = { + .pd_flags = PD_FLAG_NO_DEV_LINK, + .pd_names = emac_sa8255p_pd_names, + .num_pd_names = ETHQOS_NUM_PDS, + }, + .use_domains = true, + .clk_ptp_rate = 230400000, +}; + +static const struct ethqos_emac_match_data emac_sa8255p_data = { + .drv_data = &emac_v4_0_0_data, + .pm_data = &emac_sa8255p_pm_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev = ðqos->pdev->dev; @@ -406,6 +445,28 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) return 0; } +static int qcom_ethqos_domain_on(struct qcom_ethqos *ethqos, + enum ethqos_pd_selector sel) +{ + struct device *dev = ethqos->pd.pd_list->pd_devs[sel]; + int ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) + dev_err(ðqos->pdev->dev, + "Failed to enable the power domain for %s\n", + dev_name(dev)); + return ret; +} + +static void qcom_ethqos_domain_off(struct qcom_ethqos *ethqos, + enum ethqos_pd_selector sel) +{ + struct device *dev = ethqos->pd.pd_list->pd_devs[sel]; + + pm_runtime_put_sync(dev); +} + static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed) { struct device *dev = ðqos->pdev->dev; @@ -655,6 +716,20 @@ static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos, ethqos_pcs_set_inband(priv, interface == PHY_INTERFACE_MODE_SGMII); } +static void ethqos_configure_sgmii_pd(struct qcom_ethqos *ethqos, + phy_interface_t interface, int speed) +{ + switch (speed) { + case SPEED_2500: + case SPEED_1000: + case SPEED_100: + case SPEED_10: + ethqos->pd.serdes_level = speed; + } + + ethqos_configure_sgmii(ethqos, interface, speed); +} + static void ethqos_configure(struct qcom_ethqos *ethqos, phy_interface_t interface, int speed) { @@ -710,6 +785,45 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv, return ret; } +static int ethqos_mac_finish_serdes_pd(struct net_device *ndev, void *priv, + unsigned int mode, + phy_interface_t interface) +{ + struct qcom_ethqos *ethqos = priv; + struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + int ret = 0; + + qcom_ethqos_set_sgmii_loopback(ethqos, false); + + if (interface == PHY_INTERFACE_MODE_SGMII || + interface == PHY_INTERFACE_MODE_2500BASEX) + ret = dev_pm_opp_set_level(dev, ethqos->pd.serdes_level); + + return ret; +} + +static int qcom_ethqos_pd_serdes_powerup(struct net_device *ndev, void *priv) +{ + struct qcom_ethqos *ethqos = priv; + struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + int ret; + + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES); + if (ret < 0) + return ret; + + return dev_pm_opp_set_level(dev, ethqos->pd.serdes_level); +} + +static void qcom_ethqos_pd_serdes_powerdown(struct net_device *ndev, void *priv) +{ + struct qcom_ethqos *ethqos = priv; + struct device *dev = ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + + dev_pm_opp_set_level(dev, 0); + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_SERDES); +} + static int ethqos_clks_config(void *priv, bool enabled) { struct qcom_ethqos *ethqos = priv; @@ -741,6 +855,68 @@ static void ethqos_clks_disable(void *data) ethqos_clks_config(data, false); } +static void ethqos_disable_serdes(void *data) +{ + struct qcom_ethqos *ethqos = data; + + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_SERDES); +} + +static int ethqos_pd_clks_config(void *priv, bool enabled) +{ + struct qcom_ethqos *ethqos = priv; + int ret = 0; + + if (enabled) { + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO); + if (ret < 0) { + dev_err(ðqos->pdev->dev, + "Failed to enable the MDIO power domain\n"); + return ret; + } + + ethqos_set_func_clk_en(ethqos); + } else { + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO); + } + + return ret; +} + +static int qcom_ethqos_pd_init(struct device *dev, void *priv) +{ + struct qcom_ethqos *ethqos = priv; + int ret; + + /* + * Enable functional clock to prevent DMA reset after timeout due + * to no PHY clock being enabled after the hardware block has been + * power cycled. The actual configuration will be adjusted once + * ethqos_fix_mac_speed() is called. + */ + ethqos_set_func_clk_en(ethqos); + + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_CORE); + if (ret) + return ret; + + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO); + if (ret) { + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE); + return ret; + } + + return 0; +} + +static void qcom_ethqos_pd_exit(struct device *dev, void *data) +{ + struct qcom_ethqos *ethqos = data; + + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO); + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE); +} + static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) { struct plat_stmmacenet_data *plat_dat = priv->plat; @@ -781,31 +957,11 @@ static int qcom_ethqos_probe(struct platform_device *pdev) "dt configuration failed\n"); } - plat_dat->clks_config = ethqos_clks_config; - ethqos = devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL); if (!ethqos) return -ENOMEM; ethqos->phy_mode = plat_dat->phy_interface; - switch (ethqos->phy_mode) { - case PHY_INTERFACE_MODE_RGMII: - case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII_RXID: - case PHY_INTERFACE_MODE_RGMII_TXID: - ethqos->configure_func = ethqos_configure_rgmii; - break; - case PHY_INTERFACE_MODE_2500BASEX: - case PHY_INTERFACE_MODE_SGMII: - ethqos->configure_func = ethqos_configure_sgmii; - plat_dat->mac_finish = ethqos_mac_finish_serdes; - break; - default: - dev_err(dev, "Unsupported phy mode %s\n", - phy_modes(ethqos->phy_mode)); - return -EINVAL; - } - ethqos->pdev = pdev; ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii"); if (IS_ERR(ethqos->rgmii_base)) @@ -823,35 +979,101 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->has_emac_ge_3 = drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback = drv_data->needs_sgmii_loopback; - ethqos->pm.link_clk = devm_clk_get(dev, clk_name); - if (IS_ERR(ethqos->pm.link_clk)) - return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), - "Failed to get link_clk\n"); + if (pm_data && pm_data->use_domains) { + switch (ethqos->phy_mode) { + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + ethqos->configure_func = ethqos_configure_rgmii; + break; + case PHY_INTERFACE_MODE_2500BASEX: + case PHY_INTERFACE_MODE_SGMII: + ethqos->configure_func = ethqos_configure_sgmii_pd; + plat_dat->mac_finish = ethqos_mac_finish_serdes_pd; + break; + default: + dev_err(dev, "Unsupported phy mode %s\n", + phy_modes(ethqos->phy_mode)); + return -EINVAL; + } - ret = ethqos_clks_config(ethqos, true); - if (ret) - return ret; + ret = devm_pm_domain_attach_list(dev, &pm_data->pd, + ðqos->pd.pd_list); + if (ret < 0) + return dev_err_probe(dev, ret, "Failed to attach power domains\n"); + + plat_dat->clks_config = ethqos_pd_clks_config; + plat_dat->serdes_powerup = qcom_ethqos_pd_serdes_powerup; + plat_dat->serdes_powerdown = qcom_ethqos_pd_serdes_powerdown; + plat_dat->exit = qcom_ethqos_pd_exit; + plat_dat->init = qcom_ethqos_pd_init; + plat_dat->clk_ptp_rate = pm_data->clk_ptp_rate; + + ret = qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable the serdes power domain\n"); + + ret = devm_add_action_or_reset(dev, ethqos_disable_serdes, ethqos); + if (ret) + return ret; + } else { + switch (ethqos->phy_mode) { + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + ethqos->configure_func = ethqos_configure_rgmii; + break; + case PHY_INTERFACE_MODE_2500BASEX: + case PHY_INTERFACE_MODE_SGMII: + ethqos->configure_func = ethqos_configure_sgmii; + plat_dat->mac_finish = ethqos_mac_finish_serdes; + break; + default: + dev_err(dev, "Unsupported phy mode %s\n", + phy_modes(ethqos->phy_mode)); + return -EINVAL; + } - ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); - if (ret) - return ret; + ethqos->pm.link_clk = devm_clk_get(dev, clk_name); + if (IS_ERR(ethqos->pm.link_clk)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), + "Failed to get link_clk\n"); + + ret = ethqos_clks_config(ethqos, true); + if (ret) + return ret; + + ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); + if (ret) + return ret; + + ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes"); + if (IS_ERR(ethqos->pm.serdes_phy)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), + "Failed to get serdes phy\n"); - ethqos->pm.serdes_phy = devm_phy_optional_get(dev, "serdes"); - if (IS_ERR(ethqos->pm.serdes_phy)) - return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), - "Failed to get serdes phy\n"); + ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, + SPEED_1000); - ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, - SPEED_1000); + plat_dat->clks_config = ethqos_clks_config; + plat_dat->set_clk_tx_rate = ethqos_set_clk_tx_rate; + plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config; + + if (ethqos->pm.serdes_phy) { + plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; + plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown; + } + } qcom_ethqos_set_sgmii_loopback(ethqos, true); ethqos_set_func_clk_en(ethqos); plat_dat->bsp_priv = ethqos; - plat_dat->set_clk_tx_rate = ethqos_set_clk_tx_rate; plat_dat->fix_mac_speed = ethqos_fix_mac_speed; plat_dat->dump_debug_regs = rgmii_dump; - plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config; plat_dat->core_type = DWMAC_CORE_GMAC4; if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs = &drv_data->dwmac4_addrs; @@ -877,6 +1099,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) static const struct of_device_id qcom_ethqos_match[] = { { .compatible = "qcom,qcs404-ethqos", .data = &emac_qcs404_data}, + { .compatible = "qcom,sa8255p-ethqos", .data = &emac_sa8255p_data}, { .compatible = "qcom,sa8775p-ethqos", .data = &emac_sa8775p_data}, { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_sc8280xp_data}, { .compatible = "qcom,sm8150-ethqos", .data = &emac_sm8150_data},