From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2C4030E84F for ; Mon, 27 Oct 2025 15:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579908; cv=none; b=KDlBgpKLAzWlr436NW1qS0LEXholbZ/mfNmoOQRURVocXN1vJKPyTwB4KA67jnw3XM6n0yN8LYHayJ0dMMpAt3BWWjWusP5SIyY3GB5+VwZ/8fFa8fw9ZqlskHtkXLFyAygfIV9KFRxFtpTpplpSPmKs+v5rIkIXv8ik/ZbQ7po= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579908; c=relaxed/simple; bh=7o+nqASHx7UH7QHI/rACvEF8YONzSPI+tDQ5Q819Mjo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NAZXM7t6bpQjadAOxvOQ/xnSw+rj/bXuk7orVtIyaq6782lQTn4Qg3bLx/Bguja25tRNBwoIhV9yJGcE41+4VQA6BSvNFlUFgbCmoCkVAAfD/pB4QVwIutQ8FfD+j4703zp3IdlQoYro6u/XMDvp8Yj585Qcaq0WDfUTb84eBCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=gRxg1sLf; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="gRxg1sLf" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4711810948aso35214485e9.2 for ; Mon, 27 Oct 2025 08:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579904; x=1762184704; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2OlAwR0Ez2lmPLsYc3tLDTQTUPw8dFRTu8oJtM9uyYA=; b=gRxg1sLfl/oNehVvqBWREMyuSzblcB8cWusv0Rv41CZPh5rigCp2Yji9sKEJ2FDcx1 55OH+GAbdGH7pjQDtBBTkCiGaiFnhNdWt7H8mT6BcpCttcwz4vB0qcI3WKxOvizNjtzo t7Xo/Z5GfeE6iGEKyDe7B0gqtQGIz3pIcOod+DRGXt1FiHrKcRO6Do8eJCsB5tbcqgLy IwyjXQjrpyc8+zI15ZiyVUSF7i2cySFic5+BVRgiHc0QeQUXwqDwmUlxtP3s7dcJAD+/ 5IxbT849DQud7vfgnw8JadpQ3FeSe1fA4s69iXuSwm4jhIEmoqXfLPyUIlzX47p+pxm5 1L1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579904; x=1762184704; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2OlAwR0Ez2lmPLsYc3tLDTQTUPw8dFRTu8oJtM9uyYA=; b=mfGwuRMIbHEeQy6gJjsiuZY5e3XAvbm8zq7OuSmdNZCU9QNSyEE4WLqGYS9wx9cO2g KJgB1BX/k0ZAlubtdwp++oZAw2TFRRqMJmaQ+9RvRHgOfH7hcS+c4JxKwoYEYeaFRHTh 1yjvFzl1goDY6QpnbLTrSphWFYlSsSdRftBcaEa2UeG9X2XUFqyZj7EKSUucfHOeohzk rMJHjPxImCWXKQDtWOXzSCiSrNyOA8FoIs/QSIR5L1MCkhzhZEoztUaMjhHS3IlMcw7h YjFmrL1WhQOOl9SMmkkTvF220H5BhCU1yK4LoKEwEghlEuP2Abd340d33ok2OTdN64pT +J3Q== X-Forwarded-Encrypted: i=1; AJvYcCWRoPsVhWFNFM30fKcAQ4GwrNkbv2uUwNKZGmx6txrQNnYOIUCgL5Pu4y7Myd5ZZoSsrVYRwtbgFFD/rIs=@vger.kernel.org X-Gm-Message-State: AOJu0YxhADQn8yLYfTN3mgCMYkVdSsBKcCTdmtg83l/5rKIH+Oz3JMrF vE7cwWGlTS303NtzMloearuq8PnGPsIiPQfA37w8y11IeW6t7/RrnkhbJh8xMGjYo1E= X-Gm-Gg: ASbGnctnUu63Xs2QY2bm7ISTXDXv36+2/ubJERn202YO1wrKQhxAntXSpV12jveGQ3C 3p1PUFlCGBkRGlm13Be8zL1dPCpSAjdx7epIh1MGxPA0snjyZN/QOaiWq+zop6rvAusfm3QnGFQ G4VfnF9gWmPWXyF/rRpmayl6aCdVPVYL6DVi30H2t0q3k3dWR4QAYnxq+mYjSUw6znqrci40qXi YJHyQNSBU7LR+RY/JckVlXPO55+U0ifIFnEThVEjU8+5Qv80y6p8nFcDB3YQWN3n7drA+j2JSjV kL3737rzBtXHm8MqqKhQxYrDBZdDwX94DliChmiWLmuwY9IaCJ1cQ7LMGN1AVCGubl+KEHuM8p0 vUBpUONUgHn+8lDu1P4RFP17xyRihvyMiCE4jX6d2fqmHlYAAelgIez3LR8bSdqv+YCY/xZT0VU wSrwIRC15LHxzvRPk8 X-Google-Smtp-Source: AGHT+IF3LUL3bfxhtdpuEv0pHPdlEkBGo06ytgVfCVUCGuaC1FOwUetTffXhS0o9uNVApIit+32qLA== X-Received: by 2002:a05:600d:416d:b0:475:dcbb:76b0 with SMTP id 5b1f17b1804b1-47717dfaa40mr966635e9.12.1761579903932; Mon, 27 Oct 2025 08:45:03 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:03 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:49 +0100 Subject: [PATCH v3 1/8] dt-bindings: net: qcom: document the ethqos device for SCMI-based systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-1-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4896; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=OSzCwUgDD3l4L0pYJMm0DD9DnJ/KFBo24c29rgi8yQk=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N6lhNlND4rsq376wqaZULe50mt5NDwwtTRC AFI8PIWioaJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TegAKCRARpy6gFHHX cruND/9HOgu2X1rNis9f+h3vpeLQ56ytu76P+bQW61H4CEezr3VWwQLx8BRjR1WXEoMT+5TlQRs ipD2fBeg8mJEbLux1Ltn6ag6107Soa/wvshuCQLxGVql/6xlYoDxSEEptIPhKa87T5+cb9tkCFJ xnw7Y4Wmsi9CKCy0YmRXURj0Gp+5llGqF6v0GYFf47t0PMRU6EQaxv5WFe7nw1V2ZA3ObckRqO2 /e6dA0pR8x+mdWoIX9kdjlHcXEtlIseWvd+t3xM1UhGQM6atPn6tzQTh3JYd0uYChSqoqqxEO7x HjKBGc8YG1yjalOGpowa/eVeCjdVXw5KoUwZIREYEGEEnj5n4UssoDUABQC/LnKNGkoFRnF+0Bm Gg+7o9dasJAxuLr1Me2URwCXqUmxY6MQaN7/FqJm32LzdDs4z25W8siYaIc6hgl+/He8Nc1NAqP 54GzTigkE5CjoL26SEhe+fRWClFSMDXUQQaFEfPDzvo5ZqPXkxZ/i4Jzac7IElpTQ6ItiKflDXL uqL6938plMXE7AQDbQ6IiZG20RV8dFgp6lHN3fN6Ktz4SLWi1jNkPMeFP9MzpATft99M2HDcAII NJVxIgZOSCbNz6zOqA9UlgkJ1Xo4f018d/ZhkyJ2hY4Sd1Sdc+Vt13hMV3uJCsJCuSJOd8luOwo i45uTVSxobapSnQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Describe the firmware-managed variant of the QCom DesignWare MAC. As the properties here differ a lot from the HLOS-managed variant, lets put it in a separate file. Signed-off-by: Bartosz Golaszewski --- .../devicetree/bindings/net/qcom,ethqos-scmi.yaml | 101 +++++++++++++++++= ++++ .../devicetree/bindings/net/snps,dwmac.yaml | 5 +- MAINTAINERS | 1 + 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml b/= Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b821299d7b30cdb802d9ee5d9fa= 17542b8334bd2 --- /dev/null +++ b/Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml @@ -0,0 +1,101 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/qcom,ethqos-scmi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Ethernet ETHQOS device (firmware managed) + +maintainers: + - Bjorn Andersson + - Konrad Dybcio + - Bartosz Golaszewski + +description: + dwmmac based Qualcomm ethernet devices which support Gigabit + ethernet (version v2.3.0 and onwards) with clocks, interconnects, etc. + managed by firmware + +allOf: + - $ref: snps,dwmac.yaml# + +properties: + compatible: + const: qcom,sa8255p-ethqos + + reg: + maxItems: 2 + + reg-names: + items: + - const: stmmaceth + - const: rgmii + + interrupts: + items: + - description: Combined signal for various interrupt events + - description: The interrupt that occurs when HW safety error trigge= red + + interrupt-names: + items: + - const: macirq + - const: sfty + + power-domains: + minItems: 3 + + power-domain-names: + items: + - const: core + - const: mdio + - const: serdes + + iommus: + maxItems: 1 + + dma-coherent: true + + phys: true + + phy-names: + const: serdes + +required: + - compatible + - reg-names + - power-domains + +unevaluatedProperties: false + +examples: + - | + #include + + ethernet: ethernet@7a80000 { + compatible =3D "qcom,sa8255p-ethqos"; + reg =3D <0x23040000 0x10000>, + <0x23056000 0x100>; + reg-names =3D "stmmaceth", "rgmii"; + + iommus =3D <&apps_smmu 0x120 0x7>; + + interrupts =3D , + ; + interrupt-names =3D "macirq", "sfty"; + + dma-coherent; + + snps,tso; + snps,pbl =3D <32>; + rx-fifo-depth =3D <16384>; + tx-fifo-depth =3D <16384>; + + phy-handle =3D <ðernet_phy>; + phy-mode =3D "2500base-x"; + + snps,mtl-rx-config =3D <&mtl_rx_setup1>; + snps,mtl-tx-config =3D <&mtl_tx_setup1>; + + power-domains =3D <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>; + power-domain-names =3D "core", "mdio","serdes"; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Docume= ntation/devicetree/bindings/net/snps,dwmac.yaml index dd3c72e8363e70d101ed2702e2ea3235ee38e2a0..312d1bbc2ad1051520355039f55= 87381cbd1e01c 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -71,6 +71,7 @@ properties: - loongson,ls7a-dwmac - nxp,s32g2-dwmac - qcom,qcs404-ethqos + - qcom,sa8255p-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos @@ -180,7 +181,8 @@ properties: - const: ahb =20 power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 =20 mac-mode: $ref: ethernet-controller.yaml#/properties/phy-connection-type @@ -643,6 +645,7 @@ allOf: - ingenic,x1830-mac - ingenic,x2000-mac - qcom,qcs404-ethqos + - qcom,sa8255p-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos diff --git a/MAINTAINERS b/MAINTAINERS index 252b06d4240cc2b67405b8a967055bd53dec7c8e..14c80fbad8b97cc5562555d2422= c81724d42111d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21218,6 +21218,7 @@ M: Vinod Koul L: netdev@vger.kernel.org L: linux-arm-msm@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/net/qcom,ethqos-scmi.yaml F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c =20 --=20 2.48.1 From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6230F30E820 for ; Mon, 27 Oct 2025 15:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579910; cv=none; b=MmTinCC/HNYESYK3hGSJ3MxNqtu93C1nbxAYIbI/QW4l1D9NbprZZ+78SWLXnhitFpkKvNd5y7S5+Hl0qu9zVyo4J11+75Ta6PWia0r2J/+/QmcCJSNr5jNtSc6d8aY6UbjdpQtU4lleiFq6o86iEn66EmMjACvlZNXCABjLNsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579910; c=relaxed/simple; bh=ExojDb41iXZ/wPAxRGpSxEr0wf1BiXIiQyP4GRsSHFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CzUXvcKe+hsN6MM5b4brQgc2lOh2FRdAnksU6fU3a2d/bJmIMp36SuiXIZp0iVwnX27SHIEmtmt9FWueZRlt5ESA66ygoCWIwL9v77YBjF674AZ8ibYBTGNENJz71R12W8rTy7D8AsAX10UTZaXPKhlB16MD+D83wNEu0CFLdfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=smSMBJ7p; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="smSMBJ7p" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-475d9de970eso22473085e9.1 for ; Mon, 27 Oct 2025 08:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579905; x=1762184705; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hPXw61XXVZPE5iGSa5+dbW4T5B5jPT8r8QbZD1R689Y=; b=smSMBJ7pEVQfJ6mMOb4n+CQRWqClYewppcOiMOiFnpvzc6FFLwKEWhMchNbrwipxaJ fXu2BCc2WVGBVGgnZ9Igt7ArznAntpxdHxJbutzX7+VRFg1Rw3ewXOnHmNGPD2vP/sNm Mm3z85NHtw0u0wRfyzbw4lT0ZPci/BU/LTCwLNqiGoghQYy8Tmpbf4QaZ1ANfeu1RQk7 OdloWMXMfaKx6Lr3D5PadOysQm113QAwu8ig0DiqX3vTEtF0eslS8T8b+AYt3UVmeg50 49xk5MhIBQ/kS1QlArstm8gnuQhKq/hEU171yjlQmAo4bPuWjY8xqCUL1kVrjHpzAavw lg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579905; x=1762184705; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hPXw61XXVZPE5iGSa5+dbW4T5B5jPT8r8QbZD1R689Y=; b=e2u0q3zRYzTGvs5eeyy36egZeD/LSAAPBiA8pU5cSOfjZj6M0zCI38IcPyE7z0+odb 7tyj0mw8VORsxjVKP2amGskIlPpjF5JH2JXmdxdG6Sxe+TcdmJB5NYu5RGtV3ZBfBe48 RmSckBxCP1lBnNG+aApWb7m+8bN1Z7T+rkm6ZbXMfUlFdIKJhQGWSo3laic6Sn+T+vPx K17MZzIEVDD4J/6UK5lz7DRuBiyVNt5d33a7SycAFM+Dvfww1E1qp1J4WDFKuYJny12k lzW8KY5Ou+xjH+R+sJbd0YLoRsOXqRTIzqK6T1MS+tO6HV76R9tbPsdsziJCdZJ5SZ9f p2sg== X-Forwarded-Encrypted: i=1; AJvYcCVQUSQAJwt3ekxv9Nsjp05dcQLaIE5nRFuKAwMjnvRoayac73UXI9pFHQA6I6aU08GCEBsWyg5eVpYJbKQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzG5g+4hdZ/uZXQOw42UdgB0qVDraS1WCIGwU+JhZEfl5U3KE60 YQh+CMSsOD1vRl2bFkPyXwTl5xWUB3feR7SpIlvB84lOgw4TRHGgpD7f4U2/3Q+sfIA= X-Gm-Gg: ASbGnctqJ/+A5rVx6dRfCe6jq/X6jsaJKT3bfPDijs6PKg7MhKkFYXdasX7EZU4vFAj KqNmRr/M3JygAAMzENhZpW2dMdGp4fKxDEJr9PnieSM9idUbKpSdKfRf5UcZuShZ1u30rgEFny1 N3S8dLiu+5gZ7bE2538xzTTW1eFhij8TYW9AralJQUfndfFCQNmdMkn7PTfW/zTekwUoegzaiyk TA0lctCAIYaQEpRVhSdqpQbTKHe3sW4XpG/NrP9j00FyIS9xEaS2LAW/by000WSyYx2ALFG07Aj qjPEbosaoyHYPEYr9T/D+amMfdZx3mtgR4evhTXp9gl2vRMQNEZ3BU+19bTfs+ElZY+M8rNAuUz OntvKqq+XmRa2V4OzR6w5RS5UcGHgdyFuxjqKhKQuAPm7vNVqXc4QBYrEbo1Ph7fgz8VEAwz6oM 99hMaVtA== X-Google-Smtp-Source: AGHT+IEGeaS0+QG2Aha1NgT9BPrRrz4NonOWyil4rVeyKXTgBzuqvDLGB5Q4ZzRtF1NNuDSXdfB8XA== X-Received: by 2002:a05:600c:45c7:b0:471:747:2116 with SMTP id 5b1f17b1804b1-47717e62ebdmr726945e9.41.1761579905524; Mon, 27 Oct 2025 08:45:05 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:04 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:50 +0100 Subject: [PATCH v3 2/8] net: stmmac: qcom-ethqos: use generic device properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-2-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2896; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=vnoFLVrcb6l7nKIGlK4OOB/YGlbBMeK7LkpWKpc+pc0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N7HQYH3vFxPerzcQsvDYeZugsZRuhl7VhVy 2Quu9L5hP6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TewAKCRARpy6gFHHX csb+D/4hfQLnbDWWeEYALfZLjfvHcxj8QC1o1ijyYS0DGDMJ3ieET7R5s5vFXLyeidjo2LB6Tkh 8xuNaYYnOMXK012RnFUcfWsqh9VA6dULq/Jec7Icz2SLCkvhUoOz1ECVU8P7/1HgscqZhmPhOrA OAVF7sMh5tRhWVl9KR89qFqaOsx3xtcKj1Irh465tlUbN0zClc5WMgPgXvHthIRPi0mT7evAzul 0BFb8/NM0urZ3Ltl0bA7WAnBBi7dQFlTXlebiWRHr9tRKb1lRD3yOq+JZBOdi6YGlBRX7lPU9qh toxfr8G9uzCoO74mRZa3B4nfcbC3XPCMc5ElZCyAizNPH8G9poSOjBCbTIqCtm3liPTitgcCX9K Wato94CMw/zKGgD1iH7/PXuT9dUx9nVhoKh4HihhNHyhIFhdXusnBLB6Ef6t0UwNF6lxxZbmbG0 sbFuan/mab3AyWEcHTXgY0kQWr61TRd61v7YFITF6W9l0sfwuHXbcDKUR8LRrP3dd4pr4IsNNwd a58xY/CshZ5B6P6t4DUaz27fECD5yhDvH1034dCAf5VZCUSjfXtpsLy/nyoaZsZXDJsYSQARDry sMsM1CFH/f6CYRh1vjyNCQgrB0KaYJGp7Iwc31evTSdVWgJzwY4Ou/YG7ueRtt4DzQU4AZaAjgA sickoFDA15UyOgg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski In order to drop the dependency on CONFIG_OF, convert all device property getters from OF-specific to generic device properties and stop pulling in any linux/of.h symbols. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethe= rnet/stmicro/stmmac/Kconfig index 716daa51df7e50e401e2c2ca305055dc52897793..d27733b8a05a393ce356543c799= da18a6d9b9083 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -134,7 +134,7 @@ config DWMAC_MESON config DWMAC_QCOM_ETHQOS tristate "Qualcomm ETHQOS support" default ARCH_QCOM - depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on ARCH_QCOM || COMPILE_TEST help Support for the Qualcomm ETHQOS core. =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index d1e48b524d7a964f229e2bf28e7a316325726193..b24134923fdff0de8b608c140df= b8ffaccd19303 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2018-19, Linaro Limited =20 +#include #include -#include #include #include #include @@ -762,7 +762,6 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_pr= iv *priv) =20 static int qcom_ethqos_probe(struct platform_device *pdev) { - struct device_node *np =3D pdev->dev.of_node; const struct ethqos_emac_driver_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; @@ -813,7 +812,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) =20 ethqos->mac_base =3D stmmac_res.addr; =20 - data =3D of_device_get_match_data(dev); + data =3D device_get_match_data(dev); ethqos->por =3D data->por; ethqos->num_por =3D data->num_por; ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_en; @@ -850,9 +849,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; plat_dat->pmt =3D 1; - if (of_property_read_bool(np, "snps,tso")) + if (device_property_present(dev, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; - if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) + if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->dma_addr_width) plat_dat->host_dma_width =3D data->dma_addr_width; --=20 2.48.1 From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43C7F313552 for ; Mon, 27 Oct 2025 15:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579911; cv=none; b=hfbZag4tJjvqGD02jl74M1ITS0a+H+bDG6RMxAzte/i0anxoX6gw0+LooJDVQkT1guizl12PqkuexYYTOMXx1JPLiQwHPNu0KRj2/E03oOgWWJwMiUviMLhMTtXpqfRHLmKjiPJqhFdiEfI9cfjebWtlqS1nqmmT/ywBESceuHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579911; c=relaxed/simple; bh=Rsilddn5Sk/PNb9loA2m4U6LcOVffhba4b6v0fmItZ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B4FasQ12qjdYcaAm1enXCSKWBu39xH04rCZzOcNXpeJwpVXtpRZ9yJwpXtRTVBEq86ChSQYdmeMLqLqzkqckEafD80zMjVcCw8LvvWh5QLHSnkMM9FsILqYMeMljeAGXEMcEA/qiYiLLk2vl6c1nluG3RvtK2QrP8NB4rVFdXAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=VAs1RItZ; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="VAs1RItZ" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4711810948aso35215035e9.2 for ; Mon, 27 Oct 2025 08:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579907; x=1762184707; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BBmZV3Vyg2J9mVCwrX0FEpMqEZn3TiFxaC6u7B4A1Dw=; b=VAs1RItZlhAN5Yi7DLju0yhgGx5itR+LbLkOaURUrlz3JI/EsULTlmfAwxndh2lbye HFiBDCjaWzg8/tpRai3pKt7e7KntzaNcJsaQVc6F/SO0ozI/U8W03t7CARUHYX8NsRZB lHJfjeYk2mEcSKs0tPr5LGdrF4m7/qF9DfAPRJQKBkNOVZ3wF0lHD6TA8NVK3bjkm2ic /AwEVMn4/of2CCUR5MT7TG8/5HZFS3vywfUvXmNCNj81eOVqUHJ5nAducpyhgnJy5jiF VbNwRM8B2afoI1dAWPx/mIMxpsXAlZ29yJ2zdukgV+QpCuoA7SFgU22z/V/dSoiLHdld SCsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579907; x=1762184707; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BBmZV3Vyg2J9mVCwrX0FEpMqEZn3TiFxaC6u7B4A1Dw=; b=i2rDG5vuLA4CM7F9RTmCsfugZUwXRP0BGBjkPgoBlZ9/1UiPVEpQErag8O5o5psEye doZIq5OfQUiB+2sbENMFFS5H5rsza8fPodaCd4a6GfLGzOc6K5CmklmY96jSyo1cOpLq plaAjyahufW45OS/LdhDcXvjP0pVZMCwLXQgRE9oLhChJktOzYqKL3X1W6qvbZeQDLSV sUo301DIJHy5D3tyy/HMigleoMyPQXlOuPhokuUlsk9jmiBvaqf1JfZTPbUQb5/5NKnb oUYEo4wLREw0fHc+sLXFTIqgzFrgLcNTQD+BMnKKLcdJEqBSSZl6EZjGAyAYJDnw2+4j xncA== X-Forwarded-Encrypted: i=1; AJvYcCWY/foD0mJE5ctvXV9DL7dY4fBRDk/BJWktTMGpU29VOoadDJuauDJdd9uA2zNnqER41lWIIY+VlklfSDA=@vger.kernel.org X-Gm-Message-State: AOJu0YxRDD1BWA4GHtkttUZW/vVB8VVNnNcyn7wFYZeW2xH0AFRNfWhM sVruHCCOCwx8xEumS0zenrga8O8J3fgedWVpzunxmsu/+DZYcGhZWfuY1GE9WeiZOi2cdBIIOst IS3s249s= X-Gm-Gg: ASbGncthHM42MOnOcJ6ar5kSa0PJF+2UcJVnG4spmoOqoCRj8X3LN+Q36RMk60Q40ff e9DX+bfFHDaCXSZU87aRpZEQRaRbR/aDLPidd1yyzh9yW72KcOl+EFqF3f1G9H/RXwe8p6HQwa0 Bv+zVVRk6iR4NYuEczkct7tWzOQmPW4VZFct0CFu8gB7SQjPSmKhOQv2qNx8OIwYBmehcJqm+5f 5lgnchI8IOQCEvj8R8wteUk9QFt36FaCnhmqVoCeOaX6RLVm5Y86Xfd1Gu6mJnVaR5azPt8lY+j 5qwOiT9Xk5IkhmtTYlbvNrcqd+MSXkLQg++G+WHbi2+6DuWRCAzu8vqD0ZdigxIg+edI/vmJxOA Ddya+m8UIn4mW+KnlrwloXOUdnUv/GGN5PiRi8D268qMozQ5ljZXAEqodgDfIvA6QXgdZXyPmKR qbFDaYJA== X-Google-Smtp-Source: AGHT+IECWyoE3V6eNyQ+Ni8Ig1arWy6NtdUV/t1u+09OLLf2glJJDnd/F8BXPUeWLSqyq4r2HXl0iw== X-Received: by 2002:a05:600c:3b1c:b0:471:1b25:fa00 with SMTP id 5b1f17b1804b1-47717e633acmr828955e9.36.1761579907219; Mon, 27 Oct 2025 08:45:07 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:06 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:51 +0100 Subject: [PATCH v3 3/8] net: stmmac: qcom-ethqos: improve typing in devres callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-3-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1037; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=mTsLMd9S404QxSew2dDaObEMEcD+rURz88/DzU+Cui8=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N7EtUYevy0KNURGjAbWD3ayjri7A65CXIjY quz63CLKUGJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TewAKCRARpy6gFHHX cpbXD/4rW59U3OyLKQKSjyyGQZLRkkV8UI/gn6+DtitezsllRAWiFL5xVrZxt57QxejnFAXi8D2 ES0aolYvT57xfwVmbnieVs//EfL4Nq2ufUvnOJRYovEMS8cCxZ0FdtbrDV55ZFA2xHFcRUbpeGT +kcbYMDKWwu7pmV+biu9VEX6h1ZsuN6inepunZO6CYaGeUQOFyxJgf7ZY+nVWGvFsttL39Yai+d 47t+qO1FSkpLxuakyURveQR1OsD0K1NInybeUmT5ApMUTKH2qNvpINsML4eTdL8yQN1zDL4mJjO zvN7lHjuKVJzogJnKQ078cHKC4hZ37wTHXuLwlHMG6URPvJbZj5MC8vvsU+tYoAnlNa5og0EUSZ R6gp5VYDQjzuERZnenBkmnx1WxQWAELVzPGpjwiUZ4J+UjIsk924po+ncs6LLXVCzuZx2uVzOEF y3FOVDZJSxf+vY7AR+vS8gkmZX/d1ZK8IqdnG5pOqB0wClGIfY1ZHo0Fqi+HqYfAvQocNAD6Bds m11j2pa6BtW2jcLPAxKE0gGZK397ZfEijSV/fIFP+LU609n2HiR5LiLaZc5BfPjYZgBAezW96l3 0WyQf+SCZ6+fviTWrnZYwhzrLPFBH/4e4GWB1aWkoTnrXpLB9ivxHseQnnGvlI6MPkZ5n2/WLxJ /yj4Q1OMbOUwjFg== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski It's bad practice to just directly pass void pointers to functions which expect concrete types. Make it more clear what type ethqos_clks_config() expects. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index b24134923fdff0de8b608c140dfb8ffaccd19303..ed799da4e4079b4da4b555dd119= cce8c6591aa39 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -740,7 +740,9 @@ static int ethqos_clks_config(void *priv, bool enabled) =20 static void ethqos_clks_disable(void *data) { - ethqos_clks_config(data, false); + struct qcom_ethqos *ethqos =3D data; + + ethqos_clks_config(ethqos, false); } =20 static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) --=20 2.48.1 From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36E3F30C368 for ; Mon, 27 Oct 2025 15:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579913; cv=none; b=ck9bl4/FfGapUmRDnI9GDHRsDpgUpmLrCzroEAGvrz1qmzPArIIA+4iD9sHsnoz9cvsmM9MeqalE3FOOFBvnkwRT7/JStyO4lNS1gNXxaDc9cyBwbCpvXLYd4c17Pj6TVkU5ALMwSQKtNkykauN/D3P6VWqhpu7Q4tC3yKR/a0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579913; c=relaxed/simple; bh=Zl99jxf9GqRUfYwhYic7tLWQVs7Z1avi6s/bbIYjffU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ryHiV0T3ELFzhTT/C1rOnGvMUeRVnAym/Zp7kOnjLpJiwv3S2xMv6WE4Vx1qrw+VsUGCH8+eOHLwsDb8aN8x+b+ahFNPZiueELlv7PaspnYEF8AiwhQRNIzsUtGT2eoVo81ajuMI6qJJFyooCTGky0uTEaO+puJb1Lj/Jl2YCOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=q/4rFPnU; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="q/4rFPnU" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-46e6a689bd0so48556475e9.1 for ; Mon, 27 Oct 2025 08:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579909; x=1762184709; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OicQ1OKV8T/1KX5QBfxYsQT9BwdWiJOdtGfcmUcFvvk=; b=q/4rFPnU/fv4dQG5NLyotxHifdaDdMXgJp0UGTwRCslFf2nPjxgThRj9LkahXr4ZjP /68t3RA5MjKllO3d4obzPEVn2Tqie0e8uSCnK+ePbVFVLQmHQ7qlwT5L5B/LfucTdmEF usomDjNVcoxDPtZyLytX1tOXmNatJlsRVI8lP/4zGWj06ZqccSASHhqoRkY9vUzZfhQ6 D0z9Yl3NQ/ZjD8Cq/3gB7JK1NT2xY7R8s0H0jeSKiZJnHS+HYW3U4nN3TU5LC7sIbftO 2uI+0uuxRlv/6/LECJIwOpd443jzdJk6F6visGJ56ExfxKIpJevTS/RCoEHwHf1R5RzY 4fyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579909; x=1762184709; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OicQ1OKV8T/1KX5QBfxYsQT9BwdWiJOdtGfcmUcFvvk=; b=mBO+VrFAIfbali/op8Pr5cKglRarOQl5m0tB7oPnPpdwltkwkaHSTpfvW083LqMo6L LElvdCBHZOjvGKFxPDFaGWNoj/UF/hH01V041+V1B/LS45T7jzDaG8rxm1j2zkN8YFvJ gaMkQDrqjbUakZY5EXoaNEee0eiqskoYvpTlcx1puSRyyB9FohbQ+fyiCtNU7jZnAHdg K1ZEwwpg9PYz2YmUYOWW3Qcu19nQzdkZa0Ze22xguCupZjmQ1aioGwQy+OXz/n/oGp7L tMik864we5cbguDAu3eoiMR/6V0MEE/WFBkI1Wgo1cI5v99XEeN30f/Sriey4D+BjzTv kc1w== X-Forwarded-Encrypted: i=1; AJvYcCX1fvqVwqCqafaQ0yhtJLfYCpNsbAvofkHrn9OkuRuHnsbPbUXOmffss0cTHZ4Tx00F3AwV9C+VtZ7/QjY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5+WipWAv0oA+Ys8ucX22YvSelYJfAPeWFPu0F07oWTDNiRX1k oRSeEaMFKDrGp1Z+H/z/bSgNhw6i4nX/SzZJM9Xdh6lS0aHUXMjkmnfVqGPB/WVRnA8= X-Gm-Gg: ASbGnctG0MR1S5MyrLPX5n6Bz0ZWue5A0dR8Ah3ZH6Aco8X0mThmIT1iFgejmRvPs89 +Qk6Wo77tV6PvFYznMUpxCSHWcijv7oiN7AMltnXlmzMGAKjmqhHUaZY8StYGeqcCU43rndRqLU P2ZDjTunlQhkDf1XwLjAXxfLZ1iSN/Y8UYX3BC3H1iujojN62aHO2M/tgEL0/pXErPYaSLGUME9 1D+X167zpjy/nZmEL9lkRIFWDhhN8fN4KcnuTBHQhLf/wyxY6LCgJb+kTq1CMB+ND2gQkAMfana MrFc06KGoV1fMtxCOlFe+z5kJyrBwLRPtb4LC/vglA89QUfXYbsyy2sd97d3FAk68W49ZfPvmdh xstO64NQaW0MgLPwoMHlPR4vb8khkFBpDLpCWub4op3gDZa2Ryz44fxev1mkmhLmIFyV6vYg= X-Google-Smtp-Source: AGHT+IGnURDzCL6EXlYFgChfMetXN9DLHbDSZlPkZ7qshRFfNPQz3EB5h9snkYgIRzQ1RyekW2OGPA== X-Received: by 2002:a05:600c:3b24:b0:477:58:7cf4 with SMTP id 5b1f17b1804b1-47717df7c8emr1161855e9.4.1761579908909; Mon, 27 Oct 2025 08:45:08 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:07 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:52 +0100 Subject: [PATCH v3 4/8] net: stmmac: qcom-ethqos: wrap emac driver data in additional structure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-4-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5648; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=cOSA+NoNF7WC2Y1gjjgtDMtaHJ+KGJ3IylBfWUELjyM=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N7y18ZJr6B/GhKmUSNUtBu9u+ofCQBq/O26 ld3TvaFaLuJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TewAKCRARpy6gFHHX cnwoD/0cxZBAb4XAX91qdtSNuOWe6oX6jeNpN8yk7QsX2VHoodzwPCt6oj6wMspuj4vJ9DxjBPf AP2jLjtIoV5hqOIHm0IhgTYcYRaFDR15GH/TOam2GYeAWLV92aBYmv6IdSBjAutwJgaBc318d6T g2hkFviaHTZEenJLMQEnvI72Q45xskOQC+TvH/yydMDmrQbMzEHN/cFqQ4GUSWsWZm6OseMnhAa iUB6ippCvLUyp7heH/nCGsSHLbhV9UDlKd1JOaow2u1Ulgpx45S5axLLX9/6pqZigvs2rfHzATJ Le+qEqvR7+Uh2+Q9Aws6QSXWlTa4Z3iSiIy5ZbP7bAsTaq9nuZsrL2kpAN1UIKoF/G6Oa7rsBgx +X8w0yx0w1H6U5UejolDHTeX9ZLHVoA850ctVr3h7XGjx/emlBJAo6uPxQ7VQPa0RiZeQ2E7BBE 9xTyHHvZtzzpDpmEczdJpo8406xsjrY3v1SPmY1NOAJnThscNxNoNiUqCsyv7nUHtuxHRU7N0wN /aC5CsoAVcXZwPU1bJaddyFRpmB3ZzvurfMTgH9TO6Of3h56qMhET+WPorex+Xg/jPwotPdFs2b zsSehrtTd1JcZuqiNWbl1mYIvXuR/1nD6z8Y8l3LjqK+mOvqnUU201WCfTRZ0heDj3vpJxm6sQu burt8o4HoSXycxw== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski As the first step in enabling power domain support in the driver, we'll split the device match data and runtime data structures into their general and power-management-specific parts. To allow that: first wrap the emac driver data in another layer which will later be expanded. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 51 ++++++++++++++++--= ---- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index ed799da4e4079b4da4b555dd119cce8c6591aa39..2739bc00e7525a5913bd3a5d28d= 9c9a8871fb7cf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -101,6 +101,10 @@ struct ethqos_emac_driver_data { bool needs_sgmii_loopback; }; =20 +struct ethqos_emac_match_data { + const struct ethqos_emac_driver_data *drv_data; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; @@ -218,6 +222,10 @@ static const struct ethqos_emac_driver_data emac_v2_3_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_qcs404_data =3D { + .drv_data =3D &emac_v2_3_0_data, +}; + static const struct ethqos_emac_por emac_v2_1_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40C01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642C }, @@ -234,6 +242,10 @@ static const struct ethqos_emac_driver_data emac_v2_1_= 0_data =3D { .has_emac_ge_3 =3D false, }; =20 +static const struct ethqos_emac_match_data emac_sm8150_data =3D { + .drv_data =3D &emac_v2_1_0_data, +}; + static const struct ethqos_emac_por emac_v3_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -266,6 +278,10 @@ static const struct ethqos_emac_driver_data emac_v3_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sc8280xp_data =3D { + .drv_data =3D &emac_v3_0_0_data, +}; + static const struct ethqos_emac_por emac_v4_0_0_por[] =3D { { .offset =3D RGMII_IO_MACRO_CONFIG, .value =3D 0x40c01343 }, { .offset =3D SDCC_HC_REG_DLL_CONFIG, .value =3D 0x2004642c }, @@ -301,6 +317,10 @@ static const struct ethqos_emac_driver_data emac_v4_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_match_data emac_sa8775p_data =3D { + .drv_data =3D &emac_v4_0_0_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev =3D ðqos->pdev->dev; @@ -764,7 +784,8 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_pr= iv *priv) =20 static int qcom_ethqos_probe(struct platform_device *pdev) { - const struct ethqos_emac_driver_data *data; + const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_match_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev =3D &pdev->dev; @@ -815,13 +836,15 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) ethqos->mac_base =3D stmmac_res.addr; =20 data =3D device_get_match_data(dev); - ethqos->por =3D data->por; - ethqos->num_por =3D data->num_por; - ethqos->rgmii_config_loopback_en =3D data->rgmii_config_loopback_en; - ethqos->has_emac_ge_3 =3D data->has_emac_ge_3; - ethqos->needs_sgmii_loopback =3D data->needs_sgmii_loopback; + drv_data =3D data->drv_data; =20 - ethqos->link_clk =3D devm_clk_get(dev, data->link_clk_name ?: "rgmii"); + ethqos->por =3D drv_data->por; + ethqos->num_por =3D drv_data->num_por; + ethqos->rgmii_config_loopback_en =3D drv_data->rgmii_config_loopback_en; + ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; + ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; + + ethqos->link_clk =3D devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii"= ); if (IS_ERR(ethqos->link_clk)) return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), "Failed to get link_clk\n"); @@ -849,14 +872,14 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; plat_dat->core_type =3D DWMAC_CORE_GMAC4; if (ethqos->has_emac_ge_3) - plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; + plat_dat->dwmac4_addrs =3D &drv_data->dwmac4_addrs; plat_dat->pmt =3D 1; if (device_property_present(dev, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; if (device_is_compatible(dev, "qcom,qcs404-ethqos")) plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; - if (data->dma_addr_width) - plat_dat->host_dma_width =3D data->dma_addr_width; + if (drv_data->dma_addr_width) + plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 if (ethqos->serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; @@ -871,10 +894,10 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) } =20 static const struct of_device_id qcom_ethqos_match[] =3D { - { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_v2_3_0_data}, - { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_v4_0_0_data}, - { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_v3_0_0_data}, - { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_v2_1_0_data}, + { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_qcs404_data}, + { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_sa8775p_data}, + { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_sc8280xp_data}, + { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_sm8150_data}, { } }; MODULE_DEVICE_TABLE(of, qcom_ethqos_match); --=20 2.48.1 From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE354314D11 for ; Mon, 27 Oct 2025 15:45:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579915; cv=none; b=YSm6E4wInF798sK2evEWPWAKFDaH3OU2ctahDwZirAQaWGZD77FWXvARjXioWfVSF+FN3x62dVLETMCZwudzyZjkMZsSvHU4/cCW/CO0l/3THWcVINiKNIMizRyjB+4AnB9sMZDP0BGhhb3s33T1HIjbelprG6nGJ6mIQfiOIF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579915; c=relaxed/simple; bh=vqAQ6/vT/bVKVkAXMLO9ry32/KCXXrRCURyvHpvIC8g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QnMePLmuiH8xPESQxK1K1hZlINucU26mwcAaHOgKTcx9UIgDLu9Q02LYJumVLtv+IUm2r64/nzsv9pWXEPZj6JX+yXFgPa8Cjj8sHU78nOOWO2DvumziQFlu1Rm6ZcoKwYWHX8UiqqVe3sLdpNCN04xPc4L41ulfbT8sSghXN4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=bmKNVYYq; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="bmKNVYYq" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4711810948aso35215735e9.2 for ; Mon, 27 Oct 2025 08:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579911; x=1762184711; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gbnM+7JUoQu99psJVRjfGTzLa9V8XPsbrju+vMCFuVM=; b=bmKNVYYqXkj6qVSCHMSmKyUZfaEqZS65CQJ7SgjTmJkaixG7Gfz8Sn2cSxP6JDu991 VA6EwdEN06gbS+DQcm+Hku9Dt2GM4p9qanMcqEpREFLC3pcV9YWy1sPy9yGBXiqxWv16 FdAnvt/pD+3o/2B0bsrtaP2bWS4e/2hNRvgTQ+g3WIwFF9UJs7a161HgUvXNi7sYsqMv CxU0XQRXeFB18jEhIFYiLKZjs8XsCGwxvm8Laj62hNuTv/kGofw5HYhmBsAElW8dz7uC kOX20ekywTvFRsbHCGu/mX2i8nZ89uKo/uZstTDDESE7hUP9nXyoW/0M5VpYZfCbCJv7 nouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579911; x=1762184711; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gbnM+7JUoQu99psJVRjfGTzLa9V8XPsbrju+vMCFuVM=; b=CmzayCt67X3sVxglx82aHZHZ0ZJqyOvHziQybgPphUWhOW6RY4GYdNeKDBvdIMv/Rf vnc/CjuuMbLq2wGqHsPNkCRp7vCgMsy0StL1omRIPDRL9bDkUJSYg/TlLuRYjq1O7OTm BOHdn2fBwx0BLE7XUCkuiSy9nqvVvCUXtLetJ2m25toBC0eGmrJZh0qHMT1dPWyvL2I6 /9+osfxkeGhWxwf9aAOrZwgBmgO5jWrD1TDO8TbIGgD/o32mBhcj/Q/6VrCEBQFm46PP RbMZENc2UFdwDXfLJVKDNhFPtzao5RXAx7IzBfHe0E7zhFxA0TZPHLm5QCONe39dhe1D c5Bg== X-Forwarded-Encrypted: i=1; AJvYcCWDSRO7XH+a+Wkajppg5XbiYKqOznTi+7KNJ9nOSKixEpPutqctBpULiRTRv92CEXlOlanyfvkyFjUMhWU=@vger.kernel.org X-Gm-Message-State: AOJu0Yye3YMAOpA7ziTr2RATXVBmirqb/goJWeSLXu1uBdn86alnAwEe AtfyZAcn76IKcVOebNWAwZxhC5HbyWR0y8kSWnFnthOEdu8yXSb/0AjnoJW3qGMUetI= X-Gm-Gg: ASbGncuY6Tl0hXCvMQvi6xR5GeF4K9cD0wE0mEKWU7CbTYoAe1r3KO7d+jLTy4vHrHP MgUj45eCgVe0TkReHtM1/KIziX7Ir+gnOlDDewsCW7a0ltr4u59megBMA+Kriqt9CHFZ1fn4Jcn B2H26Qnv9fytdv+Esre9COQu638YqAsiCvQiYZaYqggtVwScoVXEtpQtgjiWM+tbx0SeKqOB21t bO05QfCzeC7gnJSIOBSJiFB5HbD1B8cPGpiJHzStQgypVeczXkTsFQ7N70w01aOxmDjMNhwL/to ZZ1H4lBbc1yI0PSANS/oBu0z0D5+MEWRFVBiBrkDIHwiUR60mJAvLhbQWi1SEAf3fqX/5bN6XGd JZgUE7aL4D8kkfbVAhxrsFRgU2Zmw4FSy6ASxdywJcplpDs30CwQuYsA3SgUTPunYLwN3zT5Aig 6NUJapiQ== X-Google-Smtp-Source: AGHT+IGvMG3wu3r+IbbZg/5/7mILxDWAzW1LalNld5Mwz0HOjM2EkN8wK4I3r8TzG4x6hIzWvNeibA== X-Received: by 2002:a05:600c:3154:b0:46e:39e1:fc3c with SMTP id 5b1f17b1804b1-47717def755mr1118575e9.5.1761579910577; Mon, 27 Oct 2025 08:45:10 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:09 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:53 +0100 Subject: [PATCH v3 5/8] net: stmmac: qcom-ethqos: split power management fields into a separate structure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-5-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3440; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=EQbFLUJhBusR5R/WLS2zY6u2a3Qrdavc6CuZtxM8a7Y=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N732qdepXwjTMMy3gsuitEVbWcrcVZjQoR7 Zsfgri/RgSJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TewAKCRARpy6gFHHX ckPzD/4iZm89XdVS11zAr9khaNEvnEltpu59g4ozId5XbAMVxDZglviYveiLmqycpJ4ruDOay49 QW1IHD1qaIiGbhzj398upRiUvk9h/6XjjVtjFG8h/iRWzkg/sduilnVGPPUsHDqZq5Fehm2XRNJ +HgergEpmyi871x5T4LIKxW13HzuAECg2FMLBAoNR8hRvM34p/DC5+pdOQeQJj+kJxWrzbeF5Sl Qt38NSuIlBYV0vWL9ALsuipnZIMVDXp3eGMjhoAeoFjJJckDGV45yqFswWYUQ9B7C2D4wpCfhGY ZIpFGiDQiXFw5LPO+6HxTzXEdPf83Yz9SUwNkld9kCx4+rBCbiTdkTapduBAlehxo0VtIC/DYKl WLlXvRpr8IFaKzRidwPY8RLhWPhdZUZtLWno2DWzcbtRDbN8KWVAInmJPv6Hx9EsBjKwUXD0Ts3 3moUpB+I6nWUjWebMCedX0U/T7KpoehAJyeHSjDOAOSs9vs94pLqQvObv1iUJUpLgks+Vg9y4lB GrTebcmkkjB0L7yJEpEsHAJrPI0EKTTWnzowh8DbHTP5+THcTfcEeAEpzM/7OTM8UV+AOeCUfcs shy3tH23ZNwVhY/ycIRVx2l7pLj0uuZLC3EbnnRGUcC+eDoXhViB0YFdmI0b/x1IJ/j7JJivvAm wxZsoJrM/fwHA3g== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Now that we have a separate wrapper for device match data, let's extend this structure with a pointer to the structure containing fields related to power-management only. This is done because a device may have the same device settings but different power management mode (e.g.: firmware vs manual). Signed-off-by: Bartosz Golaszewski --- .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 19 +++++++++++++++= +--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 2739bc00e7525a5913bd3a5d28d9c9a8871fb7cf..7ed07142f67c931cb2c2c0e8806= f5a7fbd68945d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -95,14 +95,18 @@ struct ethqos_emac_driver_data { unsigned int num_por; bool rgmii_config_loopback_en; bool has_emac_ge_3; - const char *link_clk_name; u32 dma_addr_width; struct dwmac4_addrs dwmac4_addrs; bool needs_sgmii_loopback; }; =20 +struct ethqos_emac_pm_data { + const char *link_clk_name; +}; + struct ethqos_emac_match_data { const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_pm_data *pm_data; }; =20 struct qcom_ethqos { @@ -296,7 +300,6 @@ static const struct ethqos_emac_driver_data emac_v4_0_0= _data =3D { .num_por =3D ARRAY_SIZE(emac_v4_0_0_por), .rgmii_config_loopback_en =3D false, .has_emac_ge_3 =3D true, - .link_clk_name =3D "phyaux", .needs_sgmii_loopback =3D true, .dma_addr_width =3D 36, .dwmac4_addrs =3D { @@ -317,8 +320,13 @@ static const struct ethqos_emac_driver_data emac_v4_0_= 0_data =3D { }, }; =20 +static const struct ethqos_emac_pm_data emac_sa8775p_pm_data =3D { + .link_clk_name =3D "phyaux", +}; + static const struct ethqos_emac_match_data emac_sa8775p_data =3D { .drv_data =3D &emac_v4_0_0_data, + .pm_data =3D &emac_sa8775p_pm_data, }; =20 static int ethqos_dll_configure(struct qcom_ethqos *ethqos) @@ -785,11 +793,13 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_= priv *priv) static int qcom_ethqos_probe(struct platform_device *pdev) { const struct ethqos_emac_driver_data *drv_data; + const struct ethqos_emac_pm_data *pm_data; const struct ethqos_emac_match_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; struct device *dev =3D &pdev->dev; struct qcom_ethqos *ethqos; + const char *clk_name; int ret, i; =20 ret =3D stmmac_get_platform_resources(pdev, &stmmac_res); @@ -837,6 +847,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) =20 data =3D device_get_match_data(dev); drv_data =3D data->drv_data; + pm_data =3D data->pm_data; + clk_name =3D pm_data && pm_data->link_clk_name ? + pm_data->link_clk_name : "rgmii"; =20 ethqos->por =3D drv_data->por; ethqos->num_por =3D drv_data->num_por; @@ -844,7 +857,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; =20 - ethqos->link_clk =3D devm_clk_get(dev, drv_data->link_clk_name ?: "rgmii"= ); + ethqos->link_clk =3D devm_clk_get(dev, clk_name); if (IS_ERR(ethqos->link_clk)) return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), "Failed to get link_clk\n"); --=20 2.48.1 From nobody Mon Feb 9 01:35:02 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FE67314D3B for ; Mon, 27 Oct 2025 15:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579917; cv=none; b=l8NreedkkK3w/wL1UYQk7KiUcAfC4zdA2TO62nKaXzRez/DYCCBV70nvDPmwB8kniF8pZcJPRUd8HqDNO7eUdJQeY3bW/2QLsblwAxTn9rtgKkKDg0pwPF08aThYjJUexNGUzbk7llFLP0uP75uAXaECHC/dTl/1OZZehQebKPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579917; c=relaxed/simple; bh=i1kWXJ1nEYOgPM1tmCAbFb+vRHzNPInWom5+gW0JW9U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TkRHjKBPefBmfp5sa1oSSe/DR8RKWph/rWQRft8/1mtZWWdqOlZWXlP4Updfuy3j7ZRFC4IQNup7pn11fErgz5j+A16RnSQtCqFbDXVbzoqRh1rZAbzfl/woq6BMfs9CV9lNjsFWCGfLFFwKaKkrWOwwWomP7S2JoXWpWlwNC/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=A541Nr+i; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="A541Nr+i" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-475de184058so9500175e9.2 for ; Mon, 27 Oct 2025 08:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579912; x=1762184712; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eNS/wqhYOljfWC+fSnpn1y3WQ4q23+yxEBnxY7wxw6g=; b=A541Nr+i3goxCxCvHRDwCOjNbVlCimKQU/m+q3yzcBCOdgWrh2G54WtIaJFcoT8gsq RXv3ZW8QYbqvC0DdafYiTd2Y95ncOihrgWiuMQs06jWM6NjUlzwISos9x8q4ufFWGJjI NjfDq02rO3PaAa5C6RSgyRf13dtPwfg5F8gqavHqs9xhW2txPCCMq0zkT61R1VPXTWrX LAZXImXPfnPL7wjcnUrX4MQYJrXAVfu269NHpJVJxSK/vOPsmUcWjo8ZwhSIuFBrYJ03 BcA/llpSNXr3Ustq3Fkf6adRfAZ+AlTOygGVKjVJAATnO6G3vZftdVoLoR65OFc5dm+a /goQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579912; x=1762184712; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eNS/wqhYOljfWC+fSnpn1y3WQ4q23+yxEBnxY7wxw6g=; b=v7XAU5BdCdhvIE8FP5k68dykogTl4e1OzR/Y3Q1MRqTiyHqO6IHOvc4eOYY4GK4BHF ytpJNnSIV9+5od9/WB1SumwbrUoXrpgnV0uVSuUoBX1cXH2YPChp/ug4ziaedOyj1Tfk njBLDQ56y2WcnNA1t/ZcgnkXJ/WeYOlggUAJl/uLjvivJj6lX5SqGB5s3B+CJ+YDrMP0 SHJTLukj9Vfm5kWiDvDbQzdM7AyvfAovqDggiH8h5JVs0/r0+zPYIyhVE7eKTAeX81Nw gGA6RNR0eT35m5ygZMgpx9j6eYZ7zQmbpiAlmDuBZ5/833W4jz9zjU/YOmu4TdYKgfqv cy3w== X-Forwarded-Encrypted: i=1; AJvYcCWQYewwjxU05+Wqtxc4dZFRaKEhvch0A969yvyMoa7aP6S1iKPvKV85ITjEJCrjzgSYJYymnvjqiXRrgGg=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6Z/mpxn59ck3ldcg7IBNyBPLy7ivaxRi6KzQMfIZs3iKfJSBn xwCK3ebOd6JCuvJHpvhWpfVzhsKJSNgZ66jXKMpPumCEv9jRjwzgGo+5yehqjQzQOZQ= X-Gm-Gg: ASbGncuWzU6fcmyKCZfvGqoi0gLcpu7VthDIrtSIvtfpc3WyZldTvxnvvhTFfmVfgIc gguyokTe9Wi5hGe9z+pUVb2ouhQpP+I2gNlnWeN+rJ/ZHGChbxQBVzTv7b/sF+izYG8MM6SlcDv u/3WKuvD5GtHO3on0M9vqIIF3IMsUPR/AW7GJGIOt0S1e0FPe3Tr8h7ivBXqS0ZeL4WEjIBEDdR YEvCsiQK8LoM/o4dqefAZuhp+av1j4sJMpr7UQBWla46T5M+yiXKZmMcOCkyjuHBYPb+DRL2Jmb Hj+EjUrE/3EYzWM1kmk+1/z4WbaaaGGgx8RbsBoNjeupzmENNb70/ogpqAxgdXqGnOMy0aWujtz esop0vYItQt3MNafzmZgd8VIpsDCW+ojMlkeW0qWKxbWYsyIUfx48YKOp9WpnyCsfvQ2Qye8= X-Google-Smtp-Source: AGHT+IEcS3+Mjv+mhXDzePSPYtR5z2XLlTFPrVb1vdXnvrOFtKLZZKXhn+EX6Uyf8++3V+KI2L1nQA== X-Received: by 2002:a05:600c:3109:b0:475:dba3:9ca with SMTP id 5b1f17b1804b1-47717e7fa0fmr551335e9.39.1761579912349; Mon, 27 Oct 2025 08:45:12 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:11 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:54 +0100 Subject: [PATCH v3 6/8] net: stmmac: qcom-ethqos: split power management context into a separate struct Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-6-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4943; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=GgzPtEPZX7xvMWn454sVcSaK6B006ED6cn0Ay90ur54=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N8H8/tfulP9sfcdTh0prmWo4yvzuq4p3oVM UzG5vCPRh6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TfAAKCRARpy6gFHHX ckfYD/9GFZbGhB0rIgQMsDuYjJI2F6r8bEJR2t5MXewyHGb0uBNirHJxqdDET5pMKzrBjXMX4i6 AMmgzpETEwaCyZAswoOaTBd6YYaQo286whbtuGE/TVm671hhPk/mTkXcHnFUtC8C7QnwSAxTliq h1yXzbw9Yn7kOiOiCbhV6PHouufWr/FVGORHbqvkBYmae451ubnkG/8RPye1JwGBR2KKBTH2ECN LxfQ/LT9F91EgLGgi856IJz6OJZ0fzY0jRl0VwNbwMsjBe0ZLr/W315gMbRMzjobB7SK48vflJn kABE1SXMUrEF29ZM8KyKtx5BTz/yQ2fYZcFVYw3kSxW91nuTOk2h3jpgncAJmX2XfFMldm6SIVO bKCPsxtf7AKsVN9w268LsHvdemlilofFoYSP6863Ofq6L7UVMHiIaUAY4gTY3/Xw6qQ0OrIp7MA VBYngI5Lhe2NLsAHWCvVcvwVpUgIshWlSl9fpdhP8wCIGVcnYJlxF3mNu5UBIkyN3ESGiCeAl/G +ytjDgLy2TxB8dFqrMKk162NaW6E9DXdkoVoDujO+0tyw9detsCzs2d8fNu4g5V12u+KBJ9hxPV FIspXSJBb5mU47bGsF4bsagQIYmEz1koQQipGYowzi3OV2jeB8Hd4u61AY01NP3SBLP8M9OQKg1 lMUDvHUmSKnRsvA== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski With match data split into general and power-management sections, let's now do the same with runtime device data. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 46 ++++++++++++------= ---- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 7ed07142f67c931cb2c2c0e8806f5a7fbd68945d..c25b4b4581f9cea6107a39f0bc6= 165be6955cc1b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -109,17 +109,21 @@ struct ethqos_emac_match_data { const struct ethqos_emac_pm_data *pm_data; }; =20 +struct ethqos_emac_pm_ctx { + struct clk *link_clk; + unsigned int link_clk_rate; + struct phy *serdes_phy; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; void __iomem *mac_base; int (*configure_func)(struct qcom_ethqos *ethqos, int speed); =20 - unsigned int link_clk_rate; - struct clk *link_clk; - struct phy *serdes_phy; - int serdes_speed; + struct ethqos_emac_pm_ctx pm; phy_interface_t phy_mode; + int serdes_speed; =20 const struct ethqos_emac_por *por; unsigned int num_por; @@ -185,9 +189,9 @@ ethqos_update_link_clk(struct qcom_ethqos *ethqos, int = speed) =20 rate =3D rgmii_clock(speed); if (rate > 0) - ethqos->link_clk_rate =3D rate * 2; + ethqos->pm.link_clk_rate =3D rate * 2; =20 - clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate); + clk_set_rate(ethqos->pm.link_clk, ethqos->pm.link_clk_rate); } =20 static void @@ -643,7 +647,7 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *e= thqos, int speed) static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) { if (ethqos->serdes_speed !=3D speed) { - phy_set_speed(ethqos->serdes_phy, speed); + phy_set_speed(ethqos->pm.serdes_phy, speed); ethqos->serdes_speed =3D speed; } } @@ -722,23 +726,23 @@ static int qcom_ethqos_serdes_powerup(struct net_devi= ce *ndev, void *priv) struct qcom_ethqos *ethqos =3D priv; int ret; =20 - ret =3D phy_init(ethqos->serdes_phy); + ret =3D phy_init(ethqos->pm.serdes_phy); if (ret) return ret; =20 - ret =3D phy_power_on(ethqos->serdes_phy); + ret =3D phy_power_on(ethqos->pm.serdes_phy); if (ret) return ret; =20 - return phy_set_speed(ethqos->serdes_phy, ethqos->serdes_speed); + return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed); } =20 static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *pr= iv) { struct qcom_ethqos *ethqos =3D priv; =20 - phy_power_off(ethqos->serdes_phy); - phy_exit(ethqos->serdes_phy); + phy_power_off(ethqos->pm.serdes_phy); + phy_exit(ethqos->pm.serdes_phy); } =20 static int ethqos_clks_config(void *priv, bool enabled) @@ -747,7 +751,7 @@ static int ethqos_clks_config(void *priv, bool enabled) int ret =3D 0; =20 if (enabled) { - ret =3D clk_prepare_enable(ethqos->link_clk); + ret =3D clk_prepare_enable(ethqos->pm.link_clk); if (ret) { dev_err(ðqos->pdev->dev, "link_clk enable failed\n"); return ret; @@ -760,7 +764,7 @@ static int ethqos_clks_config(void *priv, bool enabled) */ ethqos_set_func_clk_en(ethqos); } else { - clk_disable_unprepare(ethqos->link_clk); + clk_disable_unprepare(ethqos->pm.link_clk); } =20 return ret; @@ -857,9 +861,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; =20 - ethqos->link_clk =3D devm_clk_get(dev, clk_name); - if (IS_ERR(ethqos->link_clk)) - return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), + ethqos->pm.link_clk =3D devm_clk_get(dev, clk_name); + if (IS_ERR(ethqos->pm.link_clk)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), "Failed to get link_clk\n"); =20 ret =3D ethqos_clks_config(ethqos, true); @@ -870,9 +874,9 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (ret) return ret; =20 - ethqos->serdes_phy =3D devm_phy_optional_get(dev, "serdes"); - if (IS_ERR(ethqos->serdes_phy)) - return dev_err_probe(dev, PTR_ERR(ethqos->serdes_phy), + ethqos->pm.serdes_phy =3D devm_phy_optional_get(dev, "serdes"); + if (IS_ERR(ethqos->pm.serdes_phy)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), "Failed to get serdes phy\n"); =20 ethqos->serdes_speed =3D SPEED_1000; @@ -894,7 +898,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (drv_data->dma_addr_width) plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 - if (ethqos->serdes_phy) { + if (ethqos->pm.serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; } --=20 2.48.1 From nobody Mon Feb 9 01:35:03 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34915316194 for ; Mon, 27 Oct 2025 15:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579919; cv=none; b=b4CirHAfsPm/+jSRdtDHlOGRnfQ8IAPhmPE1SFXUXonV5IRvmlVEe5bYSRoae6Xf8Loye7EzWJJOlvGXJximY6TZdjX0lZGnfKk15/jTCkSEs7E4Zh1wSgQelttAyA9UgrZXTf6E+YRSeRZTFdqsEkZQfaS9hADcbi1pbvm6CPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579919; c=relaxed/simple; bh=l9RtVNC5Fv9HEtVFzEnmdGSQ5TtnCI0n17QaytPVRuU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MU4cbyxvfuPLLiOmRwLDHH+kDPHYg8Ktsvmu1ABW2J6acSv+QBnC8w+4R3HGJF7rChu+KwR9RzgsuXaQMJaOrrT2ZSRuGbwG1iElJ023r+gY+xqJ0bRbQ4FN1H2YjgKdS9tr2s9kqFgT8M4R143cr9bVcZ9sxZRMEhWnwrHkGlw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=LlLW3+UP; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="LlLW3+UP" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-47118259fd8so36393895e9.3 for ; Mon, 27 Oct 2025 08:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579914; x=1762184714; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+F6l0oreG7JTFMb6Sz6ExSU/mU3oVRcsO804GwDbowo=; b=LlLW3+UPRi1KYhTwqZ0LCfvUp3jVRc46PrvNQsVUjTwgLUQX0VrdAuo3QkeIZfMqiX jr3v2TNmwIYdOFxH3NiolvGVjqefMNfYzjYX2McVHaPl573T69NeAxtYfuWoRWARLzkk SPRsyYqDOAJziQb+7JBRlAjkoXmSxNl1CnWd79vDhrhXDd3BRlCyk4kGaq7ND8iyEdPZ 1+eOUiuNEYNe3uO1d3MZUgxPrkOVSiXRzCRXIoPw0soM+1c2KdLruIK79RvMLpocex+G 8PW91WO5UdkLw4/21sHpHc7CIaSDfYWV/ifgUKmvBlhTqeazfw15h8J6kZ753SQ1nIPO 1/vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579914; x=1762184714; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+F6l0oreG7JTFMb6Sz6ExSU/mU3oVRcsO804GwDbowo=; b=e5NMfGdhCn0xdLcOyXw4+FspmSKGg8ObNxt9xzSUVBrBBDGi5ymYELNOGLuZ9yLaIC kcFlfQywFXIsMCTvS1xriiOaOVfRhWj43z9YF0KNOU7rxM20mbQc6lm7M3h2NKuy0PUU RUq/DCK4h3sHwI4BMLSePLhcDbheZj3Z/TCfaoS1m8biHCAtd5hYRHx7u0aEIglkBXnK EMTyFbA8mAdyNeFw8him7vAuehtgFYn1QgadaLV8xif7EcEepeBFe7i2pM5Aa3ttyNJi +/9aCTpUyLUK5Z8ojrHLmPqpYdyUfFPA+3qX7YPRqokLmxedKnDRWCulRVKVz1TPaEai odBw== X-Forwarded-Encrypted: i=1; AJvYcCV6LhB5cTk3XU2nY1LEKA5mLGuaadA0qZpm8EzB5IXTmx4eYi/kfC3Rv2WPXZ0SD45439+vsCg9ZKiWQAc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3FixS0PCrAqEUF/sx2gOOkmGIM6ThjVYUgZMeaQJpgigFlMUX Rv22NHxJ4De5hQpsGSvcxStckE0sUqbLJxFHtHUR9BympMu1d1HMP4iSsGbe23OWeH4= X-Gm-Gg: ASbGncuwcx9VuJ5HDL9D4yQvONuJl5iQiKPHoUhCqc+NxwBij0lScqb+IMVxhw9vcQ/ JyXmF9REEoCYIhb51JNoOYO2uRdv20WKUwFqFmIeFlveb+zPmDAR5p6kDMMvf2pUWmUx33tmd1O 01P8f04D2QrL3czw/40SfsuhzP8JAaCFJSNxP/poph/X+qxQavziNFGY0W7VZVo5+YoshP2wfsd XTBzulKjuELKUiH1aBCM0OCz/jFMp8KbCX0RP+emK2knr1T2WNRxyskFds+APif8871aRpdmLdH 05dKeNRmbVI0DoBGEjcRcTtNa9PgNdlGZA657tM7xkBfopyEaXgrH57f3itcWBLN0VYbdKCwX+6 yvF81TPS7wCYFee9dBwK9XoQNyZhzG0ePFJ865KA3xEa9R2VS7AoRXcw8ST9hLDNogg7u7UQ= X-Google-Smtp-Source: AGHT+IHRGKVi5MN0KlmP/QWn9GK7Gt4IncDu1UnMNHIlVsLNKr3cmM9451HaPofTrSWpTuM98bmS9w== X-Received: by 2002:a05:600c:45c7:b0:471:6f4:601f with SMTP id 5b1f17b1804b1-47717e30926mr964515e9.19.1761579914067; Mon, 27 Oct 2025 08:45:14 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:13 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:55 +0100 Subject: [PATCH v3 7/8] net: stmmac: qcom-ethqos: define a callback for setting the serdes speed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-7-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1914; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=5Gxjb/17qAbEtiGjyBW7mjBpKziLG21U9VH1r3QiV6U=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N8BBE1xELlKYS4ZKFTuPBcaEPIPgSxudZ/m 3UORCOMzZyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TfAAKCRARpy6gFHHX cmQWEADIxpsG6tmx74j0WRSxVrRH/JRNVBzM4zS/ZdSdSlQ4LxTy1mCDLEtm4Fi/6+WZ/SZiWXI 1ZzMvymBFVn2D0iZPoYzpkAabamHrQrlQJe6noPUboVYrfR9EeQ+RKSVikMZ98pad0NLj2bT/Nd 4a0XI3jAoeBjMPegufW4igZP+WeYXpxgIdkxP5b55+7iDHEpWwzDMAFklDLzMcQumr/YYWTAzD9 mjGM4WGouN/jtGgNHac0Avwd5CJ704zorc5h0XENpiBH/YXCdg1xhJw5RkIUVk9lsQyWS86Hv/H P4OSHiq/vBYXZusrl6cMzGlolvc0S0PB4476vZC77MyWRhAzxLtSxRuM6CPLFVxDh7QLA3/kdmT iGGSDxGcgn6lvKEQGropggTfrMvRcxtQCSyScQ02aEw92XnTUtqE5sF/4o8R4DYIS6o2sd/RYFA eXK4HuFvPXD9fc3ykTGCtnvw+fkq35yCAxUFpNBpB3vgsIaRb3WV5CIS/o+IukZkU8YGX0bXfVu J3Plra45gnO0uIBzIJAGgU8uIyRtlqQM+BPBboMu/B9Mmm1UmgksrUDEMv3y36cJ74CwygQcivF fbOG3nv0FvGk6hBfzztxguJORGBB4Cepg2dnoMFUVeJK20HwbhY5inwbdsKL5uGhXchr63VTOD/ KOj+W54h3X1BhaQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Ahead of adding support for firmware driven power management, let's allow different ways of setting the PHY speed. To that end create a callback with a single implementation for now, that will be extended later. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index c25b4b4581f9cea6107a39f0bc6165be6955cc1b..840d44f052786a79b85d25d2181= 467aa96102ec8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -124,6 +124,7 @@ struct qcom_ethqos { struct ethqos_emac_pm_ctx pm; phy_interface_t phy_mode; int serdes_speed; + int (*set_serdes_speed)(struct qcom_ethqos *ethqos); =20 const struct ethqos_emac_por *por; unsigned int num_por; @@ -644,11 +645,16 @@ static int ethqos_configure_rgmii(struct qcom_ethqos = *ethqos, int speed) return 0; } =20 +static int ethqos_set_serdes_speed_phy(struct qcom_ethqos *ethqos) +{ + return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed); +} + static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) { if (ethqos->serdes_speed !=3D speed) { - phy_set_speed(ethqos->pm.serdes_phy, speed); ethqos->serdes_speed =3D speed; + ethqos->set_serdes_speed(ethqos); } } =20 @@ -879,6 +885,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), "Failed to get serdes phy\n"); =20 + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_phy; ethqos->serdes_speed =3D SPEED_1000; ethqos_update_link_clk(ethqos, SPEED_1000); ethqos_set_func_clk_en(ethqos); --=20 2.48.1 From nobody Mon Feb 9 01:35:03 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49C673168E0 for ; Mon, 27 Oct 2025 15:45:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579921; cv=none; b=G7vh9PPS8cnGqljHWcAj57KwxGbyBfgMvXNqb7E9u2JYmqe5XrGRKyVLoVT0FFwJ7vvSFE4YfxbWvBb0Tu9nziBwODsvVBfINTZusFyRR89WbZOSFu8mhNAjWlKz5Iwwefi1SDuagcyePMEQ5QHBc41aFMFuw8o6wrS5hXapA8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761579921; c=relaxed/simple; bh=em6tk+3P9TpgJ8hPtXgwSlRTG7LIzg61tAiNLS81KlM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ohqldoizvcze1zX4L8RjTFmapHIitMRBkGw3BWPmW5lPws6AxoAVSULlag4GDTLHuM9A+DM3eJGgsy2EjTffo8urfVCV+/RPWvoBZLr877iFa5adFLImOWEFh1brB3NhXidZhdKW0Z+8zaRw8B5TsYoZN/gJPs90moSzw1swGAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=2lvLNtc4; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="2lvLNtc4" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-46e6a689bd0so48557775e9.1 for ; Mon, 27 Oct 2025 08:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1761579916; x=1762184716; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nj4YfFzT8L9rvoRDSjiGKfJ4d8m7Uwj19oEU9ZUoPQk=; b=2lvLNtc4Wv9hrYe+WH1yW4uAUlk2Yu8ti1xPCHaU7cmBA2QrCs+ohrKnyaduJApaqQ DxQ/MLcpkOoMfRtjjdhHmmNqvQGRRG34RKxDAsDV8H1642VG6Bp0rLJa2NP7BvCR5FL0 fdN9CaxtzOytTiITGHSgOJ53C8Nz95Je62oqDCTVeusIm4XB0NXUtOlCfvZWhO2VKSpw cJSo3rdq2WsC7Y8ua30Ojs8igE4lawYUZ06/1U+4qH9teLcxDKSeXp3HNpJlSLOMgprf YZamePaW+DY4pNGHefkxKEhK3LiyXyQq2E9GtllF8KYBdMxjOjBlZB/Mft5rdQzzkt0G FDbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761579916; x=1762184716; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nj4YfFzT8L9rvoRDSjiGKfJ4d8m7Uwj19oEU9ZUoPQk=; b=SLnamlgF4UIfqrekJ4OYS1ZSnoGQHWLTcBv0jLPWFMBXqf1E+95POSSKva+JwCZJlN msLxQtHFpntz8VsEpCMz4PHn4IPoZTAuhsDkHo5GJuqLS5dmvJoupA+3xpl48j2SYNqE 4UYqDDqnNif/9r6TI6/nlbLOl69TxsQZYAKuUUku/GKeciheJZ+41I/d8yMf8a6Hig/x lYWFe8Hj3Ki/pVh31qs6Rbz0VjKnUNy9L6TbPNH5lx258ecp+dNUBShzctbM2AJUhD92 2Acg36MlzR96irjc0+sX/4gJ4TS0ftEShKILR6BtHZfEB8CECtqJBScBBNq1Gh6ETcyL HFzA== X-Forwarded-Encrypted: i=1; AJvYcCWYbNqrKFt17Oqq5zMdEJBVW1TB+z+DZY6HMCNZH3rkGwqfaoOhEFCuLVEU115sq9R3lxRSsUQC9RGXAdc=@vger.kernel.org X-Gm-Message-State: AOJu0YwUez6xRH55VdajKedxM6JdqfH+3sA7dj7DcAvZ4vmNSXoZIIlm sYWfknNrc/HSt3vQTDmgj1rzWDgyA/vDSJnZBjYRWZRCFTNUh/53EUo5Kr7RlAen+NA= X-Gm-Gg: ASbGncszowHD35a84MzJMVVPrkFh5lXBgTCkR70I41PPWvRfLf1vLO4C/fd2xheQg6C RwZxaFNX1F1mONcP9Vl6nvXz/M0/HD+FNB/GxCXnIgi2vCG/C8f8qaU3ZviwYWfdySLsj8XtMCK 4FYDboeh0oz1OFzATH2ydKaZkOwNK6aUtTVsGY0PUr6PfqACoWLV3SAAwct+uvw1qMaSZm08UM4 dQsXHr6FjQpm86PyDZf/z8dAGOeWIii0RFsuev2yKXpD58bJRyeia8b/ZYT6ad/9vugGLNH6D4m j+7sfIuH1SxLYISCV93hT3joYyCAYGBcq5uGOF826B9/LhEnj+tj1h03ipz6DLHujli/YJx9BbM xAClHxCovSCUrLn16F5f3p0YlokfkowiOLFa+6Ib88KRRDwOBtItHq7GBBWhD3akaYuhk5N4= X-Google-Smtp-Source: AGHT+IEvxnMh4ifJ66vdKDXCM9wH6Mq7LAphJvwou4QF6wkWuLadBPW8xF+aUT2FdCl6ibpuW9RHwg== X-Received: by 2002:a05:600c:4e56:b0:475:dd7f:f6cd with SMTP id 5b1f17b1804b1-47717e7a4e8mr655015e9.35.1761579915818; Mon, 27 Oct 2025 08:45:15 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:c1c6:7dde:fe94:6881]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-475dd477d0esm138708045e9.0.2025.10.27.08.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 08:45:14 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 27 Oct 2025 16:44:56 +0100 Subject: [PATCH v3 8/8] net: stmmac: qcom-ethqos: add support for sa8255p Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251027-qcom-sa8255p-emac-v3-8-75767b9230ab@linaro.org> References: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> In-Reply-To: <20251027-qcom-sa8255p-emac-v3-0-75767b9230ab@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Jose Abreu 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, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10772; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=1b3sySaTfsXuK4c/F0Opr6AUet9LgnCZjxhUFKkU4z0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo/5N8hjhU5H0+0VU0DoorFqs8FTYQfOw41vwIZ GkA+1B/QEiJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaP+TfAAKCRARpy6gFHHX cqiZD/9c1z7V6BcYinZHb4qY/lEX5BFjcUvG3JVZmuhbAgAgsBctdrWRxN9KQBWHRe9buG43ZuF eYn/ViHUdL4y0j4/+cTB19zJqy4J1MnwxCb6aUAWmKRYN9yDxB7NApbEfklNnoUshR5OIUP/R32 MoIW9lXliDZ5PMrVXfzUIYqLlqmjQ3Yim8CfpAXFObwrIujAcBuHrQ3yhBgHs/KHpPA/P8Jbg45 2BrEuQKzjXcyGidpaEGwMyocDr99czlWPZAXsG3Y12WGStjtc8dUE2XWirHkBg72abmDMS2//aI jWUiRPmUuyD1F9r7LNBVNTheHUtDBmuD8+IlzdBxnBnYhlHRJFXbH92WOMPqs5HsQd3pimmZ+s+ 7ytrU5i6qxlZLGjTFzDntGLQOuKDJKX0TCQUIQ2W3O+czmj/BAR94auWdHvACLlMDtnGkEm7VSF H2TtqWAyAFxrBj/8W4vAeNAnJ+gb5307c5yLFpSMVhqyNbij2Sptezqmh8RXv6ZDjXA50kK8P5f aDYziPdGVrlOpqDDNEUR/cB7XkxsRZo/vhHqNb23bFqsX3UV3yOhm/RlPLnaMUFKWApYY9f+0bh ZrKT1od0cahASgO63FXtsA8Mp6IEAMl9uKPbmbIhj0fbWAUWDlvz0pGkOLB5IPxCdEiKH1Adw/e X5vzGJETbRwWaZQ== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Extend the driver to support a new model - sa8255p. Unlike the previously supported variants, this one's power management is done in the firmware using SCMI. This is modeled in linux using power domains so add support for them. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 230 +++++++++++++++++= +--- 1 file changed, 201 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 840d44f052786a79b85d25d2181467aa96102ec8..0917168b1dfa05fdc28d6113261= f368fcf06d893 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include =20 #include "stmmac.h" #include "stmmac_platform.h" @@ -85,6 +87,13 @@ =20 #define SGMII_10M_RX_CLK_DVDR 0x31 =20 +enum ethqos_pd_selector { + ETHQOS_PD_CORE =3D 0, + ETHQOS_PD_MDIO, + ETHQOS_PD_SERDES, + ETHQOS_NUM_PDS, +}; + struct ethqos_emac_por { unsigned int offset; unsigned int value; @@ -102,6 +111,9 @@ struct ethqos_emac_driver_data { =20 struct ethqos_emac_pm_data { const char *link_clk_name; + bool use_domains; + struct dev_pm_domain_attach_data pd; + unsigned int clk_ptp_rate; }; =20 struct ethqos_emac_match_data { @@ -115,13 +127,20 @@ struct ethqos_emac_pm_ctx { struct phy *serdes_phy; }; =20 +struct ethqos_emac_pd_ctx { + struct dev_pm_domain_list *pd_list; +}; + struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; void __iomem *mac_base; int (*configure_func)(struct qcom_ethqos *ethqos, int speed); =20 - struct ethqos_emac_pm_ctx pm; + union { + struct ethqos_emac_pm_ctx pm; + struct ethqos_emac_pd_ctx pd; + }; phy_interface_t phy_mode; int serdes_speed; int (*set_serdes_speed)(struct qcom_ethqos *ethqos); @@ -334,6 +353,25 @@ static const struct ethqos_emac_match_data emac_sa8775= p_data =3D { .pm_data =3D &emac_sa8775p_pm_data, }; =20 +static const char * const emac_sa8255p_pd_names[] =3D { + "power_core", "power_mdio", "perf_serdes" +}; + +static const struct ethqos_emac_pm_data emac_sa8255p_pm_data =3D { + .pd =3D { + .pd_flags =3D PD_FLAG_NO_DEV_LINK, + .pd_names =3D emac_sa8255p_pd_names, + .num_pd_names =3D ETHQOS_NUM_PDS, + }, + .use_domains =3D true, + .clk_ptp_rate =3D 230400000, +}; + +static const struct ethqos_emac_match_data emac_sa8255p_data =3D { + .drv_data =3D &emac_v4_0_0_data, + .pm_data =3D &emac_sa8255p_pm_data, +}; + static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { struct device *dev =3D ðqos->pdev->dev; @@ -415,6 +453,28 @@ static int ethqos_dll_configure(struct qcom_ethqos *et= hqos) return 0; } =20 +static int qcom_ethqos_domain_on(struct qcom_ethqos *ethqos, + enum ethqos_pd_selector sel) +{ + struct device *dev =3D ethqos->pd.pd_list->pd_devs[sel]; + int ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret < 0) + dev_err(ðqos->pdev->dev, + "Failed to enable the power domain for %s\n", + dev_name(dev)); + return ret; +} + +static void qcom_ethqos_domain_off(struct qcom_ethqos *ethqos, + enum ethqos_pd_selector sel) +{ + struct device *dev =3D ethqos->pd.pd_list->pd_devs[sel]; + + pm_runtime_put_sync(dev); +} + static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed) { struct device *dev =3D ðqos->pdev->dev; @@ -650,6 +710,13 @@ static int ethqos_set_serdes_speed_phy(struct qcom_eth= qos *ethqos) return phy_set_speed(ethqos->pm.serdes_phy, ethqos->serdes_speed); } =20 +static int ethqos_set_serdes_speed_pd(struct qcom_ethqos *ethqos) +{ + struct device *dev =3D ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + + return dev_pm_opp_set_level(dev, ethqos->serdes_speed); +} + static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) { if (ethqos->serdes_speed !=3D speed) { @@ -751,6 +818,27 @@ static void qcom_ethqos_serdes_powerdown(struct net_de= vice *ndev, void *priv) phy_exit(ethqos->pm.serdes_phy); } =20 +static int qcom_ethqos_pd_serdes_powerup(struct net_device *ndev, void *pr= iv) +{ + struct qcom_ethqos *ethqos =3D priv; + struct device *dev =3D ethqos->pd.pd_list->pd_devs[ETHQOS_PD_SERDES]; + int ret; + + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES); + if (ret < 0) + return ret; + + return dev_pm_opp_set_level(dev, ethqos->serdes_speed); +} + +static void qcom_ethqos_pd_serdes_powerdown(struct net_device *ndev, void = *priv) +{ + struct qcom_ethqos *ethqos =3D priv; + + /* TODO set level */ + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_SERDES); +} + static int ethqos_clks_config(void *priv, bool enabled) { struct qcom_ethqos *ethqos =3D priv; @@ -783,6 +871,61 @@ static void ethqos_clks_disable(void *data) ethqos_clks_config(ethqos, false); } =20 +static int ethqos_pd_clks_config(void *priv, bool enabled) +{ + struct qcom_ethqos *ethqos =3D priv; + int ret =3D 0; + + if (enabled) { + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO); + if (ret < 0) { + dev_err(ðqos->pdev->dev, + "Failed to enable the MDIO power domain\n"); + return ret; + } + + ethqos_set_func_clk_en(ethqos); + } else { + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO); + } + + return ret; +} + +static int qcom_ethqos_pd_init(struct platform_device *pdev, void *priv) +{ + struct qcom_ethqos *ethqos =3D priv; + int ret; + + /* + * Enable functional clock to prevent DMA reset after timeout due + * to no PHY clock being enabled after the hardware block has been + * power cycled. The actual configuration will be adjusted once + * ethqos_fix_mac_speed() is called. + */ + ethqos_set_func_clk_en(ethqos); + + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_CORE); + if (ret) + return ret; + + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_MDIO); + if (ret) { + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE); + return ret; + } + + return 0; +} + +static void qcom_ethqos_pd_exit(struct platform_device *pdev, void *data) +{ + struct qcom_ethqos *ethqos =3D data; + + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_MDIO); + qcom_ethqos_domain_off(ethqos, ETHQOS_PD_CORE); +} + static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) { struct plat_stmmacenet_data *plat_dat =3D priv->plat; @@ -823,8 +966,6 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) "dt configuration failed\n"); } =20 - plat_dat->clks_config =3D ethqos_clks_config; - ethqos =3D devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL); if (!ethqos) return -ENOMEM; @@ -866,28 +1007,63 @@ static int qcom_ethqos_probe(struct platform_device = *pdev) ethqos->rgmii_config_loopback_en =3D drv_data->rgmii_config_loopback_en; ethqos->has_emac_ge_3 =3D drv_data->has_emac_ge_3; ethqos->needs_sgmii_loopback =3D drv_data->needs_sgmii_loopback; - - ethqos->pm.link_clk =3D devm_clk_get(dev, clk_name); - if (IS_ERR(ethqos->pm.link_clk)) - return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), - "Failed to get link_clk\n"); - - ret =3D ethqos_clks_config(ethqos, true); - if (ret) - return ret; - - ret =3D devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); - if (ret) - return ret; - - ethqos->pm.serdes_phy =3D devm_phy_optional_get(dev, "serdes"); - if (IS_ERR(ethqos->pm.serdes_phy)) - return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), - "Failed to get serdes phy\n"); - - ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_phy; ethqos->serdes_speed =3D SPEED_1000; - ethqos_update_link_clk(ethqos, SPEED_1000); + + if (pm_data && pm_data->use_domains) { + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_pd; + + ret =3D devm_pm_domain_attach_list(dev, &pm_data->pd, + ðqos->pd.pd_list); + if (ret < 0) + return dev_err_probe(dev, ret, "Failed to attach power domains\n"); + + plat_dat->clks_config =3D ethqos_pd_clks_config; + plat_dat->serdes_powerup =3D qcom_ethqos_pd_serdes_powerup; + plat_dat->serdes_powerdown =3D qcom_ethqos_pd_serdes_powerdown; + plat_dat->exit =3D qcom_ethqos_pd_exit; + plat_dat->init =3D qcom_ethqos_pd_init; + plat_dat->clk_ptp_rate =3D pm_data->clk_ptp_rate; + + ret =3D qcom_ethqos_pd_init(pdev, ethqos); + if (ret) + return ret; + + ret =3D qcom_ethqos_domain_on(ethqos, ETHQOS_PD_SERDES); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable the serdes power domain\n"); + } else { + ethqos->set_serdes_speed =3D ethqos_set_serdes_speed_phy; + + ethqos->pm.link_clk =3D devm_clk_get(dev, clk_name); + if (IS_ERR(ethqos->pm.link_clk)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.link_clk), + "Failed to get link_clk\n"); + + ret =3D ethqos_clks_config(ethqos, true); + if (ret) + return ret; + + ret =3D devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); + if (ret) + return ret; + + ethqos->pm.serdes_phy =3D devm_phy_optional_get(dev, "serdes"); + if (IS_ERR(ethqos->pm.serdes_phy)) + return dev_err_probe(dev, PTR_ERR(ethqos->pm.serdes_phy), + "Failed to get serdes phy\n"); + + ethqos_update_link_clk(ethqos, SPEED_1000); + + plat_dat->clks_config =3D ethqos_clks_config; + plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; + + if (ethqos->pm.serdes_phy) { + plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; + plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; + } + } + ethqos_set_func_clk_en(ethqos); =20 plat_dat->bsp_priv =3D ethqos; @@ -905,11 +1081,6 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) if (drv_data->dma_addr_width) plat_dat->host_dma_width =3D drv_data->dma_addr_width; =20 - if (ethqos->pm.serdes_phy) { - plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; - plat_dat->serdes_powerdown =3D qcom_ethqos_serdes_powerdown; - } - /* Enable TSO on queue0 and enable TBS on rest of the queues */ for (i =3D 1; i < plat_dat->tx_queues_to_use; i++) plat_dat->tx_queues_cfg[i].tbs_en =3D 1; @@ -919,6 +1090,7 @@ static int qcom_ethqos_probe(struct platform_device *p= dev) =20 static const struct of_device_id qcom_ethqos_match[] =3D { { .compatible =3D "qcom,qcs404-ethqos", .data =3D &emac_qcs404_data}, + { .compatible =3D "qcom,sa8255p-ethqos", .data =3D &emac_sa8255p_data}, { .compatible =3D "qcom,sa8775p-ethqos", .data =3D &emac_sa8775p_data}, { .compatible =3D "qcom,sc8280xp-ethqos", .data =3D &emac_sc8280xp_data}, { .compatible =3D "qcom,sm8150-ethqos", .data =3D &emac_sm8150_data}, --=20 2.48.1