apm821xx: prepare WNDR4700 for 6.6 - add preliminary u-boot-env access
[openwrt/staging/pepe2k.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 1>;
109 };
110
111 map2 {
112 trip = <&cpu_alert2>;
113 cooling-device = <&fan0 2 4>;
114 };
115
116 map3 {
117 trip = <&cpu_alert3>;
118 cooling-device = <&fan0 4 8>;
119 };
120
121 map4 {
122 trip = <&cpu_alert4>;
123 cooling-device = <&fan0 9 12>;
124 };
125
126 map5 {
127 trip = <&cpu_alert5>;
128 cooling-device = <&fan0 13 15>;
129 };
130
131 map6 {
132 trip = <&cpu_alert6>;
133 cooling-device =<&fan0 16 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 compatible = "fixed-partitions";
187 read-only;
188
189 partition@40000 {
190 label = "u-boot-env-main";
191 compatible = "u-boot,env-redundant-count";
192 reg = <0x00040000 0x20000>; /* one block is 128k */
193 read-only;
194 };
195
196 /*
197 * Causes u_boot_env: probe of 4e4000000.ndfc:nand:partitions:partition@0:partition@60000
198 * failed with error -17
199 *
200 * partition@60000 {
201 * label = "u-boot-env-redundant";
202 * compatible = "u-boot,env-redundant-count";
203 * reg = <0x00060000 0x20000>;
204 * read-only;
205 * };
206 */
207 };
208
209 partition@180000 {
210 label = "firmware";
211 reg = <0x00180000 0x01860000>;
212
213 compatible = "fixed-partitions";
214 #address-cells = <1>;
215 #size-cells = <1>;
216
217 partition@0 {
218 label = "kernel";
219 reg = <0x00000000 0x00480000>;
220
221 compatible = "fixed-partitions";
222 #address-cells = <1>;
223 #size-cells = <1>;
224
225 /*
226 * device-tree is @ 0x00180000 - 0x0019ffff
227 * kernel starts from 0x20000.
228 * this is coded into netgear's u-boot.
229 */
230 partition@0 {
231 label = "dtb";
232 reg = <0x00000000 0x20000>;
233 };
234 /*
235 * this partition will also contain a
236 * fake/empty rootfs at the end to fool
237 * Netgear's uboot rootfs integrety checks.
238 */
239 };
240
241 partition@480000 {
242 label = "ubi";
243 reg = <0x00480000 0x013e0000>;
244 };
245 };
246
247
248 /*
249 * Netgear's u-boot in the fw_recovery mode (can be
250 * triggered by holding the reset button, or if
251 * "bootm" fails) will not flash past this point
252 * (= 0x19E0000).
253 */
254
255 partition@19e0000 {
256 label = "config";
257 reg = <0x019e0000 0x00080000>;
258 read-only;
259 };
260
261 partition@1a60000 {
262 label = "pot";
263 reg = <0x01a60000 0x00080000>;
264 read-only;
265 };
266
267 partition@1ae0000 {
268 label = "traffic_meter";
269 reg = <0x01ae0000 0x00300000>;
270 read-only;
271 };
272
273 partition@1de0000 {
274 label = "language";
275 reg = <0x01de0000 0x001c0000>;
276 read-only;
277 };
278
279 partition@1fa0000 {
280 label = "ecos";
281 reg = <0x01fa0000 0x06020000>;
282 read-only;
283 };
284
285 partition@7fc0000 {
286 label = "wifi_data";
287 reg = <0x07fc0000 0x00040000>;
288 read-only;
289
290 nvmem-layout {
291 compatible = "fixed-layout";
292 #address-cells = <1>;
293 #size-cells = <1>;
294
295 macaddr_wifi_0: macaddr@0 {
296 reg = <0x0 0x6>;
297 };
298 macaddr_wifi_c: macaddr@c {
299 reg = <0xc 0x6>;
300 };
301
302 calibration_wifi_1000: calibration@1000 {
303 reg = <0x1000 0x440>;
304 };
305
306 calibration_wifi_5000: calibration@5000 {
307 reg = <0x5000 0x440>;
308 };
309 };
310 };
311 };
312 };
313 };
314
315 &UART0 {
316 status = "okay";
317 };
318
319 &GPIO0 {
320 status = "okay";
321 };
322
323 &IIC0 {
324 status = "okay";
325
326 fan0: fan@1b {
327 compatible = "microchip,tc654";
328 reg = <0x1b>;
329 #cooling-cells = <2>; /* min followed by max */
330
331 gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; /* fan status */
332 alarm-gpios = <&GPIO0 5 GPIO_ACTIVE_LOW>; /* fault */
333 interrupt-parent = <&UIC3>;
334 interrupts = <0x16 IRQ_TYPE_EDGE_FALLING>; /* fault */
335 };
336
337 temp0: temp@4d {
338 compatible = "gmt,g781";
339 reg = <0x4d>;
340 #thermal-sensor-cells = <1>;
341
342 /*
343 * The LM90 has two sensors:
344 * temp0 -> internal to LM90
345 * temp1 -> external NTC near CPU
346 */
347 };
348 };
349
350
351 &EMAC0 {
352 status = "okay";
353 phy-handle = <&phy0>;
354 fifo-entry-size = <10>;
355
356 mdio {
357 #address-cells = <1>;
358 #size-cells = <0>;
359 phy0: ethernet-phy@0 {
360 device_type = "ethernet-phy";
361 reg = <0>;
362 qca,mib-poll-interval = <500>;
363
364 qca,ar8327-initvals = <
365 0x0010 0x40000000
366 0x0624 0x007f7f7f
367 0x0004 0x07a00000 /* PAD0_MODE */
368 0x000c 0x01000000 /* PAD6_MODE */
369 0x007c 0x0000007e /* PORT0_STATUS */
370 >;
371 };
372 };
373 };
374
375 &POB0 {
376
377 keys {
378 compatible = "gpio-keys";
379
380 button-restart {
381 label = "Reset button";
382 gpios = <&GPIO0 15 GPIO_ACTIVE_LOW>;
383 linux,code = <KEY_RESTART>;
384 interrupt-parent = <&UIC1>;
385 interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
386 debounce-interval = <60>;
387 };
388
389 button-backup_hd {
390 label = "Backup HD button";
391 gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>;
392 linux,code = <BTN_0>;
393 interrupt-parent = <&UIC1>;
394 interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
395 debounce-interval = <60>;
396 };
397
398 button-rfkill {
399 label = "RFKILL button";
400 gpios = <&GPIO0 20 GPIO_ACTIVE_LOW>;
401 linux,code = <KEY_RFKILL>;
402 interrupt-parent = <&UIC1>;
403 interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
404 debounce-interval = <60>;
405 };
406
407 button-wps {
408 label = "WPS button";
409 gpios = <&GPIO0 23 GPIO_ACTIVE_LOW>;
410 linux,code = <KEY_WPS_BUTTON>;
411 interrupt-parent = <&UIC2>;
412 interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
413 debounce-interval = <60>;
414 };
415 };
416
417 leds {
418 compatible = "gpio-leds";
419
420 led-0 {
421 color = <LED_COLOR_ID_GREEN>;
422 function = LED_FUNCTION_POWER;
423 gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>;
424 };
425
426 led-1 {
427 color = <LED_COLOR_ID_AMBER>;
428 function = LED_FUNCTION_FAULT;
429 gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>;
430 panic-indicator;
431 };
432
433 led-2 {
434 color = <LED_COLOR_ID_BLUE>;
435 function = LED_FUNCTION_USB;
436 gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
437 trigger-sources = <&usb2_port 1>, <&usb2_port 2>,
438 <&usb3_port 1>, <&usb3_port 2>;
439 linux,default-trigger = "usbport";
440 };
441
442 led-3 {
443 color = <LED_COLOR_ID_WHITE>;
444 function = LED_FUNCTION_INDICATOR;
445 gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>;
446 };
447
448 led-4 {
449 color = <LED_COLOR_ID_YELLOW>;
450 function = LED_FUNCTION_WAN;
451 gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>;
452 };
453
454 led-5 {
455 color = <LED_COLOR_ID_GREEN>;
456 function = LED_FUNCTION_WAN;
457 gpios = <&GPIO0 12 GPIO_ACTIVE_HIGH>;
458 };
459
460 led-6 {
461 color = <LED_COLOR_ID_GREEN>;
462 function = LED_FUNCTION_DISK;
463 gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
464 linux,default-trigger = "disk-activity";
465 };
466
467 led-7 {
468 color = <LED_COLOR_ID_RED>;
469 function = LED_FUNCTION_DISK_ERR;
470 gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>;
471 };
472
473 led-8 {
474 color = <LED_COLOR_ID_BLUE>;
475 function = LED_FUNCTION_WLAN;
476 gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
477 linux,default-trigger = "phy0tpt";
478 };
479 };
480 };
481
482 &PCIE0 {
483 status = "okay";
484
485 /*
486 * relevant lspci topology:
487 *
488 * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0
489 * +-03.0-[44]----00.0
490 * \-04.0-[45]----00.0
491 *
492 */
493
494 bridge@64,0 {
495 reg = <0x00400000 0 0 0 0>;
496 #address-cells = <3>;
497 #size-cells = <2>;
498 ranges;
499
500 bridge@65,0 {
501 /* IDT PES4T4 PCI Express Switch */
502 compatible = "pci111d,803a";
503 reg = <0x00410000 0 0 0 0>;
504 #address-cells = <3>;
505 #size-cells = <2>;
506 ranges;
507
508 bridge@66,2 {
509 compatible = "pci111d,803a";
510 reg = <0x00421000 0 0 0 0>;
511 #address-cells = <3>;
512 #size-cells = <2>;
513 ranges;
514
515 wifi0: wifi@67,0 {
516 /* Atheros AR9380 5GHz */
517 compatible = "pci168c,0030";
518 reg = <0x00430000 0 0 0 0>;
519 interrupts = <3>; /* INTC */
520 nvmem-cell-names = "mac-address", "calibration";
521 nvmem-cells = <&macaddr_wifi_0>, <&calibration_wifi_1000>;
522
523 /*
524 * Because this was such a pain.
525 * Here's the full device path:
526 * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0
527 */
528 };
529 };
530
531 bridge@66,3 {
532 compatible = "pci111d,803a";
533 reg = <0x00421800 0 0 0 0>;
534 #address-cells = <3>;
535 #size-cells = <2>;
536 ranges;
537
538 wifi1: wifi@68,0 {
539 /* Atheros AR9381 2.4GHz */
540 compatible = "pci168c,0033";
541 reg = <0x00440000 0 0 0 0>;
542 interrupts = <4>; /* INTD */
543 nvmem-cell-names = "mac-address", "calibration";
544 nvmem-cells = <&macaddr_wifi_c>, <&calibration_wifi_5000>;
545 };
546 };
547
548 bridge@66,4 {
549 compatible = "pci111d,803a";
550 reg = <0x00422000 0 0 0 0>;
551 #address-cells = <3>;
552 #size-cells = <2>;
553 ranges;
554
555 usb1: usb@69,0 {
556 /* Renesas uPD720202 */
557 compatible = "pci1912,0015";
558 reg = <0x00450000 0 0 0 0>;
559 interrupts = <1>; /* INTA */
560
561 #address-cells = <1>;
562 #size-cells = <0>;
563
564 usb2_port: port@1 {
565 reg = <1>;
566 #trigger-source-cells = <1>;
567 };
568
569 usb3_port: port@2 {
570 reg = <2>;
571 #trigger-source-cells = <1>;
572 };
573 };
574 };
575 };
576 };
577 };