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