8f6f8a287a0cb773cd1039ac710222e4e738fc96
[openwrt/openwrt.git] / target / linux / ipq806x / patches-6.6 / 108-02-ARM-dts-qcom-add-MDIO-dedicated-controller-node-for-.patch
1 From 504188183408fac0f61b59f5ed8ea1773fe43669 Mon Sep 17 00:00:00 2001
2 From: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 15 Jun 2022 16:59:30 +0200
4 Subject: [PATCH 2/2] ARM: dts: qcom: add MDIO dedicated controller node for
5 ipq806x
6
7 Add MDIO dedicated controller attached to gmac0 and fix rb3011 dts to
8 correctly use the new tag.
9
10 Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
11 ---
12 arch/arm/boot/dts/qcom/qcom-ipq8064-rb3011.dts | 134 +++++++++++-----------
13 arch/arm/boot/dts/qcom/qcom-ipq8064.dtsi | 14 +++
14 2 files changed, 81 insertions(+), 67 deletions(-)
15
16 --- a/arch/arm/boot/dts/qcom/qcom-ipq8064-rb3011.dts
17 +++ b/arch/arm/boot/dts/qcom/qcom-ipq8064-rb3011.dts
18 @@ -25,131 +25,6 @@
19 device_type = "memory";
20 };
21
22 - mdio0: mdio-0 {
23 - status = "okay";
24 - compatible = "virtual,mdio-gpio";
25 - gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
26 - <&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
27 - #address-cells = <1>;
28 - #size-cells = <0>;
29 -
30 - pinctrl-0 = <&mdio0_pins>;
31 - pinctrl-names = "default";
32 -
33 - switch0: switch@10 {
34 - compatible = "qca,qca8337";
35 -
36 - dsa,member = <0 0>;
37 -
38 - pinctrl-0 = <&sw0_reset_pin>;
39 - pinctrl-names = "default";
40 -
41 - reset-gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
42 - reg = <0x10>;
43 -
44 - ports {
45 - #address-cells = <1>;
46 - #size-cells = <0>;
47 -
48 - switch0cpu: port@0 {
49 - reg = <0>;
50 - label = "cpu";
51 - ethernet = <&gmac0>;
52 - phy-mode = "rgmii-id";
53 - fixed-link {
54 - speed = <1000>;
55 - full-duplex;
56 - };
57 - };
58 -
59 - port@1 {
60 - reg = <1>;
61 - label = "sw1";
62 -
63 - leds {
64 - #address-cells = <1>;
65 - #size-cells = <0>;
66 -
67 - led@0 {
68 - reg = <0>;
69 - color = <LED_COLOR_ID_GREEN>;
70 - function = LED_FUNCTION_LAN;
71 - default-state = "keep";
72 - };
73 - };
74 - };
75 -
76 - port@2 {
77 - reg = <2>;
78 - label = "sw2";
79 -
80 - leds {
81 - #address-cells = <1>;
82 - #size-cells = <0>;
83 -
84 - led@0 {
85 - reg = <0>;
86 - color = <LED_COLOR_ID_GREEN>;
87 - function = LED_FUNCTION_LAN;
88 - default-state = "keep";
89 - };
90 - };
91 - };
92 -
93 - port@3 {
94 - reg = <3>;
95 - label = "sw3";
96 -
97 - leds {
98 - #address-cells = <1>;
99 - #size-cells = <0>;
100 -
101 - led@0 {
102 - reg = <0>;
103 - color = <LED_COLOR_ID_GREEN>;
104 - function = LED_FUNCTION_LAN;
105 - default-state = "keep";
106 - };
107 - };
108 - };
109 -
110 - port@4 {
111 - reg = <4>;
112 - label = "sw4";
113 -
114 - leds {
115 - #address-cells = <1>;
116 - #size-cells = <0>;
117 -
118 - led@0 {
119 - reg = <0>;
120 - color = <LED_COLOR_ID_GREEN>;
121 - function = LED_FUNCTION_LAN;
122 - default-state = "keep";
123 - };
124 - };
125 - };
126 -
127 - port@5 {
128 - reg = <5>;
129 - label = "sw5";
130 -
131 - leds {
132 - #address-cells = <1>;
133 - #size-cells = <0>;
134 -
135 - led@0 {
136 - reg = <0>;
137 - color = <LED_COLOR_ID_GREEN>;
138 - function = LED_FUNCTION_LAN;
139 - default-state = "keep";
140 - };
141 - };
142 - };
143 - };
144 - };
145 - };
146 -
147 mdio1: mdio-1 {
148 status = "okay";
149 compatible = "virtual,mdio-gpio";
150 @@ -222,6 +155,131 @@
151 status = "okay";
152 };
153
154 +&mdio0 {
155 + status = "okay";
156 + compatible = "virtual,mdio-gpio";
157 + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
158 + <&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
159 + #address-cells = <1>;
160 + #size-cells = <0>;
161 +
162 + pinctrl-0 = <&mdio0_pins>;
163 + pinctrl-names = "default";
164 +
165 + switch0: switch@10 {
166 + compatible = "qca,qca8337";
167 +
168 + dsa,member = <0 0>;
169 +
170 + pinctrl-0 = <&sw0_reset_pin>;
171 + pinctrl-names = "default";
172 +
173 + reset-gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
174 + reg = <0x10>;
175 +
176 + ports {
177 + #address-cells = <1>;
178 + #size-cells = <0>;
179 +
180 + switch0cpu: port@0 {
181 + reg = <0>;
182 + label = "cpu";
183 + ethernet = <&gmac0>;
184 + phy-mode = "rgmii-id";
185 + fixed-link {
186 + speed = <1000>;
187 + full-duplex;
188 + };
189 + };
190 +
191 + port@1 {
192 + reg = <1>;
193 + label = "sw1";
194 +
195 + leds {
196 + #address-cells = <1>;
197 + #size-cells = <0>;
198 +
199 + led@0 {
200 + reg = <0>;
201 + color = <LED_COLOR_ID_GREEN>;
202 + function = LED_FUNCTION_LAN;
203 + default-state = "keep";
204 + };
205 + };
206 + };
207 +
208 + port@2 {
209 + reg = <2>;
210 + label = "sw2";
211 +
212 + leds {
213 + #address-cells = <1>;
214 + #size-cells = <0>;
215 +
216 + led@0 {
217 + reg = <0>;
218 + color = <LED_COLOR_ID_GREEN>;
219 + function = LED_FUNCTION_LAN;
220 + default-state = "keep";
221 + };
222 + };
223 + };
224 +
225 + port@3 {
226 + reg = <3>;
227 + label = "sw3";
228 +
229 + leds {
230 + #address-cells = <1>;
231 + #size-cells = <0>;
232 +
233 + led@0 {
234 + reg = <0>;
235 + color = <LED_COLOR_ID_GREEN>;
236 + function = LED_FUNCTION_LAN;
237 + default-state = "keep";
238 + };
239 + };
240 + };
241 +
242 + port@4 {
243 + reg = <4>;
244 + label = "sw4";
245 +
246 + leds {
247 + #address-cells = <1>;
248 + #size-cells = <0>;
249 +
250 + led@0 {
251 + reg = <0>;
252 + color = <LED_COLOR_ID_GREEN>;
253 + function = LED_FUNCTION_LAN;
254 + default-state = "keep";
255 + };
256 + };
257 + };
258 +
259 + port@5 {
260 + reg = <5>;
261 + label = "sw5";
262 +
263 + leds {
264 + #address-cells = <1>;
265 + #size-cells = <0>;
266 +
267 + led@0 {
268 + reg = <0>;
269 + color = <LED_COLOR_ID_GREEN>;
270 + function = LED_FUNCTION_LAN;
271 + default-state = "keep";
272 + };
273 + };
274 + };
275 + };
276 + };
277 +};
278 +
279 &gmac0 {
280 status = "okay";
281
282 --- a/arch/arm/boot/dts/qcom/qcom-ipq8064.dtsi
283 +++ b/arch/arm/boot/dts/qcom/qcom-ipq8064.dtsi
284 @@ -476,6 +476,20 @@
285 status = "disabled";
286 };
287
288 + mdio0: mdio@37000000 {
289 + #address-cells = <1>;
290 + #size-cells = <0>;
291 +
292 + compatible = "qcom,ipq8064-mdio", "syscon";
293 + reg = <0x37000000 0x200000>;
294 + resets = <&gcc GMAC_CORE1_RESET>;
295 + reset-names = "stmmaceth";
296 + clocks = <&gcc GMAC_CORE1_CLK>;
297 + clock-names = "stmmaceth";
298 +
299 + status = "disabled";
300 + };
301 +
302 gmac0: ethernet@37000000 {
303 device_type = "network";
304 compatible = "qcom,ipq806x-gmac", "snps,dwmac";