qualcommax: AW1000: add qca8081 PHY LED configuration
[openwrt/staging/jow.git] / target / linux / qualcommax / files / arch / arm64 / boot / dts / qcom / ipq8072-aw1000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /* Copyright (c) 2023, Chukun Pan <amadeus@jmu.edu.cn> */
3
4 /dts-v1/;
5
6 #include "ipq8074.dtsi"
7 #include "ipq8074-hk-cpu.dtsi"
8 #include "ipq8074-ess.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
12
13 / {
14 model = "Arcadyan AW1000";
15 compatible = "arcadyan,aw1000", "qcom,ipq8074";
16
17 aliases {
18 led-boot = &led_power;
19 led-failsafe = &led_power;
20 led-running = &led_power;
21 led-upgrade = &led_power;
22 serial0 = &blsp1_uart5;
23 /*
24 * Aliases as required by u-boot
25 * to patch MAC addresses
26 */
27 ethernet0 = &dp1;
28 ethernet1 = &dp2;
29 ethernet2 = &dp3;
30 ethernet3 = &dp4;
31 ethernet4 = &dp6_syn;
32 label-mac-device = &dp1;
33 };
34
35 chosen {
36 stdout-path = "serial0:115200n8";
37 bootargs-append = " root=/dev/ubiblock0_1";
38 };
39
40 gpio-export {
41 compatible = "gpio-export";
42
43 lte-pwrkey {
44 gpio-export,name = "lte_pwrkey";
45 gpio-export,output = <1>;
46 gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
47 };
48
49 lte-power {
50 gpio-export,name = "lte_power";
51 gpio-export,output = <1>;
52 gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
53 };
54
55 lte-reset {
56 gpio-export,name = "lte_reset";
57 gpio-export,output = <1>;
58 gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>;
59 };
60
61 usb-vbus {
62 gpio-export,name = "usb_vbus";
63 gpio-export,output = <0>;
64 gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
65 };
66 };
67
68 keys {
69 compatible = "gpio-keys";
70
71 wlan {
72 label = "wlan";
73 linux,code = <KEY_WLAN>;
74 gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
75 };
76
77 wps {
78 label = "wps";
79 linux,code = <KEY_WPS_BUTTON>;
80 gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
81 };
82
83 reset {
84 label = "reset";
85 linux,code = <KEY_RESTART>;
86 gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
87 };
88 };
89
90 led-spi {
91 compatible = "spi-gpio";
92 #address-cells = <1>;
93 #size-cells = <0>;
94
95 sck-gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>;
96 mosi-gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>;
97
98 led_gpio: led-gpio@0 {
99 compatible = "fairchild,74hc595";
100 reg = <0>;
101 gpio-controller;
102 #gpio-cells = <2>;
103 registers-number = <2>;
104 spi-max-frequency = <1000000>;
105 enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
106 };
107 };
108
109 leds {
110 compatible = "gpio-leds";
111
112 led_power: power {
113 function = LED_FUNCTION_POWER;
114 color = <LED_COLOR_ID_GREEN>;
115 gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>;
116 };
117
118 wifi {
119 label = "green:wifi";
120 gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>;
121 };
122
123 internet {
124 label = "green:internet";
125 gpios = <&led_gpio 2 GPIO_ACTIVE_HIGH>;
126 };
127
128 5g-red {
129 label = "red:5g";
130 gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>;
131 };
132
133 5g-green {
134 label = "green:5g";
135 gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>;
136 };
137
138 5g-blue {
139 label = "blue:5g";
140 gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
141 };
142
143 signal-red {
144 label = "red:signal";
145 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
146 };
147
148 signal-green {
149 label = "green:signal";
150 gpios = <&led_gpio 8 GPIO_ACTIVE_LOW>;
151 };
152
153 signal-blue {
154 label = "blue:signal";
155 gpios = <&led_gpio 9 GPIO_ACTIVE_LOW>;
156 };
157
158 phone {
159 label = "green:phone";
160 gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>;
161 };
162 };
163 };
164
165 &tlmm {
166 mdio_pins: mdio-pins {
167 mdc {
168 pins = "gpio68";
169 function = "mdc";
170 drive-strength = <8>;
171 bias-pull-up;
172 };
173
174 mdio {
175 pins = "gpio69";
176 function = "mdio";
177 drive-strength = <8>;
178 bias-pull-up;
179 };
180 };
181 };
182
183 &blsp1_uart5 {
184 status = "okay";
185 };
186
187 &cryptobam {
188 status = "okay";
189 };
190
191 &crypto {
192 status = "okay";
193 };
194
195 &prng {
196 status = "okay";
197 };
198
199 &qpic_bam {
200 status = "okay";
201 };
202
203 &qpic_nand {
204 status = "okay";
205
206 nand@0 {
207 reg = <0>;
208 nand-ecc-strength = <8>;
209 nand-ecc-step-size = <512>;
210 nand-bus-width = <8>;
211
212 partitions {
213 compatible = "qcom,smem-part";
214 };
215 };
216 };
217
218 &qusb_phy_0 {
219 status = "okay";
220 };
221
222 &qusb_phy_1 {
223 status = "okay";
224 };
225
226 &ssphy_0 {
227 status = "okay";
228 };
229
230 &ssphy_1 {
231 status = "okay";
232 };
233
234 &usb_0 {
235 status = "okay";
236 };
237
238 &usb_1 {
239 status = "okay";
240 };
241
242 &mdio {
243 status = "okay";
244
245 pinctrl-0 = <&mdio_pins>;
246 pinctrl-names = "default";
247 reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
248
249 ethernet-phy-package@0 {
250 compatible = "qcom,qca8075-package";
251 #address-cells = <1>;
252 #size-cells = <0>;
253 reg = <0>;
254
255 qcom,package-mode = "qsgmii";
256
257 qca8075_0: ethernet-phy@0 {
258 compatible = "ethernet-phy-ieee802.3-c22";
259 reg = <0>;
260 };
261
262 qca8075_1: ethernet-phy@1 {
263 compatible = "ethernet-phy-ieee802.3-c22";
264 reg = <1>;
265 };
266
267 qca8075_2: ethernet-phy@2 {
268 compatible = "ethernet-phy-ieee802.3-c22";
269 reg = <2>;
270 };
271
272 qca8075_3: ethernet-phy@3 {
273 compatible = "ethernet-phy-ieee802.3-c22";
274 reg = <3>;
275 };
276 };
277
278 qca8081: ethernet-phy@28 {
279 compatible = "ethernet-phy-id004d.d101";
280 reg = <28>;
281 reset-deassert-us = <10000>;
282 reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
283
284 leds {
285 #address-cells = <1>;
286 #size-cells = <0>;
287
288 led@2 {
289 reg = <2>;
290 active-low;
291 color = <LED_COLOR_ID_GREEN>;
292 function = LED_FUNCTION_WAN;
293 default-state = "keep";
294 };
295 };
296 };
297 };
298
299 &switch {
300 status = "okay";
301
302 switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
303 switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
304 switch_mac_mode = <MAC_MODE_QSGMII>; /* mac mode for uniphy instance0*/
305 switch_mac_mode2 = <MAC_MODE_SGMII_PLUS>; /* mac mode for uniphy instance2*/
306
307 qcom,port_phyinfo {
308 port@1 {
309 port_id = <1>;
310 phy_address = <0>;
311 };
312 port@2 {
313 port_id = <2>;
314 phy_address = <1>;
315 };
316 port@3 {
317 port_id = <3>;
318 phy_address = <2>;
319 };
320 port@4 {
321 port_id = <4>;
322 phy_address = <3>;
323 };
324 port@6 {
325 port_id = <6>;
326 phy_address = <28>;
327 port_mac_sel = "QGMAC_PORT";
328 };
329 };
330 };
331
332 &edma {
333 status = "okay";
334 };
335
336 &dp1 {
337 status = "okay";
338 phy-mode = "qsgmii";
339 phy-handle = <&qca8075_0>;
340 label = "lan1";
341 };
342
343 &dp2 {
344 status = "okay";
345 phy-mode = "qsgmii";
346 phy-handle = <&qca8075_1>;
347 label = "lan2";
348 };
349
350 &dp3 {
351 status = "okay";
352 phy-mode = "qsgmii";
353 phy-handle = <&qca8075_2>;
354 label = "lan3";
355 };
356
357 &dp4 {
358 status = "okay";
359 phy-mode = "qsgmii";
360 phy-handle = <&qca8075_3>;
361 label = "lan4";
362 };
363
364 &dp6_syn {
365 status = "okay";
366 phy-handle = <&qca8081>;
367 label = "wan";
368 };
369
370 &wifi {
371 status = "okay";
372
373 qcom,ath11k-calibration-variant = "Arcadyan-AW1000";
374 };