devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board
@ 2022-03-03  8:48 Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson

Changes since v2:
-----------------
- v2 can be seen here: https://lore.kernel.org/linux-arm-msm/20220302110508.69053-1-bhupesh.sharma@linaro.org/T
- Fixed review comments from Dmitry - created a new [PATCH 2/6]
  to fix some identation issues with sm8150 gcc driver.

Changes since v1:
-----------------
- v1 can be seen here: https://lore.kernel.org/netdev/20220126221725.710167-1-bhupesh.sharma@linaro.org/t/
- Fixed review comments from Bjorn - broke the v1 series into two
  separate series - one each for 'net' tree and 'arm clock/dts' tree
  - so as to ease review of the same from the respective maintainers.
- This series is intended for the 'arm msm clock/dts' tree.
- Other changes:
  - Dropped [PATCH 7/8] from v1.
  - Added more background on the emac gdsc issue, requiring it to be in
    ALWAYS_ON state in [PATCH 5/5].
  - Collected Ack from Rob for [PATCH 1/5].
  - Broke down v1's [PATCH 3/8] into 3 separate patches (one each for emac,
    pci and ufs gdsc defines) - one of which is carried as [PATCH 2/5]
    in this series, which is used to enable emac GDSC.

The SA8155p-ADP board supports on-board ethernet (Gibabit Interface),
with support for both RGMII and RMII buses.

This patchset adds the support for the same.

Note that this patchset is based on an earlier sent patchset
for adding PDC controller support on SM8150 (see [1]).

[1]. https://lore.kernel.org/linux-arm-msm/20220226184028.111566-1-bhupesh.sharma@linaro.org/T/

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>

Bhupesh Sharma (3):
  clk: qcom: gcc: sm8150: Fix some identation issues
  clk: qcom: gcc: Add emac GDSC support for SM8150
  clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac
    gdsc

Vinod Koul (3):
  dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible
  arm64: dts: qcom: sm8150: add ethernet node
  arm64: dts: qcom: sa8155p-adp: Enable ethernet node

 .../devicetree/bindings/net/qcom,ethqos.txt   |   4 +-
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts      | 144 ++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  27 ++++
 drivers/clk/qcom/gcc-sm8150.c                 |  40 +++--
 include/dt-bindings/clock/qcom,gcc-sm8150.h   |   1 +
 5 files changed, 203 insertions(+), 13 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  2022-03-08 23:11   ` Bjorn Andersson
  2022-03-03  8:48 ` [PATCH v3 2/6] clk: qcom: gcc: sm8150: Fix some identation issues Bhupesh Sharma
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson,
	Vinod Koul, Rob Herring

From: Vinod Koul <vkoul@kernel.org>

SM8150 has a ethernet controller and needs a different configuration so
add a new compatible for this

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 Documentation/devicetree/bindings/net/qcom,ethqos.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.txt b/Documentation/devicetree/bindings/net/qcom,ethqos.txt
index fcf5035810b5..1f5746849a71 100644
--- a/Documentation/devicetree/bindings/net/qcom,ethqos.txt
+++ b/Documentation/devicetree/bindings/net/qcom,ethqos.txt
@@ -7,7 +7,9 @@ This device has following properties:
 
 Required properties:
 
-- compatible: Should be qcom,qcs404-ethqos"
+- compatible: Should be one of:
+		"qcom,qcs404-ethqos"
+		"qcom,sm8150-ethqos"
 
 - reg: Address and length of the register set for the device
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/6] clk: qcom: gcc: sm8150: Fix some identation issues
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150 Bhupesh Sharma
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson

Fix identation issues with usb30 gdsc structs in gcc-sm8150.

Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 drivers/clk/qcom/gcc-sm8150.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
index 245794485719..85a431ac417b 100644
--- a/drivers/clk/qcom/gcc-sm8150.c
+++ b/drivers/clk/qcom/gcc-sm8150.c
@@ -3449,21 +3449,21 @@ static struct clk_branch gcc_video_xo_clk = {
 };
 
 static struct gdsc usb30_prim_gdsc = {
-		.gdscr = 0xf004,
-		.pd = {
-			.name = "usb30_prim_gdsc",
-		},
-		.pwrsts = PWRSTS_OFF_ON,
-		.flags = POLL_CFG_GDSCR,
+	.gdscr = 0xf004,
+	.pd = {
+		.name = "usb30_prim_gdsc",
+	},
+	.pwrsts = PWRSTS_OFF_ON,
+	.flags = POLL_CFG_GDSCR,
 };
 
 static struct gdsc usb30_sec_gdsc = {
-		.gdscr = 0x10004,
-		.pd = {
-			.name = "usb30_sec_gdsc",
-		},
-		.pwrsts = PWRSTS_OFF_ON,
-		.flags = POLL_CFG_GDSCR,
+	.gdscr = 0x10004,
+	.pd = {
+		.name = "usb30_sec_gdsc",
+	},
+	.pwrsts = PWRSTS_OFF_ON,
+	.flags = POLL_CFG_GDSCR,
 };
 
 static struct clk_regmap *gcc_sm8150_clocks[] = {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 2/6] clk: qcom: gcc: sm8150: Fix some identation issues Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  2022-03-03 10:33   ` Dmitry Baryshkov
  2022-03-03  8:48 ` [PATCH v3 4/6] clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac gdsc Bhupesh Sharma
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson

Add the EMAC GDSC defines and driver structures for SM8150.

Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 drivers/clk/qcom/gcc-sm8150.c               | 10 ++++++++++
 include/dt-bindings/clock/qcom,gcc-sm8150.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
index 85a431ac417b..08ba29e3a835 100644
--- a/drivers/clk/qcom/gcc-sm8150.c
+++ b/drivers/clk/qcom/gcc-sm8150.c
@@ -3448,6 +3448,15 @@ static struct clk_branch gcc_video_xo_clk = {
 	},
 };
 
+static struct gdsc emac_gdsc = {
+	.gdscr = 0x6004,
+	.pd = {
+		.name = "emac_gdsc",
+	},
+	.pwrsts = PWRSTS_OFF_ON,
+	.flags = POLL_CFG_GDSCR,
+};
+
 static struct gdsc usb30_prim_gdsc = {
 	.gdscr = 0xf004,
 	.pd = {
@@ -3714,6 +3723,7 @@ static const struct qcom_reset_map gcc_sm8150_resets[] = {
 };
 
 static struct gdsc *gcc_sm8150_gdscs[] = {
+	[EMAC_GDSC] = &emac_gdsc,
 	[USB30_PRIM_GDSC] = &usb30_prim_gdsc,
 	[USB30_SEC_GDSC] = &usb30_sec_gdsc,
 };
diff --git a/include/dt-bindings/clock/qcom,gcc-sm8150.h b/include/dt-bindings/clock/qcom,gcc-sm8150.h
index 3e1a91876610..40596b9ded06 100644
--- a/include/dt-bindings/clock/qcom,gcc-sm8150.h
+++ b/include/dt-bindings/clock/qcom,gcc-sm8150.h
@@ -243,5 +243,6 @@
 /* GCC GDSCRs */
 #define USB30_PRIM_GDSC                     4
 #define USB30_SEC_GDSC						5
+#define EMAC_GDSC						6
 
 #endif
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 4/6] clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac gdsc
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
                   ` (2 preceding siblings ...)
  2022-03-03  8:48 ` [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150 Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node Bhupesh Sharma
  2022-03-03  8:48 ` [PATCH v3 6/6] arm64: dts: qcom: sa8155p-adp: Enable " Bhupesh Sharma
  5 siblings, 0 replies; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson

emac GDSC currently has issues (seen on SA8155p-ADP) when its
turn'ed ON, once its already in OFF state. So when the 'eth'
interface is turned up, it fails (as RGMII CLK is unavailable,
which is gated by emac GDSC) with the following logs:

  qcom-ethqos 20000.ethernet eth0: PHY [stmmac-0:07] driver [Micrel
                                   KSZ9031 Gigabit PHY] (irq=150)
  <..snip..>
  qcom-ethqos 20000.ethernet: Failed to reset the dma
  qcom-ethqos 20000.ethernet eth0: stmmac_hw_setup: DMA engine
                                   initialization failed
  qcom-ethqos 20000.ethernet eth0: stmmac_open: Hw setup failed

So, use the 'ALWAYS_ON' flag as a workaround to describe emac GDSC
for now.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 drivers/clk/qcom/gcc-sm8150.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
index 08ba29e3a835..76485bff7240 100644
--- a/drivers/clk/qcom/gcc-sm8150.c
+++ b/drivers/clk/qcom/gcc-sm8150.c
@@ -3454,7 +3454,13 @@ static struct gdsc emac_gdsc = {
 		.name = "emac_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	/*
+	 * FIXME: emac GDSC cannot resume after GDSC power off:
+	 * qcom-ethqos 20000.ethernet: Failed to reset the dma
+	 *
+	 * So use ALWAYS_ON flag as a workaround.
+	 */
+	.flags = ALWAYS_ON,
 };
 
 static struct gdsc usb30_prim_gdsc = {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
                   ` (3 preceding siblings ...)
  2022-03-03  8:48 ` [PATCH v3 4/6] clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac gdsc Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  2022-03-03 10:34   ` Dmitry Baryshkov
  2022-03-03  8:48 ` [PATCH v3 6/6] arm64: dts: qcom: sa8155p-adp: Enable " Bhupesh Sharma
  5 siblings, 1 reply; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson,
	Vinod Koul

From: Vinod Koul <vkoul@kernel.org>

SM8150 SoC supports ethqos ethernet controller so add the node for it

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[bhsharma: Correct ethernet interrupt numbers and add power-domain]
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 6012322a5984..2ed231767535 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -915,6 +915,33 @@ gpi_dma0: dma-controller@800000 {
 			status = "disabled";
 		};
 
+		ethernet: ethernet@20000 {
+			compatible = "qcom,sm8150-ethqos";
+			reg = <0x0 0x00020000 0x0 0x10000>,
+			      <0x0 0x00036000 0x0 0x100>;
+			reg-names = "stmmaceth", "rgmii";
+			clock-names = "stmmaceth", "pclk", "ptp_ref", "rgmii";
+			clocks = <&gcc GCC_EMAC_AXI_CLK>,
+				<&gcc GCC_EMAC_SLV_AHB_CLK>,
+				<&gcc GCC_EMAC_PTP_CLK>,
+				<&gcc GCC_EMAC_RGMII_CLK>;
+			interrupts = <GIC_SPI 689 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 699 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq", "eth_lpi";
+
+			power-domains = <&gcc EMAC_GDSC>;
+			resets = <&gcc GCC_EMAC_BCR>;
+
+			iommus = <&apps_smmu 0x3C0 0x0>;
+
+			snps,tso;
+			rx-fifo-depth = <4096>;
+			tx-fifo-depth = <4096>;
+
+			status = "disabled";
+		};
+
+
 		qupv3_id_0: geniqup@8c0000 {
 			compatible = "qcom,geni-se-qup";
 			reg = <0x0 0x008c0000 0x0 0x6000>;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 6/6] arm64: dts: qcom: sa8155p-adp: Enable ethernet node
  2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
                   ` (4 preceding siblings ...)
  2022-03-03  8:48 ` [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node Bhupesh Sharma
@ 2022-03-03  8:48 ` Bhupesh Sharma
  5 siblings, 0 replies; 12+ messages in thread
From: Bhupesh Sharma @ 2022-03-03  8:48 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: bhupesh.sharma, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson,
	Vinod Koul

From: Vinod Koul <vkoul@kernel.org>

Enable the etheret node, add the phy node and pinctrl for ethernet.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[bhsharma: Correct ethernet/rgmii related pinmuxs, specify multi-queues and
 plug in the PHY interrupt for WOL]
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 144 +++++++++++++++++++++++
 1 file changed, 144 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
index 8756c2b25c7e..474f688f14a2 100644
--- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
@@ -47,6 +47,65 @@ vreg_s4a_1p8: smps4 {
 
 		vin-supply = <&vreg_3p3>;
 	};
+
+	mtl_rx_setup: rx-queues-config {
+		snps,rx-queues-to-use = <4>;
+		snps,rx-sched-sp;
+
+		queue0 {
+			snps,dcb-algorithm;
+			snps,map-to-dma-channel = <0x0>;
+			snps,route-up;
+			snps,priority = <0x1>;
+		};
+
+		queue1 {
+			snps,dcb-algorithm;
+			snps,map-to-dma-channel = <0x1>;
+			snps,route-ptp;
+		};
+
+		queue2 {
+			snps,avb-algorithm;
+			snps,map-to-dma-channel = <0x2>;
+			snps,route-avcp;
+		};
+
+		queue3 {
+			snps,avb-algorithm;
+			snps,map-to-dma-channel = <0x3>;
+			snps,priority = <0xC>;
+		};
+	};
+
+	mtl_tx_setup: tx-queues-config {
+		snps,tx-queues-to-use = <4>;
+		snps,tx-sched-wrr;
+
+		queue0 {
+			snps,weight = <0x10>;
+			snps,dcb-algorithm;
+			snps,priority = <0x0>;
+		};
+
+		queue1 {
+			snps,weight = <0x11>;
+			snps,dcb-algorithm;
+			snps,priority = <0x1>;
+		};
+
+		queue2 {
+			snps,weight = <0x12>;
+			snps,dcb-algorithm;
+			snps,priority = <0x2>;
+		};
+
+		queue3 {
+			snps,weight = <0x13>;
+			snps,dcb-algorithm;
+			snps,priority = <0x3>;
+		};
+	};
 };
 
 &apps_rsc {
@@ -317,6 +376,42 @@ &remoteproc_cdsp {
 	firmware-name = "qcom/sa8155p/cdsp.mdt";
 };
 
+&ethernet {
+	status = "okay";
+
+	snps,reset-gpio = <&tlmm 79 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 11000 70000>;
+
+	snps,ptp-ref-clk-rate = <250000000>;
+	snps,ptp-req-clk-rate = <96000000>;
+
+	snps,mtl-rx-config = <&mtl_rx_setup>;
+	snps,mtl-tx-config = <&mtl_tx_setup>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&ethernet_defaults>;
+
+	phy-handle = <&rgmii_phy>;
+	phy-mode = "rgmii";
+	mdio {
+		#address-cells = <0x1>;
+		#size-cells = <0x0>;
+
+		compatible = "snps,dwmac-mdio";
+
+		/* Micrel KSZ9031RNZ PHY */
+		rgmii_phy: phy@7 {
+			reg = <0x7>;
+
+			interrupt-parent = <&tlmm>;
+			interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */
+			device_type = "ethernet-phy";
+			compatible = "ethernet-phy-ieee802.3-c22";
+		};
+	};
+};
+
 &uart2 {
 	status = "okay";
 };
@@ -407,4 +502,53 @@ mux {
 			drive-strength = <2>;
 		};
 	};
+
+	ethernet_defaults: ethernet-defaults {
+		mdc {
+			pins = "gpio7";
+			function = "rgmii";
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio59";
+			function = "rgmii";
+			bias-pull-up;
+		};
+
+		rgmii-rx {
+			pins = "gpio117", "gpio118", "gpio119", "gpio120", "gpio115", "gpio116";
+			function = "rgmii";
+			bias-disable;
+			drive-strength = <2>;
+		};
+
+		rgmii-tx {
+			pins = "gpio122", "gpio4", "gpio5", "gpio6", "gpio114", "gpio121";
+			function = "rgmii";
+			bias-pull-up;
+			drive-strength = <16>;
+		};
+
+		phy-intr {
+			pins = "gpio124";
+			function = "emac_phy";
+			bias-disable;
+			drive-strength = <8>;
+		};
+
+		pps {
+			pins = "gpio81";
+			function = "emac_pps";
+			bias-disable;
+			drive-strength = <8>;
+		};
+
+		phy-reset {
+			pins = "gpio79";
+			function = "gpio";
+			bias-pull-up;
+			drive-strength = <16>;
+		};
+	};
 };
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150
  2022-03-03  8:48 ` [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150 Bhupesh Sharma
@ 2022-03-03 10:33   ` Dmitry Baryshkov
  2022-03-08 23:09     ` Bjorn Andersson
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-03-03 10:33 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: linux-arm-msm, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson

On Thu, 3 Mar 2022 at 11:48, Bhupesh Sharma <bhupesh.sharma@linaro.org> wrote:
>
> Add the EMAC GDSC defines and driver structures for SM8150.
>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>  drivers/clk/qcom/gcc-sm8150.c               | 10 ++++++++++
>  include/dt-bindings/clock/qcom,gcc-sm8150.h |  1 +
>  2 files changed, 11 insertions(+)
>
> diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> index 85a431ac417b..08ba29e3a835 100644
> --- a/drivers/clk/qcom/gcc-sm8150.c
> +++ b/drivers/clk/qcom/gcc-sm8150.c
> @@ -3448,6 +3448,15 @@ static struct clk_branch gcc_video_xo_clk = {
>         },
>  };
>

Is it available on sm8150 or only on sa8155au? I think this deserves
at least a comment.

> +static struct gdsc emac_gdsc = {
> +       .gdscr = 0x6004,
> +       .pd = {
> +               .name = "emac_gdsc",
> +       },
> +       .pwrsts = PWRSTS_OFF_ON,
> +       .flags = POLL_CFG_GDSCR,
> +};
> +
>  static struct gdsc usb30_prim_gdsc = {
>         .gdscr = 0xf004,
>         .pd = {
> @@ -3714,6 +3723,7 @@ static const struct qcom_reset_map gcc_sm8150_resets[] = {
>  };
>
>  static struct gdsc *gcc_sm8150_gdscs[] = {
> +       [EMAC_GDSC] = &emac_gdsc,
>         [USB30_PRIM_GDSC] = &usb30_prim_gdsc,
>         [USB30_SEC_GDSC] = &usb30_sec_gdsc,
>  };
> diff --git a/include/dt-bindings/clock/qcom,gcc-sm8150.h b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> index 3e1a91876610..40596b9ded06 100644
> --- a/include/dt-bindings/clock/qcom,gcc-sm8150.h
> +++ b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> @@ -243,5 +243,6 @@
>  /* GCC GDSCRs */
>  #define USB30_PRIM_GDSC                     4
>  #define USB30_SEC_GDSC                                         5
> +#define EMAC_GDSC                                              6
>
>  #endif
> --
> 2.35.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node
  2022-03-03  8:48 ` [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node Bhupesh Sharma
@ 2022-03-03 10:34   ` Dmitry Baryshkov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-03-03 10:34 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: linux-arm-msm, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, bjorn.andersson,
	Vinod Koul

On Thu, 3 Mar 2022 at 11:49, Bhupesh Sharma <bhupesh.sharma@linaro.org> wrote:
>
> From: Vinod Koul <vkoul@kernel.org>
>
> SM8150 SoC supports ethqos ethernet controller so add the node for it

Is it available e.g. in the sm8150 SoC that I have in the phone?

>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> [bhsharma: Correct ethernet interrupt numbers and add power-domain]
> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8150.dtsi | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> index 6012322a5984..2ed231767535 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> @@ -915,6 +915,33 @@ gpi_dma0: dma-controller@800000 {
>                         status = "disabled";
>                 };
>
> +               ethernet: ethernet@20000 {
> +                       compatible = "qcom,sm8150-ethqos";
> +                       reg = <0x0 0x00020000 0x0 0x10000>,
> +                             <0x0 0x00036000 0x0 0x100>;
> +                       reg-names = "stmmaceth", "rgmii";
> +                       clock-names = "stmmaceth", "pclk", "ptp_ref", "rgmii";
> +                       clocks = <&gcc GCC_EMAC_AXI_CLK>,
> +                               <&gcc GCC_EMAC_SLV_AHB_CLK>,
> +                               <&gcc GCC_EMAC_PTP_CLK>,
> +                               <&gcc GCC_EMAC_RGMII_CLK>;
> +                       interrupts = <GIC_SPI 689 IRQ_TYPE_LEVEL_HIGH>,
> +                                    <GIC_SPI 699 IRQ_TYPE_LEVEL_HIGH>;
> +                       interrupt-names = "macirq", "eth_lpi";
> +
> +                       power-domains = <&gcc EMAC_GDSC>;
> +                       resets = <&gcc GCC_EMAC_BCR>;
> +
> +                       iommus = <&apps_smmu 0x3C0 0x0>;
> +
> +                       snps,tso;
> +                       rx-fifo-depth = <4096>;
> +                       tx-fifo-depth = <4096>;
> +
> +                       status = "disabled";
> +               };
> +
> +
>                 qupv3_id_0: geniqup@8c0000 {
>                         compatible = "qcom,geni-se-qup";
>                         reg = <0x0 0x008c0000 0x0 0x6000>;
> --
> 2.35.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150
  2022-03-03 10:33   ` Dmitry Baryshkov
@ 2022-03-08 23:09     ` Bjorn Andersson
  2022-03-08 23:12       ` Dmitry Baryshkov
  0 siblings, 1 reply; 12+ messages in thread
From: Bjorn Andersson @ 2022-03-08 23:09 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bhupesh Sharma, linux-arm-msm, bhupesh.linux, agross,
	linux-kernel, devicetree, sboyd, tdas, mturquette, linux-clk,
	robh+dt

On Thu 03 Mar 04:33 CST 2022, Dmitry Baryshkov wrote:

> On Thu, 3 Mar 2022 at 11:48, Bhupesh Sharma <bhupesh.sharma@linaro.org> wrote:
> >
> > Add the EMAC GDSC defines and driver structures for SM8150.
> >
> > Cc: Stephen Boyd <sboyd@kernel.org>
> > Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > ---
> >  drivers/clk/qcom/gcc-sm8150.c               | 10 ++++++++++
> >  include/dt-bindings/clock/qcom,gcc-sm8150.h |  1 +
> >  2 files changed, 11 insertions(+)
> >
> > diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> > index 85a431ac417b..08ba29e3a835 100644
> > --- a/drivers/clk/qcom/gcc-sm8150.c
> > +++ b/drivers/clk/qcom/gcc-sm8150.c
> > @@ -3448,6 +3448,15 @@ static struct clk_branch gcc_video_xo_clk = {
> >         },
> >  };
> >
> 
> Is it available on sm8150 or only on sa8155au? I think this deserves
> at least a comment.
> 

The ethernet controller is there on SM8150 as well.

Regards,
Bjorn

> > +static struct gdsc emac_gdsc = {
> > +       .gdscr = 0x6004,
> > +       .pd = {
> > +               .name = "emac_gdsc",
> > +       },
> > +       .pwrsts = PWRSTS_OFF_ON,
> > +       .flags = POLL_CFG_GDSCR,
> > +};
> > +
> >  static struct gdsc usb30_prim_gdsc = {
> >         .gdscr = 0xf004,
> >         .pd = {
> > @@ -3714,6 +3723,7 @@ static const struct qcom_reset_map gcc_sm8150_resets[] = {
> >  };
> >
> >  static struct gdsc *gcc_sm8150_gdscs[] = {
> > +       [EMAC_GDSC] = &emac_gdsc,
> >         [USB30_PRIM_GDSC] = &usb30_prim_gdsc,
> >         [USB30_SEC_GDSC] = &usb30_sec_gdsc,
> >  };
> > diff --git a/include/dt-bindings/clock/qcom,gcc-sm8150.h b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > index 3e1a91876610..40596b9ded06 100644
> > --- a/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > +++ b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > @@ -243,5 +243,6 @@
> >  /* GCC GDSCRs */
> >  #define USB30_PRIM_GDSC                     4
> >  #define USB30_SEC_GDSC                                         5
> > +#define EMAC_GDSC                                              6
> >
> >  #endif
> > --
> > 2.35.1
> >
> 
> 
> -- 
> With best wishes
> Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible
  2022-03-03  8:48 ` [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
@ 2022-03-08 23:11   ` Bjorn Andersson
  0 siblings, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2022-03-08 23:11 UTC (permalink / raw)
  To: Bhupesh Sharma
  Cc: linux-arm-msm, bhupesh.linux, agross, linux-kernel, devicetree,
	sboyd, tdas, mturquette, linux-clk, robh+dt, Vinod Koul,
	Rob Herring

On Thu 03 Mar 02:48 CST 2022, Bhupesh Sharma wrote:

> From: Vinod Koul <vkoul@kernel.org>
> 
> SM8150 has a ethernet controller and needs a different configuration so
> add a new compatible for this
> 
> Acked-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>

As you pass on Vinod's patch, you need to add your signed-off-by to
certify the origin of the patch.

Also please resubmit it (alone) to the networking list.

Regards,
Bjorn

> ---
>  Documentation/devicetree/bindings/net/qcom,ethqos.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.txt b/Documentation/devicetree/bindings/net/qcom,ethqos.txt
> index fcf5035810b5..1f5746849a71 100644
> --- a/Documentation/devicetree/bindings/net/qcom,ethqos.txt
> +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.txt
> @@ -7,7 +7,9 @@ This device has following properties:
>  
>  Required properties:
>  
> -- compatible: Should be qcom,qcs404-ethqos"
> +- compatible: Should be one of:
> +		"qcom,qcs404-ethqos"
> +		"qcom,sm8150-ethqos"
>  
>  - reg: Address and length of the register set for the device
>  
> -- 
> 2.35.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150
  2022-03-08 23:09     ` Bjorn Andersson
@ 2022-03-08 23:12       ` Dmitry Baryshkov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-03-08 23:12 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Bhupesh Sharma, linux-arm-msm, bhupesh.linux, agross,
	linux-kernel, devicetree, sboyd, tdas, mturquette, linux-clk,
	robh+dt

On Wed, 9 Mar 2022 at 02:09, Bjorn Andersson <bjorn.andersson@linaro.org> wrote:
>
> On Thu 03 Mar 04:33 CST 2022, Dmitry Baryshkov wrote:
>
> > On Thu, 3 Mar 2022 at 11:48, Bhupesh Sharma <bhupesh.sharma@linaro.org> wrote:
> > >
> > > Add the EMAC GDSC defines and driver structures for SM8150.
> > >
> > > Cc: Stephen Boyd <sboyd@kernel.org>
> > > Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> > > ---
> > >  drivers/clk/qcom/gcc-sm8150.c               | 10 ++++++++++
> > >  include/dt-bindings/clock/qcom,gcc-sm8150.h |  1 +
> > >  2 files changed, 11 insertions(+)
> > >
> > > diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> > > index 85a431ac417b..08ba29e3a835 100644
> > > --- a/drivers/clk/qcom/gcc-sm8150.c
> > > +++ b/drivers/clk/qcom/gcc-sm8150.c
> > > @@ -3448,6 +3448,15 @@ static struct clk_branch gcc_video_xo_clk = {
> > >         },
> > >  };
> > >
> >
> > Is it available on sm8150 or only on sa8155au? I think this deserves
> > at least a comment.
> >
>
> The ethernet controller is there on SM8150 as well.

Ack

>
> Regards,
> Bjorn
>
> > > +static struct gdsc emac_gdsc = {
> > > +       .gdscr = 0x6004,
> > > +       .pd = {
> > > +               .name = "emac_gdsc",
> > > +       },
> > > +       .pwrsts = PWRSTS_OFF_ON,
> > > +       .flags = POLL_CFG_GDSCR,
> > > +};
> > > +
> > >  static struct gdsc usb30_prim_gdsc = {
> > >         .gdscr = 0xf004,
> > >         .pd = {
> > > @@ -3714,6 +3723,7 @@ static const struct qcom_reset_map gcc_sm8150_resets[] = {
> > >  };
> > >
> > >  static struct gdsc *gcc_sm8150_gdscs[] = {
> > > +       [EMAC_GDSC] = &emac_gdsc,
> > >         [USB30_PRIM_GDSC] = &usb30_prim_gdsc,
> > >         [USB30_SEC_GDSC] = &usb30_sec_gdsc,
> > >  };
> > > diff --git a/include/dt-bindings/clock/qcom,gcc-sm8150.h b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > > index 3e1a91876610..40596b9ded06 100644
> > > --- a/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > > +++ b/include/dt-bindings/clock/qcom,gcc-sm8150.h
> > > @@ -243,5 +243,6 @@
> > >  /* GCC GDSCRs */
> > >  #define USB30_PRIM_GDSC                     4
> > >  #define USB30_SEC_GDSC                                         5
> > > +#define EMAC_GDSC                                              6
> > >
> > >  #endif
> > > --
> > > 2.35.1
> > >
> >
> >
> > --
> > With best wishes
> > Dmitry



-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-08 23:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03  8:48 [PATCH v3 0/6] Add ethernet support for Qualcomm SA8155p-ADP board Bhupesh Sharma
2022-03-03  8:48 ` [PATCH v3 1/6] dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible Bhupesh Sharma
2022-03-08 23:11   ` Bjorn Andersson
2022-03-03  8:48 ` [PATCH v3 2/6] clk: qcom: gcc: sm8150: Fix some identation issues Bhupesh Sharma
2022-03-03  8:48 ` [PATCH v3 3/6] clk: qcom: gcc: Add emac GDSC support for SM8150 Bhupesh Sharma
2022-03-03 10:33   ` Dmitry Baryshkov
2022-03-08 23:09     ` Bjorn Andersson
2022-03-08 23:12       ` Dmitry Baryshkov
2022-03-03  8:48 ` [PATCH v3 4/6] clk: qcom: gcc-sm8150: Use ALWAYS_ON flag as a workaround for emac gdsc Bhupesh Sharma
2022-03-03  8:48 ` [PATCH v3 5/6] arm64: dts: qcom: sm8150: add ethernet node Bhupesh Sharma
2022-03-03 10:34   ` Dmitry Baryshkov
2022-03-03  8:48 ` [PATCH v3 6/6] arm64: dts: qcom: sa8155p-adp: Enable " Bhupesh Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).