From nobody Thu Oct 2 22:39:29 2025 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 28E6230DD0D for ; Wed, 10 Sep 2025 08:07:48 +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=1757491671; cv=none; b=orhG4/u8dsZb7KYg07yDKzgKLz4DJ331bSpLh7yiSXcGsCVpnY3Hmor5jBtSXBG8WgsOFK0S4Nwc/MFn70/JcNiRxEpq/6XNz5/ljTxV43MjUF1YE5vzDser+RANLG9AuIPk1C/4Dtj3V60EjThcEHYwVIKzWG67p9tS7UKzC5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491671; c=relaxed/simple; bh=jEbsMly2FhQ711GN2jP5t9Qv9vt4zsmwcTKD0IWsKSw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dKTnOgvcb1rOiSatFAMIOVbDHvFFX81ZgYW2FwBUml76VdFLwS2oFyH6KFnyfMlqqY8PQQM1aJam49jUGi41Cl8kpCJ3IU2kPmE9gXflnZjZalmbDdpAKzSILjkIqoHNCBR5uRGs3LP43oxE2kplLNiL3aXJ9rIEmq1Skv6Gn5U= 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=0Ig17JDg; 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="0Ig17JDg" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-45de287cc11so1782315e9.1 for ; Wed, 10 Sep 2025 01:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491666; x=1758096466; 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=1alLi5TCWrgqVg4gWAi4guSOwfn7tcAcmAIIueAQAFg=; b=0Ig17JDg62mPBhDX25I1XWg+q6ToxeJhsYehamK3dYN7vIGIOkyI0aeZSA5qZmG86l 2pP5KEIX6RlRy6AEa/U0rT7DAPm9QQu6YxeXgjpnesjfPqoq0hre5bm83tkBYika0Rby TdXrHC0ckRCs0l0QoJm8WzaaV6Gh2SxWHQzKB8zOsWgk42Y9aIvDv+78tRTPP6GTZnfr z54p5mJeDP6eeLJb38ftvBPnAio+GzcHNGzDwO+8IL+nTtlVwO9yvuU/waNM8L46pDlO ZUAqdlveIBNqJM15lSpKbpOIFvGh6kuJc9JLbpGQG7G2rBCffyQqHVqavUSwjTtgdQ33 hNww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491666; x=1758096466; 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=1alLi5TCWrgqVg4gWAi4guSOwfn7tcAcmAIIueAQAFg=; b=ZxEN59qGbXgcOjXRSQd+CqU1xzV8yWgrniJt0qNgHZW1kkWow6R2ErYoGkJ/SYLG0O cjwafrxMty8I6a8rRSKvIvpach3w9uW1BLGvr1BgWEXrQ5js/XBlIB4IVoIC6LVmUxcZ ycdMutt+LMAwWXRzy9EIeT+pRDfmhjiC+ZBmAe86y2cus513RfCOaeyEYpfsH6l7y87f DdZni/5pdukALhzchbcJaMaFbwoWq7g5UWEH5nM98q9tKMoAJzS13aGIxAVcLxgA5r2X jIvG2Ja6MwXthymrkvHDrKeHueUaoxAx3EBsy5ois30PGcvdS4nvjEuV0NIB+AoWDOuk zBVA== X-Forwarded-Encrypted: i=1; AJvYcCUHFjNpr3YEIycWxiCzAzGc25Jk+82oALL0xHGheBvSKrXFLmuo4YOudpSkP5R5rG/0fRKzpRrQqw7hoEE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1xARx7Ccdq4YwM/7tZCb87qSYA0BT9+n5B/qYRkn8vCuoXuHO H2MQZtVIkzJZDP5CcWZ5ffTcvDTMmuVzxXArbWYlpAtoAA/Mz7CK1gD91zgGGwskBIE= X-Gm-Gg: ASbGncsTEnTke1f3cnBAOVH0uWfQH+ph58SC9gLx98BE1ZZnbE3ah1OUhr6cScSlJob YsPaIvc3WOAcIk/UhEIZVUCOhRhDLvY29Paxev+mc1w/pc2RYfZPrOuEzgQ5Op9McZyedcfr48x CaNKinrKS2u18GuMEwJ3+fuLcdVEi4z4AkgFHzMm3T1y4j0jF1gZEduRVjv0EqDc7Yd8GvjDCl1 OCgGtzaJOFL53AIXNr/qUT1RX6r/b6qbBF7k0315o93QoHYeaQWUwXw1pBb9burlD5ZE4SC1pIU bSkrxk2ggfPsl4Orh9W7KwCm6yMQ4zoObffJVB08B+66n3sYobFzfGhNd92FQYDMj2nQhOAE1kd L45JoSiPRvZWBy88deQ== X-Google-Smtp-Source: AGHT+IHUfNjE0pY7vZ+IcCgXIXh8Lahm+PtGcdsfEFu9OwRBe2SmxKxdGyY8wQLIJhN0eScOcZH4jg== X-Received: by 2002:a05:600c:3b97:b0:456:942:b162 with SMTP id 5b1f17b1804b1-45dde200426mr141421605e9.11.1757491666390; Wed, 10 Sep 2025 01:07:46 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:45 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:38 +0200 Subject: [PATCH 1/9] arm64: dts: qcom: sa8255: add ethernet nodes 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: <20250910-qcom-sa8255p-emac-v1-1-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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=6804; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=6sz23anPDRYU+tsW+2XaI9tMLFTu/c/A2ZuoT/MQdio=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBowTHMW6xqaogABRNf5jUw3TNxGIijVhn0iE2mz +JPHFY9Xq6JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzAAKCRARpy6gFHHX cokeEACkWEntE6cCSgV4bnEfG5JjbhSGi4KEv3WLjNNIVMmMVfSOm8K2pX2w4btzgnQP+pc/PR0 R5RfDyNuRpjDjawkEmAmVI0gghRTBaPea5XNfJczc+FUAAquNr9BdGAnpejL1TP2LLYzb0pCu5Z HyVPHLlx5pXLQSREfLTxbal4NI99m4QzS6KNSrlYX5+pT7Xmx2Xfgmxk1VWv3/2irrZBEwjkUHW JFOiMMHtTe3oSNvZJMn/b1uyakFUGedEdNwc6UgfHZR9qMJcxpMQHC0hVX7EpUaAB3K8bNGBjxs VLK200yoFl0u+z9eyPIjFg1G2n04kpT4UavsqwSS2VVABsVElOxCCc94fWbsh+NC5+We34qaejf V/IaglWkftnQnnkByHw2TCpYqGVvqq1RQ6MZgBjxB5BsgMs8SW6kg7Ef4b6J+0DSFYZCW1gNRJz YiOXauKAIoa07K+tpYqBXZr3sh9P0aSmRD5pE+lvI5yA6wynpcAsE5QOVsS0ByV+ZmO3Dng1cbn Vw/wfzOxLt4CCA9L7J6clGkNzKrcwk7Wupq6z+9ng05E9IbPIdkgtRXGbaJeVsfSJgUWB3eZXzn Tf3FJkOwlVdpodvRNFeQfGlcUg2JYOUVwiqGvm9/JXSKVgOEb3zfqV8yV5+yOHnDZX5yXjlbuyw rWEI0tlQdSBnq7g== X-Developer-Key: i=bartosz.golaszewski@linaro.org; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 From: Bartosz Golaszewski Add ethernet nodes for sa8255 SoC and enable them on sa8255p-ride. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sa8255p-ride.dts | 201 ++++++++++++++++++++++++++= ++++ arch/arm64/boot/dts/qcom/sa8255p.dtsi | 44 +++++++ 2 files changed, 245 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8255p-ride.dts b/arch/arm64/boot/dt= s/qcom/sa8255p-ride.dts index cb866f897d0a372ed82b08a1734202fddb4e4d3e..62b3101caeca2ef43b2eb096753= dd38b665684c6 100644 --- a/arch/arm64/boot/dts/qcom/sa8255p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8255p-ride.dts @@ -16,6 +16,8 @@ / { compatible =3D "qcom,sa8255p-ride", "qcom,sa8255p"; =20 aliases { + ethernet0 =3D ðernet0; + ethernet1 =3D ðernet1; serial0 =3D &uart10; serial1 =3D &uart4; }; @@ -31,6 +33,179 @@ &adreno_smmu { status =3D "okay"; }; =20 +ðernet0 { + phy-handle =3D <&sgmii_phy0>; + phy-mode =3D "2500base-x"; + + pinctrl-0 =3D <ðernet0_default>; + pinctrl-names =3D "default"; + + snps,mtl-rx-config =3D <&mtl_rx_setup>; + snps,mtl-tx-config =3D <&mtl_tx_setup>; + snps,ps-speed =3D <1000>; + + power-domains =3D <&scmi7_pd 0>, <&scmi7_pd 1>, <&scmi7_dvfs 0>; + power-domain-names =3D "power_core", "power_mdio","perf_serdes"; + + status =3D "okay"; + + mdio { + compatible =3D "snps,dwmac-mdio"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + sgmii_phy0: phy@8 { + compatible =3D "ethernet-phy-id31c3.1c33"; + reg =3D <0x8>; + device_type =3D "ethernet-phy"; + resets =3D <&scmi7_rst 0>; + reset-names =3D "phy"; + reset-assert-us =3D <11000>; + reset-deassert-us =3D <70000>; + }; + + sgmii_phy1: phy@0 { + compatible =3D "ethernet-phy-id31c3.1c33"; + reg =3D <0x0>; + device_type =3D "ethernet-phy"; + resets =3D <&scmi8_rst 0>; + reset-names =3D "phy"; + reset-assert-us =3D <11000>; + reset-deassert-us =3D <70000>; + }; + }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use =3D <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x0>; + snps,route-up; + snps,priority =3D <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x3>; + snps,priority =3D <0xc>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use =3D <4>; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + }; +}; + +ðernet1 { + phy-handle =3D <&sgmii_phy1>; + phy-mode =3D "2500base-x"; + + snps,mtl-rx-config =3D <&mtl_rx_setup1>; + snps,mtl-tx-config =3D <&mtl_tx_setup1>; + snps,ps-speed =3D <1000>; + + power-domains =3D <&scmi8_pd 0>, <&scmi8_pd 1>, <&scmi8_dvfs 0>; + power-domain-names =3D "power_core", "power_mdio","perf_serdes"; + + status =3D "okay"; + + mtl_rx_setup1: rx-queues-config { + snps,rx-queues-to-use =3D <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x0>; + snps,route-up; + snps,priority =3D <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel =3D <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel =3D <0x3>; + snps,priority =3D <0xc>; + }; + }; + + mtl_tx_setup1: tx-queues-config { + snps,tx-queues-to-use =3D <4>; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope =3D <0x1000>; + snps,idle_slope =3D <0x1000>; + snps,high_credit =3D <0x3e800>; + snps,low_credit =3D <0xffc18000>; + }; + }; +}; + &gpll0_board_clk { clock-frequency =3D <300000000>; }; @@ -59,6 +234,14 @@ &qupv3_id_1 { status =3D "okay"; }; =20 +&scmi7 { + status =3D "okay"; +}; + +&scmi8 { + status =3D "okay"; +}; + &scmi11 { status =3D "okay"; }; @@ -75,6 +258,24 @@ &sleep_clk { clock-frequency =3D <32000>; }; =20 +&tlmm { + ethernet0_default: ethernet0-default-state { + ethernet0_mdc: ethernet0-mdc-pins { + pins =3D "gpio8"; + function =3D "emac0_mdc"; + drive-strength =3D <16>; + bias-pull-up; + }; + + ethernet0_mdio: ethernet0-mdio-pins { + pins =3D "gpio9"; + function =3D "emac0_mdio"; + drive-strength =3D <16>; + bias-pull-up; + }; + }; +}; + &uart4 { power-domains =3D <&scmi11_pd 4>, <&scmi11_dvfs 4>; power-domain-names =3D "power", "perf"; diff --git a/arch/arm64/boot/dts/qcom/sa8255p.dtsi b/arch/arm64/boot/dts/qc= om/sa8255p.dtsi index bde94f8af8f7d2844855fe7ce432dbbaa996b6cc..144745b2ac75b5d42b682bb107e= be4b27afb6644 100644 --- a/arch/arm64/boot/dts/qcom/sa8255p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8255p.dtsi @@ -1093,6 +1093,50 @@ cpufreq_hw: cpufreq@18591000 { clock-names =3D "xo", "alternate"; #freq-domain-cells =3D <1>; }; + + ethernet1: ethernet@23000000 { + compatible =3D "qcom,sa8255p-ethqos"; + reg =3D <0x0 0x23000000 0x0 0x10000>, + <0x0 0x23016000 0x0 0x100>; + reg-names =3D "stmmaceth", "rgmii"; + + iommus =3D <&apps_smmu 0x140 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>; + + status =3D "disabled"; + }; + + ethernet0: ethernet@23040000 { + compatible =3D "qcom,sa8255p-ethqos"; + reg =3D <0x0 0x23040000 0x0 0x10000>, + <0x0 0x23056000 0x0 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>; + + status =3D "disabled"; + }; }; =20 thermal-zones { --=20 2.48.1 From nobody Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A962130F534 for ; Wed, 10 Sep 2025 08:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491673; cv=none; b=S8DCOSTNyRxgoDWqKgvxrgHfmDDxDaIokpgIz+0HiO81B1+4/fJi7wSxBV0TgaimcAM/hFpsvV2NuYj1Kydn10ANHUcR1cplqbGAJj1zEYnadP54N/CJqYzRB/N39TfHM8hNr76MJFIsUXMWaW3eWBXbq0UbhH1xZuS4K5u40Lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491673; c=relaxed/simple; bh=cCMCySr/VpbA7jK3NVpeLcWLGZWtRb22jM/wUssJ6zQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sc0Y6PmpvNtkIUnuQKwZ3OBNf4LyXh+rl7Q2+I9hHDAxYXZ8YXlxg4TPjdsio9UTyTG+kDHy0L+vHVcrm8HeURfM/kg8OPZbf8Lv0pnchj1eo+fKqlzHtpcUU3Ozy8r33VdPnBWAbFYIJ/ctAWKmyeK+4BAV8Y479pTUVFyZ+SU= 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=1agyELXW; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="1agyELXW" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-45ded619608so14445175e9.3 for ; Wed, 10 Sep 2025 01:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491669; x=1758096469; 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=uY7tyXoLmxoMYiQ/WAWTMF4JkPWNBAVamog1AGlGOlk=; b=1agyELXWC/rpnRf6lizLT83wrK3i74HpO3tbqI+B9gpgyIzVRhHCeFNAm740hkQHZF hzQi+vTx2PzUsWh4VtY/K2/WfYNXzp6qqTVLB5Yyv6XqMoISLkgD4iLwHiN7X1oG9scj b7fkZavUGHkUe/WN8G95bgWj0GDMS/HLE1WWqkyy/yUVhfG9PRjuJBz+yAxwT6kVpgMV 8wFllLl1/GWRtktGNYl4jqs+ug5vLr4LOFiJBdoMio40XZCvMVlEZtxDNCiG9jljqIzk qH10imkkKegSTUj/Z3+soQvHzs9Q+MJRAwd1iWzbJ6iPeCN/ZC1PD0IPl4Q5bUgz3zTT iWQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491669; x=1758096469; 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=uY7tyXoLmxoMYiQ/WAWTMF4JkPWNBAVamog1AGlGOlk=; b=C0N0wIZFsYgsgRuG0ttqaczfhv1MlAuMPGaXTPInfmmxtwQ6N5hDVCf5yQ/+1W79ea Sxwc+NZhLW1RHkn0SfaDiF4PpDOJUaYA1QzUSwYJfGKgGo83hGOI1kKa2CrVL99llwEh 0xux73wafNRZFtPltM5rad50HBhrfW/yQhqK91SjWieI6LLT+K8rZEa55KiZPJujgA5Z EGG05Wb4gTknUqsxuF/f6+qlqKloYxUNgcQSOwkdfklegy5W62IMJzANhb26yFPW5cey VAAWEsCHCOrolHyOl+5WbBGAz+44FtqEY/sPhNeQkrfp0k8GRtU8tDiHJYEGc2s8UabD Gdvw== X-Forwarded-Encrypted: i=1; AJvYcCUb1e4dbeddMyMLXvXjKVNYAwCVIiTAPsO9ZQfPJ8I1Aa1YZ3YNq7GWQB1BD8VVJ1G0T9YVwa1uYOrCd5A=@vger.kernel.org X-Gm-Message-State: AOJu0YwISremAzWRImH+bvBUz1MrY2Mc3Ald8vttL1cSDcDLeanahCVt WQ8oxP8k617+Zk5RlYrPV+EhXhRpBhjh+dBQhU3Rdg0Rn/YT2zoe0kryXbjDhkRm8X4= X-Gm-Gg: ASbGncsOvZOE5Lkja3V4i03t/1+hW+vLK6Q1zLXUkiQyaXk3s/aAGrw/m46Bga3lV5k VpUAqttD2UdBp1dPghA66eJw1L+SEaLIaou5CQY+MP97ETq+NM5kNlDgER50KK4XjFApxHWiSEA SU+SaYiErgWd6zGfTlTHhwkdSSKvVq96ywwPmVMWWQwMJ2MZKBawaTcfiS2sg2GOGi7mXLtb+FS 589XKp6Q7F9fJH7IlSbJso+wB/yZuqDRYJ7of0tKJoZdCmUj8Cvb2b2IynlIF6nCTbOmq8tSs0n GTyBDJgKCefWRv64/hZhkQJn2wj8NS5hWbHTY6LhT1aNV29Uw9RNeClzSg+ZDU42kFz49J+Cuj7 lXN537Fl4MyaaPJc6hG5i5CzybiOvKz1kkySAfaw= X-Google-Smtp-Source: AGHT+IFnNZEgNDzwo9ApEnobHwV8aAoxFw0Jkpaf4P9Rpvk6aHXizs1NLoPb9xG6C0xsESVPAcwBNQ== X-Received: by 2002:a05:600c:3b23:b0:45d:d3f4:a640 with SMTP id 5b1f17b1804b1-45ddde82751mr137637395e9.15.1757491668832; Wed, 10 Sep 2025 01:07:48 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:47 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:39 +0200 Subject: [PATCH 2/9] 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: <20250910-qcom-sa8255p-emac-v1-2-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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=4931; i=bartosz.golaszewski@linaro.org; h=from:subject:message-id; bh=YiaOUOOI0GWV9ljzY4gBLMGGn2gS4PsTZMpw74epeYo=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBowTHM5rrhVBB6aGbLx1+QUka9GEHLBn1Bh6zAk 6upsGPRnFWJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzAAKCRARpy6gFHHX clb7EACr8mgXcJhgQAtdioBd+rpPreLM1NgdsdbVw1eRYaLBKd8D6Gvowzq+W+SOWk6p5nt42LT yHphk380KW+A8RxjYCIPTDF0aIgEqXkvdtxViXF4WMU5rXPnG7YAgYGkZmV7XkaOBfXvkt8jr+f JIRuGuyNcLxrBDfdE+3aHT30Z5ImO3a8GAd+d1TlQT5QQr+IH+RWSddXjYXVRHbnZpNDw6A58xc 1rKH5ZhUrllwrmvfZ2tL2ySQJ2tr7t9lCwdOxEMLp7x8ceU7gyDZSMEbYHCCqhKT1CUrbX3cEQ7 seg3SC2afuBtDvkQh32Jf6v3Re9tHnMjpyzZJJGoWKnKTZlFkBWphcwA2GozI+ebZE8kGRRMM47 u6/gFnm3+i2pePRz2BGlXiErGT4soU0D/Cxykz7AN1/zIyYJrJhKqUkty4KDQdmhD1a8dU0BQTA 5Z1htu1KKk31ys72gNFQV+RrBNke/CJDTVmAqI1iuBusokeSjFbI9TLna6rROjPIGQiCIoc60VC mV701Kemnb8TglYfSTSZIc9hFX5TCfNFi4mRxn9lma7RRwmQqIo6eCuNx3kSRcTiGo5hnqnIFYQ CLS6xFvNuIDwVOKEau13A1WLlFvA6s5WHJuXCP42XtIpc6DPAghOU8OtItJIo+kk4eQtt0/u7DA QWzLqY6L+dkuFdw== 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 | 4 +- MAINTAINERS | 1 + 3 files changed, 105 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..d7d6c013311c2643d5ac0e2a75e= 0180911487d96 --- /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: true + + 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 <&sgmii_phy1>; + phy-mode =3D "2500base-x"; + + snps,mtl-rx-config =3D <&mtl_rx_setup1>; + snps,mtl-tx-config =3D <&mtl_tx_setup1>; + snps,ps-speed =3D <1000>; + + 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 4e3cbaa062290a6e8e5e60d0d01b0b39485c5478..07264c9c62778e9e8e2768999c5= c377fce6811a1 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 @@ -175,7 +176,7 @@ properties: - const: ahb =20 power-domains: - maxItems: 1 + maxItems: 3 =20 mac-mode: $ref: ethernet-controller.yaml#/properties/phy-connection-type @@ -638,6 +639,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 cd7ff55b5d321752ac44c91d2d7e74de28e08960..ab453e599a174e5414fc0c1baab= 5a64e0d88dd78 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20745,6 +20745,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 Thu Oct 2 22:39:29 2025 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 C41B531159E for ; Wed, 10 Sep 2025 08:07:52 +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=1757491674; cv=none; b=n5apL7wWGXLt1Ga2tqRBF9hYOyS6f3NsQsQsVuuO3IOE1kZ3j5gL98nOOWdd+xfmMQFNn8HX1HfgoFwv4yOnzx4XLDhqGudgQtF4uKiUMR6fHcbMNeaxYHsAPbaJQAKMTdj7bwRQRA9nP426tkBa+DNeL1iOsYd1jLsKGzDu+vQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491674; c=relaxed/simple; bh=ibsEYvxohb5mD1I4yEmeNl07uAKjfZzWOmtVL8aBmCc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rB7cx26m80ILWXTk2fp+OO72euCDkvungnluHrh8PQKO3/o0LHUhkr04gYLH3sNMen6jA2wM9tz+WDQkaPmV5L80GvzI/12SVGMLh50/SmaB5Ov9fKUJCX4r2qoGps09beb71DmBJ8V1IdznqYahW2r+ZE2S8kwMXHdnsd0v4Vs= 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=sZwtAMB5; 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="sZwtAMB5" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-45dcfecdc0fso56214755e9.1 for ; Wed, 10 Sep 2025 01:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491671; x=1758096471; 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=Z1sCvmiZl6CYI7nEwas+vkP3919eSylK4ly9/aS+CfQ=; b=sZwtAMB5lhZGl7/VJtCW0tGfOh3e8KBO1Xhps2+EMLNCIjuzkdmUXGkcFJh4PzL8rv +qvvMFmc78NOyWqEBVE7J4jen/hUStq82Nhy39Lnb/D49ATktYtkrXFQlcpgh5+l1kK3 +8yO9TxcIG+LXk4BOYc7X3lhd85li803j38Tl00T+HK8Ma+9PAaKUF/Xw4UYhBVZ6/Yp qbU/E3VyKkKyauOLjaS1uouwJhwZBZWp4UfoJsNO+OMJKNLLtFCJdJkqINwFvaxr+Ax/ xejp9LixsiFl4CABE5XG5lKPO5IeGMbtvsMOuyOsCXmPdYP7/tQrW8WL8xqI8DUeHS2J zmfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491671; x=1758096471; 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=Z1sCvmiZl6CYI7nEwas+vkP3919eSylK4ly9/aS+CfQ=; b=rsUULv+uAHCt7h/CBXY6OBqtGEmPahnvIQsIz7kLMPr9ZSQmM+cId6eQe/BC9ZwxGD mgg8s5uUC+qe93R1WA5VLGhDlR2jcYmAQF43wfA8LCwAIvJojaFlAV73BTZgkwLE2j4S m88nm004wKFMgevORlog24RcAxWK8lh4BGGdaLqUcb0VtIBl0sRXOSBElVplHL9OAJvQ yFrKqMJW0Hj+mzOeNvwRCYuV5RvewCiMBjGMZXJepvkxlvZgjPb0tOdxmPTeJsyu7jTS mhecey/KkNx95jYTvG9cCW7Gl4TtLPJBrMjcNnS4fRlgOWSTp0DfiFuMIof85DtG/szy vQYg== X-Forwarded-Encrypted: i=1; AJvYcCVel0aupUDLpImdUKfefGATMaMVo+yfuVaewJtMrZp457UQitrBffUVcs4atDTtM7Fmiixnp07S6AVPyJE=@vger.kernel.org X-Gm-Message-State: AOJu0YzDO6G3CInItthMyFrXgVa9tSynJR9rJpYpxh97UqmrmGKs+wxd GrF+CDE0fxOI5MwcgzaKKCEXaEslRi4vdpw+85dDg3ayATK6ibA9GXcCfvUsZHX5P8Y= X-Gm-Gg: ASbGncuVtITIdF4An7oJ+lONd8cgMzul2lAMDqcakjGHUKW4P9Nr8Np76oy2j7uCg08 sbmIA7ia1pkCSAM+T5UM5LC4IxKbxYikAjB4QKe1HF+L4nns2TCKj4lHy2xVyLWThwRrhIdbXIw +Ky2K23qZiAJPrQWYu09OGPu1rHG4Jn2Dh+7qsj7JDNDKPutzdLp6iwaLLs98Rd/qM+bs3yuyC4 xuPQyLmo+0bZdYiQSuCJ1mOseXdRik1f9yh+Kj58v6f1pEysXZDRvQe67CO7QRE68CWwKSP5nEt XSwPbXyHDI9HHBr6kpvfR9Tv0q8uP5+qvAMSlD5e+jb//wQgnddr2AI8Bn1wtSZzgtfYAdWAUJV gyd8cGVEV38amCZe+KA== X-Google-Smtp-Source: AGHT+IGcJm1mXQDl/cArlppVSaTq7H4cXV1oKCtm0I7gPOnxwJ8/RibyfCM5aVWWqsaeO31u/dWC2Q== X-Received: by 2002:a05:600c:1ca0:b0:45b:8352:4475 with SMTP id 5b1f17b1804b1-45dddf02148mr141677935e9.36.1757491671063; Wed, 10 Sep 2025 01:07:51 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:49 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:40 +0200 Subject: [PATCH 3/9] 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: <20250910-qcom-sa8255p-emac-v1-3-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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=wKpcSDQ9j5gn7fqOrffdxHVw4IYX35svrsS9hhVY/uU=; b=owEBbQKS/ZANAwAKARGnLqAUcddyAcsmYgBowTHNyzW1urCJGaZW5gke5O8FSvQ7UnCqZZ8Cj PtMPh+GTVyJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzQAKCRARpy6gFHHX cijUEADYjksEkSI3XXPioMcFqFig+ma4t/+cw3XI6Nn8GUS2nhn1HpaO+L3aLWDlpp5xJROdTMv qhOiiiZmMvYyeWo9afPRxaDGdjv3fWICRI45x8VoZ/AzPLw4dI5he37GOpfjJ0A2Zin7NKz4RGm ywo/NHT79dS+3SvYysaFfL2z/UmW53HGqDG+/UKgL8MivzfgATeROpRpgrHuX30yTqzka9IqDz6 oP6WqPREVulYKjwg9Y9vD4IraHpFP998xKBmvNbTmIzDGwsV5nSrr0pKdUTJGGt43S9WfI0M14A 4XvEpZHXEfTv/4QAhz4I/Dr4fuIm5E7yr23MUHOvoChMnkg2QQQIIe/X57J97l4TGYcqcxWODGP lEu+ENy9jJONFai4j31aIgckTvTvZ1JbtYKvnkJ/f9cZBYTitZhswBMrFR6xHWqo7bWsWkViCco WF+2GsWPRIa2etHizQNLIOw8014zf8qu+czN7Ukj6F3lpuDL3J7yO160HpBpbpNbYFAkXNTm1ur bmxcK9UenqvbBpw/k86NlsSSKBSkYYT0MT3X6O3DbHGyu1ZZeBXMLKOThxl2zLamrAbQUH0Ur60 kbRzFya8F/XeR7LLjBf2Md2r6FJlrQ3W3oBUDyKhgza92D0gllCwL84XdPcfFKVGyuRoK9hTnzA M/OfCOjqiEY8BkQ== 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 67fa879b1e521ef6d7bd2a8db30d812301eb4cf7..beeca52d4d0f0795d27a2cc35be= 44d1d4e7d45d2 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 Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AA763115A1 for ; Wed, 10 Sep 2025 08:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491677; cv=none; b=nwxaQ7KXUf7UcNcFwDtbnG0FlwhHwJkDXnJc6GELl2NHeAkyugSreM/C3QrbI+JptXdU3iJTfalls7Cam+VpTjh3k0y01Wxs8aZ5CDQWbRYxmPPN3lndlVwrSTKt4+gYVQAMo2QUIZr90chOhVWAIIHHhrkgfU/oLUk1VZhrCNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491677; c=relaxed/simple; bh=fwsfkO/edNU0K9G/U0ffbwq3ATl5oZ4mal9F1JcWMmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O337fY6hbAhfBjjtZxnUdllHWqrLpgeJpvhC8RVrVdMyViRz/n1CiLwhd/9jaXqxQ5cKUPSh10X814hu1nk/edOMFralxA1WbNmU57F8OssKKUU+U+z/eLIdDE2Q+/yiWVNMOIqadDUniZdUFyN+YT3/z/fla+azvHC8RhiY00U= 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=f0pf2R4c; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="f0pf2R4c" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-45de6490e74so29435715e9.2 for ; Wed, 10 Sep 2025 01:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491673; x=1758096473; 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=f0pf2R4cDjwGxM7o7+PN8nqd6iXaga0AC5gG25lOvNf5ENNCenTKpn1eykQqTNg0Kg BSaHyDd7NnEw8YfB+H3Nu4uv5NQ1XV/d3Zj0TT4RpqODF1JaewX6K8R5OnxtLUO/b9u7 r/VbE6BVvF73dKJcXraFSnHi+/0YFOpHz5nYCuCbKpU+nFITKI4+Qrw1yxmy0reX4+S5 Ia+3DSmubWWzxck+DfcF08v1Z4uESaIiRqFqLkrQtRvtvW98ufrqc7g0zSIiWV1qngwS ZEFnmYmLspnKAvDrURBXP2QPzjz8z1l8TW0MaKBXeCzkIf+qrhRfzkVAtmHmXk4vFcej xYlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491673; x=1758096473; 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=uAyNmyUZOUSpz/WdJjlcdg8HetwYP+xpICG173wuO7s8Kev5ssfDvcf0VoaqV9oqSf jf1xC00BQD8B7Ra1yv3TBMBFNXHisuBMIuSb2f5KagwEccuaXIZeYXRB/mzNY10g1WRy SYmXNZyKefAs6J4naTApwqK11Eu+r/65BIF32fz9t9SzWc8+xajq9auNvqUxoChTThWs TbxRvBE7+XRLllR1khZ02rY+AVAyK/koKKeJdeYfMhqJxhVsCjWi4rSfeZOOuoJ9KeFk j+73Pr30yFpZtXjg7v07Ip56Hf6brLytMPNS8NcO4E9nF9xvi6dNea7BEuPiHBcUGzLr MZKQ== X-Forwarded-Encrypted: i=1; AJvYcCU3Q6sbuu+cx70fsaZzWDtgBDpposTiOG88fh2c3PK4Jc5duGj+WbcU2VgCFqRpTeYxdMCpnlhtjctEX9A=@vger.kernel.org X-Gm-Message-State: AOJu0YyukTTn5cjlc/t2m8Y7bCyGZfqJ2as1uv3abB8F0dQinlaOPifF PJ9WcR23JBVHsUMP40ahohzvFUMcZmNnYrE5/c7zGmstnlSKIsjqG4MWPMcLXW9yyP8= X-Gm-Gg: ASbGncsIkUfg4MR6oNBtY3yr3zCbl0T5qCvut/py1MkNKgmNclyt4JJ/kMPdxvJDyNk zZRq5OefyS56LY/GE0RYMuTpB5F/IJZxX1MerYrwVEfl1yVhfQki8js3yj52e7csm2FXUAOLl1I K3SMWAUiBCAxhQaXKmLeFYlcAKGviJ62WAxgbuGLsENajFyq3d1/7SOk8Jifbq1S1cA84hPuQ+H qlrxVx3iQPW2xNsloxkRShlGcunFmgr4ZCdwuTNK3hddKtOFppkuKyYUax8SM/ZapTWcq5GIYg1 GN3odL+vf+kZwlPFTi6q589fGjQb7jLS0GOBDDpLTjtJ+ObekceQzF+pXVSSP7OYtb5Iuk4Nr09 2zOheNx+Se+GQ9uthE1w7qoTRylid X-Google-Smtp-Source: AGHT+IFjyHooIgPzsIu5mjEBNXpXbM4EqzCxFwgK0R45SY2NiW1XrpvBRtE5XdvWfXqw4HoOsFUisQ== X-Received: by 2002:a05:600c:6305:b0:45d:5c71:76a9 with SMTP id 5b1f17b1804b1-45ddded7652mr141100805e9.24.1757491673453; Wed, 10 Sep 2025 01:07:53 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:52 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:41 +0200 Subject: [PATCH 4/9] 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: <20250910-qcom-sa8255p-emac-v1-4-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHNFd6+XtHbiUlr0CBiyUr3sDo3TcopvUbxA Cez11/GZEiJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzQAKCRARpy6gFHHX crSCD/sHgzl01Xm7vNRAaVRSRvpCpLopzb9hsEChofm4FjfDYUIcvTtJaJuDjU3XhHdNDwZV9Zu Jvj61hgts5CXRzx2EblTpQ/3DuiqYeDUlYoRNrKZ+bFnX5AXAVq/TA2zOzyXsWrNbUAaV1gNLOz VTz+PAVZGKpiWFDBpYusQE8juIR6bh0tEB17WWbbhZV6l0uK2fFCvllZG1nNk3SqJ5qG36efTPj /6VjOG1kimbc6GRwk5dLbYporMJimuedb5ycfMKxPqv+u3sJ1GTEbnxQDx9BxF/u562rsqfxazv mXGxtvtw56tQ3NaUCvLlWl5uxCMVhqV+jt0c8yiUxhssWPP6jK9r06eAybsTAVxChagDzakxs01 n65RPiOgqoEuSqlYQpchL/l6Vjst4EKT/9xb/qi3pqlJTpBqcSyxiri6drcKDGaxihhe8w8gmMs sYLzxlL/oqpOYFfhL0aeFEA1WTGBYIeYQwsezafFr0CpNawRbrT5V8AuBRhSVZkNelEuFmYE9SI oAXG5zUxUzYb6LOW9qQ/LhFF6/plZCYbBsZP4cWXfzas3rXBaTecTfEcRctYXDXFmc596Gy3CTw eDYk7Xqxz1uDVEZOr5HoOdY/3M6E7CBtmpvBdIIMuVmWW43k8aLvjHK8ZWqdpWkIQ7ijqwOkMFM DCJTB/f1x5kcYUw== 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 Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E6A6312807 for ; Wed, 10 Sep 2025 08:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491680; cv=none; b=HnlzMG7rjXIWQ5zfLT373qLgRcBIxZ31oUk72ybdNt0/TJQTS1n7QtbmWOGOF8gMJ5XUFtOPfE9T1GoPucx4f/dOZPzi0vHN0E7+nguPuUg8/FzBny+Unabra7AoWqJHwInMR5sR4QNUadKKtpLlsFYDShBEEvKkTukCwbyveII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491680; c=relaxed/simple; bh=W/Q0BE0iC0PpvIbRAV6KjcdJcBamxfsiRHWDDOKoVz4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d40Zd/Guki77AwTXzGx3pJUu1clzz9qrMtl0N2ofoVOlI22XB2ni7YpjLw4yzgkqAK0vQq8a0ciBQYlMpCb1kK9tQn/dQc68l0gczXRHdDnx/vWrKgSTkN6ihcQUf212voDTi5du+2Wc+9AzDfxK2D1KnJ2Ks8xBWpfBPprBRnc= 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=ekonzq+F; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ekonzq+F" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-45dcfecdc0fso56215535e9.1 for ; Wed, 10 Sep 2025 01:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491676; x=1758096476; 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=ekonzq+FPdZTOf9wOy/SYvj4NKVv6todk/MFOnZ7YhHkGx0ul89Rwmyx+HPsY9dCtF DT9iqqWd6rO66jSsTOtttyy1/Za7MKPJP5H4Un6muafHNLzB3zfS+4kkxReXk+aU2LSf CC+F7gwP/MIGXQPF9sD3+3mfePb11GuHQR9rSqhERDMTbcy3+WyQrSR4V6ugB5CNG21I f65O63PfryB/U41gw/aMREE117O16rI9pEj8P8faM2GKMOXtPhVhVcl82iScbuX9JLiW opWWsSfIeiQhThAg3EF7/VHBki3oTIjry8uiXtWNxB5MdeovPei99EsCcrXU0xd4vsxL w1VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491676; x=1758096476; 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=J2LJoJmeW6CzUudd2iVm7SYyR5B5t3eJ4RDhASO5ti4F1FSBFiD++9kEHfGi59/9IJ AnpH9WFf+9yAUF/dCR/n2bf0/Y6Bo3o9DqnvqS8QQMwL8GBHbdxfJspyluCKyjC7p38q gmSTiyc20LCfxnfl8/A3ooHX8Uvb/9mAu9MnpRDL2VwcPB8tqrzrZ8Xu7QynbCQDsiR+ tPY1gj2dYztdtW9gSfC0j4eNycvwkBwMw+6JyXciy58GwDwg/vdibd7dkNGh/1VgjpXj 6EjT5saCHPgIrzlCGbTcyOrwiAzsOE41Hkhbni6TQ1/6WHF/dIZFaQA66FqpwsTRI32A WakQ== X-Forwarded-Encrypted: i=1; AJvYcCX8Yix4k2jtEOB8gbwFZ6Tuyt09TmkznCgzYcLfYQSt3s/qRgAx5paYZiu61CubyNfEE4Y1wjDDbfJX0Lc=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9WfEyp3s6j5dyaJfaW6SSBHJpGrOy3/C66UGytdnz8E49fERP hm3lH1/2ieqnyO8FLB9H57yuC2AkU46ynqlJ0f7FsiJWgrvuXtvmb0l0boVjxDv4/9o= X-Gm-Gg: ASbGncs7cbDu8e2fiUVUD101X6qCeHYGRbeJYYSzLb7GfGQIdqjhUx0qCh3/01ZQPHJ UmKjGJlJzZJGKkQxjVA5IMDJ0wIF8+NyszoruIlzqQqioSRSoquE0DUrZhK5TOjNgZq0t+3R4Fy mcwLkfW22xl/lbwPziNXWW6hO6F0btRsP7lTaeKi8TfJ9eynt/5ZxGprYdyyJ+2yXSa7MNuxIeo VVUcKEoFJ67jWn4XA6vqNs+B0cuI+Wcp4jpIQ4etom/3bdvDK6bC0h6pu8Exd5Vg6bAEwdAlyL8 DPwvPNJVn+Cis429O5kJaL90cv1LISbIuvdvjTq0JqMSBDbbpW/0YSHxFPMkl9MTv9lLS5Z8Ctx HPT47Csd6wPmVbBudC/EH9FPjUY7f X-Google-Smtp-Source: AGHT+IEsK3oi0wf15kTBAy3YQl8GVyAviVz8pnGaP+PQNHUDKYX8iQ3HQ1jMhkYqaRwKVBm0IQS1Fw== X-Received: by 2002:a05:600c:a14:b0:45b:72da:e622 with SMTP id 5b1f17b1804b1-45dddef7fe5mr113764435e9.28.1757491675470; Wed, 10 Sep 2025 01:07:55 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:54 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:42 +0200 Subject: [PATCH 5/9] 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: <20250910-qcom-sa8255p-emac-v1-5-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHN1hh7bVoHkwddobbhnAlbR/3YpFVH0VSzk ZGtNXsCxwqJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzQAKCRARpy6gFHHX cjljEADAPtg6edA14A3liA9qVeSJiL8hYCWrFHZ0oUVtq7pHShstUnF0t5Hiy4RztGs8+OTqI+4 51f6UgJDAyzbfD7/4velVdTgTEeSt9xcU3daYnL0djFwLV5WjqO377W5sOj/gmgEzmG74cB1EVB Vk56sX40SRFoyjySR4KATZDlUL9+xodcXU3Szpl7P06rPpCUgZzUgjEViE7mpXqJIDGlGh4Plxy RAdGBiusm4gOrUqwCsvyKMwz2MMUylq3q2FwGWEip+6JJnXAHmAqCIYLHVxer8x2MuBYQLWxzop WIpjUMXguXGs65GWQZGOab5J0wYCcuvVAD26fW745KcsD0Gbc4Ai9wRQBvFTMHkOyUTpl0Qaxww w9zQ66ODYjvZZu1KvCnz8XkvvCoTLRwPjTFM2hTzbJ3ZnfgEgOlrx3WH4nyKFpMjqOP+LXTeBZN c0aJV3yc5wRHQbF0azICbdPkJdhjLEyPru7ioH4zf5AQQ32lnKYPOIpInQ1xCe7b4KM0C6HRRiu GHvfCfslegpg9sixBNGv23z4IrBFBt8y+WwLjKL7nRybTJt836zF3O47iEn2R9gj/KJuQvORNFF g/1nXOINY0xcvqY5kkkY4iGZTBow4Oqq11Vt4j1TWPm6aP/iM4aJ0tqedWonKddeSld5Ui0bowp gMTTawSgzOdmuXg== 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 Thu Oct 2 22:39:29 2025 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 014FA313529 for ; Wed, 10 Sep 2025 08:07:59 +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=1757491682; cv=none; b=QZ70g1WYcJKS1KNjLOSHVAqrzPeJlxU9YrVjo3tkgvdjZx8jIxyLUbbaitPLHxDP3Zw26Fu/bb2EVDGVDmpGn18z5t3I9pGn+ak/c2y3NhweX5zZExHskt38A3O2hzYpABHmdID/os54Swer0jQi4kuYjMnOuKC6alt7ezv0zL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491682; c=relaxed/simple; bh=TO9nsTt0YPxpWytCVH7ZJjGxn2Z4plKkUXJnF32G1IE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rUuKzxpNLtaxq+jpDQK8zHE9PTxT8Y7zRBu9+gYJxl69cKxEVkPiRFm7ii34HdxRJ6LyRrVuYYPIkMmTbEwHfGJNs8xlKiaHOHgbfW0bIgjg4YqdiF8WvvrIiLIjOzTBh6yraGTtIqu7UimjnWJDWYgm1+cBbuNc5NlZEuYD6SE= 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=lImqtPdP; 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="lImqtPdP" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-45cb5e1adf7so53771505e9.0 for ; Wed, 10 Sep 2025 01:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491678; x=1758096478; 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=lImqtPdPGEznMoBmibjexcE5txcc7mvtdPZVDF/bhZrFVf8EH1lb85KkZRLUkACilb T0wN+fzejMATKYqdm1w63JaiXlt0cKb+Jezj69ie9VdSNqHnTPaEYrYxtuKiv7W6a1Vg gQH42hh5pFXGN4r1c4rcaTx49xXyeU3h7g8P1TXQOucsPromu3H3F3qaRGgnnsa+XcKp f/pUc7Nr9b/PjLhAo4ZKNx4TnGMAdNnVCCnmiUTcy27WZ9UruGbSys1kNi0uM+R7cek5 K73i2SKwbJJbIOXXfMYYyq85qTIE/HCHY4kEiWZCzZsCI1dSchZefjmukVYJnxD7j3EL Tdaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491678; x=1758096478; 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=CVXzF2NrnY1piUDmZSLmLPgg16rXBxCCQKJb27A8bTl30eW9Vwy0n0TVjbGcC4lcaQ +pGQWntDFm8znl/0rAyJQ0B1wsPxmupfgQ2lhf+QnngPd5T4gSUgArAXjTVWAlSPuccz tk4thpSc5CJs+AwVlniLm8cAknXveUR+exJS0nrd0lsQjOEyvTXc6QLoO4lUneb2OIbn pTPzs98l+rjseF2QmT2oSmRIQ+ZBP0n09XntgDzRGCG91Sj3kv2ILd0i4//md0wxcFw6 4MAGzl3AkKaNdIh+8gQPIl2WDyBgHDsjzh+Q5jnJq9v6sFNt3q4yWOs/jwUC5TOJ7HIw Rzjg== X-Forwarded-Encrypted: i=1; AJvYcCUA5ZJpbXf7POGYXG3put6B6b3ewwreRoOeWkYrfOP6DMkbmIl+K6+wkp5SWzcnrtAHasXceKB4S7GxVzk=@vger.kernel.org X-Gm-Message-State: AOJu0YwbY+rQp15Ka0sFFRvUQHXd6ZmB2iYNuNf8gEG+xPAWC3FG9YB6 hf9lUFx68idC32+vRtz7yWbmHh4UKZ9p9bpEAZSciFIxvzJy0ERf1a13NjiVY2nvW8g= X-Gm-Gg: ASbGncuJ1jwFKRKSDK/DkBxnGrvsPjy4HXEPz1c7khW6ZJELJ833kXpBRsj3iRIVwu4 GxC8Gm+px26s5NyMtEgXYKOqOwMM+8DGit2u0i3vUYDds4B048oQ4hJwuYp1BaSDv5p5+g10hv9 5gv0M+pDNmQh15dLTYO4/kqOb8V/cfWk537t71bCs+hQwnT3ynSeW4CsLY9BlC/jn9KwpHVYv3F Ud4MuaVFbzWlTUkUuA6cB22n0xF9nVc+ha2FQwt5GdSIhMBTClDcHvh37x7bd0eKqLygvPs8gWw 6jOV3iHSCvTXAQJ1G8920PQowMR8ALCg1IGTSd/ylLqBvPSLnmqWsEt9Sm5CFL1fKuNGe/YDqpU TehovIfKeCzWjSKCMctBihZCCtEsD X-Google-Smtp-Source: AGHT+IGcNjYgg+7jgh4blEMFccFbkJGi6bO3RhLZjRwgFf65PTFPcgmBOAxw+fKWIq8T2MZtB5RgxQ== X-Received: by 2002:a05:6000:647:b0:3e7:1f63:6e7d with SMTP id ffacd0b85a97d-3e71f6373admr13288055f8f.45.1757491678234; Wed, 10 Sep 2025 01:07:58 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:56 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:43 +0200 Subject: [PATCH 6/9] 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: <20250910-qcom-sa8255p-emac-v1-6-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHNSoutMu84csaXFAxK6JnDf6fEo4asszTGJ FRKVbeAlzmJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzQAKCRARpy6gFHHX cpjoEACYKIZtA23uWtKTc0XoGqp/fP7cMOcYG5mSWp8fvqyIw8kXSHByC0xxlZe/srDOLERBEhF yKU25p1oPHRtZisFB6RsQcgiszzHbZ/kjL5ZRQciJETi0moEBIkrsOkFx1dRwgaaFrHpNfD8rPq 4mcf0j8xD+yssUJneaB2FANeiklmrp2PTZncMYKfnD88RJS8KO8HzgN01+puQGPd1wD3puGSv3O oyFQnvcFb5ssK/QShi0JKNtrDKc1o1hneQjoNNj+OzspZ+p/f9NccvKCcR8qFUVe9Cv23ck7zxt uRi5UD5z8ip/JF/bOigUNvgvdWCpsCeKjrkC88txKlACsUHMtkfFBq+I3JgQjvKNdNPeLt2fNgN G6OkHIMX8T/7c1Ug9r33lfRReohcPlk8bMXGu7CuwD4vXovzQ/sc/wc0XZwghe+DxyTzbrmh37J dJTS3HQ/Ih9OfatUUGz2P48FROomMfLD2cTYSnG+6dYnAm9DuKhmTWttLmzoh+6+RmRTLQLEa7n maqZU+srgHub5I++RBm/Hp7aHq7g9HR8hZipyCcFWMJFMO79boC6n21fShmqupy16Q73Wt9+Id6 0oNsysqQ49Z9GLt/+wOZZEtHMME19WePfEu2TDmoXNy2HgWqPckjl7cA91nLzXqr22srgpwrtuR An7Ylq9J9Xb5RrA== 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 Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37460313E2F for ; Wed, 10 Sep 2025 08:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491685; cv=none; b=h8pHrqba54ClJvC74djfIzx4DGCqivqUx2nwT06YGIqdvaTnw+akQm9lE5oxhJnbzDDZHrvifyhHQP0vY7LYvupKDVh55VuBs7LkZxwX8kgdU679B4boVhzBIJ2DBVlFaL3U9Xvwar/LKnXhDoA1WQFYkI08iNCVwBqGSRmzXAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491685; c=relaxed/simple; bh=XIlqJOjcxzT3WhouCo/+UR8137UrPJNI5EXcordY0iE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O5jB5fspJ6xu9XUWZRL7s4q9sqi0OOGOwXp+QipAiEyecHYw+wd2C0JxEXUqEu50lsFtjhRTIkagEvFjqxWEzMBIvhlkGcOpy3fBCDD5GJ9KeQGp6rsdgjsqlFpm4oQF6KZc+jKfqkv00Z4Wi3JO9M63k5UwjWfkL29l9ulD40M= 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=emN3K6w/; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="emN3K6w/" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-45dd513f4ecso40167045e9.3 for ; Wed, 10 Sep 2025 01:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491681; x=1758096481; 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=emN3K6w/kGw0qh7G5ZYSFTN8kAEFNDf8d1ze1E1EBH0VMCwiMVsyduMe3KY3tYQuWc qMlUe6oVUXYRuudPM38TFj8ICATYT0gkUFV7Tz6rarZOdg5FLTmJnJ4oM2guJilzhosh u5F0GsThJKOCkQ+1bvmVn1WC+gMWEhDZrzx2Qz6ulLUbwd6soNU10k7F2fEsBF3hmR1g 4ppunFQ7+FZO/bZ/MgE1s1VuLUpjSFHws/WXhgDjoqovrfgNBJj6J2Y5YVZ6Ri7wCvZT fPZ6r1i29o94nDw0tFmPnb+JJsbPrRxKKQ8OLVU6cfDQPOwx/b/fdp6B3aebgM9O0AyN wk5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491681; x=1758096481; 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=n/qxcVbCP8XpiuqBWhPNO+IiMPbI15VYRla2aP5Mc2vu7uEyi5GmoGoaS9uLuO+6u5 sROGIQsoyNMaRUZANkMzxn+3CZQlV8rybgcdoDKX674oHkBHayC9+aGInLHbUqbFMx2b AaNVzmF5AgH0xztY7FGiHjclgYJSTC2IrBDN/gHinTOsixzLuZsP+8/KbM+UKJWfrNNZ jOF8IOvDLsnsCgzW3e/9UoGyTKQy7ESWGMlZ4THwVL1B3M15wzetoHvzq3fa5LxiCCl1 RBQ6xU6jEduc2cQxDDonmWTGiE+9NU5RuV91dWZfK5VP6Ve112IXU+235ZWBGGuC9vDt 51rg== X-Forwarded-Encrypted: i=1; AJvYcCWDxgzl8Fh1q2mwGEj/fw8VNbmaktgWBJ6fKEN4qvtwduzym1KLvc18N44w9lLHIxc7uU5zDgVsE3N2Goc=@vger.kernel.org X-Gm-Message-State: AOJu0YyI7Rv/rATU9U5CdF5Aa7YlF3BtgCHCj/CucNoM6K9ndTqV0Wnf iDE87QgRicKQPn2G2wwTV6dUJS9e04jARTrY7k5RA6QVVXiNpfxs//ChtfrjsRLlvPU= X-Gm-Gg: ASbGncvq7Fc6dyRR1vsWU3DAslhR2+sXN5WItP+OQfkg1GkUj/FdlsYxkD8ESkgQKJX 7YKAEPOWTxXzJ0aQyorggylN4DsO4QhmjBvrcBVNG084Q43wlZmNEWXLAntltMglGhoQkli3lap 9MJ+VbEMyfSPaNaCuPr2B0854GxD2gkLlhOlkeitejfhlnXbb6j1CjidMBr0x51JmuY98VmWl23 eksIIxDvDAm5xVQevVkOD+vQ4UEs3WjFPxv6/V2Lbr9ogrC1X5oFdYfrsrt5hMcpW3e26f5Z5B3 /IVfJ8p2Sh8tVqNo/dEVqZO17QCwgGo7ezqhRuKrhI9Hr2ws3242ydEPx6bFINH+cW9eciZT6lJ 5ha1bsb7RirZq6esnuBXgm96p+wyX X-Google-Smtp-Source: AGHT+IGtTZTBxDp6rKWXdB/VBpkJj6AncbJgtDSJtbOLi94Ze8GYVYUd/pOcMlolezAIYylFkwVcfA== X-Received: by 2002:a05:600c:468e:b0:45d:da4a:8dd0 with SMTP id 5b1f17b1804b1-45de6b386abmr80521435e9.27.1757491681543; Wed, 10 Sep 2025 01:08:01 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:07:59 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:44 +0200 Subject: [PATCH 7/9] 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: <20250910-qcom-sa8255p-emac-v1-7-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHOuZe0uiqQW2Zgiw87pkQviYLugbHl4HVm6 6cuWdNFuamJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzgAKCRARpy6gFHHX cqWbD/9JjExtcSAoeJytoBguDSVFDiLWEedYT2wU6Ln/fpgS+pWlLnROCIZr5W2/sroazOl/Gly 2zfKHYub9rpzVyhcc/FhCHxfsL45TQTo9lzyDYf7wMn7c9FFuqFczU5BhUrGETPCPmw4J9cjDE9 wk9Xvw2ZBMINtzeCxXB00eUKFHsooYoWFE4G00dncC7b94/ReUz/Xh0P48j+JScRp1FvbAh+t3O M62lArrEcvAFTnLEHjYPPLHGMkwfWFf6Y9XirwTNCPnfzeOKZ33dtXcJE3MSDFcHDU86zIfhrHw i5bN9PRG2zW19Ac3lt+PQ/2PJdT1aut82NNcRkmY4seswW4ku65ND7HcwlDIX3V6eMupGvfirkc 8JT9Owbqf0L7w5smgcEbwVTTyTVtnEcLAPt1nxehJTciHnwbLjrQJSYodZZaCSOjUr6YOKSb5zn AXPaWrBfjEqTRVxLDnvig+YAGYr634Zo64oAQbEXWPVc5XVg0TFA4zCHE0wTkNUdHL7sP6ggnWg ofhmSHgl7z+l4kBeCROm98rH0FOxivvc8+yDt7uQ+MOBmG2PG2HXtYYCtU2Zdp4GLFMwhmxLjgm 6vHdDKKL7MD9TBzPng07OuRZFv1d5Sf9ujrLI6myzQhfonZTTKydGAO9KgO4f0uxjO7XenKJ409 lYurxGnOOatO3dw== 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 Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 165583148D2 for ; Wed, 10 Sep 2025 08:08:05 +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=1757491687; cv=none; b=MaKrFY4Qkvg4s4E0d+9PRIIc9/EZkZWcWMYncyNzUGZm5RQtbSmNbtgu+q0ZvcFrRcH28QBNHbRT7EE+XPru0plJ9I/g2c8zrzWVr35VNFCdsBKqe9FNwsUMQWc3grD3fP8UVkLBfvA1AoYlivxu69awMlrXrV+6VoGA9gRr4Ss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491687; c=relaxed/simple; bh=NKTMPnPBEN3JCEgCuFzVlb6Jno24tg0DVRR09XWDb2w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hBGmgjR9/niSJGLRcQjNH0mibL/Vkawm+TBYfICgo6PfNHSH93ZJ+hRQ+RMiIzk6QfY4cC3F23d8q3U8OBLA1dVJPNYP4oEHiVAG1AY4N2fXCld0TOEx49HmC0m5/ZlAfy6Z6dEYdhnjx+YPbJuaNZKNvSR8cbwY63aPsnbScu0= 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=SCkGzMAs; 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="SCkGzMAs" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-45de6490e74so29438085e9.2 for ; Wed, 10 Sep 2025 01:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491684; x=1758096484; 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=SCkGzMAsQFap2dIP0bebgFeHUi0m/8G8rGzTLS1qL5rkj+wWcrZ1ecgYCrR+/oX7ER CG6yLimcUUus8b5W3ldaQEAvHwTyjzRBcfR+ZVFoHFeLsOoy/88Iu1qAmC2dLNOoi/bM iosxic+/1pMYBowPPiT5a6hrZMuq0dXcHog/5CHveuLF/hfN84l7SIebqacEglVNJ/Rm dROvzmhoBlqTwtpr8ehtCZwCTGjF4E3z7klInEe1ri5XC/ydp1Dlv+VBxaqQWytqBUA9 rlLH+covD3C0Tck4/YoSGalPgfhZnNTS7NXjLibKCDzdKeP7izAPdxlRthsqNz+3ioqI QApw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491684; x=1758096484; 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=M7wg12ZSd3obz9t3wi1ZHnYJdpXi9B4zrrix6Q1F1oKKNK4xqNgD88saf6NKnEgOzn wWRjUjQl86c0LQxXl2tH7ynkUs4f332EEIoBfunBpYX4Astzgrrte0YZj8jz7G4rsSSE mz9m/32GCejltero3LeaGN61Co28Ci9x4siYYjoyk9ZV2Mlcbar9TvyiBBbsgR8GVRAm 7/8g//6kl/w/OxEYp1EXzAVBtDat40FiwzaClOwBgjfg6yGLBbxnax+jFQ/jfB5PDuwf 3uIslvWWwr/M3hCmtGZUAlgMN0Op3onKZm+IPyuVFfnsWo8qBOlSrxfxQ1aDfXc3Lq25 0g8Q== X-Forwarded-Encrypted: i=1; AJvYcCXwOM6iadClqF/yKRUH2V7Q1p3tGgUNRKMLbpajbbydQqaZXPks/M9wHSGqSTrT5w3SQLvqWDEHaqtgRDk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyi4C5080JUB5G4WMohbYDq/SZWISIs/vUUxVrbypUAXjKujhsM XqmgGefopSpVdxDLvBMfoxDP0InQ07iDlvwlj+hoyoDm6PvcJjQzhRXWkZ7HnOHzdt4= X-Gm-Gg: ASbGncssi6WCLdRikry1nEBs+TPoQwBy/ywz5Jg23qwSU8iNGWSF3iczKJSFPJ+zz6W urUqVKwCs3svMEqksSIhD9tNDGg+RFdMBv/0K2MP66a2YGj4X2jdX1taCVxWYTK8eF0FBCbWH0A VDf2JWmRvjjAVjZVRjTHcRYcyPiKu7sJKuHlhtpgzFg1WO6vXpNIXKlQ/+B4TIiy2hJBLmOf2fo x1MB7V+3mMeOvJM+2MH929A4ugGpFSuIpzfyz87xvDuHv5BKoQEgEYK7OR41N2XG/2EriePTj2f uS1wVNgbG5WCUD42aYZI4N+4UF1Dg9jlMOR27/UJDkzUVspuSjqliDZruCdG/QZBKulY+0UtMlP NIkyMXjskpbRXhttVKw== X-Google-Smtp-Source: AGHT+IGvVc5t4v/zXXj3XSOg9VlCKaRjy8RNapwWMKX626xKKo9LfhELM3jW9IkDumPkK7A4e7csLA== X-Received: by 2002:a05:600c:1f11:b0:45d:db2a:ce4a with SMTP id 5b1f17b1804b1-45de07ee7b3mr127598945e9.9.1757491684304; Wed, 10 Sep 2025 01:08:04 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:08:02 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:45 +0200 Subject: [PATCH 8/9] 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: <20250910-qcom-sa8255p-emac-v1-8-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHO6EyrLNmJZzntjQ+QxktZHKsf8HIE32fP3 DKzaOXZ/t2JAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzgAKCRARpy6gFHHX cjAhD/9mxAdGPfan6KTr7LSNd95YNC9Xhm8DikmzNJETYy9C99YxJGy+fco1O7O6JQB/NB2yyqj b8H7YlXOcHEWEpajLXslZcKO+MGrldGf+4YySTKrgVI0eJfC2tiKU72AgyWVX8mTvzbCYd/QE1B Q/q6VX+d5LcP83v7vJMP+qvyJCEc9zm/AGrV1v67wekYIh0jN+i9PITEBqqCqdHyNeEmhtxXDbH BrPBe/0Q7vQH4t0YCui0PB67K2J7bTu2TE3be8u3eJQ+AyDXkQIMGNxfmZ7/SHhPk8ISPRarx6P 3A/7hoe2nFnpq78Jtda4OWOzSxizgWCwylVbcGAY6N6B1bFwxBkmu3xFk4yvXeO5YueTq7XFbc7 /SsCnTdkkNI/qwMHtzRaF1aqEy4A8gqomnxkO/icK9cUAGKtvyI4JbAfp9DzrkTsfAkZF6C9Fg0 yqbqHPKHpiecBRW4GDJZl4YiqP/IA+wPY/D7Pj4VJjpdfID0XsnGAOgonVEzjPxwoPm4C2iKk1W Q/P8QkqnnazoP08VI0ZR/oUhxONVStSbiCTJ2IOvWcUYSUfm6/2lJeAvxvQ4l7aQfjFi0mTbUok mGTyi/ZSo1b+kDIJ9Swlrh8hlqVaEirtfRm1fTTz0L0md52Fn65DO4rIbsFEm83rxn1oWUZ8KJJ dA/04HfQrhChqmA== 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 Thu Oct 2 22:39:29 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2929E313E2F for ; Wed, 10 Sep 2025 08:08:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491693; cv=none; b=t6XldQ74rWkSPeX/SDopWmZOpMNSBl0VoUt24mz99waPapdb7H0I6+7D/xKiP9SDv/8R1p7447uT17e+k2IUK8cQpvNbRn+VGcgiey4HvM1Q/Y2R7p6+a/ykcFkw5HefIlcVa+CQfW+FSdc29oFwGBUPFPhNJvz8saQrnNqcUFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757491693; c=relaxed/simple; bh=oWXfa3SvJwwCEKqzllHDlbCszXa1p/f/sbqZPJo4AjM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jvVNhBx/QoUrmGiPdfPeDOup1hL4+CItCkOpN38xEFHti5aRaqt43Q445+gCuWhJR+AHJxoOU/2xbadwIqecQhtCnI3W2uYaae/DatrtnBplMGqdKBpi0HNUjlcEG5qHaRaHzruNeHZi6cDLDvg6BiL5xicuZjRO7NjJOhYYhWY= 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=Ht8muMr6; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="Ht8muMr6" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-45dd5e24d16so47008345e9.3 for ; Wed, 10 Sep 2025 01:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1757491688; x=1758096488; 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=Ht8muMr6bxXWi2/TQxbRKLxYxV5d0qZ+Ul3zt3erJOGkXfQLUaOLd20mYYxYtlFdSU ihL9tWSxiysYEUElVln6W1hEehFAP5YECmox1aFE3IO357eVepaB/k0yi54QbSiY8a2d 6VE9h/ehHynrbdlxjRVNGdmDBGIsVqZaVGBZ2JpGR8ypoRdDUXRJ1myW1Lzri+OwoyCG j9TLQ+jEyWcI2VSwkSHpJ5eihrg/C+oWKMo599Il6xbuAXP17knm6KSXuoeAZzBZUKP8 mHp3WMIrpL/H9RHbxvCB8vfvwNl0zC9WJSqU5HYN4UnrktDnEjJjL8fHvhOCIFeHfSFh CrzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757491688; x=1758096488; 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=wfsktJ0tN/jLPLU533JX6HOCYJrOWSJHXBfHv+9L+OtrEGq6cnU4Xs1uPSlhMRT+or tHMTzr8KxHVHzmDEg9xeSleXLHCQaLQI7SCThRAd4mQARhieoTTvAd1YIpbZzhBki5Kc o5uBZTKstD31RCYGA/8BFOb1QtDqK7WLchMJlzdBGSmQKaoeOrBf5C0rAHmpWSbQTb+V kqlco8yda5KrN0HFDxbpjb2Vrd+51Gv0SVDCMpTtzhhsG+Ih2VImoXSEUxBAmQQhRRud 0hTdWhkErqn7uMCcqmnw6NvOa5RtGxcsuPylkimA2TbzD1RdJ/dtqro4ESzINNDMVxG0 XMYg== X-Forwarded-Encrypted: i=1; AJvYcCUnMkhbawf9uboxBa7dRmomDIBpV5j6o+1/yy7A2bjP5OB3had19xASLz5jSTspoe9GJjczQ4a5uibUsyQ=@vger.kernel.org X-Gm-Message-State: AOJu0YziWhcBlftse3E8ErhXkHDlZrXgCLPgCUgdc85sQcFfs/1dyJ8g JjXtyHOom0XuxjvdI3FCryLYvX253VfH9sO7DIyy31lbquOnZhhhrYYM3BMTdd/rQs0= X-Gm-Gg: ASbGncv/5IYHqWytdHjl6W6J+5hu/9dOlP31a3sPk87BNou0avgmPhrQ7FTxh5MaiXQ T9KzBICBV++mPWUfsMn/nDiVGrO74Da48CfoPhwhjvXQCTjuKSD48RDZqFI96RWu8tBCPJk7vmT bk1ntFAXD2iqRYAFOIVtE+2fFIDkuQS1aH01VNW97C0ndCwSfLxRnionICSeBLeO7nIPGINi+Sc uGmaoTjOU2IqBLkm+eiJjj/394x9fdwoooM04/+r7EwcOJOEINt80OugO+VEgITBN+qCk0rQ498 FedsRgUY7QircCju3qQbp9AEyiis4hu4OwQHUtll6vjHEs9RsP13x62qifOawZDejTCeS15UzoK 0j9expMy6/9ebaRMQxV2DWX4YdJZC X-Google-Smtp-Source: AGHT+IG56XJwGZpZ4GrwEXPPYhCBa6sqkrTUyBxMNLpvWbgdc36pNT5Jlm5ghMOSQ92DQFQleNNYHw== X-Received: by 2002:a05:600c:350a:b0:45d:dbf4:8880 with SMTP id 5b1f17b1804b1-45dddef7b71mr122974055e9.27.1757491688342; Wed, 10 Sep 2025 01:08:08 -0700 (PDT) Received: from [127.0.1.1] ([2a01:cb1d:dc:7e00:3936:709a:82c4:3e38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df8247cc6sm17813605e9.12.2025.09.10.01.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:08:05 -0700 (PDT) From: Bartosz Golaszewski Date: Wed, 10 Sep 2025 10:07:46 +0200 Subject: [PATCH 9/9] 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: <20250910-qcom-sa8255p-emac-v1-9-32a79cf1e668@linaro.org> References: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@linaro.org> In-Reply-To: <20250910-qcom-sa8255p-emac-v1-0-32a79cf1e668@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/ZANAwAKARGnLqAUcddyAcsmYgBowTHOVfIA1Wwhqxc+2Pag26471J1TJM+1FKP0n XKraEnGk+qJAjMEAAEKAB0WIQQWnetsC8PEYBPSx58Rpy6gFHHXcgUCaMExzgAKCRARpy6gFHHX ckj2D/9L8Z7yDBDgU+bsZvWM1EWHrRTZ7XgOJyKsWZ9i4EN8YqUnfe+Qz1ydQA6L6niDqqgSLca j9gpRn0pMsn8P7HKO3LRvEeltVHYFOo+NPyCBZvvaL4tl+pT9GTYYTsHeNhh74pyWzfaBSAEycp fMmBb19nHJpLKqKvKU4E5wie8flibPuwjuLDnKboUV6snLuBSRB7/aN5yTdWwCqMcTu24nkySwJ MGqrfaCD8pUKfUcbfy2cADMepZDeoXa8jP/nLdGyRf09cjtGQfgMKJ3CADdZolb6Ul6Rfod/QYN kF+XmFjZ7o1qRR9dOMQ2k5NUDcNuOdhmpXAihqpgcZR23FWqFskaoQV6BGeXDuzy6Lb4jrHNKw4 EnaaRaEMocSIrfIe+L0aIpnK7vTh5+rgrknlsgKUO3oGBAxb8v3yWW43gXuNUnHrbHKV0eLRYUF 8M9+5rC0ccDSf4aNUD975R1tS3cRlJAAVGuisa1Utwuo3DDUX6ZX5U1so4BlUY6suxM8+fJyWcR 6Cqn/cQb6HFJO3rJ7+IDymVA/ZEfEJymEnbFXqUXoFGFJWT/W9COhfMubiSVFjPBZC2O06gGbdF h7lC9wpcYuIBZLbUtEof0XKYzbRBOT/2m9ozroGmt8hWvdCWvwycJwDdycr2znSAUX7FeOQ1jIA qeazTiTh0oJm0aA== 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