Skip to contentSkip to conversation

sa8155p-adp devicetree ethernet cleanup

PATCH Applied Andrew Halaney 4 participants 9 messages May 1, 2023 – May 25, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 sa8155p-adp devicetree ethernet cleanup

This series cleans up some devicetree conventions in sa8155p-adp based on feedback from other platforms.

The hope is that by getting it right here, future contributors won't repeat the same mistakes as I did!

v3: https://lore.kernel.org/linux-arm-msm/[email protected]/

Thanks,
Andrew

Andrew Halaney (4):
arm64: dts: qcom: sa8155p-adp: Make compatible the first property
arm64: dts: qcom: Make -cells decimal
arm64: dts: qcom: sa8155p-adp: Remove unneeded rgmii_phy information
arm64: dts: qcom: sa8155p-adp: Move mtl nodes into ethernet node

 arch/arm64/boot/dts/qcom/ipq6018.dtsi        |  2 +-
 arch/arm64/boot/dts/qcom/ipq8074.dtsi        | 14 ++---
 arch/arm64/boot/dts/qcom/msm8953.dtsi        |  4 +-
 arch/arm64/boot/dts/qcom/qcs404-evb-4000.dts |  4 +-
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts     | 56 ++++++++++----------
 5 files changed, 39 insertions(+), 41 deletions(-)
Signature · 1 line
2.40.0
#1 lore raw

PATCH v4 1/4 arm64: dts: qcom: sa8155p-adp: Make compatible the first property

As stated at the below link in another review, compatible is always the first property.

Follow suit here to avoid copying incorrectly in the future.

---

Changes since v3:
* None
Changes since v2:
* Collect tags
Changes since v1:
* None

 arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sa8155p-adp.dts +2 -3
index 339fea522509..029b23198b3a 100644
@@ -352,19 +352,18 @@ &ethernet {
 	max-speed = <1000>;
 
 	mdio {
+		compatible = "snps,dwmac-mdio";
 		#address-cells = <0x1>;
 		#size-cells = <0x0>;
 
-		compatible = "snps,dwmac-mdio";
-
 		/* Micrel KSZ9031RNZ PHY */
 		rgmii_phy: phy@7 {
+			compatible = "ethernet-phy-ieee802.3-c22";
 			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";
 		};
 	};
 };
Signature · 1 line
2.40.0
#2 lore raw

PATCH v4 2/4 arm64: dts: qcom: Make -cells decimal

In reply to Andrew Halaney

The property logically makes sense in decimal, and is the standard used elsewhere.

---

Changes since v3:
* Treat all of arm64/qcom at once (Krzysztof)
* Dropped Konrad's RB tag since the scope expanded
Changes since v2:
* Collect tags
Changes since v1:
* New patch (Konrad)

 arch/arm64/boot/dts/qcom/ipq6018.dtsi        |  2 +-
 arch/arm64/boot/dts/qcom/ipq8074.dtsi        | 14 +++++++-------
 arch/arm64/boot/dts/qcom/msm8953.dtsi        |  4 ++--
 arch/arm64/boot/dts/qcom/qcs404-evb-4000.dts |  4 ++--
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts     |  4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +1 -1
index 9ff4e9d45065..ccaf8e57668a 100644
@@ -571,7 +571,7 @@ intc: interrupt-controller@b000000 {
 			#address-cells = <2>;
 			#size-cells = <2>;
 			interrupt-controller;
-			#interrupt-cells = <0x3>;
+			#interrupt-cells = <3>;
 			reg = <0x0 0x0b000000 0x0 0x1000>,  /*GICD*/
 			      <0x0 0x0b002000 0x0 0x1000>,  /*GICC*/
 			      <0x0 0x0b001000 0x0 0x1000>,  /*GICH*/
arch/arm64/boot/dts/qcom/ipq8074.dtsi +7 -7
index 84e715aa4310..0bde1303bb9d 100644
@@ -29,8 +29,8 @@ xo: xo {
 	};
 
 	cpus {
-		#address-cells = <0x1>;
-		#size-cells = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
 
 		CPU0: cpu@0 {
 			device_type = "cpu";
@@ -106,8 +106,8 @@ scm {
 	};
 
 	soc: soc {
-		#address-cells = <0x1>;
-		#size-cells = <0x1>;
+		#address-cells = <1>;
+		#size-cells = <1>;
 		ranges = <0 0 0 0xffffffff>;
 		compatible = "simple-bus";
 
@@ -321,9 +321,9 @@ tlmm: pinctrl@1000000 {
 			interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
 			gpio-controller;
 			gpio-ranges = <&tlmm 0 0 70>;
-			#gpio-cells = <0x2>;
+			#gpio-cells = <2>;
 			interrupt-controller;
-			#interrupt-cells = <0x2>;
+			#interrupt-cells = <2>;
 
 			serial_4_pins: serial4-state {
 				pins = "gpio23", "gpio24";
@@ -666,7 +666,7 @@ intc: interrupt-controller@b000000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 			interrupt-controller;
-			#interrupt-cells = <0x3>;
+			#interrupt-cells = <3>;
 			reg = <0x0b000000 0x1000>, <0x0b002000 0x1000>;
 			ranges = <0 0xb00a000 0xffd>;
 
arch/arm64/boot/dts/qcom/msm8953.dtsi +2 -2
index 602cb188a635..eeebdab58c04 100644
@@ -1505,8 +1505,8 @@ apcs: mailbox@b011000 {
 		timer@b120000 {
 			compatible = "arm,armv7-timer-mem";
 			reg = <0x0b120000 0x1000>;
-			#address-cells = <0x01>;
-			#size-cells = <0x01>;
+			#address-cells = <1>;
+			#size-cells = <1>;
 			ranges;
 
 			frame@b121000 {
arch/arm64/boot/dts/qcom/qcs404-evb-4000.dts +2 -2
index 59702ba24f35..358827c2fbd3 100644
@@ -27,8 +27,8 @@ &ethernet {
 	phy-handle = <&phy1>;
 	phy-mode = "rgmii";
 	mdio {
-		#address-cells = <0x1>;
-		#size-cells = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
 		compatible = "snps,dwmac-mdio";
 		phy1: phy@4 {
 			compatible = "ethernet-phy-ieee802.3-c22";
arch/arm64/boot/dts/qcom/sa8155p-adp.dts +2 -2
index 029b23198b3a..ac52a8dfeba1 100644
@@ -353,8 +353,8 @@ &ethernet {
 
 	mdio {
 		compatible = "snps,dwmac-mdio";
-		#address-cells = <0x1>;
-		#size-cells = <0x0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
 
 		/* Micrel KSZ9031RNZ PHY */
 		rgmii_phy: phy@7 {
Signature · 1 line
2.40.0
Reviewed-by on v4 2/4
#3 lore raw

Re: [PATCH v4 2/4] arm64: dts: qcom: Make -cells decimal

Quoted 7 lines · Andrew Halaney

The property logically makes sense in decimal, and is the standard used elsewhere.

---

Quoted 7 lines

Changes since v3:
* Treat all of arm64/qcom at once (Krzysztof)
* Dropped Konrad's RB tag since the scope expanded
Changes since v2:
* Collect tags
Changes since v1:
* New patch (Konrad)

Best regards,
Krzysztof

#4 lore raw

PATCH v4 3/4 arm64: dts: qcom: sa8155p-adp: Remove unneeded rgmii_phy information

In reply to Andrew Halaney

Using interrupts-extended already indicates what the interrupt-parent is, so drop the explicit interrupt-parent.

The comment about this being the phy-intr is not helpful either, since this is the only interrupt in the phy node.

---

Changes since v3:
* None
Changes since v2:
* Collect tags
Changes since v1:
* New patch (Konrad)

 arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sa8155p-adp.dts +1 -2
index ac52a8dfeba1..b65e0203d783 100644
@@ -361,8 +361,7 @@ rgmii_phy: phy@7 {
 			compatible = "ethernet-phy-ieee802.3-c22";
 			reg = <0x7>;
 
-			interrupt-parent = <&tlmm>;
-			interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>; /* phy intr */
+			interrupts-extended = <&tlmm 124 IRQ_TYPE_EDGE_FALLING>;
 			device_type = "ethernet-phy";
 		};
 	};
Signature · 1 line
2.40.0
#5 lore raw

PATCH v4 4/4 arm64: dts: qcom: sa8155p-adp: Move mtl nodes into ethernet node

In reply to Andrew Halaney

The mtl nodes aren't evaluated unless they're under the node with the compatible. Move them so they're now evaluated in case future patchsets modify them incorrectly.

An example of this can be seen in the link.

---

Changes since v3:
* None
Changes since v2:
* New patch (me, after realizing this on another platform)

 arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 46 ++++++++++++------------
 1 file changed, 23 insertions(+), 23 deletions(-)
arch/arm64/boot/dts/qcom/sa8155p-adp.dts +23 -23
index b65e0203d783..02d04ce877c9 100644
@@ -47,29 +47,6 @@ vreg_s4a_1p8: smps4 {
 
 		vin-supply = <&vreg_3p3>;
 	};
-
-	mtl_rx_setup: rx-queues-config {
-		snps,rx-queues-to-use = <1>;
-		snps,rx-sched-sp;
-
-		queue0 {
-			snps,dcb-algorithm;
-			snps,map-to-dma-channel = <0x0>;
-			snps,route-up;
-			snps,priority = <0x1>;
-		};
-	};
-
-	mtl_tx_setup: tx-queues-config {
-		snps,tx-queues-to-use = <1>;
-		snps,tx-sched-wrr;
-
-		queue0 {
-			snps,weight = <0x10>;
-			snps,dcb-algorithm;
-			snps,priority = <0x0>;
-		};
-	};
 };
 
 &apps_rsc {
@@ -365,6 +342,29 @@ rgmii_phy: phy@7 {
 			device_type = "ethernet-phy";
 		};
 	};
+
+	mtl_rx_setup: rx-queues-config {
+		snps,rx-queues-to-use = <1>;
+		snps,rx-sched-sp;
+
+		queue0 {
+			snps,dcb-algorithm;
+			snps,map-to-dma-channel = <0x0>;
+			snps,route-up;
+			snps,priority = <0x1>;
+		};
+	};
+
+	mtl_tx_setup: tx-queues-config {
+		snps,tx-queues-to-use = <1>;
+		snps,tx-sched-wrr;
+
+		queue0 {
+			snps,weight = <0x10>;
+			snps,dcb-algorithm;
+			snps,priority = <0x0>;
+		};
+	};
 };
 
 &qupv3_id_1 {
Signature · 1 line
2.40.0
#7 lore raw
In reply to Andrew Halaney

Hey Bjorn,

I think this one is ready to be picked up. Just a gentle reminder, I almost forgot about it until I cleaned my inbox this morning :)

Thanks,
Andrew

Quoted 27 lines · Andrew Halaney

This series cleans up some devicetree conventions in sa8155p-adp based on feedback from other platforms.

The hope is that by getting it right here, future contributors won't repeat the same mistakes as I did!

v3: https://lore.kernel.org/linux-arm-msm/[email protected]/

Thanks,
Andrew

Andrew Halaney (4):
arm64: dts: qcom: sa8155p-adp: Make compatible the first property
arm64: dts: qcom: Make -cells decimal
arm64: dts: qcom: sa8155p-adp: Remove unneeded rgmii_phy information
arm64: dts: qcom: sa8155p-adp: Move mtl nodes into ethernet node

 arch/arm64/boot/dts/qcom/ipq6018.dtsi        |  2 +-
 arch/arm64/boot/dts/qcom/ipq8074.dtsi        | 14 ++---
 arch/arm64/boot/dts/qcom/msm8953.dtsi        |  4 +-
 arch/arm64/boot/dts/qcom/qcs404-evb-4000.dts |  4 +-
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts     | 56 ++++++++++----------
 5 files changed, 39 insertions(+), 41 deletions(-)
Signature · 1 line
2.40.0
maintainer Applied
#8 lore raw

Re: (subset) [PATCH v4 v0/4] sa8155p-adp devicetree ethernet cleanup

In reply to Andrew Halaney
Quoted 9 lines · Andrew Halaney

This series cleans up some devicetree conventions in sa8155p-adp based on feedback from other platforms.

The hope is that by getting it right here, future contributors won't repeat the same mistakes as I did!

v3: https://lore.kernel.org/linux-arm-msm/[email protected]/

[...]

Applied, thanks!

[1/4] arm64: dts: qcom: sa8155p-adp: Make compatible the first property

      commit: eee7369de0c3cca7aacab3874663d460fb7a5b06
[2/4] arm64: dts: qcom: Make -cells decimal
      commit: 674631c35f8670017d3bbd51a5b52f8b953f6816
[3/4] arm64: dts: qcom: sa8155p-adp: Remove unneeded rgmii_phy information
      commit: 0ff4f6a380214fcf85a5b5ad64ff481d9bd1dfc6
[4/4] arm64: dts: qcom: sa8155p-adp: Move mtl nodes into ethernet node
      commit: 93fe463652504bba298a68b56334729cdf92c0c3

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>