apm821xx: WNDR4700: utilize ath9k nvmem-cells
[openwrt/staging/mkresin.git] / target / linux / apm821xx / dts / netgear-wndr4700.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Device Tree Source for Netgear WNDR4700/WNDR4720 Series
4 *
5 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
6 */
7
8 /dts-v1/;
9
10 #include <dt-bindings/thermal/thermal.h>
11 #include <dt-bindings/leds/common.h>
12 #include "apm82181.dtsi"
13
14 / {
15 model = "Netgear WNDR4700/WNDR4720 Series";
16 compatible = "netgear,wndr4700", "apm,bluestone";
17
18 aliases {
19 serial0 = &UART0;
20 };
21
22 chosen {
23 stdout-path = "/plb/opb/serial@ef600300:115200n8";
24 };
25
26 thermal-zones {
27 cpu_thermal: cpu-thermal {
28 polling-delay-passive = <10000>; /* milliseconds */
29 polling-delay = <20000>; /* milliseconds */
30
31 thermal-sensors = <&temp0 1>;
32
33 /*
34 * REVISIT:
35 *
36 * Add the <&drive_temp>; sensor there and wire up
37 * the coefficients = <1 1>; property.
38 *
39 * Note: The kernel does not yet support more than
40 * one sensor (see of_thermal.c's function:
41 * thermal_of_build_thermal_zon()). Once this is
42 * implemented.
43 */
44
45 trips {
46 /*
47 * Once the thermal governers are a bit smarter
48 * and do hysteresis properly, we can disable
49 * the fan when the HDD and CPU has < 39 C.
50 */
51 cpu_alert0: board-alert0 {
52 temperature = <25000>;
53 hysteresis = <2000>;
54 type = "active";
55 };
56
57 cpu_alert1: cpu-alert1 {
58 temperature = <27000>; /* millicelsius */
59 hysteresis = <2000>; /* millicelsius */
60 type = "active";
61 };
62
63 cpu_alert2: cpu-alert2 {
64 temperature = <65000>; /* millicelsius */
65 hysteresis = <2000>; /* millicelsius */
66 type = "active";
67 };
68
69 cpu_alert3: cpu-alert3 {
70 temperature = <70000>; /* millicelsius */
71 hysteresis = <2000>; /* millicelsius */
72 type = "active";
73 };
74
75 cpu_alert4: cpu-alert4 {
76 temperature = <75000>; /* millicelsius */
77 hysteresis = <2000>; /* millicelsius */
78 type = "active";
79 };
80
81 cpu_alert5: cpu-alert5 {
82 temperature = <80000>; /* millicelsius */
83 hysteresis = <2000>; /* millicelsius */
84 type = "active";
85 };
86
87 cpu_alert6: cpu-alert6 {
88 temperature = <85000>; /* millicelsius */
89 hysteresis = <2000>; /* millicelsius */
90 type = "active";
91 };
92
93 cpu_crit: cpu-crit {
94 temperature = <90000>; /* millicelsius */
95 hysteresis = <2000>; /* millicelsius */
96 type = "critical";
97 };
98 };
99
100 cooling-maps {
101 map0 {
102 trip = <&cpu_alert0>;
103 cooling-device = <&fan0 THERMAL_NO_LIMIT 0>;
104 };
105
106 map1 {
107 trip = <&cpu_alert1>;
108 cooling-device = <&fan0 1 76>;
109 };
110
111 map2 {
112 trip = <&cpu_alert2>;
113 cooling-device = <&fan0 77 101>;
114 };
115
116 map3 {
117 trip = <&cpu_alert3>;
118 cooling-device = <&fan0 102 147>;
119 };
120
121 map4 {
122 trip = <&cpu_alert4>;
123 cooling-device = <&fan0 148 207>;
124 };
125
126 map5 {
127 trip = <&cpu_alert5>;
128 cooling-device = <&fan0 208 231>;
129 };
130
131 map6 {
132 trip = <&cpu_alert6>;
133 cooling-device =<&fan0 232 THERMAL_NO_LIMIT>;
134 };
135 };
136 };
137 };
138 };
139
140 &CRYPTO {
141 status = "okay";
142 };
143
144 &PKA {
145 status = "okay";
146 };
147
148 &TRNG {
149 status = "okay";
150 };
151
152 &SATA1 {
153 status = "okay";
154
155 /*
156 * This drive may have a temperature sensor with a
157 * thermal zone we can use for thermal control of the
158 * chassis temperature using the fan.
159 */
160
161 drive_temp: sata-port@0 {
162 reg = <0>;
163 #thermal-sensor-cells = <0>;
164 };
165 };
166
167 &USBOTG0 {
168 status = "okay";
169 dr_mode = "host";
170 };
171
172 &ndfc {
173 status = "okay";
174 /* 128 MiB Nand Flash */
175 nand {
176 nand-is-boot-medium;
177
178 partitions {
179 compatible = "fixed-partitions";
180 #address-cells = <1>;
181 #size-cells = <1>;
182
183 partition@0 {
184 label = "uboot";
185 reg = <0x00000000 0x00180000>;
186 read-only;
187 };
188
189 partition@180000 {
190 label = "kernel";
191 reg = <0x00180000 0x00380000>;
192 /*
193 * device-tree is @ 0x00180000 - 0x001fffff
194 * kernel starts from 0x200000.
195 * this is coded into netgear's u-boot.
196 *
197 * this partition will also contain a
198 * fake/empty rootfs at the end to fool
199 * Netgear's uboot rootfs integrety checks.
200 */
201 };
202
203 partition@500000 {
204 label = "ubi";
205 reg = <0x00500000 0x014e0000>;
206 };
207
208
209 /*
210 * Netgear's u-boot in the fw_recovery mode (can be
211 * triggered by holding the reset button, or if
212 * "bootm" fails) will not flash past this point
213 * (= 0x19E0000).
214 */
215
216 partition@19e0000 {
217 label = "config";
218 reg = <0x019e0000 0x00080000>;
219 read-only;
220 };
221
222 partition@1a60000 {
223 label = "pot";
224 reg = <0x01a60000 0x00080000>;
225 read-only;
226 };
227
228 partition@1ae0000 {
229 label = "traffic_meter";
230 reg = <0x01ae0000 0x00300000>;
231 read-only;
232 };
233
234 partition@1de0000 {
235 label = "language";
236 reg = <0x01de0000 0x001c0000>;
237 read-only;
238 };
239
240 partition@1fa0000 {
241 label = "ecos";
242 reg = <0x01fa0000 0x06020000>;
243 read-only;
244 };
245
246 partition@7fc0000 {
247 label = "wifi_data";
248 reg = <0x07fc0000 0x00040000>;
249 read-only;
250
251 compatible = "nvmem-cells";
252 #address-cells = <1>;
253 #size-cells = <1>;
254
255 macaddr_wifi_0: macaddr@0 {
256 reg = <0x0 0x6>;
257 };
258 macaddr_wifi_c: macaddr@c {
259 reg = <0xc 0x6>;
260 };
261
262 calibration_wifi_1000: calibration@1000 {
263 reg = <0x1000 0x440>;
264 };
265
266 calibration_wifi_5000: calibration@5000 {
267 reg = <0x5000 0x440>;
268 };
269 };
270 };
271 };
272 };
273
274 &UART0 {
275 status = "okay";
276 };
277
278 &GPIO0 {
279 status = "okay";
280 };
281
282 &IIC0 {
283 status = "okay";
284
285 fan0: fan@1b {
286 compatible = "microchip,tc654";
287 reg = <0x1b>;
288 #cooling-cells = <2>; /* min followed by max */
289
290 gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; /* fan status */
291 alarm-gpios = <&GPIO0 5 GPIO_ACTIVE_LOW>; /* fault */
292 interrupt-parent = <&UIC3>;
293 interrupts = <0x16 IRQ_TYPE_EDGE_FALLING>; /* fault */
294 };
295
296 temp0: temp@4d {
297 compatible = "gmt,g781";
298 reg = <0x4d>;
299 #thermal-sensor-cells = <1>;
300
301 /*
302 * The LM90 has two sensors:
303 * temp0 -> internal to LM90
304 * temp1 -> external NTC near CPU
305 */
306 };
307 };
308
309
310 &EMAC0 {
311 status = "okay";
312 phy-handle = <&phy0>;
313 fifo-entry-size = <10>;
314
315 mdio {
316 #address-cells = <1>;
317 #size-cells = <0>;
318 phy0: ethernet-phy@0 {
319 device_type = "ethernet-phy";
320 reg = <0>;
321 qca,mib-poll-interval = <500>;
322
323 qca,ar8327-initvals = <
324 0x0010 0x40000000
325 0x0624 0x007f7f7f
326 0x0004 0x07a00000 /* PAD0_MODE */
327 0x000c 0x01000000 /* PAD6_MODE */
328 0x007c 0x0000007e /* PORT0_STATUS */
329 >;
330 };
331 };
332 };
333
334 &POB0 {
335
336 keys {
337 compatible = "gpio-keys";
338
339 reset {
340 label = "Reset button";
341 gpios = <&GPIO0 15 GPIO_ACTIVE_LOW>;
342 linux,code = <KEY_RESTART>;
343 interrupt-parent = <&UIC1>;
344 interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
345 debounce-interval = <60>;
346 };
347
348 backup_hd {
349 label = "Backup HD button";
350 gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>;
351 linux,code = <BTN_0>;
352 interrupt-parent = <&UIC1>;
353 interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
354 debounce-interval = <60>;
355 };
356
357 rfkill {
358 label = "RFKILL button";
359 gpios = <&GPIO0 20 GPIO_ACTIVE_LOW>;
360 linux,code = <KEY_RFKILL>;
361 interrupt-parent = <&UIC1>;
362 interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
363 debounce-interval = <60>;
364 };
365
366 wps {
367 label = "WPS button";
368 gpios = <&GPIO0 23 GPIO_ACTIVE_LOW>;
369 linux,code = <KEY_WPS_BUTTON>;
370 interrupt-parent = <&UIC2>;
371 interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
372 debounce-interval = <60>;
373 };
374 };
375
376 leds {
377 compatible = "gpio-leds";
378
379 led-0 {
380 color = <LED_COLOR_ID_GREEN>;
381 function = LED_FUNCTION_POWER;
382 gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>;
383 };
384
385 led-1 {
386 color = <LED_COLOR_ID_AMBER>;
387 function = LED_FUNCTION_FAULT;
388 gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>;
389 panic-indicator;
390 };
391
392 led-2 {
393 color = <LED_COLOR_ID_BLUE>;
394 function = LED_FUNCTION_USB;
395 gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
396 trigger-sources = <&usb2_port 1>, <&usb2_port 2>,
397 <&usb3_port 1>, <&usb3_port 2>;
398 linux,default-trigger = "usbport";
399 };
400
401 led-3 {
402 color = <LED_COLOR_ID_WHITE>;
403 function = LED_FUNCTION_INDICATOR;
404 gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>;
405 };
406
407 led-4 {
408 color = <LED_COLOR_ID_YELLOW>;
409 function = LED_FUNCTION_WAN;
410 gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>;
411 };
412
413 led-5 {
414 color = <LED_COLOR_ID_GREEN>;
415 function = LED_FUNCTION_WAN;
416 gpios = <&GPIO0 12 GPIO_ACTIVE_HIGH>;
417 };
418
419 led-6 {
420 color = <LED_COLOR_ID_GREEN>;
421 function = LED_FUNCTION_DISK;
422 gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
423 linux,default-trigger = "disk-activity";
424 };
425
426 led-7 {
427 color = <LED_COLOR_ID_RED>;
428 function = LED_FUNCTION_DISK_ERR;
429 gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>;
430 };
431
432 led-8 {
433 color = <LED_COLOR_ID_BLUE>;
434 function = LED_FUNCTION_WLAN;
435 gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
436 linux,default-trigger = "phy0tpt";
437 };
438 };
439 };
440
441 &PCIE0 {
442 status = "okay";
443
444 /*
445 * relevant lspci topology:
446 *
447 * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0
448 * +-03.0-[44]----00.0
449 * \-04.0-[45]----00.0
450 *
451 */
452
453 bridge@64,0 {
454 reg = <0x00400000 0 0 0 0>;
455 #address-cells = <3>;
456 #size-cells = <2>;
457 ranges;
458
459 bridge@65,0 {
460 /* IDT PES4T4 PCI Express Switch */
461 compatible = "pci111d,803a";
462 reg = <0x00410000 0 0 0 0>;
463 #address-cells = <3>;
464 #size-cells = <2>;
465 ranges;
466
467 bridge@66,2 {
468 compatible = "pci111d,803a";
469 reg = <0x00421000 0 0 0 0>;
470 #address-cells = <3>;
471 #size-cells = <2>;
472 ranges;
473
474 wifi0: wifi@67,0 {
475 /* Atheros AR9380 5GHz */
476 compatible = "pci168c,0030";
477 reg = <0x00430000 0 0 0 0>;
478 interrupts = <3>; /* INTC */
479 nvmem-cell-names = "mac-address", "calibration";
480 nvmem-cells = <&macaddr_wifi_0>, <&calibration_wifi_1000>;
481
482 /*
483 * Because this was such a pain.
484 * Here's the full device path:
485 * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0
486 */
487 };
488 };
489
490 bridge@66,3 {
491 compatible = "pci111d,803a";
492 reg = <0x00421800 0 0 0 0>;
493 #address-cells = <3>;
494 #size-cells = <2>;
495 ranges;
496
497 wifi1: wifi@68,0 {
498 /* Atheros AR9381 2.4GHz */
499 compatible = "pci168c,0033";
500 reg = <0x00440000 0 0 0 0>;
501 interrupts = <4>; /* INTD */
502 nvmem-cell-names = "mac-address", "calibration";
503 nvmem-cells = <&macaddr_wifi_c>, <&calibration_wifi_5000>;
504 };
505 };
506
507 bridge@66,4 {
508 compatible = "pci111d,803a";
509 reg = <0x00422000 0 0 0 0>;
510 #address-cells = <3>;
511 #size-cells = <2>;
512 ranges;
513
514 usb1: usb@69,0 {
515 /* Renesas uPD720202 */
516 compatible = "pci1912,0015";
517 reg = <0x00450000 0 0 0 0>;
518 interrupts = <1>; /* INTA */
519
520 #address-cells = <1>;
521 #size-cells = <0>;
522
523 usb2_port: port@1 {
524 reg = <1>;
525 #trigger-source-cells = <1>;
526 };
527
528 usb3_port: port@2 {
529 reg = <2>;
530 #trigger-source-cells = <1>;
531 };
532 };
533 };
534 };
535 };
536 };