ipq40xx: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ipq40xx / files / arch / arm / boot / dts / qcom-ipq4019-rtl30vw.dts
1 // SPDX-License-Identifier: ISC
2 // Copyright (c) 2015, The Linux Foundation. All rights reserved.
3 // Copyright (c) 2019, Cezary Jackiewicz <cezary@eko.one.pl>.
4 // Copyright (c) 2020, Pawel Dembicki <paweldembicki@gmail.com>.
5
6 #include "qcom-ipq4019.dtsi"
7 #include <dt-bindings/soc/qcom,tcsr.h>
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/leds/common.h>
11
12 / {
13 model = "Cell C RTL30VW";
14 compatible = "cellc,rtl30vw";
15
16 aliases {
17 led-boot = &led_power_blue;
18 led-failsafe = &led_power_red;
19 led-running = &led_power_blue;
20 led-upgrade = &led_power_red;
21 };
22
23 chosen {
24 bootargs-append = "ubi.mtd=ubifs root=/dev/ubiblock0_0 rootfstype=squashfs ro";
25 };
26
27 led_spi {
28 compatible = "spi-gpio";
29 #address-cells = <1>;
30 #size-cells = <0>;
31 num-chipselects = <1>;
32
33 mosi-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
34 cs-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
35 sck-gpios = <&tlmm 58 GPIO_ACTIVE_LOW>;
36
37 led_gpio: led_gpio@0 {
38 compatible = "fairchild,74hc595";
39 reg = <0>;
40 gpio-controller;
41 #gpio-cells = <2>;
42 registers-number = <2>;
43 spi-max-frequency = <1000000>;
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led_power_blue: power_blue {
51 gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>;
52 function = LED_FUNCTION_POWER;
53 color = <LED_COLOR_ID_BLUE>;
54 default-state = "on";
55 };
56
57 led_power_red: power_red {
58 gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>;
59 function = LED_FUNCTION_POWER;
60 color = <LED_COLOR_ID_RED>;
61 };
62
63 tp28 {
64 gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
65 label = "ext:tp28";
66 default-state = "keep";
67 };
68
69 tp27 {
70 gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>;
71 label = "ext:tp27";
72 default-state = "keep";
73 };
74
75 wlan2g {
76 gpios = <&led_gpio 8 GPIO_ACTIVE_HIGH>;
77 label = "blue:wlan2g";
78 linux,default-trigger = "phy0tpt";
79 };
80
81 wlan5g {
82 gpios = <&led_gpio 9 GPIO_ACTIVE_HIGH>;
83 label = "blue:wlan5g";
84 linux,default-trigger = "phy1tpt";
85 };
86
87 wps {
88 gpios = <&led_gpio 10 GPIO_ACTIVE_HIGH>;
89 function = LED_FUNCTION_WPS;
90 color = <LED_COLOR_ID_BLUE>;
91 };
92
93 voip {
94 gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>;
95 label = "blue:voip";
96 };
97
98 s1 {
99 gpios = <&led_gpio 12 GPIO_ACTIVE_HIGH>;
100 label = "blue:s1";
101 };
102
103 s2 {
104 gpios = <&led_gpio 13 GPIO_ACTIVE_HIGH>;
105 label = "blue:s2";
106 };
107
108 s3 {
109 gpios = <&led_gpio 14 GPIO_ACTIVE_HIGH>;
110 label = "blue:s3";
111 };
112
113 s4 {
114 gpios = <&led_gpio 15 GPIO_ACTIVE_HIGH>;
115 label = "blue:s4";
116 };
117
118 signal {
119 gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
120 label = "red:signal";
121 };
122 };
123
124 keys {
125 compatible = "gpio-keys";
126
127 wps {
128 label = "wps";
129 linux,code = <KEY_WPS_BUTTON>;
130 gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
131 };
132
133 reset {
134 label = "reset";
135 linux,code = <KEY_RESTART>;
136 gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
137 };
138 };
139
140 soc {
141 rng@22000 {
142 status = "okay";
143 };
144
145 mdio@90000 {
146 status = "okay";
147 };
148
149 tcsr@1949000 {
150 compatible = "qcom,tcsr";
151 reg = <0x1949000 0x100>;
152 qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
153 };
154
155 tcsr@194b000 {
156 /* select hostmode */
157 compatible = "qcom,tcsr";
158 reg = <0x194b000 0x100>;
159 qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
160 status = "okay";
161 };
162
163 ess_tcsr@1953000 {
164 compatible = "qcom,tcsr";
165 reg = <0x1953000 0x1000>;
166 qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
167 };
168
169 tcsr@1957000 {
170 compatible = "qcom,tcsr";
171 reg = <0x1957000 0x100>;
172 qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
173 };
174
175 usb2@60f8800 {
176 status = "okay";
177 };
178
179 usb3@8af8800 {
180 status = "okay";
181 };
182
183 crypto@8e3a000 {
184 status = "okay";
185 };
186
187 watchdog@b017000 {
188 status = "okay";
189 };
190 };
191 };
192
193 &blsp_dma {
194 status = "okay";
195 };
196
197 &blsp1_spi1 {
198 pinctrl-0 = <&spi_0_pins>;
199 pinctrl-names = "default";
200 status = "okay";
201 cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 59 GPIO_ACTIVE_HIGH>;
202
203 flash@0 {
204 /*"n25q128a11" is required for proper nand recognition in u-boot. */
205 compatible = "jedec,spi-nor", "n25q128a11";
206 #address-cells = <1>;
207 #size-cells = <1>;
208 reg = <0>;
209 spi-max-frequency = <24000000>;
210
211 partitions {
212 compatible = "fixed-partitions";
213 #address-cells = <1>;
214 #size-cells = <1>;
215
216 partition@0 {
217 label = "0:SBL1";
218 reg = <0x0 0x40000>;
219 read-only;
220 };
221
222 partition@40000 {
223 label = "0:MIBIB";
224 reg = <0x40000 0x20000>;
225 read-only;
226 };
227
228 partition@60000 {
229 label = "0:QSEE";
230 reg = <0x60000 0x60000>;
231 read-only;
232 };
233
234 partition@c0000 {
235 label = "0:CDT";
236 reg = <0xc0000 0x10000>;
237 read-only;
238 };
239
240 partition@d0000 {
241 label = "0:DDRPARAMS";
242 reg = <0xd0000 0x10000>;
243 read-only;
244 };
245
246 partition@e0000 {
247 label = "0:APPSBLENV";
248 reg = <0xe0000 0x10000>;
249 read-only;
250 };
251
252 partition@f0000 {
253 label = "0:APPSBL";
254 reg = <0xf0000 0x80000>;
255 read-only;
256 };
257
258 partition@170000 {
259 label = "0:ART";
260 reg = <0x170000 0x10000>;
261 read-only;
262 };
263
264 partition@180000 {
265 label = "0:BOOTCONFIG";
266 reg = <0x180000 0x10000>;
267 read-only;
268 };
269 };
270 };
271
272 flash@1 {
273 /*
274 * Factory U-boot looks in 0:BOOTCONFIG partition for active
275 * partitions settings and mangle partition config. So kernel
276 * /kernel_1 and rootfs/rootfs_1 pairs can be swaped.
277 * It isn't a problem but we never can be sure where OFW put
278 * factory images. "spinand,mt29f" value is required for proper
279 * nand recognition in u-boot.
280 */
281 compatible = "spi-nand","spinand,mt29f";
282 #address-cells = <1>;
283 #size-cells = <0>;
284 reg = <1>;
285 spi-max-frequency = <24000000>;
286
287 partitions {
288 compatible = "fixed-partitions";
289 #address-cells = <1>;
290 #size-cells = <1>;
291
292 partition@0 {
293 label = "kernel";
294 reg = <0x0 0x400000>;
295 };
296
297 partition@400000 {
298 label = "rootfs";
299 reg = <0x400000 0x2000000>;
300 };
301
302 partition@2400000 {
303 label = "kernel_1";
304 reg = <0x2400000 0x400000>;
305 };
306
307 partition@2800000 {
308 label = "rootfs_1";
309 reg = <0x2800000 0x2000000>;
310 };
311
312 partition@4800000 {
313 label = "ubifs";
314 reg = <0x4800000 0x3800000>;
315 };
316 };
317 };
318 };
319
320 &blsp1_uart1 {
321 pinctrl-0 = <&serial_pins>;
322 pinctrl-names = "default";
323 status = "okay";
324 };
325
326 &cryptobam {
327 status = "okay";
328 };
329
330 &tlmm {
331 serial_pins: serial_pinmux {
332 mux {
333 pins = "gpio60", "gpio61";
334 function = "blsp_uart0";
335 bias-disable;
336 };
337 };
338
339 spi_0_pins: spi_0_pinmux {
340 pinmux {
341 function = "blsp_spi0";
342 pins = "gpio55", "gpio56", "gpio57";
343 drive-strength = <12>;
344 bias-disable;
345 };
346
347 pinmux_cs {
348 function = "gpio";
349 pins = "gpio54", "gpio59";
350 drive-strength = <2>;
351 bias-disable;
352 output-high;
353 };
354 };
355 };
356
357 &usb2_hs_phy {
358 status = "okay";
359 };
360
361 &usb3_ss_phy {
362 status = "okay";
363 };
364
365 &usb3_hs_phy {
366 status = "okay";
367 };
368
369 &wifi0 {
370 status = "okay";
371 qcom,ath10k-calibration-variant = "cellc,rtl30vw";
372 };
373
374 &wifi1 {
375 status = "okay";
376 qcom,ath10k-calibration-variant = "cellc,rtl30vw";
377 };
378
379 &gmac {
380 status = "okay";
381 };
382
383 &switch {
384 status = "okay";
385 };
386
387 &swport3 {
388 status = "okay";
389
390 label = "lan1";
391 };
392
393 &swport4 {
394 status = "okay";
395
396 label = "lan2";
397 };