From nobody Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 645CB2F0C6F for ; Wed, 8 Oct 2025 08:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911487; cv=none; b=t8iT7dXMxSvdT+438AMoLJhO/k6CoKPB5qC6BMcqYiwhZqeSiMdSPLq53VXpAmqSEjSDE32viV9gy33GQpVkRsAZBPeo1pq9+w7DZJacVzgLsxfm0H/HuODby76o+r4Y7phvRyY0PXSaDGaf7rShst27416qSSOiPp9OVyWpJK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911487; c=relaxed/simple; bh=uciJlq+TbXsKutG22uU7xLtKChzbr5uSBiBa5VcNwoQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BXKav5eaoTP/rGRZP4zmAVyPtfEjzx5AWiOcEoewo5a9cYXfTidsO4AZCZzj+aMpqEyXH6+sbY0xCe3m/6/aUCEeK8WAjqxNaQyASkDNNbry8/Zg37k/RIqFHb5dhoxG6qxs4SjTFk7Rkp+A2ZRl0UaIU5TX2sJ7gRvmeIIg6Bg= 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=eHEGt6g9; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="eHEGt6g9" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-42557c5cedcso3573817f8f.0 for ; Wed, 08 Oct 2025 01:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911483; x=1760516283; 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=GBlQSSiEamv+oYM2If/aD+aYUWLw42K0i3enm5+zupw=; b=eHEGt6g9X2ItHKIIO8tmUD/k0LpSLnBnPOOLZ3G1DNwUFTxSX8iniEiQ7j1/37SD32 RWV50crPmeC4CkBA0DKLGcIaSovQ/w6wlua/Jazz3tZAvs4lXv774alX34UtN2IYE54k 5e3pJauDelOxt41YB8i3lFrum9SEB3wqoB8S7Y1tvRhttaExNh7twO6M529/AZDCnmWs w+fVyg4RYsiP7GK03FNPY3fWj1rkkALGmNfXJ56EpH7ph0x7Sw28sn6HQ3vZ7THb0cJ7 Y+3rx/MO36BZGV5aWdHToJChJX1p1frmry7y+0RihrpE/aTXUcc4hU8dECNuyOdL10ER FP4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911483; x=1760516283; 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=GBlQSSiEamv+oYM2If/aD+aYUWLw42K0i3enm5+zupw=; b=WG32R0zVnBG4Yly7kHnSZbgq1026YlyLhfm2Q3BKFdTfIzKzF+dfy4ej9KbYVMuEF9 UAFktkjt3PDhl1OvA47mJWNOjH4T/3sMssSqetho6OkS/6txNavKEs1UVJkVCtZOZgJZ 2zaGR5nGSVWl+H29SvpXQbyuLeaA9bayBcZf7280qznaMlJt+6fs8cyLxpWZx8rzxnLh ytMGKDRCgOTdEw99KEsdVrrmewINrkvOkEIh4GQC4XG6fnbS8zcpJTipny+UW6Df4WDX fWX2S3lmeNMmEZO9IdMfttx985nJvs+4KpSsRyOC+660c3H1vislgRYeANIC9CWCx9ih YiXA== X-Forwarded-Encrypted: i=1; AJvYcCWjqzYOAj0tUnUApFxfd8QsATyDvru6/MR/ca/P+/qgPn9Qm2XzupyaPWI7ZRO4Ge6vRbduKxPqloJDlqs=@vger.kernel.org X-Gm-Message-State: AOJu0YyxWbNYeNlaQdhRRikQXnhsC/kaIfP1alBoW59q+STtCutGXY8W 2Bjqwd2fYAXEVTGFoWwlxTax27FBUSILXDkI2XCCcCB2myU2sXZkxt29mC54yaogZ96/P1eE1Ha 3Prsbi14= X-Gm-Gg: ASbGnctvNqlVj7RFSEi8KUlOQhVaHJN7nZJmYuQ3bGE1t75XcPBQ5VfYtQhoNsUCghT AncOHymK0/bfGjwbRr1nagQMwH5UV51ZFIzIUcuLL3Dj/lEs4GMC+TXndGFWnOIMRBGtJj/0Bw+ C8ubKs4vco6TXmPPTU1EwolGiuZTONyED7K+SkXqJfEuVs7SDNrEK4XKptgf3UE/hYsLkVnZ/qf kXaQzIfrfViqmOuvnBKbUtP/tYSvlMOZkOk3W/zNvH9Y8hOjVBG+mZ1oeBnplp5pwqvag+1j0SM bVH1tEnkxjfDJt8pm+7g2IEhGEXQK6sp4O0WyYCOUOPNSNgG+OMSEAz5qdhTzJdaIsfqFy8+H2R FD6r3jbtn7K+nZFh5lcetdoTwLLFyXOG387XUbC2oCdCBN7vzuSKe X-Google-Smtp-Source: AGHT+IHFjiAXaEAX/qwdcuEj85ehmkltNO/B2fGV2gAeQQvqe2timCfHbDTdR4nqHfSt59VV8hUwRg== X-Received: by 2002:a5d:5c8a:0:b0:415:7a6c:6a38 with SMTP id ffacd0b85a97d-4266e8e6ebemr1270056f8f.59.1759911482606; Wed, 08 Oct 2025 01:18:02 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:01 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:48 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-1-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=4930; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=jt98/fKCMiWsJRKIBoUPImv7pfYjdVSMRpukpIdLRi0=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h41r2ZAFmiwUn7PgIvcsf9/Ki1be/TmFs6ex u9nsqOD39GJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNQAKCRARpy6gFHHX cmLzEADDqXLdT+V7DmBbV2ZHe6RevBtvs/WskQguIekDpkpNMLSZUe9utgX4MAErix3Em600Fzb Tkj9Kqh+36Bc1FRGcZdRxZe73pOJpCGuCmG/KRJF5tLYIJyahyZC1508jX2v7hNmyGf6mo9E82N 6/NDjG6ER2cU5IYtRDXLCbZHCxLJ55/QETUEBaEDppvVeYw2fuHPkXI72YN/rEZXDH/H/53yqlE 2S1DabEok5qR3ZriVTUgPrb1A5F/Mwl/cSXsC0Z08RNG1kLKgKnOEkyJiGDQGXMI2KaBS0hKwCY cU9b7DMtbM0N9iWaFSPSjx0dTPcnmYvibwW7lvnhzDdeIEt3KHnD7PBgr2dOxUIJ1HGKarNYk01 /70LZu4CmKqAZCP7cmP1mOA3lQWM9bMoQRQfcHyRrCIwb9NapxwyzZhqFtFnljzzrfoIUkLVR/b buL4wdvPvzHXXcsESe+jKltN0EA5k9iEWoeyMoeh5G+6BulF9UXbnw0k0s+8nFI6SeaEHCTdswK fP+l7j4Y1xw8Eg8ytjO4p30MMZso6krN7sHCC3JpUbVn83uAbqc+l53bbiyaEe0q1D2ZT/FxloU qX0NuHdAFujSg0cBE4rrb8p4H9I8Jbb7r8FKuj0nL1/bRE1uZkC3ZDexsMgQ1McQhE+YUNpAjUA n39CRzJaFaAqWnw== 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..0a9cc789085e8bc94d44adc9da9= 82b66071d1e79 --- /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: power_core + - const: power_mdio + - const: perf_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 "power_core", "power_mdio","perf_serdes"; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Docume= ntation/devicetree/bindings/net/snps,dwmac.yaml index 658c004e6a5c836bcc1dca109a251e27af6e23ca..5ef5c28d0337050268e76cdd787= b4cd6de7fb0e2 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 @@ -176,7 +177,8 @@ properties: - const: ahb =20 power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 =20 mac-mode: $ref: ethernet-controller.yaml#/properties/phy-connection-type @@ -639,6 +641,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 3773c74b31d6d9d4c2f9ba53c4b3ecf3e4e2dd79..cb097a1369d08e708152a3a41b6= 10b35273cebea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21096,6 +21096,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 Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E364A2F39A0 for ; Wed, 8 Oct 2025 08:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911488; cv=none; b=K2hRSNhPlRT3J2LTZmxEVTZUdiPi39jCjIQkHVF0qPlm+HwMzV5qFY355u09SPLNwtbFDJN5kccDhOei2SB4Ytjmv/GRmq/DmY48xfaGsdawioprmUvrHuVHnKX3DW7huxMOT0brV84g6pNadaEOfoARPztzE4v2M6tB28ydyCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911488; c=relaxed/simple; bh=BwfCoBnPTT5rX7Sdj59SJNV0iReosQyMrWaTx8NgluA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q3/h9bTjKhZbLXUFxFq7xD9iFZj3XhGraWsNd57auqDxWMGFvgXD4nPNJn07WuT+cP3aEa9bJc4jmbwGDjovWjF0NJwQgsOZyMoI0ef5n8Wocmt5SLTYVP5154mlm+bBwAy7NgGM06ngE9giHpuEr4myGWuaMs/g4d0AlsT+AKk= 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=PQfNId0a; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="PQfNId0a" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-4257aafab98so2672846f8f.3 for ; Wed, 08 Oct 2025 01:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911484; x=1760516284; 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=ul8GBU+O+XdLER6XCbhZBXCxZuiNlzEAtMGpu/p1y6Q=; b=PQfNId0ad5TjsZXOKmCnl66HLeqk70xhfxU9WLVx6/lRD0MVgUKHete2K8yihTLraE gV8+TrFNpgGr6a2jdk/fCiUSiRY0WKyQEstgHzSdYte0ZGIEqU/7upS8Y0psGVmokeDM /lxeFZqQOIFjHIkFac6R1OBx1ek625aaC1KXrjJ5Kk/+JTHBidnQk9kJpplG98zEDkZJ 29lPWEKdPlTtl6r6Zq90/oVdoOiM+MuajZ8kFCtJC45oWm0M30+0ZJgsyxIgIx/S2KZ7 STAC+0iJuZMv7ZSM3ES81BZXCt5ji6AcTj9b61Xk+/3po2p6o9YI5lPU/aARxc7u1vmx PmPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911484; x=1760516284; 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=ul8GBU+O+XdLER6XCbhZBXCxZuiNlzEAtMGpu/p1y6Q=; b=EejWaJWodxbC/zb1cKE37tZlpSX+W1aJUMU1CHwF1DmXV+6oMM0usZd8FQdwK4zTVc 7t4PypO9qgT+yGow2Ir/Py8weFk/rWCSecl+cvEVXxDgcN55IOW5AfPKu6P72gj1vo/T 4nvg9dFe95ucyoB9oPQhgKPrQ19ssmjr4hqFXP0WclNGAtZnauf/rLMiVC81Ja4Z8y+N du3xpxe169N2TqkEphIc8W2QXhEUZ1wJ9Uoudm9FksK1sk8xjasWyImPhq1ujA4nfnAP 4aQQnPeHaoGQmqjZisU4Le6xKaKwp+QJxODVirI1JusjYnT5QQA7qbHikYhy/XlniKtP Hong== X-Forwarded-Encrypted: i=1; AJvYcCVEWurrMzp/Mbr+T65iB+X/vLZ4plB3q+9HazvmQhAzzcavIOBZNrEp/2EK9iWp7reR8g3Frf1A8L4iqDc=@vger.kernel.org X-Gm-Message-State: AOJu0YzMLeTcoLDc/9beLnvMcLVFU+S0IXCfC8JTFixIN7Wv7+LKR6vG f0UBF8mdO+kbXqrUmGleJ54nidykvFMHp+fhwS4hr/8R8wNtwtVJgikdnKOTin6MtzpuHOHQord PNFxrKd8= X-Gm-Gg: ASbGncsSEMHHuBQnmFdeNAvuoO4Xk7BjT73oekoL7umbpmNOuN2FmCoBoEfEg0DXcDO gHPWYz91Id1ZPhIhuhKiZAF1k+Bi2Sm224r1DcjD2wgJ0l2xvGKbzheEjVI0eoiOr+v/9daQnRH BoL3s7s42r1+ktoKDmfTKDLbFoFlR1/YXqGSb2wPAe+BJVfNQ3FEPc8n8r5WKJSzM7H0mj3x84w Mn0kNCm19Or1JJhXIkJTe1ZvQ/nkvjB2JWP1TA6SXppRyCzXgx+QOApcnwo2QOOuY6Ud1kD4wxY yKr1ONVrM0lX6vfWMKYLnHMxOJAFfB0r7EHCErcQuHYYWR45pe1nAKUEV2HO+80WZPTPAgAYVPR 2nkHIPscDCsbjxjDgRbUhdCvBODXcdSArX4YV8L81F00b9nGPPz3S X-Google-Smtp-Source: AGHT+IE6ZMyLcsBN0V50RlzjIFoIQLk9iOg6oRiNR5JvPii+uUuTFdHwXGEV0hlJlVRQnaGtVLEXhw== X-Received: by 2002:a05:6000:60f:b0:425:7589:2737 with SMTP id ffacd0b85a97d-4266e8d8e67mr1317470f8f.43.1759911484416; Wed, 08 Oct 2025 01:18:04 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:03 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:49 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-2-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=2902; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=D247/I9k9+jdDafl4QuGSA0//M+k597SsL92RQwFhvk=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h413esbXqnjuND12yudzI6EY/1g9lJi/uRCy Uuv9fCwSSOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNQAKCRARpy6gFHHX cpxRD/9UQQ6GsDEhCf2230he2y8bhcrw003wd+e+aOxvP1HQjx2HrvP/Zh1enLCAxqMlTE4Ipiq c+UtF6BPiuYKaa62kQx3y8twflIjh1bFOgQCKz0b8Kps5yLsS7lZwX1dSRrIvMCWPxrXJtqXWvx HNlULSdJR8x9p8IXMGHCG5rEOSi6Mgo9FsIq0rqbVBwUeX06kOe7pA2ssdvbr44P5KecfrBfnwK a6/o5AK8MjJZjOLhhyzuigM92jp4W/KA/qFSEgdRcOP9mSlCaRvV5F0Ibraq6o8b8UZGPWo6HQs N11vvaBgINRZNs155aKWFaBuUYy9WM+GJ9+gp8PtR9GGZ/cCVnyar2uf+ZyUemeaa75LyHTuqCZ BfuXXMZdAxRjPRtMqdz+nd/RHj/S7/0PCafuZj/nWKgKOTBTFDZvj5UlWbGpHugfFbBcqB9OP5w IeemlR06TcuY1gdnoz7/WzHAnC5K8ELWdnDyB+7SU9+S3M0ViN23lM3k/xzPL2sOGQWpPzMi5Py rx9bsW3PeEHqilRbhNJ/9AplrkCZwL6BuYoXS3FrGwy1etNxuHiZolqfer5Vg5O2ygobzIdlUus qVJQusAqdj1Man4KZInD244TGspt8J5sVbVbs7DkDIQjueXTsaHiO0+OVRoK1yx9pnFfWxVj6cG M/aKIqen9XWrJOA== 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 9507131875b2ca05fedcab95a3bb4c7f8e8810fc..7734acc6f1dd669ffec622812f4= 8d355c507fc32 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -125,7 +125,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 d8fd4d8f6ced76cbe198f3d3443084daee151b04..aa4715bc0b3e7ebb8534f6456c2= 9991d2ab3f917 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 @@ -764,7 +764,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; @@ -815,7 +814,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; @@ -852,9 +851,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->has_integrated_pcs) plat_dat->flags |=3D STMMAC_FLAG_HAS_INTEGRATED_PCS; --=20 2.48.1 From nobody Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 136422F3C1F for ; Wed, 8 Oct 2025 08:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911489; cv=none; b=IBpdGkZXI9OGcjwq+hz6pw57+7yp9PuKMoyEzvaI3Fy1XndUPv8O85Dwf20ZSZIGWll+LeWbQzZfQ+TmY9E9jifoJoU8aS7zcYlPR9vmcuFkYFdP3gk5j8ko2e3ZPzsY8P/fTFOw5u6VfcZeJJZeJsDoBnjN1iJlsgZjm8Do5HE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911489; c=relaxed/simple; bh=fwsfkO/edNU0K9G/U0ffbwq3ATl5oZ4mal9F1JcWMmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OkDxrfs3/gIzD97X5bJVFtZio3+LlygaqgprWUxnZprlNXoE+nzHJct9/rxVJLWJ8VohQPLM1UrnF+Q0qFaQa+YIFgXp6eEWHRKERGjQvZz3DLk0lmh9jfDMH9Xq3J8dEjYGyMYqNxGqDKHIQmq5uR1Lvf1yPi2VMN9ibIaRwVw= 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=AKeRO9cz; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="AKeRO9cz" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-4060b4b1200so6177127f8f.3 for ; Wed, 08 Oct 2025 01:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911486; x=1760516286; 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=pG70VB/2THcHEf1bbNlRsLCEdjUZ295qJspYMOYZW5c=; b=AKeRO9czjZv00Dn2+H0YSz8R5NTOJX9b1GgstI+U5Tls+1YkBSwmWjkJpjgNKKpq7J SK8J+kSC9NHeNZxYVDSRwSA5akgEUWvx8yoqfIdurubPD4vjFcZCa6gapcPX5iNFuDoI vzOQJYLDKyBvGqnL4nxDVmlzmfbOz0KUxebekf6MQwHhUCTig1wKbULIkcAvA+t+9U7e JLuPBW65qoN2ciELOuG5788WOr5/mRLYTVrpxsrAi9AYJuxqlSQsJDE2JBsOJslRs/PN uKCS1BiUVNhQFW/lSPaUlM94vy7buLAjGXlUsrpdlXpSKWUZqyXjO3mWp5Mk8RybHVfI qVBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911486; x=1760516286; 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=pG70VB/2THcHEf1bbNlRsLCEdjUZ295qJspYMOYZW5c=; b=qh7LAClRCVxpv94TwQJ3aVnT8TL78Lu6oyGU41BCdJQVKtemVfibTkiMFpIsyWdn7c NBqhmC2H00W5A4jcvRXuf/nqLW1O+ZGxYLRNAcUSivJBhbVUmprWnzS5HPde29UCmZ5/ CgIUzJeQnXaTRUbIfcloDW7qGgRIqgaXjSU+Wf/STnoXgNkKE5+VuyRbMysnFaz4QRTN mhKHB+jaW+ixyHB4pA7+J0LdVUvXyFo9lgL0inTzrouB2DzTxtSMQGqTVbWN+afqkXym izXTHnUYb0w2A5fqEILH76VQbKDmL/2HVYi1K9R77HoXMynwQBqsXSuyecX3eY+asVVh 2uOg== X-Forwarded-Encrypted: i=1; AJvYcCWtrEgAObix6GT7KWTJvkSpQh+o97WZAnrPyq4uZFpF9FFlQzOajTeFfIwMdef755dl+Kvo6WtkHGBEUhg=@vger.kernel.org X-Gm-Message-State: AOJu0YxX/bF7HLsNEwos142Z06OH+D6dOAnhrMR8DXr9G6tRJJ0v3abF WDaaugofHRuoww5OafvPnE2FRfoLD1sF8k2BF1RzjTH51o7+uvh+9ZYFQfudFkKZMvA= X-Gm-Gg: ASbGncvBgPx7Alml3Nk92Kt07kxBo9CvEkJ7IffXyJbg5RsNTTcrSaTFeE1mXbvbP4H iIf7UpMfl3MDAMQZKjHCSJ0czVKo3egpZ9vygZUTDxyFl9xDAF1An4IxZVPv8iCuesc0Dc4zfG1 GTowxYtMxIpFHca/cgObWS2x7HSNbeZjPabHAUBRZCKpq9puAbgtLndnXpZ8kfEQWjK4e1ifm5t pSTViQrtXb04rMLRocOR4DxLwSr5mJ0BtHd1EpNHufGdYZ1RK4lkVk7zzlh8I4Fk4KNErfU9wrY Pcz70sKjFbsm75BMgKPEBoY6jitKOFa91tfvTCSpqeVoN7QC7HHCuVNbg1BdrVJY4NH1vS06Rzc in16jo4v6wVAVcx+icNAqtp7ibWEreTpJMsD+n9r5OQ== X-Google-Smtp-Source: AGHT+IFZ5tJ74Dd8NfGzTg8vtMg1MllO17lT82vWUmOq7OQ3gG3+s+nr7vbc7H7XnZcyQC4U55uDjQ== X-Received: by 2002:a05:6000:2c0b:b0:3ff:17ac:a347 with SMTP id ffacd0b85a97d-4266e7e11c4mr1568045f8f.27.1759911486432; Wed, 08 Oct 2025 01:18:06 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:05 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:50 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-3-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=XKd4Dvzw0ejsOil4omJOz8oD8d0/SZudynnYpUwSWG4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h415mstwMbaW7Pd+AMIYxCLrUK+0mL13oDMj r/Lo2JcBn6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNQAKCRARpy6gFHHX ci4REAC4/wE7bcatuqkHrpg5e3HuhnTcns6CmyWz3AKa2/Puse4ECBVjst/2AarVW1uwOO54Y6w xuvwBtYsD5n/fFvMElHuDacPLVuUEKxPAGIvSa2rWXpQDz+/rDz02E618QKXcAOPAGP/udYMrGK pCNGnGHYbu3973QNtraN9l/qkIWonjrYC8j2DiHWxlmTG438f/ioYqBN8lGWNgB0gABdFc6nB4K 8FAfZzZr12R3W/hHlSLye5wRbw86R8tPGuVI8fdB3hHo/EGTEZyhZf5VkYFIm0cVX3Dw+dkR9+G fZBw7gcfpi92uN9QetmOSiiFRvD13QpiD26EtbO74cinB72NGOXb6s3Fdnf5mvTa2Hwn87zUQme ftGnM2R2IZc8rxslO14U4tNEc5/bKHT/QX2nxSPQ+xA7riXel0xBu2VlP+oh+15E2H3jZ00CyN5 zoBVnoXTTolGtT/AceoBTEsobWOnHMtodoxIBuwLDCQEn+URSm4esLLlTotDkCuD2dQVdY7MN7a dcpeDWTx6OCqZH2PLrk/Vl/mLsD6thI+Bw5BNhNO1pjh0g1zbI9+3Q/VvgEn4BCyowO1iS+6k59 hoi68TOJV25dXJ73L0Os+xXL+7hQZDY2h5VBG0zeiFi1hNfB7oaUgC0GBMacCHqeveAb31UxRtI 6gA8uKzLorgErgQ== 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 aa4715bc0b3e7ebb8534f6456c29991d2ab3f917..0381026af0fd8baaefa767f7e0e= f33efe41b0aa4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -742,7 +742,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 Sun Feb 8 18:43:33 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 5C7302F5319 for ; Wed, 8 Oct 2025 08:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911492; cv=none; b=L6pRTvk1ZY6UXlvnuQxC41AP4xtt3FgVii6+m9aDjIHqxzk5j1nVTeoDl10fuKhGCpOqmzlZtJjgQD7mSbsvkLBaEDuqPRlXxoGbdGVcbdTLDv02U7qG1Sl09QCzZedpO3RsodK6FtdPgYJr0LiozV3J4fJh5rtaWW8ih0yrO40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911492; c=relaxed/simple; bh=W/Q0BE0iC0PpvIbRAV6KjcdJcBamxfsiRHWDDOKoVz4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=laEjB2JSYHfu57ar1cpGTAdMpLYnHx6UNWstlOuqipZwFgmftay47QxMB6evQRQqk6Qi8KtHlFVDWKyklwxqwrEfnCEwBHmCqmV9P9/X8/DKFzJ2Ok39WZsmtt6TGzuhsf42q8RpgEPOgiKdUArUo5wZj5ZawfiFQRli3l0QuBg= 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=C0mXuVsF; arc=none smtp.client-ip=209.85.128.49 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="C0mXuVsF" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-46e3af7889fso43522425e9.2 for ; Wed, 08 Oct 2025 01:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911489; x=1760516289; 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=jaxsI5wjc2fZX1+u0/1MOkxyHBJYNhx76B7+LombEVg=; b=C0mXuVsFTnRbfdYz8HcfsnRcft2OUpKpZ/EKebSZUpC2pLrRd7aP2aJMkOXxq8Qvp4 bSaXM1P2n6FeixxaWFYROXvD2o08yOr9slDcbTiTz7y50sN9WtnSX0cxVg4WgSr50LJf zvDhJQul9y+d6Mzb2e+QstlF6osMXYHQsdeALY4Lu+22E//XnCGF/WYAckS6pMQZNWqD Q9I9mZyDGjcvI3+p9DbBiSbpqjs1qlrKEGcrEcoMuk/ehytcxRi7GApkcJcclTk4JPU+ HR1S0Hv+h9CdBfIAF3CU/I6ZMkWvckkMtOFmQV+fWfKTg8PnRuubBgyk5GzjzyqDlIHf HL5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911489; x=1760516289; 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=jaxsI5wjc2fZX1+u0/1MOkxyHBJYNhx76B7+LombEVg=; b=bQWHQ5KnbNep3XL2TWS7RLvMFS2nqdC8tviG2asCL0ObJj7Hmgh7AYh4VE6tESgw3Q uOUu7ydrbDcPUTwe3osRy28fW/XFEMmNJvQzAABSpRbJANCWerwM1w7X4tyuC5r01HjD NPkNY8P+Lax+kmHcNFCtdSj1Qnpj3GMGVvGDbTKmy3HBNjBC5A5VIeVq6o/xbXUT/AFt haKdOmn+ANND6Ao3z8tEgAk1dACdd7bmXH/pH2OgJ4ePhUErwnhXRJz6zOKmxZTe3lhx 9wPGJO3WIHXwl/ZeRLuk1DC5npT3UBNs7Rz7gwCmVlLdg8iQOCA6nxHLO0b1PZ8fX8qO k+oA== X-Forwarded-Encrypted: i=1; AJvYcCWwOwpAvKYLvIaamDURjO/R3sgpzaG6hOCCJVn7pjncnN9Tq0YewgbMJ+DSfUFVbAFAyNtNYRDfNobalYg=@vger.kernel.org X-Gm-Message-State: AOJu0YxJk0VIW3yStLBtvilA1XPrQANIm0PKLnfM+OUrPnQ9R8ejKNg6 tqHDdPaU950AppzlEzHFsKypMt+6VE60h+wuAnt+kr6xeoFZap89jJA/BqfCVRWir4U= X-Gm-Gg: ASbGncvVqai9nRho9+5JwZLWoEB7ZZGX3AJld49d4OuVX8LbnqTAd71TRZU9QCbjzKZ iV2yc2JDI4XAY8lUTo/511hfT/8eSBW8O2ouw3Mw+02jzAkBxtex9KurD+Sj8PPE+87KBezIC/D zO3UOUyXB/m0pTXcCBSUeREGxgYwia7UG5vr08cqojFwPYxz6mQbNQ7s+L06UWoJqwx9tvLdWsz ZUl1KdzJRShup/lfCc5EcgWGvFZuAWcme894od0HBfHULCT0MStIgxBLISE/EG+MZbCVn1HuXD6 Wp2QfcVQfh73mJKHlB3JMY7lUzDKQJkE6DrftFmQHUfq6m2C27UJ0MNpS3j6pcy8A9ulVTpYIkF RU5QXz58rhV5GKOKY8Gx0h7CZwGf3MRB7umLKbXUKfw== X-Google-Smtp-Source: AGHT+IFFI0M9udeJcMqE+CoColhQNMFY1CADDWaFh0akyB3kucjJWvoO6XySvRVTgngRa4SKqM+zxg== X-Received: by 2002:a05:600c:4f08:b0:45b:7b54:881 with SMTP id 5b1f17b1804b1-46fa9a86307mr16468655e9.1.1759911488611; Wed, 08 Oct 2025 01:18:08 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:07 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:51 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-4-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=5758; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=sMGV2HQxeUJ7fEJpZJPTl2YIIxSzYzigYX8J2eZkPAg=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h41VPsOJ0Yjb5Y8MpfBiKZVcL5BNGgjgfuES hpZHzR6ZIOJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNQAKCRARpy6gFHHX cqqFD/0RsqzsZFM1K+8+vt+P8qA7yx4vp9xwXuK0+w5Vn/5uOkxlvkbMz5iBxNS1ys4T36S/8aH v7XeGizwnfEN09rHSJvLH/1T0Y5km6tZmqEH9cSiw2gUKmvaGAnV/BcMhdI470tvb9f0YZ4COgD P7oedPWAECgxSguxna3DraU3PpSg0mx3dhTX+b5493c7ICk6dqqBID2nI/O/R1NoG3ywciR6FPH ufh/Z/O9EGgIkfzqxS7d9XVNhfoTfbRf3nMsA0CGvCBjTr3B30K1e0ZNYy1T+K5eJgBzG3TE6nC p+uIQ28z5VwjEgdDaMK3xVTf7pzgZucy5hpZEFdncgGChhPc6VXMCuoMoSjYqyxrb3FBCCBSusq G9fTgN6aBdxtoK+IBJo+6KWE3i57DQ3mG6UmZfE6NW33/tUJiIZfGch4UAfjBIS99hlDIQ2BWp6 TYWqmgg8CpNvvywKx+v06qVdi7f9hanEpJ49uRmaLCLZWECBUedhEoe+GqGs1KtFB9nQLlnUDQ0 nIXVTR4LpsVCyou+L/Ld2EUdxKNt0Jzr76LIBZOWh1C7Y8OdeGhu22FCSSUX5zt2LyIWZh8nME2 CfRjdmF3DxPT0psjb7ckYedHPNmMfkaHksRMeYqb8yzacOZD28BZMQlrhUFX0/ciIdS2sZOawAr Gn5B48RqsYXVgvQ== 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 | 53 ++++++++++++++++--= ---- 1 file changed, 38 insertions(+), 15 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 0381026af0fd8baaefa767f7e0ef33efe41b0aa4..dcee5c161c01124ea6bf36ceaec= a4cc8ca29c5d5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -102,6 +102,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; @@ -219,6 +223,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 }, @@ -235,6 +243,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 }, @@ -267,6 +279,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 }, @@ -303,6 +319,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; @@ -766,7 +786,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; @@ -817,13 +838,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"); @@ -851,16 +874,16 @@ static int qcom_ethqos_probe(struct platform_device *= pdev) plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; plat_dat->has_gmac4 =3D 1; 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->has_integrated_pcs) + if (drv_data->has_integrated_pcs) plat_dat->flags |=3D STMMAC_FLAG_HAS_INTEGRATED_PCS; - 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; @@ -875,10 +898,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 Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C81E12F5A18 for ; Wed, 8 Oct 2025 08:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911494; cv=none; b=q9YOHCFoUjuBdzeyfZuNPWaPMWYJA4gh3ZiQZ6BNM4IezhS4Sb7BGMExWR+oJW4+Ezdw6AXwPglx1JSo3Q4Xq1j8bbvQO3d1CUbobk8MAB9tdEwm/2UbTbfsY1Ob0xkIlXlCUmtxamiE+mp4KI+b6h6ePWVzwcMIAFgkbKLFzG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911494; c=relaxed/simple; bh=TO9nsTt0YPxpWytCVH7ZJjGxn2Z4plKkUXJnF32G1IE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WDo4u8e0ui3D4HNNZP802aargyQH/mwsyWllshG1Kdyu6kZc+nsC2P9hHZRHHR7eN+rh2u+LfH7aVq2Sao982lbkXDQfETWnB595zgbnpfGbUtLwqXRtJnGF73s8DpjfcSbESPIYQQuuXdVm7oG9tD3IvXirZKlAKnLtdJXupHU= 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=lVz7wwNC; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="lVz7wwNC" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3ece0e4c5faso5729513f8f.1 for ; Wed, 08 Oct 2025 01:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911491; x=1760516291; 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=K5ZbnZbGKkG8LBPBH3Ir29b+fdJ02lrKRlpbmxW9/T8=; b=lVz7wwNCmV4aq8tRumqCGo46eHXQJLDoq/mxCkXOWELb3SntbwGqaLscoQxUR9pduV gnAllMFvcUnlS4lLEZC+LZROBRWSscHkP3J3m9pUZreXBSw+xFECg+/A0wL0DgbHFFg5 WovNxQkZUHMGHyjXX+8syeUUP/nfBn30vZOp7tFkFnPf0P9wdkr3pg6NvB0kYy3EKTYr 0zeQ9UAdzceX3oH+lQvvbV2ZEQjzilYgO8RldP3mojEuwuTVfoxW2qwWgUrFSDZlJtCS KX+uYqe/sRm3YsaruPY5wHeRCKp6cjGeUNuPKbBOmoNjrfKBT/E1ZVb5XdBFN43xGur0 VvtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911491; x=1760516291; 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=K5ZbnZbGKkG8LBPBH3Ir29b+fdJ02lrKRlpbmxW9/T8=; b=uLgt5yQK3sEeflZsLdix1uvv8LDru+jWVWFSUIwmqgorllapet+yH7lgVSFcCkVKB6 3ukRyQqF7d9UVmliq26410vdi6kp2zRcPuWI/+pea3x9g+GcLfOPvA5yZNELbihtuzaJ EWTCUDeMh8wylSla26cDgHTtwb5C3B/rWRn7x6CY8ymkHinmb0JpIh4KpAxOfY0g3Z/z UZ9tpL0NSKCsfRWKeiSxSswcxndoYI5J/iAUCCfH2lDkiMe/9r2LZ795/cPDnTXO2/ij Pkw7d4EWGIgsvKzXbdEVLtZ/SalkCmGCb6ytgDhv4rwykaT/lXsDKcMBx8s7mBKcxC7p lYlw== X-Forwarded-Encrypted: i=1; AJvYcCUnUCgZXhaw1EPT5lWL1kwzZiUfE1+UUJ3FIJ8gEQnsTFo+bagmPs84OYU10MXIEwQpdvWZqX69Ez55Gps=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4Yc8bSWE4nQcnPW6YnGUIiuGkAxJ+8/w+iI535gtD1eb9nagr ygzlpRpaJ29o1DDe2IqCZHVyQ1h/iqNIxO6A6XzMLukQpC0kn2LEfWwdIwrROL7hHwA= X-Gm-Gg: ASbGncvqCI4q5hdZ8gYrReqGiwCTgcRL3e7gLnKGFAa0oRkqhiH2MKcg9xJMfa0skP3 lu5hpR/XwIcOtmrD8a7TD1JkSsKNJ9M66ZtCBVNw2nRe+r0gh4eEoUNIJPL/94C9PzWRElrhvWo N7UCPcGgz3vo8k07YaBCqYUJL8s71Oc3zWU656mMTPiXnwy7hzOImkOIhxBBf3tcq/ZpVNa9Swo Q3c2EQGf6r1m4sty+E8an8UBr9sD2gskw42v/EkyAvdo2142gD21QQEyXcoYAmfsmniFm1s2hQz nhg3VYrVqqC574KjtuuUqBQeWd1gjM/1E8fGI9y6eUUBmAmqQGidiu3KaxtanY9Ehcby25eJWtU /BrSlcA75WqeX5zCSF1y6MJA/AmFCgA7piPAcXu9V+g== X-Google-Smtp-Source: AGHT+IHkwtqy2vb9uxT6M7LtlQU6zwCjb9IR5rIG74fXz3TalugvLB02SuzmrQY3nea1fwBLGELWhQ== X-Received: by 2002:a05:6000:1845:b0:425:8bc2:9c43 with SMTP id ffacd0b85a97d-42666ac4502mr1491294f8f.1.1759911490600; Wed, 08 Oct 2025 01:18:10 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:09 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:52 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-5-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=3478; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=QXDtZJBSeiuTqR9NRW8KT3qs59BPygxIGrInXJc2Y/o=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h42Xak+xMy0XGVbg60nsHByk/5QWfRt+MQk2 tRZVAmURSeJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNgAKCRARpy6gFHHX ci7yD/9T88d234rhjtNAnU5hIUiy2KPa1vwStmh6rzlpiBEAYQWJ7n0qtpVAahYHWOUDFfpCxbX qwsLaWX2pQdosbU2lkFdffA5lYMtlXOH6J6GUvcdj0SWTSPeHuhvGaoQjr7rMYT7wVScdfK/f0T Q1CKPK/+i7nlZ2XpFhFSHcPcHMwzGmSe7yNtxWyMhmTZEv8xPu9N45yE6Rkw1f4qtdQujoBZ/wk ViGxpFT6K2MmqD7NkTEgzs6EwNBhKII+UCC0hlGskAB5N8PiTaE4r7rPLvA/B79t2fjd2o6Gdqm kD1Qhk73OktYQEiw64TAkceahph3P7g2PKW5p8whO3jVBKsjKRnG8RPhrtkPoV/muXooK+UnYXv mmYJvnC8pUx3BXZGy0PMtyN8HuSK05GDhscy0T/HJaRGcw9bpg777ge6XlAfW1BxNTP8nVndOD2 C63+OilZ0jPj8BKIQyY88Mudny2/zvh9bu44+UKEa54IJUn5ZuGUZDWUHhFH3Qcgs7Ha3ampG1u g/o2E0tK5wZcBSN0d0YwtACEOcKuLIBBakebxgraxUV5tByTHxwOPcMoVU2nHMyVfZM5riUXQgJ klzu9ahNp03ITcGbo5/lCY3N3M4bAkCKevXvcNQXc+oXsr/KMNhSmNINpCoZrlbCTLyp/r4mwsi fNcmzHN7Zq/n+Zg== 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 dcee5c161c01124ea6bf36ceaeca4cc8ca29c5d5..d4ddf1c5c1bca2ae1fc5ec38a4a= c244e1677482e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -95,15 +95,19 @@ struct ethqos_emac_driver_data { unsigned int num_por; bool rgmii_config_loopback_en; bool has_emac_ge_3; - const char *link_clk_name; bool has_integrated_pcs; 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 { @@ -297,7 +301,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", .has_integrated_pcs =3D true, .needs_sgmii_loopback =3D true, .dma_addr_width =3D 36, @@ -319,8 +322,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) @@ -787,11 +795,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); @@ -839,6 +849,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; @@ -846,7 +859,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 Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 9B02A2F5A27 for ; Wed, 8 Oct 2025 08:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911495; cv=none; b=sJ3/UPYHs/F00ly1WH89gK26d7RSz1oW+2+bYULBPxuDfWx3KzFG2hdGOkqsHqpv0kxrKq/a+l0leP/TXAkRRMDOGj5LfMGEB/8J99WT+NCj/7NfOWFtiM/hGuHuRxnA3F/K49P7W7QPP6U0IEO/rkqW3uA9+uFYhhBqC0K5WzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911495; c=relaxed/simple; bh=XIlqJOjcxzT3WhouCo/+UR8137UrPJNI5EXcordY0iE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lJrIQhF6do8Y8uUa/cIGAucZP2nfdE88fCtBhlpagEB+sMxzn9rDS/6pEJN0Qei+pAq08Z7KBKvQRq51NqQt2LQ1Fjx1jT/tBRHUVqIEmehcMac6qzFMFGCR8upVcleJdlwFNwF59Nu7f5zjH0RO84Zc85UoIcefcFxEtMsZ7uQ= 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=i3WiXKGS; arc=none smtp.client-ip=209.85.221.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="i3WiXKGS" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3fa528f127fso509010f8f.1 for ; Wed, 08 Oct 2025 01:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911492; x=1760516292; 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=/vSLcjrovVRdefyPQB8K8T5zFHjp8pcBoDKJgvNVhJg=; b=i3WiXKGSFxh4Da+AIArtMAxN/iTauoHIPEs2Hv/Dzz99wO+g1r26BRWyfaCBgWMVjj WCdurnxNu0qWAAwciTY7ojtTxN01bHqw4aP/++WuCC6KhQFO5GgBulLr8+O8pba5U2Wf PCn9W32QGlK/r9fwDbjBer4sDWDdRk+p0LCTn6b/Lhd2CiiLZfj65jWMOIJGMRypkFPz kUxreMZ3wnmGOlup8aG/PMv8HG1BuLILxFKZloyBXsjTcpgB92n/w2sGbvaYCpPBoQlx OBPqvvtz0VNeLBtO9L1aZUBdNcaQxG4TYDLgd01yef/sUzq5tVP5/0qdMU7/DrkgYftC Yj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911492; x=1760516292; 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=/vSLcjrovVRdefyPQB8K8T5zFHjp8pcBoDKJgvNVhJg=; b=pqmDeN6reH1SLXA9VrIjn3AKsCvoiMQ4Q9HabZfYYhjCKndT56VgtJFuIfbO3KdiMP e17hYjAUq+r5mAwrChvs3DynWkER3CpH+Zbhw4a0UEyo9J+hja5JvwqVK4DIDqOKtTUS kUbHsW63dwpEjNFZkKkDwXoIx9X8UyoOOrl6IjIQXxEUmBSS0Qzu7r/+2KroeAvcvxlk nADQpV/Z1EQ1GeMY4h2t43MwylvsVOQ5nLBQkNGgR1l2cfaSA3aW8IbnRRITkz2/e2AU bOf2QO41e33L3aumLSKpSBfvmbLmeG/AnKNzYa2ewYCFO8u2Yt3ALfjuVHMaL21B5zbX morA== X-Forwarded-Encrypted: i=1; AJvYcCVdR2nKLImIm0bqyrgeciURTaWcz9lB+c2uiRjKWT+WHf1odfXkGZnCg2/217fdrP9jeMtPkvqRW2E4m68=@vger.kernel.org X-Gm-Message-State: AOJu0YzSRbp9yfDVFTAgadEDq1W6vDu4wpdKKxyza5vqSQVlyPp3mZc5 eOOnE4pkHkxLHAQ3oqVnc/OdxRurvs4kraU179W0hpmXO14oC63LrySaxn7L6XpWmZQ= X-Gm-Gg: ASbGncv8MiUZJn54S22gd7ZT21jvD2zfCLKdX5gHIzUdA7BbUpg8LGnm9cMx3SlUqQY mQigngWB668y8E2SYV4pg81uRJVk2pT+C5mVcwZr5QU46PrDHaAcohWAjdaDVvUPtq/bzoALLJT sa1e5vDhAu+rNQ3LncBRdcOYiCtjKBY//tRnjqzklpDsoCJR/HuJuHhUJsTDnHw1QU1TJIereHn M5DaRNyXAWcgpNzftJyFdXKwnxsC6TxJN104xdnWc3f+tVV9/nBbGiHdaGowHV64aIfkXZEPXYp MwiU0YbELGf4TLuv3593W33fTcvFZGFZTNrc/b91/6lTQDms0sHzYdKgp+GfMmaIaCyhlsd05bN VfIPAu7weZE8S95oLWbMldfH0iLKcmlvutJ4ZRTz/wg== X-Google-Smtp-Source: AGHT+IEkLvf+ip6rnng1Q3wqUaE7YnRlE5+SKbX9ob3uGgdaQmwMgPZM1fXpO1H39fcBtRjNqboEKA== X-Received: by 2002:a05:6000:4210:b0:3d8:3eca:a97d with SMTP id ffacd0b85a97d-42666aa6616mr1684492f8f.11.1759911491904; Wed, 08 Oct 2025 01:18:11 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:11 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:53 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-6-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=72Rcv9lcaIE/fmtmW9sA3UZwGSkP3ncYbbWtrZ8FIEk=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h4202HoR6T5dxOtuURsXoZwH667ULKwPUQFt Pg5ZX90pKCJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNgAKCRARpy6gFHHX cvlXD/4oMQTfpDo2uPwukuQI/KQzXU/y8GklCY3xl2oO9CQHg18InhSbcIB9dCmUvObM94bmnBD n0J4E2ACalqEmPZUdDJ60jHvqactv0F+ntRz2qkDFYzaFexRkfXATjzFchCpRqAXvGcU5VpB1ZQ i2UDsHvtzVzNg4pipc7aPGvimknq7CfFFRbZMD5lRGEHGioI+XCGYUNsTNrIJykpwfaFiPmzN30 XUb6glegwPsqra4CQ99uSKclBK47FOh7o4+VhVUZsNRaa8xa9/naZ/1JOLYU3TQh2uNXwvzJ8e5 TNsWN0mzl3MVeoPLkD+pVZFH9CbDPGdzNeksgEEYiqgzXJSaqeCuIpB28EFp1UQrRw4uzwgBmsN jbhqw9LWU8l2rwBCobJtSMZSoZ50dTicEoQMhvR5ZBeBrjYSRRHB7JJKhsoy+T93Yu7C3b5qcfK V0ua3QeFOxf4uEUygKIu/SlgVq/j8ZVKSByJ/WkjPccIT7smJOCydOxlHoLIU85FoQ3U0jizMIv ZLAhuNgLcx+r7C5d0FM3sekaGOIA8J41lTbOCnz+hv+O2/W5YCciZd5IXC5LV1PcqIP6WYYE4Ib NMqYXy6BGOQIc7iv2vIzf+uNDjW7JbanfVIHHJT0ZM9PsfhDA24lyp1YNS35D7UXP7zU965LxpM eF/64jenVdSWCKg== 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 d4ddf1c5c1bca2ae1fc5ec38a4ac244e1677482e..1fec3aa62f0f01b29cdbc4a5887= dbaa0c3c60fcd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -110,17 +110,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; @@ -186,9 +190,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 @@ -645,7 +649,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; } } @@ -724,23 +728,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) @@ -749,7 +753,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; @@ -762,7 +766,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; @@ -859,9 +863,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); @@ -872,9 +876,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; @@ -898,7 +902,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 Sun Feb 8 18:43:33 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 D37442F6164 for ; Wed, 8 Oct 2025 08:18:15 +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=1759911497; cv=none; b=gdL196aunJeUK6+b904Vqk9NrKv2gBQ07kImENIdk0M2JzfdVHRM5LFh1U8BJmvAbHj2/t4nxX8FNNQZkchkIwjMsicO2+qoaCSwUYGpuDvuqByzlaTDLcHqObKa4joVyPp/g+I0jVDGLlgVGpXN4EurffCfWc0XvIp9p8NeVMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911497; c=relaxed/simple; bh=NKTMPnPBEN3JCEgCuFzVlb6Jno24tg0DVRR09XWDb2w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=STsxIQn+AjIDhoSb57G6ovBnl20TwloWLBDnTaqQltaQT7bMso9uncpWnUfBst3dW1/3+m7JTumw6XcpZKg0dh4Ip5+1ePAz3zHxrqkGTsLLSgQNN9cYEJlso7dBRRl2tWsRn5AKktAZ2mHSvQXoFj7gc9UTwEX2sqwkf/xBnLo= 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=nVhXnqOj; 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="nVhXnqOj" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-46e37d6c21eso51423695e9.0 for ; Wed, 08 Oct 2025 01:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911494; x=1760516294; 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=CdoEjc5e7kQwXoL1Cm6IjPM2seG7Imvb9wLqalhk7Jo=; b=nVhXnqOjvumo7MCZjiCJjJ5xydyx28mcU95gWIXkTYQLaloS+uS0lBvlSkkeu/kD2r sSJZeG2dOU6WNZ7PyAwDOGo4Sk3RHO3gW8lHGCPQ6bIPNVC6SHRz6E3zZ0IbGu1GzJ5k TKFC/5oZ02yg0Na2VgRVP1ZW/bk52remsoJN+KhhxDmBsPro+6Ui3MzzdFoIs5A9pg4h 6LJVcVzRW0IeFa315l1LkezhpDUOJx/p0RM3WNKS2EQ56Ruv0A3eguvIyKBiWZ+QFcZH 0ZNaxY3tsb5MzTCpKU4Uto+v5QXvaUnYVZiO77u/74Y4jhOKDzu0t93V2SXhLz8VkiAq QZaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911494; x=1760516294; 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=CdoEjc5e7kQwXoL1Cm6IjPM2seG7Imvb9wLqalhk7Jo=; b=H75xMfB9MR4hhCLKyDMcFhP8HW88PHuZJDeuM0Y3RnbG0Mt17IfhokuMQ6LRx6i3x/ +L9+t6Y2IkEadtYnGK+rP/aW1gy5V8clBTV8g7e+Gt5qBxwX1rnKNnWPfm2EBmTcVddU 2ME5VIoYyZPY3Q4mZ2v7/x+Ip7Vro58t5usOVZCFiHQ/lj26BZ5jpDt+QZ6ExSKO7xA2 iHuVDVNUHkDvjdC0ta7uICrQiPu0tnAS/bZevSEWxoWgN7Z1t7CAkUY5LRu14Z2UbMif Cm+3dwAxlSlWYXEyWwxfsv35ZqQU4b5UjdQdtBV5I/xx0/aAyUz4uUQNxylbJBrIUS5+ cUww== X-Forwarded-Encrypted: i=1; AJvYcCVlpztv46o03OnPixWoLY1treo0Lod3eiKbOfsaWAflkowcdi57j4ae9NYp6dyYBRGBWWavophvU/ApUqY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyb2U2ij51kQG36byLUKwgiTUQxa4tUTQEnceTvigfr9zilyGQE XftX/s+yXmld4aN4BNQt8HYCWpCJCm3Tw9xkNW6fhGblC7MUhgw+98aZAOmQumn2WMw= X-Gm-Gg: ASbGncusi0Jrqs/uDxKWqKaaSwVuV6WYdmL/JvdqdzGdZ2mgu0siOlx3nFXiDz8ES1h EYsbT9a/ueTNnhjiRFtxkV+6/aQ4N8fFO3B+WYZlPqqULnf2H8o1k0nymPmxNAVTGDSF3Fn+Eup 59jgrmt//AUDBpzHc3kImZ6yf9ZdCzTlziFygOb3nreVb4qxpFCWoxlX4Om6Sn6mydo/g97Z84+ HWUF1kwTcCFv+s4YbVRxM6FmqgKctbSLpowyrElt2mTlM7d1zCqqWR82bq1LvFcGL7KzgKCWmR4 W8oYpbe31OgOlqnL/eyCBGLfNLB6Q+dvhwG71ONdcT9fJwZCu15hmKGPdXmcW05dk7PzH0nuVef 5GMNAcC35SXkKk6nOD/jCWtzxF6wOo52S7W+jeYgmo+HGgvofot9l X-Google-Smtp-Source: AGHT+IGGV9RTxvTs6ChYk2BboL/91pz8TbAVWTDNgaDs9JbMT5f/sR8m26V513f/xADuHAv6BhGW0w== X-Received: by 2002:a05:600d:4205:b0:46e:74bb:6f6 with SMTP id 5b1f17b1804b1-46fa9af914bmr14615105e9.22.1759911494198; Wed, 08 Oct 2025 01:18:14 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:12 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:54 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-7-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=xmsTTIN+xNt0moiTieLp775A3Rxh60igauD1SnixUA4=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h424wYIOWx/QTIauQ0Xb0HiSiOu+mcvinaVu GhOkDp/gnqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNgAKCRARpy6gFHHX cln8D/40P5o2ziTr4Wk7CJ0ckAfckinQriPZ81qAubZQawfXquU0f9MHcGxOVvpWRqeF8pQsvQV XSQsT51LnHQ9SZMfesP3vKY0QQaz6SKjkhiAoR2CKFM/8nkGzuRjt7oWYKFKbJVhwkJKAfK6tRf 6/vUg0er/eXFIy/tXoe71+uRvAqTClesPLUXGcPLRpcGchrumTBYB5j4bKFN0DdQBuNJlp2QbN+ 0/gxygzyNpUtZwtdJLGN73TZSTSE1bVeVicT3tIIiYPIjCW1Lah0/IJL4w5Cp5qEiq5oiThfgjx /t6Eq2bUJ5kns+bSpzgVx3cHIMMdqf/Km/K2gUsyBPkW6VF9KvF3QObG17Nej1gxaOGRgDoFje7 X3/68pKORhRcaflwwnlGIwWUK0BGsjQ9rAZ4OUMg+7Oz8mYGwlhKrI/Aq1Me6slet7SrbfBpkyf uEOYvdOLVFR/0WSifZVhrNABqZWtD/BBnanKxR8Rh5VGg3fki7Ev8jEDA364ubJkfYcKWt6O3bK q+ukAukJOQmZayqSjIyQ5gqU0j97tXkVuqONtZA0UGiFf7RvuodWy2AteLDVpbwXXmGRt8InpSf S03B2C+Ox/rniLc3eY+4YPs40szdtegi1bKYPhM0FIKWxCbL6B97v+vVxnMSPo7t9K2l0S2s0my bRm3rw809SJ/T2w== 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 1fec3aa62f0f01b29cdbc4a5887dbaa0c3c60fcd..2a6136a663268ed40f99b47c9f0= 694f30053b94a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -125,6 +125,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; @@ -646,11 +647,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 @@ -881,6 +887,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 Sun Feb 8 18:43:33 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E2F32F6582 for ; Wed, 8 Oct 2025 08:18:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911500; cv=none; b=atczZUdEtcycHYpIwBZUyhvQ/AxBlz/6iO6To825F35d1qPqz3EpZAXrGIHJhzoIyjTZYw6/UMzxddj9f8D54VMb/QTFiS990MX+E7jC9ILGR+uDHMhenrxgBSiqG3/YCClRpCAXllEL2A8ZI2SfumwSxDPNLWzZV0+qImigfYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759911500; c=relaxed/simple; bh=oWXfa3SvJwwCEKqzllHDlbCszXa1p/f/sbqZPJo4AjM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I1nR6pVJVleEg6E2GIq+B3eKenkBWJ9V469Vt+t2QtpxwMWz2JHTFdn9DmMbQgwESzySx3CayJFbLdXyAgRQ4RN6z0qDla5oDv2BfNGiS4v5fC6mD2/ifXL6kadb7ORl93+eArYI1d0jnTR2aPUZMXKMDSj+Ptiz5bZAWv5KzLs= 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=H8AY4beB; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="H8AY4beB" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3f0ae439bc3so3323672f8f.1 for ; Wed, 08 Oct 2025 01:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1759911496; x=1760516296; 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=TVw9UEkU6CM7T/P7hDMj+CzXogm3wRYsQn+ddAlTT/k=; b=H8AY4beBq//mIck38maeXxlNnZjK6xAUWNwGx7KhmlE7PTjgZ9oHu5IgeBSnm2feW/ DmseduC3GYZpkBV9Hi5KCNVw6tloJOE7E0I82dXGkJonKY8WACUBDjt8n7nosVHWxJ9C VVa/Fmi7dTZNtpSkfzR34hRcpG9yH7zHc/NqtoiZnMApz6L9aGswcGDwi1/B/Iz3Q1+0 NedustTIT0J+k/nGfmIH+h5YZYqrPG+mxGZSx+uldf7T0hzAzSks+0HKO4u9RozrtmqI hV2mgfEJSf6KgHcUSJgdKz/AoftphYkFsHhQtcITK86Ag9ceorNZUYGcGkV/1/mfiAEG 5cMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759911496; x=1760516296; 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=TVw9UEkU6CM7T/P7hDMj+CzXogm3wRYsQn+ddAlTT/k=; b=S8sHq3eewSZKxANoJHyVnrc0KIbRkeyjCn3Chao/n7mmbMBP8CFuhqvNwXym7HUkDp WerOD5tCMAb2ZzyCJjjlNEFFI+KW5SeIKYkMLdL/1b3t3z2BHs4e2CqsFZi3V6vQIYWS Xl7IzyIq/tZYQPWy9c1nK2GGuwW6xlUYETLZ4OLdifSh1gQ6Ayajd5EtE6jK6Z7Y7Eku hlwAYPYo78gItbxFWSYFlZVYknqkBdAtB0LMe93HKPXy+UO+PQm0CBHLbAKjLiLIpUVf hl4h4DLsY+iJ77nfUB5DHsHKy26xKDrW1ZwE+nF95YKu8o4zrljZxReno1A6LSCzqO2g oVcA== X-Forwarded-Encrypted: i=1; AJvYcCX6C5kjTeyQBsoAWhhFg1CliqPS08mXcJVgrYwixFL8B06xrJUxgIqNt5ISphtgLblKNWBxtfJordXHFK0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5XX4RrSEFr1UzIMuttqogA0zLMr9WIkxCOiTlI6SGL6r7/0B+ u1CRbU3nLCuEvSobmmnLm3ay8zGiEUvUDkj9UFfHstT7FYu3hQ+89kbaL5uMwheHO6I= X-Gm-Gg: ASbGncsbtHrRGvocmEq4Xp+EwZLjaS/dmLj46RfDRtR1OcNYC1ZrS/y6BZIi/8q5R3s NWci3eee6wafvocSsJhkZ7csXCYcto2lyZuoWRYGxa8B4B5b+TWdsIZisyioEbrmD9t0cK3dPwe zeXCde9hiQjxt78KeMZrLY0UgGUk2K/NGSeMEvZ2+yTEi/ooNWlFE2IvA5y6CQ6NSNdAJURPH++ 17YKqw2f3qNLWVuW2KB8OrrKA9zOBI7IddJYYFh0Khpb0WslLkUcbX5p6Qx2EULStKRps5S8StJ od1+kPARIZBPFPrud3NUGz+LsoZgn17pQzRPOk/e1ZF1gYMvW8cfM2qqYuieeGLzls2I+GhPhV3 L+u419A60/Ih788xpFofKcKFT9ULRSX+6+vqXvE+SPA== X-Google-Smtp-Source: AGHT+IE5uwNDTxd4A0Ajiz4HMQ5bvHJui+XnjQLDJDUSnCNquZMiPjT26y9xkNQU0KHpuX271O4KKg== X-Received: by 2002:a05:6000:400a:b0:408:5363:8266 with SMTP id ffacd0b85a97d-4266e7df744mr1579631f8f.44.1759911496235; Wed, 08 Oct 2025 01:18:16 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:286d:ff1d:8b7c:4328]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8e97f0sm28498943f8f.27.2025.10.08.01.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 01:18:14 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 08 Oct 2025 10:17:55 +0200 Subject: [PATCH v2 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: <20251008-qcom-sa8255p-emac-v2-8-92bc29309fce@linaro.org> References: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@linaro.org> In-Reply-To: <20251008-qcom-sa8255p-emac-v2-0-92bc29309fce@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=11041; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=LTwoONxJf6sm0sg7eKQaSo0lKsmMiPsYLDmqFKmz5Bc=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBo5h4230eKuXA62F8il579ETUM0fL9gmdn2Fu9W 8fqg4Y8FA2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaOYeNgAKCRARpy6gFHHX ci33D/4lNVaP33gYWgUJsvyrkvrj5aqUsfbfzktrgvp9BYGpDP4xPSPKNoXmoynoeweRhaMyhzL AYDfyquKfF+Uh3HIwfQ7c9F2gKQ2/bsgdOvOgOSKGjA9xwdrRlSfEmQe5ZUnyWizNtzh+D5XU6g P9MbQOGm7/EiBhgUHrlfmkmszUWGAtcWJF6l2jPp8MW+g1GXKi49ap8EI4MwQVX0tw3bKCjUZTi 8zvDnLPVy3g+ECyU1YILAfISeXQymP/oJ9c8wjYR19zyuqs/SLH4VELVA2CoccOO2hTdgZ8xyEV jhpF/gMlKCxymUt6aO8mqF9DahJ1LT6nRzxS6fQazqBDMaaYqLe+yZkmb0kVEz/UsbmFBgmXEb/ ji3EpDRMk3EFAp7AnHHQK1gKimMXD/QCiUaDVugCRsmbB6cAu6EtrxhpuLu0/UNmEhs45z+OmTg 9dnh1SadnPnNT/sdNSJDbjXlrbJwnaFbLMVrv6dRg7YtAEdRfCJNr3dTRj1PZDLvVQf+uz7WAM/ kd+gJyrMQWjzqgL0JHsZsoe9VtHPcDtL4nNtK4vbp7Wk7x79ocweyFMU7vprmYHnvlYgqXZjMqN 156UUW5WTFLIafHtYbZWxJuUWqiATzLFTmCduahVR4a3isngnOjHF32JIF4DKVkBcODoV2+x278 d6x9y2lDsHhQdiA== 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 | 231 +++++++++++++++++= +--- 1 file changed, 201 insertions(+), 30 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 2a6136a663268ed40f99b47c9f0694f30053b94a..e1620d724e18dd824ae9615dfef= 122836e5140fd 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; @@ -103,6 +112,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 { @@ -116,13 +128,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); @@ -336,6 +355,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; @@ -417,6 +455,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; @@ -652,6 +712,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) { @@ -753,6 +820,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; @@ -785,6 +873,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; @@ -825,8 +968,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; @@ -868,34 +1009,68 @@ 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; plat_dat->fix_mac_speed =3D ethqos_fix_mac_speed; plat_dat->dump_debug_regs =3D rgmii_dump; - plat_dat->ptp_clk_freq_config =3D ethqos_ptp_clk_freq_config; plat_dat->has_gmac4 =3D 1; if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs =3D &drv_data->dwmac4_addrs; @@ -909,11 +1084,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; @@ -923,6 +1093,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