qualcommax: ipq807x: fix LEDs on Buffalo WXR-5950AX12
[openwrt/staging/stintel.git] / target / linux / qualcommax / files / arch / arm64 / boot / dts / qcom / ipq8074-wxr-5950ax12.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4
5 #include "ipq8074.dtsi"
6 #include "ipq8074-hk-cpu.dtsi"
7 #include "ipq8074-ess.dtsi"
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/leds/common.h>
10 #include <dt-bindings/input/input.h>
11
12 / {
13 model = "Buffalo WXR-5950AX12";
14 compatible = "buffalo,wxr-5950ax12", "qcom,ipq8074";
15
16 aliases {
17 serial0 = &blsp1_uart5;
18 led-boot = &led_power_white;
19 led-failsafe = &led_power_red;
20 led-running = &led_power_white;
21 led-upgrade = &led_power_white;
22 label-mac-device = &dp5_syn;
23 };
24
25 chosen {
26 stdout-path = "serial0:115200n8";
27 bootargs-append = " ubi.mtd=user_property root=/dev/ubiblock1_0";
28 };
29
30 leds {
31 compatible = "gpio-leds";
32
33 led-0 {
34 gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
35 color = <LED_COLOR_ID_WHITE>;
36 function = "router";
37 };
38
39 led-1 {
40 gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
41 color = <LED_COLOR_ID_RED>;
42 function = "router";
43 };
44
45 led_power_red: led-2 {
46 gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
47 color = <LED_COLOR_ID_RED>;
48 function = LED_FUNCTION_POWER;
49 };
50
51 led_power_white: led-3 {
52 gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
53 color = <LED_COLOR_ID_WHITE>;
54 function = LED_FUNCTION_POWER;
55 };
56
57 led-4 {
58 gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
59 color = <LED_COLOR_ID_WHITE>;
60 function = "internet";
61 };
62
63 led-5 {
64 gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
65 color = <LED_COLOR_ID_RED>;
66 function = "internet";
67 };
68
69 led-6 {
70 gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;
71 color = <LED_COLOR_ID_RED>;
72 function = LED_FUNCTION_WLAN;
73 };
74
75 led-7 {
76 gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
77 color = <LED_COLOR_ID_WHITE>;
78 function = LED_FUNCTION_WLAN;
79 };
80 };
81
82 keys {
83 compatible = "gpio-keys";
84
85 /*
86 * mode: 3x position switch
87 *
88 * - ROUTER
89 * - AP
90 * - WB (Wireless Bridge)
91 */
92 ap {
93 label = "mode-ap";
94 gpios = <&tlmm 29 GPIO_ACTIVE_LOW>;
95 linux,code = <BTN_0>;
96 };
97
98 bridge {
99 label = "mode-wb";
100 gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
101 linux,code = <BTN_1>;
102 };
103
104 /*
105 * op: 2x position switch
106 *
107 * - AUTO
108 * - MANUAL (select Router/AP/WB manually)
109 */
110 manual {
111 label = "op-manual";
112 gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
113 linux,code = <BTN_2>;
114 };
115
116 wps {
117 label = "wps";
118 gpios = <&tlmm 51 GPIO_ACTIVE_LOW>;
119 linux,code = <KEY_WPS_BUTTON>;
120 };
121
122 reset {
123 label = "reset";
124 gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
125 linux,code = <KEY_RESTART>;
126 };
127 };
128
129 reg_usb_vbus: regulator-5v-vbus {
130 compatible = "regulator-fixed";
131 regulator-name = "vbus";
132 regulator-min-microvolt = <5000000>;
133 regulator-max-microvolt = <5000000>;
134 gpio = <&tlmm 64 GPIO_ACTIVE_HIGH>;
135 enable-active-high;
136 regulator-always-on;
137 };
138 };
139
140 &tlmm {
141 mdio_pins: mdio-pins {
142 mdc {
143 pins = "gpio68";
144 function = "mdc";
145 drive-strength = <8>;
146 bias-pull-up;
147 };
148
149 mdio {
150 pins = "gpio69";
151 function = "mdio";
152 drive-strength = <8>;
153 bias-pull-up;
154 };
155 };
156 };
157
158 &blsp1_uart5 {
159 status = "okay";
160 };
161
162 &prng {
163 status = "okay";
164 };
165
166 &cryptobam {
167 status = "okay";
168 };
169
170 &crypto {
171 status = "okay";
172 };
173
174 &qpic_bam {
175 status = "okay";
176 };
177
178 &qpic_nand {
179 status = "okay";
180
181 nand@0 {
182 reg = <0>;
183 nand-ecc-strength = <4>;
184 nand-ecc-step-size = <512>;
185 nand-bus-width = <8>;
186
187 partitions {
188 compatible = "qcom,smem-part";
189
190 partition-0-appsblenv {
191 compatible = "fixed-partitions";
192 label = "0:appsblenv";
193 read-only;
194 #address-cells = <1>;
195 #size-cells = <1>;
196
197 partition@0 {
198 compatible = "u-boot,env";
199 label = "env-data";
200 reg = <0x0 0x40000>;
201
202 macaddr_appsblenv_ethaddr: ethaddr {
203 };
204 };
205 };
206 };
207 };
208 };
209
210 &mdio {
211 status = "okay";
212 pinctrl-0 = <&mdio_pins>;
213 pinctrl-names = "default";
214 /*
215 * RESET pins of phy chips
216 *
217 * WXR-5950AX12 has 2x RESET pins for QCA8075 and AQR113C.
218 * The pin of QCA8075 is for the chip and not phys in the chip, the
219 * pin of AQR113C is for 2x chips. So both pins are not appropriate
220 * to declare them as reset-gpios in phy nodes.
221 * Multiple entries in reset-gpios of mdio may not be supported, but
222 * leave the following as-is to show that the those reset pin exists.
223 */
224 reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>, /* QCA8075 RESET */
225 <&tlmm 63 GPIO_ACTIVE_LOW>; /* AQR113C RESET (2x) */
226
227 aqr113c_1: ethernet-phy@0 {
228 compatible = "ethernet-phy-ieee802.3-c45";
229 reg = <0x0>;
230 };
231
232 aqr113c_2: ethernet-phy@8 {
233 compatible = "ethernet-phy-ieee802.3-c45";
234 reg = <0x8>;
235 };
236
237 ethernet-phy-package@17 {
238 #address-cells = <1>;
239 #size-cells = <0>;
240 compatible = "qcom,qca8075-package";
241 reg = <0x18>;
242
243 qcom,package-mode = "qsgmii";
244
245 qca8075_1: ethernet-phy@19 {
246 compatible = "ethernet-phy-ieee802.3-c22";
247 reg = <0x19>;
248 };
249
250 qca8075_2: ethernet-phy@1a {
251 compatible = "ethernet-phy-ieee802.3-c22";
252 reg = <0x1a>;
253 };
254
255 qca8075_3: ethernet-phy@1b {
256 compatible = "ethernet-phy-ieee802.3-c22";
257 reg = <0x1b>;
258 };
259 };
260 };
261
262 &switch {
263 status = "okay";
264
265 switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>;
266 switch_wan_bmp = <ESS_PORT5>;
267 switch_mac_mode = <MAC_MODE_QSGMII>;
268 switch_mac_mode1 = <MAC_MODE_USXGMII>;
269 switch_mac_mode2 = <MAC_MODE_USXGMII>;
270
271 qcom,port_phyinfo {
272 port@2 {
273 port_id = <2>;
274 phy_address = <0x19>;
275 };
276
277 port@3 {
278 port_id = <3>;
279 phy_address = <0x1a>;
280 };
281
282 port@4 {
283 port_id = <4>;
284 phy_address = <0x1b>;
285 };
286
287 port@5 {
288 port_id = <5>;
289 ethernet-phy-ieee802.3-c45;
290 phy_address = <0x0>;
291 };
292
293 port@6 {
294 port_id = <6>;
295 ethernet-phy-ieee802.3-c45;
296 phy_address = <0x8>;
297 };
298 };
299 };
300
301 &edma {
302 status = "okay";
303 };
304
305 &dp2 {
306 status = "okay";
307 phy-mode = "qsgmii";
308 phy-handle = <&qca8075_1>;
309 label = "lan4";
310 nvmem-cells = <&macaddr_appsblenv_ethaddr>;
311 nvmem-cell-names = "mac-address";
312 };
313
314 &dp3 {
315 status = "okay";
316 phy-mode = "qsgmii";
317 phy-handle = <&qca8075_2>;
318 label = "lan3";
319 nvmem-cells = <&macaddr_appsblenv_ethaddr>;
320 nvmem-cell-names = "mac-address";
321 };
322
323 &dp4 {
324 status = "okay";
325 phy-mode = "qsgmii";
326 phy-handle = <&qca8075_3>;
327 label = "lan2";
328 nvmem-cells = <&macaddr_appsblenv_ethaddr>;
329 nvmem-cell-names = "mac-address";
330 };
331
332 &dp5_syn {
333 status = "okay";
334 phy-mode = "usxgmii";
335 phy-handle = <&aqr113c_1>;
336 label = "wan";
337 nvmem-cells = <&macaddr_appsblenv_ethaddr>;
338 nvmem-cell-names = "mac-address";
339 };
340
341 &dp6_syn {
342 status = "okay";
343 phy-mode = "usxgmii";
344 phy-handle = <&aqr113c_2>;
345 label = "lan1";
346 nvmem-cells = <&macaddr_appsblenv_ethaddr>;
347 nvmem-cell-names = "mac-address";
348 };
349
350 &ssphy_0 {
351 status = "okay";
352 };
353
354 &qusb_phy_0 {
355 status = "okay";
356 };
357
358 &usb_0 {
359 status = "okay";
360
361 vbus-supply = <&reg_usb_vbus>;
362 };
363
364 &wifi {
365 status = "okay";
366
367 qcom,ath11k-calibration-variant = "Buffalo-WXR-5950AX12";
368 };