e0fb4e305fc11a63540f0fa9964dd69b65dabce6
[librecmc/librecmc.git] / target / linux / apm821xx / dts / wndr4700.dts
1 /*
2  * Device Tree Source for Netgear WNDR4700/WNDR4720 Series
3  *
4  * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without
8  * any warranty of any kind, whether express or implied.
9  */
10
11 /dts-v1/;
12
13 #include "apm82181.dtsi"
14 #include <dt-bindings/thermal/thermal.h>
15
16 / {
17         model = "Netgear WNDR4700/WNDR4720 Series";
18         compatible = "netgear,wndr4700";
19
20         aliases {
21                 serial0 = &UART0;
22         };
23
24         chosen {
25                 linux,stdout-path = "/plb/opb/serial@ef600300";
26         };
27
28         thermal-zones {
29                 cpu_thermal: cpu-thermal {
30                         polling-delay-passive = <10000>; /* milliseconds */
31                         polling-delay = <20000>; /* milliseconds */
32
33                         thermal-sensors = <&temp0 1>;
34
35                         trips {
36                                 /*
37                                  * Once the thermal governers are a bit smarter
38                                  * and do hysteresis properly, we can disable
39                                  * the fan when the HDD and CPU has < 39 C.
40                                  */
41                                 cpu_alert0: cpu-alert0 {
42                                         temperature = <25000>;
43                                         hysteresis = <2000>;
44                                         type = "active";
45                                 };
46
47                                 cpu_alert1: cpu-alert1 {
48                                         temperature = <27000>; /* millicelsius */
49                                         hysteresis = <2000>; /* millicelsius */
50                                         type = "active";
51                                 };
52
53                                 cpu_alert2: cpu-alert2 {
54                                         temperature = <65000>; /* millicelsius */
55                                         hysteresis = <2000>; /* millicelsius */
56                                         type = "active";
57                                 };
58
59                                 cpu_alert3: cpu-alert3 {
60                                         temperature = <70000>; /* millicelsius */
61                                         hysteresis = <2000>; /* millicelsius */
62                                         type = "active";
63                                 };
64
65                                 cpu_alert4: cpu-alert4 {
66                                         temperature = <75000>; /* millicelsius */
67                                         hysteresis = <2000>; /* millicelsius */
68                                         type = "active";
69                                 };
70
71                                 cpu_alert5: cpu-alert5 {
72                                         temperature = <80000>; /* millicelsius */
73                                         hysteresis = <2000>; /* millicelsius */
74                                         type = "active";
75                                 };
76
77                                 cpu_alert6: cpu-alert6 {
78                                         temperature = <850000>; /* millicelsius */
79                                         hysteresis = <2000>; /* millicelsius */
80                                         type = "active";
81                                 };
82
83                                 cpu_crit: cpu-crit {
84                                         temperature = <90000>; /* millicelsius */
85                                         hysteresis = <2000>; /* millicelsius */
86                                         type = "critical";
87                                 };
88                         };
89
90                         cooling-maps {
91                                 map0 {
92                                         trip = <&cpu_alert0>;
93                                         cooling-device = <&fan0 THERMAL_NO_LIMIT 0>;
94                                 };
95
96                                 map1 {
97                                         trip = <&cpu_alert1>;
98                                         cooling-device = <&fan0 1 87>;
99                                 };
100
101                                 map2 {
102                                         trip = <&cpu_alert2>;
103                                         cooling-device = <&fan0 88 100>;
104                                 };
105
106                                 map3 {
107                                         trip = <&cpu_alert3>;
108                                         cooling-device = <&fan0 101 147>;
109                                 };
110
111                                 map4 {
112                                         trip = <&cpu_alert4>;
113                                         cooling-device = <&fan0 148 207>;
114                                 };
115
116                                 map5 {
117                                         trip = <&cpu_alert5>;
118                                         cooling-device = <&fan0 208 231>;
119                                 };
120
121                                 map6 {
122                                         trip = <&cpu_alert6>;
123                                         cooling-device =<&fan0 232 THERMAL_NO_LIMIT>;
124                                 };
125                         };
126                 };
127         };
128 };
129
130 &CRYPTO {
131         status = "okay";
132 };
133
134 &PKA {
135         status = "okay";
136 };
137
138 &TRNG {
139         status = "okay";
140 };
141
142 &SATA1 {
143         status = "okay";
144 };
145
146 &USBOTG0 {
147         status = "okay";
148         dr_mode = "host";
149 };
150
151 &EBC0 {
152         ndfc@1,0 {
153                 status = "okay";
154                 /* 128 MiB Nand Flash */
155                 nand {
156                         #address-cells = <1>;
157                         #size-cells = <1>;
158
159                         partition0,0@0x00000000 {
160                                 label = "NAND 128MiB 3,3V 8-bit";
161                                 reg = <0x00000000 0x08000000>;
162                                 read-only;
163                         };
164
165                         partition0,1@0x00000000 {
166                                 label = "uboot";
167                                 reg = <0x00000000 0x00180000>;
168                                 read-only;
169                         };
170
171                         partition0,2@0x00180000 {
172                                 label = "device-tree";
173                                 reg = <0x00180000 0x00020000>;
174                                 read-only;
175                         };
176
177                         partition0,3@0x001a0000 {
178                                 label = "kernel";
179                                 reg = <0x001a0000 0x001e0000>;
180                                 /*
181                                  * will also contain a fake/empty
182                                  * rootfs to fool Netgear's uboot
183                                  * rootfs integrety checks.
184                                  */
185                         };
186
187                         partition0,4@0x00380000 {
188                                 label = "ubi";
189                                 reg = <0x00380000 0x01660000>;
190                         };
191
192                         partition0,5@0x019e0000 {
193                                 label = "config";
194                                 reg = <0x019e0000 0x00080000>;
195                                 read-only;
196                         };
197
198                         partition0,6@0x01a60000 {
199                                 label = "pot";
200                                 reg = <0x01a60000 0x00080000>;
201                                 read-only;
202                         };
203
204                         partition0,7@0x01ae0000 {
205                                 label = "traffic_meter";
206                                 reg = <0x01ae0000 0x00300000>;
207                                 read-only;
208                         };
209
210                         partition0,8@0x01de0000 {
211                                 label = "language";
212                                 reg = <0x01de0000 0x001c0000>;
213                                 read-only;
214                         };
215
216                         partition0,9@0x01fa0000 {
217                                 label = "ecos";
218                                 reg = <0x01fa0000 0x06020000>;
219                                 read-only;
220                         };
221
222                         partition0,10@0x07fc0000 {
223                                 label = "wifi_data";
224                                 reg = <0x07fc0000 0x00040000>;
225                                 read-only;
226                         };
227
228                         partition0,11@0x00180000 {
229                                 label = "firmware";
230                                 reg = <0x00180000 0x01860000>;
231                                 read-only;
232                         };
233                 };
234         };
235 };
236
237 &UART0 {
238         status = "okay";
239 };
240
241 &GPIO0 {
242         status = "okay";
243         #interrupt-cells = <2>;
244         interrupt-controller;
245         interrupts-extended = <&UIC1 0x14>,
246                               <&UIC1 0x1e>,
247                               <&UIC1 0x1f>,
248                               <&UIC2 0x19>;
249 };
250
251 &IIC0 {
252         status = "okay";
253
254         fan0: fan@1b {
255                 compatible = "microchip,tc654";
256                 reg = <0x1b>;
257                 cooling-min-level = <0>;
258                 cooling-max-level = <255>;
259                 #cooling-cells = <2>; /* min followed by max */
260
261                 gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; /* fan status */
262                 alarm-gpios = <&GPIO0 5 GPIO_ACTIVE_LOW>; /* fault */
263                 interrupt-parent = <&UIC3>;
264                 interrupts = <0x16 IRQ_TYPE_EDGE_FALLING>; /* fault */
265         };
266
267         temp0: temp@4d {
268                 compatible = "gmt,g781";
269                 reg = <0x4d>;
270                 #thermal-sensor-cells = <1>;
271
272                 /*
273                  * The LM90 has two sensors:
274                  *   temp0 -> internal to LM90
275                  *   temp1 -> external NTC near CPU
276                  */
277         };
278 };
279
280
281 &EMAC0 {
282         status = "okay";
283         phy-handle = <&phy0>;
284
285         mdio {
286                 #address-cells = <1>;
287                 #size-cells = <0>;
288                 phy0: ethernet-phy@0 {
289                         device_type = "ethernet-phy";
290                         reg = <0>;
291                         qca,ar8327-initvals = <
292                                 0x0010 0x40000000
293                                 0x0624 0x007f7f7f
294                                 0x0004 0x07a00000       /* PAD0_MODE */
295                                 0x000c 0x01000000       /* PAD6_MODE */
296                                 0x007c 0x0000007e       /* PORT0_STATUS */
297                         >;
298                 };
299         };
300 };
301
302 &POB0 {
303         gpio_keys_polled {
304                 compatible = "gpio-keys-polled";
305                 #address-cells = <1>;
306                 #size-cells = <0>;
307                 #interrupt-cells = <2>;
308                 autorepeat;
309                 poll-interval = <60>;   /* 3 * 20 = 60ms */
310
311                 reset {
312                         label = "Reset button";
313                         linux,code = <KEY_RESTART>;
314                         gpios = <&GPIO0 15 GPIO_ACTIVE_HIGH>;
315                         interrupt-parent = <&UIC1>;
316                         interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
317                 };
318
319                 backup_hd {
320                         label = "Backup HD button";
321                         gpios = <&GPIO0 19 GPIO_ACTIVE_HIGH>;
322                         linux,code = <BTN_0>;
323                         interrupt-parent = <&UIC1>;
324                         interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
325                 };
326
327                 rfkill {
328                         label = "RFKILL button";
329                         gpios = <&GPIO0 20 GPIO_ACTIVE_HIGH>;
330                         linux,code = <KEY_RFKILL>;
331                         interrupt-parent = <&UIC1>;
332                         interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
333                 };
334
335                 wps {
336                         label = "WPS button";
337                         gpios = <&GPIO0 23 GPIO_ACTIVE_HIGH>;
338                         linux,code = <KEY_WPS_BUTTON>;
339                         interrupt-parent = <&UIC2>;
340                         interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
341                 };
342
343                 sdcard {
344                         label = "SDCard inserted";
345                         gpios = <&GPIO0 7 GPIO_ACTIVE_LOW>;
346                         linux,code = <BTN_1>;
347                 };
348         };
349
350         gpio-leds {
351                 compatible = "gpio-leds";
352                 power-green {
353                         label = "wndr4700:green:power";
354                         gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>;
355                 };
356
357                 power-orange {
358                         label = "wndr4700:orange:power";
359                         gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>;
360                         linux,default-trigger = "panic";
361                 };
362
363                 usb-blue {
364                         label = "wndr4700:blue:usb";
365                         gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
366                 };
367
368                 logo-white {
369                         label = "wndr4700:white:logo";
370                         gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>;
371                 };
372
373                 wan-yellow {
374                         label = "wndr4700:yellow:wan";
375                         gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>;
376                 };
377
378                 wan-green {
379                         label = "wndr4700:green:wan";
380                         gpios = <&GPIO0 12 GPIO_ACTIVE_HIGH>;
381                 };
382
383                 hd-green {
384                         label = "wndr4700:green:hd";
385                         gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
386                 };
387
388                 hd-red {
389                         label = "wndr4700:red:hd";
390                         gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>;
391                 };
392
393                 wlan-blue {
394                         label = "wndr4700:blue:wlan";
395                         gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
396                 };
397         };
398 };
399
400 &PCIE0 {
401         status = "okay";
402 };
403
404 &MSI {
405         status = "okay";
406 };