apm821xx: make it possible to update the dtb partition on the WNDR4700
[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                         };
175
176                         partition0,3@0x001a0000 {
177                                 label = "kernel";
178                                 reg = <0x001a0000 0x001e0000>;
179                                 /*
180                                  * will also contain a fake/empty
181                                  * rootfs to fool Netgear's uboot
182                                  * rootfs integrety checks.
183                                  */
184                         };
185
186                         partition0,4@0x00380000 {
187                                 label = "ubi";
188                                 reg = <0x00380000 0x01660000>;
189                         };
190
191                         partition0,5@0x019e0000 {
192                                 label = "config";
193                                 reg = <0x019e0000 0x00080000>;
194                                 read-only;
195                         };
196
197                         partition0,6@0x01a60000 {
198                                 label = "pot";
199                                 reg = <0x01a60000 0x00080000>;
200                                 read-only;
201                         };
202
203                         partition0,7@0x01ae0000 {
204                                 label = "traffic_meter";
205                                 reg = <0x01ae0000 0x00300000>;
206                                 read-only;
207                         };
208
209                         partition0,8@0x01de0000 {
210                                 label = "language";
211                                 reg = <0x01de0000 0x001c0000>;
212                                 read-only;
213                         };
214
215                         partition0,9@0x01fa0000 {
216                                 label = "ecos";
217                                 reg = <0x01fa0000 0x06020000>;
218                                 read-only;
219                         };
220
221                         partition0,10@0x07fc0000 {
222                                 label = "wifi_data";
223                                 reg = <0x07fc0000 0x00040000>;
224                                 read-only;
225                         };
226
227                         partition0,11@0x00180000 {
228                                 label = "firmware";
229                                 reg = <0x00180000 0x01860000>;
230                                 read-only;
231                         };
232                 };
233         };
234 };
235
236 &UART0 {
237         status = "okay";
238 };
239
240 &GPIO0 {
241         status = "okay";
242         #interrupt-cells = <2>;
243         interrupt-controller;
244         interrupts-extended = <&UIC1 0x14>,
245                               <&UIC1 0x1e>,
246                               <&UIC1 0x1f>,
247                               <&UIC2 0x19>;
248 };
249
250 &IIC0 {
251         status = "okay";
252
253         fan0: fan@1b {
254                 compatible = "microchip,tc654";
255                 reg = <0x1b>;
256                 cooling-min-level = <0>;
257                 cooling-max-level = <255>;
258                 #cooling-cells = <2>; /* min followed by max */
259
260                 gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; /* fan status */
261                 alarm-gpios = <&GPIO0 5 GPIO_ACTIVE_LOW>; /* fault */
262                 interrupt-parent = <&UIC3>;
263                 interrupts = <0x16 IRQ_TYPE_EDGE_FALLING>; /* fault */
264         };
265
266         temp0: temp@4d {
267                 compatible = "gmt,g781";
268                 reg = <0x4d>;
269                 #thermal-sensor-cells = <1>;
270
271                 /*
272                  * The LM90 has two sensors:
273                  *   temp0 -> internal to LM90
274                  *   temp1 -> external NTC near CPU
275                  */
276         };
277 };
278
279
280 &EMAC0 {
281         status = "okay";
282         phy-handle = <&phy0>;
283
284         mdio {
285                 #address-cells = <1>;
286                 #size-cells = <0>;
287                 phy0: ethernet-phy@0 {
288                         device_type = "ethernet-phy";
289                         reg = <0>;
290                         qca,ar8327-initvals = <
291                                 0x0010 0x40000000
292                                 0x0624 0x007f7f7f
293                                 0x0004 0x07a00000       /* PAD0_MODE */
294                                 0x000c 0x01000000       /* PAD6_MODE */
295                                 0x007c 0x0000007e       /* PORT0_STATUS */
296                         >;
297                 };
298         };
299 };
300
301 &POB0 {
302         gpio_keys_polled {
303                 compatible = "gpio-keys-polled";
304                 #address-cells = <1>;
305                 #size-cells = <0>;
306                 #interrupt-cells = <2>;
307                 autorepeat;
308                 poll-interval = <60>;   /* 3 * 20 = 60ms */
309
310                 reset {
311                         label = "Reset button";
312                         linux,code = <KEY_RESTART>;
313                         gpios = <&GPIO0 15 GPIO_ACTIVE_HIGH>;
314                         interrupt-parent = <&UIC1>;
315                         interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>;
316                 };
317
318                 backup_hd {
319                         label = "Backup HD button";
320                         gpios = <&GPIO0 19 GPIO_ACTIVE_HIGH>;
321                         linux,code = <BTN_0>;
322                         interrupt-parent = <&UIC1>;
323                         interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>;
324                 };
325
326                 rfkill {
327                         label = "RFKILL button";
328                         gpios = <&GPIO0 20 GPIO_ACTIVE_HIGH>;
329                         linux,code = <KEY_RFKILL>;
330                         interrupt-parent = <&UIC1>;
331                         interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>;
332                 };
333
334                 wps {
335                         label = "WPS button";
336                         gpios = <&GPIO0 23 GPIO_ACTIVE_HIGH>;
337                         linux,code = <KEY_WPS_BUTTON>;
338                         interrupt-parent = <&UIC2>;
339                         interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>;
340                 };
341
342                 sdcard {
343                         label = "SDCard inserted";
344                         gpios = <&GPIO0 7 GPIO_ACTIVE_LOW>;
345                         linux,code = <BTN_1>;
346                 };
347         };
348
349         gpio-leds {
350                 compatible = "gpio-leds";
351                 power-green {
352                         label = "wndr4700:green:power";
353                         gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>;
354                 };
355
356                 power-orange {
357                         label = "wndr4700:orange:power";
358                         gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>;
359                         linux,default-trigger = "panic";
360                 };
361
362                 usb-blue {
363                         label = "wndr4700:blue:usb";
364                         gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>;
365                 };
366
367                 logo-white {
368                         label = "wndr4700:white:logo";
369                         gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>;
370                 };
371
372                 wan-yellow {
373                         label = "wndr4700:yellow:wan";
374                         gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>;
375                 };
376
377                 wan-green {
378                         label = "wndr4700:green:wan";
379                         gpios = <&GPIO0 12 GPIO_ACTIVE_HIGH>;
380                 };
381
382                 hd-green {
383                         label = "wndr4700:green:hd";
384                         gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>;
385                 };
386
387                 hd-red {
388                         label = "wndr4700:red:hd";
389                         gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>;
390                 };
391
392                 wlan-blue {
393                         label = "wndr4700:blue:wlan";
394                         gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>;
395                 };
396         };
397 };
398
399 &PCIE0 {
400         status = "okay";
401 };
402
403 &MSI {
404         status = "okay";
405 };