aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-5.15/108-02-ARM-dts-qcom-add-MDIO-dedicated-controller-node-for-.patch
blob: 4a57fc0330b18c048842c2b0d2bad7a5ce520c58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
From 504188183408fac0f61b59f5ed8ea1773fe43669 Mon Sep 17 00:00:00 2001
From: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Date: Wed, 15 Jun 2022 16:59:30 +0200
Subject: [PATCH 2/2] ARM: dts: qcom: add MDIO dedicated controller node for
 ipq806x

Add MDIO dedicated controller attached to gmac0 and fix rb3011 dts to
correctly use the new tag.

Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
---
 arch/arm/boot/dts/qcom-ipq8064-rb3011.dts | 134 +++++++++++-----------
 arch/arm/boot/dts/qcom-ipq8064.dtsi       |  14 +++
 2 files changed, 81 insertions(+), 67 deletions(-)

--- a/arch/arm/boot/dts/qcom-ipq8064-rb3011.dts
+++ b/arch/arm/boot/dts/qcom-ipq8064-rb3011.dts
@@ -24,73 +24,6 @@
 		device_type = "memory";
 	};
 
-	mdio0: mdio-0 {
-		status = "okay";
-		compatible = "virtual,mdio-gpio";
-		gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
-			<&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		pinctrl-0 = <&mdio0_pins>;
-		pinctrl-names = "default";
-
-		switch0: switch@10 {
-			compatible = "qca,qca8337";
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			dsa,member = <0 0>;
-
-			pinctrl-0 = <&sw0_reset_pin>;
-			pinctrl-names = "default";
-
-			reset-gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
-			reg = <0x10>;
-
-			ports {
-				#address-cells = <1>;
-				#size-cells = <0>;
-
-				switch0cpu: port@0 {
-					reg = <0>;
-					label = "cpu";
-					ethernet = <&gmac0>;
-					phy-mode = "rgmii-id";
-					fixed-link {
-						speed = <1000>;
-						full-duplex;
-					};
-				};
-
-				port@1 {
-					reg = <1>;
-					label = "sw1";
-				};
-
-				port@2 {
-					reg = <2>;
-					label = "sw2";
-				};
-
-				port@3 {
-					reg = <3>;
-					label = "sw3";
-				};
-
-				port@4 {
-					reg = <4>;
-					label = "sw4";
-				};
-
-				port@5 {
-					reg = <5>;
-					label = "sw5";
-				};
-			};
-		};
-	};
-
 	mdio1: mdio-1 {
 		status = "okay";
 		compatible = "virtual,mdio-gpio";
@@ -220,6 +153,73 @@
 	status = "okay";
 };
 
+&mdio0 {
+	status = "okay";
+	compatible = "virtual,mdio-gpio";
+	gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
+		<&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	pinctrl-0 = <&mdio0_pins>;
+	pinctrl-names = "default";
+
+	switch0: switch@10 {
+		compatible = "qca,qca8337";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		dsa,member = <0 0>;
+
+		pinctrl-0 = <&sw0_reset_pin>;
+		pinctrl-names = "default";
+
+		reset-gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
+		reg = <0x10>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			switch0cpu: port@0 {
+				reg = <0>;
+				label = "cpu";
+				ethernet = <&gmac0>;
+				phy-mode = "rgmii-id";
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				label = "sw1";
+			};
+
+			port@2 {
+				reg = <2>;
+				label = "sw2";
+			};
+
+			port@3 {
+				reg = <3>;
+				label = "sw3";
+			};
+
+			port@4 {
+				reg = <4>;
+				label = "sw4";
+			};
+
+			port@5 {
+				reg = <5>;
+				label = "sw5";
+			};
+		};
+	};
+};
+
 &gmac0 {
 	status = "okay";
 
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -1446,6 +1446,20 @@
 			};
 		};
 
+		mdio0: mdio@37000000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			compatible = "qcom,ipq8064-mdio", "syscon";
+			reg = <0x37000000 0x200000>;
+			resets = <&gcc GMAC_CORE1_RESET>;
+			reset-names = "stmmaceth";
+			clocks = <&gcc GMAC_CORE1_CLK>;
+			clock-names = "stmmaceth";
+
+			status = "disabled";
+		};
+
 		vsdcc_fixed: vsdcc-regulator {
 			compatible = "regulator-fixed";
 			regulator-name = "SDCC Power";