apm821xx: add support for kernel 5.10 for testing
[openwrt/staging/chunkeey.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: ndfc@1,0 {
177
178 status = "okay";
179 /* 128 MiB Nand Flash */
180 nand {
181 nand-is-boot-medium;
182
183 partition0,0@0 {
184 label = "NAND 128MiB 3,3V 8-bit";
185 reg = <0x00000000 0x08000000>;
186 read-only;
187 };
188
189 partition0,1@0 {
190 label = "uboot";
191 reg = <0x00000000 0x00180000>;
192 read-only;
193 };
194
195 partition0,2@180000 {
196 label = "device-tree";
197 reg = <0x00180000 0x00020000>;
198 };
199
200 partition0,3@180000 {
201 label = "kernel";
202 reg = <0x00180000 0x00380000>;
203 /*
204 * device-tree is @ 0x00180000 - 0x001fffff
205 * kernel starts from 0x200000.
206 * this is coded into netgear's u-boot.
207 *
208 * this partition will also contain a
209 * fake/empty rootfs at the end to fool
210 * Netgear's uboot rootfs integrety checks.
211 */
212 };
213
214 partition0,4@500000 {
215 label = "ubi";
216 reg = <0x00500000 0x014e0000>;
217 };
218
219 partition0,5@19e0000 {
220 label = "config";
221 reg = <0x019e0000 0x00080000>;
222 read-only;
223 };
224
225 partition0,6@1a60000 {
226 label = "pot";
227 reg = <0x01a60000 0x00080000>;
228 read-only;
229 };
230
231 partition0,7@1ae0000 {
232 label = "traffic_meter";
233 reg = <0x01ae0000 0x00300000>;
234 read-only;
235 };
236
237 partition0,8@1de0000 {
238 label = "language";
239 reg = <0x01de0000 0x001c0000>;
240 read-only;
241 };
242
243 partition0,9@1fa0000 {
244 label = "ecos";
245 reg = <0x01fa0000 0x06020000>;
246 read-only;
247 };
248
249 partition0,10@7fc0000 {
250 label = "wifi_data";
251 reg = <0x07fc0000 0x00040000>;
252 read-only;
253 };
254
255 partition0,11@180000 {
256 label = "firmware";
257 reg = <0x00180000 0x01860000>;
258 read-only;
259 };
260 };
261 };
262 };
263
264 &UART0 {
265 status = "okay";
266 };
267
268 &GPIO0 {
269 status = "okay";
270 };
271
272 &IIC0 {
273 status = "okay";
274
275 fan0: fan@1b {
276 compatible = "microchip,tc654";
277 reg = <0x1b>;
278 cooling-min-level = <0>;
279 cooling-max-level = <255>;
280 #cooling-cells = <2>; /* min followed by max */
281
282 gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; /* fan status */
283 alarm-gpios = <&GPIO0 5 GPIO_ACTIVE_LOW>; /* fault */
284 interrupt-parent = <&UIC3>;
285 interrupts = <0x16 IRQ_TYPE_EDGE_FALLING>; /* fault */
286 };
287
288 temp0: temp@4d {
289 compatible = "gmt,g781";
290 reg = <0x4d>;
291 #thermal-sensor-cells = <1>;
292
293 /*
294 * The LM90 has two sensors:
295 * temp0 -> internal to LM90
296 * temp1 -> external NTC near CPU
297 */
298 };
299 };
300
301
302 &EMAC0 {
303 status = "okay";
304 phy-handle = <&phy0>;
305 fifo-entry-size = <10>;
306
307 mdio {
308 #address-cells = <1>;
309 #size-cells = <0>;
310 phy0: ethernet-phy@0 {
311 device_type = "ethernet-phy";
312 reg = <0>;
313 qca,mib-poll-interval = <500>;
314
315 qca,ar8327-initvals = <
316 0x0010 0x40000000
317 0x0624 0x007f7f7f
318 0x0004 0x07a00000 /* PAD0_MODE */
319 0x000c 0x01000000 /* PAD6_MODE */
320 0x007c 0x0000007e /* PORT0_STATUS */
321 >;
322 };
323 };
324 };
325
326 &POB0 {
327
328 keys {
329 compatible = "gpio-keys";
330
331 reset {
332 label = "Reset button";
333 gpios = <&GPIO0 15 GPIO_ACTIVE_LOW>;
334 linux,code = <KEY_RESTART>;
335 interrupt-parent = <&UIC1>;
336 interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
337 debounce-interval = <60>;
338 };
339
340 backup_hd {
341 label = "Backup HD button";
342 gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>;
343 linux,code = <BTN_0>;
344 interrupt-parent = <&UIC1>;
345 interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
346 debounce-interval = <60>;
347 };
348
349 rfkill {
350 label = "RFKILL button";
351 gpios = <&GPIO0 20 GPIO_ACTIVE_LOW>;
352 linux,code = <KEY_RFKILL>;
353 interrupt-parent = <&UIC1>;
354 interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
355 debounce-interval = <60>;
356 };
357
358 wps {
359 label = "WPS button";
360 gpios = <&GPIO0 23 GPIO_ACTIVE_LOW>;
361 linux,code = <KEY_WPS_BUTTON>;
362 interrupt-parent = <&UIC2>;
363 interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
364 debounce-interval = <60>;
365 };
366 };
367
368 leds {
369 compatible = "gpio-leds";
370 status: power-green {
371 label = "wndr4700:green:power";
372 gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>;
373 };
374
375 failsafe: power-orange {
376 label = "wndr4700:orange:power";
377 gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>;
378 linux,default-trigger = "panic";
379 };
380
381 usb-blue {
382 label = "wndr4700:blue:usb";
383 gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
384 trigger-sources = <&usb2_port 1>, <&usb2_port 2>,
385 <&usb3_port 1>, <&usb3_port 2>;
386 linux,default-trigger = "usbport";
387 };
388
389 logo-white {
390 label = "wndr4700:white:logo";
391 gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>;
392 };
393
394 wan-yellow {
395 label = "wndr4700:yellow:wan";
396 gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>;
397 };
398
399 wan-green {
400 label = "wndr4700:green:wan";
401 gpios = <&GPIO0 12 GPIO_ACTIVE_HIGH>;
402 };
403
404 hd-green {
405 label = "wndr4700:green:hd";
406 gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
407 linux,default-trigger = "disk-activity";
408 };
409
410 hd-red {
411 label = "wndr4700:red:hd";
412 gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>;
413 };
414
415 wlan-blue {
416 label = "wndr4700:blue:wlan";
417 gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
418 linux,default-trigger = "phy0tpt";
419 };
420 };
421 };
422
423 &PCIE0 {
424 status = "okay";
425
426 /*
427 * relevant lspci topology:
428 *
429 * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0
430 * +-03.0-[44]----00.0
431 * \-04.0-[45]----00.0
432 *
433 */
434
435 bridge@64,0 {
436 reg = <0x00400000 0 0 0 0>;
437 #address-cells = <3>;
438 #size-cells = <2>;
439 ranges;
440
441 bridge@65,0 {
442 /* IDT PES4T4 PCI Express Switch */
443 compatible = "pci111d,803a";
444 reg = <0x00410000 0 0 0 0>;
445 #address-cells = <3>;
446 #size-cells = <2>;
447 ranges;
448
449 bridge@66,2 {
450 compatible = "pci111d,803a";
451 reg = <0x00421000 0 0 0 0>;
452 #address-cells = <3>;
453 #size-cells = <2>;
454 ranges;
455
456 wifi0: wifi@67,0 {
457 /* Atheros AR9380 5GHz */
458 compatible = "pci168c,0030";
459 reg = <0x00430000 0 0 0 0>;
460 interrupts = <3>; /* INTC */
461 qca,no-eeprom;
462 /* wifi CAL & MAC is stored in nvram */
463
464 /*
465 * Because this was such a pain.
466 * Here's the full device path:
467 * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0
468 */
469 };
470 };
471
472 bridge@66,3 {
473 compatible = "pci111d,803a";
474 reg = <0x00421800 0 0 0 0>;
475 #address-cells = <3>;
476 #size-cells = <2>;
477 ranges;
478
479 wifi1: wifi@68,0 {
480 /* Atheros AR9381 2.4GHz */
481 compatible = "pci168c,0033";
482 reg = <0x00440000 0 0 0 0>;
483 interrupts = <4>; /* INTD */
484 qca,no-eeprom;
485 /* wifi CAL & MAC is stored in nvram */
486 };
487 };
488
489 bridge@66,4 {
490 compatible = "pci111d,803a";
491 reg = <0x00422000 0 0 0 0>;
492 #address-cells = <3>;
493 #size-cells = <2>;
494 ranges;
495
496 usb1: usb@69,0 {
497 /* Renesas uPD720202 */
498 compatible = "pci1912,0015";
499 reg = <0x00450000 0 0 0 0>;
500 interrupts = <1>; /* INTA */
501
502 #address-cells = <1>;
503 #size-cells = <0>;
504
505 usb2_port: port@1 {
506 reg = <1>;
507 #trigger-source-cells = <1>;
508 };
509
510 usb3_port: port@2 {
511 reg = <2>;
512 #trigger-source-cells = <1>;
513 };
514 };
515 };
516 };
517 };
518 };
519
520 &MSI {
521 status = "okay";
522 };