f92c28973810a56a87f256e0ab171b9c0575ea6e
[openwrt/openwrt.git] / target / linux / ipq40xx / files / arch / arm / boot / dts / qcom-ipq4019-wifi.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2016, 2018 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2016 Google, Inc
5 */
6
7 #include "qcom-ipq4019.dtsi"
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/leds/common.h>
11
12 / {
13 model = "Google WiFi (Gale)";
14 compatible = "google,wifi", "google,gale-v2", "qcom,ipq4019";
15
16 aliases {
17 label-mac-device = &gmac0;
18 led-boot = &led0_blue;
19 led-failsafe = &led0_red;
20 led-running = &led0_blue;
21 led-upgrade = &led0_red;
22 };
23
24 chosen {
25 /*
26 * rootwait: in case we're booting from slow/async USB storage.
27 */
28 bootargs-append = " rootwait";
29 stdout-path = &blsp1_uart1;
30 };
31
32 memory {
33 device_type = "memory";
34 reg = <0x80000000 0x20000000>; /* 512MB */
35 };
36
37 soc {
38 edma@c080000 {
39 /*
40 * Factory bootloader (depthcharge) will fail to boot
41 * if this exact path (soc/edma@c080000/gmac0) doesn't
42 * exist.
43 */
44 gmac0: gmac0 {
45 };
46
47 /*
48 * Factory bootloader (depthcharge) will fail to boot
49 * if this exact path (soc/edma@c080000/gmac1) doesn't
50 * exist.
51 */
52 gmac1 {
53 };
54 };
55 };
56
57 keys {
58 compatible = "gpio-keys";
59 pinctrl-0 = <&fw_pinmux>;
60 pinctrl-names = "default";
61
62 reset {
63 label = "reset";
64 gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_RESTART>;
66 };
67 };
68 };
69
70 &tlmm {
71 fw_pinmux: fw_pinmux {
72 wp {
73 pins = "gpio53";
74 output-low;
75 };
76 recovery {
77 pins = "gpio57";
78 function = "gpio";
79 bias-none;
80 };
81 developer {
82 pins = "gpio41";
83 bias-none;
84 };
85 };
86
87 reset802_15_4 {
88 pins = "gpio60";
89 };
90
91 led_reset {
92 pins = "gpio22";
93 output-high;
94 };
95
96 sys_reset {
97 pins = "gpio19";
98 output-high;
99 };
100
101 rx_active {
102 pins = "gpio43";
103 bias-pull,down;
104 };
105
106 spi_0_pins: spi_0_pinmux {
107 pinmux {
108 function = "blsp_spi0";
109 pins = "gpio13", "gpio14","gpio15";
110 };
111 pinmux_cs {
112 function = "gpio";
113 pins = "gpio12";
114 };
115 pinconf {
116 pins = "gpio13", "gpio14","gpio15";
117 drive-strength = <12>;
118 bias-disable;
119 };
120 pinconf_cs {
121 pins = "gpio12";
122 drive-strength = <2>;
123 bias-disable;
124 output-high;
125 };
126 };
127
128 spi_1_pins: spi_1_pinmux {
129 pinmux {
130 function = "blsp_spi1";
131 pins = "gpio44", "gpio46","gpio47";
132 };
133 pinmux_cs {
134 function = "gpio";
135 pins = "gpio45";
136 };
137 pinconf {
138 pins = "gpio44", "gpio46","gpio47";
139 drive-strength = <12>;
140 bias-disable;
141 };
142 pinconf_cs {
143 pins = "gpio45";
144 drive-strength = <2>;
145 bias-disable;
146 output-high;
147 };
148 };
149
150 serial_0_pins: serial0_pinmux {
151 mux {
152 pins = "gpio16", "gpio17";
153 function = "blsp_uart0";
154 bias-disable;
155 };
156 };
157
158 serial_1_pins: serial1_pinmux {
159 mux {
160 pins = "gpio8", "gpio9", "gpio10", "gpio11";
161 function = "blsp_uart1";
162 bias-disable;
163 };
164 };
165
166 i2c_0_pins: i2c_0_pinmux {
167 mux {
168 pins = "gpio20", "gpio21";
169 function = "blsp_i2c0";
170 drive-open-drain;
171 };
172 };
173
174 i2c_1_pins: i2c_1_pinmux {
175 mux {
176 pins = "gpio34", "gpio35";
177 function = "blsp_i2c1";
178 drive-open-drain;
179 };
180 };
181
182 sd_0_pins: sd_0_pinmux {
183 sd0 {
184 pins = "gpio23", "gpio24", "gpio25", "gpio26", "gpio29", "gpio30", "gpio31", "gpio32";
185 function = "sdio";
186 drive-strength = <10>;
187 bias-pull-up;
188 pull-up-res = <0>;
189 };
190 sdclk {
191 pins = "gpio27";
192 function = "sdio";
193 drive-strength = <2>;
194 bias-pull-up;
195 pull-up-res = <0>;
196 };
197 sdcmd {
198 pins = "gpio28";
199 function = "sdio";
200 drive-strength = <10>;
201 bias-pull-up;
202 pull-up-res = <0>;
203 };
204 };
205
206 mdio_pins: mdio_pinmux {
207 mux_1 {
208 pins = "gpio6";
209 function = "mdio";
210 bias-disable;
211 };
212 mux_2 {
213 pins = "gpio7";
214 function = "mdc";
215 bias-disable;
216 };
217 mux_3 {
218 pins = "gpio40";
219 function = "gpio";
220 bias-disable;
221 output-high;
222 };
223 };
224
225 wifi1_1_pins: wifi2_pinmux {
226 mux {
227 pins = "gpio58";
228 output-low;
229 };
230 };
231 };
232
233 &blsp_dma {
234 status = "okay";
235 };
236
237 &blsp1_i2c3 {
238 pinctrl-0 = <&i2c_0_pins>;
239 pinctrl-names = "default";
240 status = "okay";
241
242 tpm@20 {
243 compatible = "infineon,slb9645tt";
244 reg = <0x20>;
245 powered-while-suspended;
246 };
247 };
248
249 &blsp1_i2c4 {
250 pinctrl-0 = <&i2c_1_pins>;
251 pinctrl-names = "default";
252 status = "okay";
253
254 led-controller@32 {
255 #address-cells = <1>;
256 #size-cells = <0>;
257 compatible = "national,lp5523";
258 reg = <0x32>;
259 clock-mode = /bits/ 8 <1>;
260
261 #if 1
262 led0_red: led@0 {
263 reg = <0>;
264 chan-name = "LED0_Red";
265 led-cur = /bits/ 8 <0x64>;
266 max-cur = /bits/ 8 <0x78>;
267 color = <LED_COLOR_ID_RED>;
268 function = LED_FUNCTION_FAULT;
269 };
270
271 led@1 {
272 reg = <1>;
273 chan-name = "LED0_Green";
274 led-cur = /bits/ 8 <0x64>;
275 max-cur = /bits/ 8 <0x78>;
276 color = <LED_COLOR_ID_GREEN>;
277 };
278
279 led0_blue: led@2 {
280 reg = <2>;
281 chan-name = "LED0_Blue";
282 led-cur = /bits/ 8 <0x64>;
283 max-cur = /bits/ 8 <0x78>;
284 color = <LED_COLOR_ID_BLUE>;
285 function = LED_FUNCTION_POWER;
286 };
287 #else
288 /*
289 * openwrt isn't ready to handle multi-intensity leds yet
290 * # echo 255 255 255 > /sys/class/leds/tricolor/multi_intensity
291 * # echo 255 > /sys/class/leds/tricolor/brightness
292 */
293 multi-led@2 {
294 function = LED_FUNCTION_POWER;
295 reg = <2>;
296 color = <LED_COLOR_ID_RGB>;
297 #address-cells = <1>;
298 #size-cells = <0>;
299
300 led@0 {
301 reg = <0>;
302 chan-name = "tricolor";
303 led-cur = /bits/ 8 <0x64>;
304 max-cur = /bits/ 8 <0x78>;
305 color = <LED_COLOR_ID_RED>;
306 };
307
308 led@1 {
309 reg = <1>;
310 chan-name = "tricolor";
311 led-cur = /bits/ 8 <0x64>;
312 max-cur = /bits/ 8 <0x78>;
313 color = <LED_COLOR_ID_GREEN>;
314 };
315
316 led@2 {
317 reg = <2>;
318 chan-name = "tricolor";
319 led-cur = /bits/ 8 <0x64>;
320 max-cur = /bits/ 8 <0x78>;
321 color = <LED_COLOR_ID_BLUE>;
322 };
323 };
324 #endif
325 };
326 };
327
328 &blsp1_spi1 {
329 pinctrl-0 = <&spi_0_pins>;
330 pinctrl-names = "default";
331 status = "okay";
332 cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
333
334 flash@0 {
335 compatible = "jedec,spi-nor";
336 reg = <0>;
337 spi-max-frequency = <24000000>;
338 };
339 };
340
341 &blsp1_spi2 {
342 pinctrl-0 = <&spi_1_pins>;
343 pinctrl-names = "default";
344 status = "okay";
345 cs-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
346
347 /*
348 * This "spidev" was included in the manufacturer device tree. I
349 * suspect it's the (unused; and removed from later HW spins) Zigbee
350 * radio -- SiliconLabs EM3581 Zigbee? There's no driver or binding for
351 * this at the moment.
352 */
353 spidev@0 {
354 compatible = "spidev";
355 reg = <0>;
356 spi-max-frequency = <24000000>;
357 };
358 };
359
360 &blsp1_uart1 {
361 pinctrl-0 = <&serial_0_pins>;
362 pinctrl-names = "default";
363 status = "okay";
364 };
365
366 &blsp1_uart2 {
367 pinctrl-0 = <&serial_1_pins>;
368 pinctrl-names = "default";
369 status = "okay";
370 };
371
372 &gmac {
373 status = "okay";
374 };
375
376 &mdio {
377 status = "okay";
378 pinctrl-0 = <&mdio_pins>;
379 pinctrl-names = "default";
380 };
381
382 &prng {
383 status = "okay";
384 };
385
386 &sdhci {
387 status = "okay";
388 pinctrl-0 = <&sd_0_pins>;
389 pinctrl-names = "default";
390 clock-frequency = <192000000>;
391 vqmmc-supply = <&vqmmc>;
392 non-removable;
393 };
394
395 &switch {
396 status = "okay";
397 };
398
399 &swport4 {
400 status = "okay";
401
402 label = "lan";
403 };
404
405 &swport5 {
406 status = "okay";
407 };
408
409 &usb2 {
410 status = "okay";
411 };
412
413 &usb2_hs_phy {
414 status = "okay";
415 };
416
417 &usb3 {
418 status = "okay";
419 };
420
421 &usb3_ss_phy {
422 status = "okay";
423 };
424
425 &usb3_hs_phy {
426 status = "okay";
427 };
428
429 &vqmmc {
430 status = "okay";
431 };
432
433 &watchdog {
434 status = "okay";
435 };
436
437 &wifi0 {
438 status = "okay";
439 qcom,ath10k-calibration-variant = "GO_GALE";
440 };
441
442 &wifi1 {
443 status = "okay";
444 pinctrl-0 = <&wifi1_1_pins>;
445 pinctrl-names = "default";
446 qcom,ath10k-calibration-variant = "GO_GALE";
447 };