mvebu: add support for the Linksys WRT3200ACM (Rango)
[lede.git] / target / linux / mvebu / files / arch / arm / boot / dts / armada-385-linksys-rango.dts
1 /*
2  * Device Tree file for the Linksys WRT3200ACM (Rango)
3  *
4  * Copyright (C) 2016 Imre Kaloz <kaloz@openwrt.org>
5  *
6  *
7  * This file is dual-licensed: you can use it either under the terms
8  * of the GPL or the X11 license, at your option. Note that this dual
9  * licensing only applies to this file, and not this project as a
10  * whole.
11  *
12  *  a) This file is licensed under the terms of the GNU General Public
13  *     License version 2.  This program is licensed "as is" without
14  *     any warranty of any kind, whether express or implied.
15  *
16  * Or, alternatively,
17  *
18  *  b) Permission is hereby granted, free of charge, to any person
19  *     obtaining a copy of this software and associated documentation
20  *     files (the "Software"), to deal in the Software without
21  *     restriction, including without limitation the rights to use,
22  *     copy, modify, merge, publish, distribute, sublicense, and/or
23  *     sell copies of the Software, and to permit persons to whom the
24  *     Software is furnished to do so, subject to the following
25  *     conditions:
26  *
27  *     The above copyright notice and this permission notice shall be
28  *     included in all copies or substantial portions of the Software.
29  *
30  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
32  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
34  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
35  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
36  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
37  *     OTHER DEALINGS IN THE SOFTWARE.
38  */
39
40 /dts-v1/;
41 #include <dt-bindings/gpio/gpio.h>
42 #include <dt-bindings/input/input.h>
43 #include "armada-385.dtsi"
44
45 / {
46         model = "Linksys WRT3200ACM";
47         compatible = "linksys,rango", "linksys,armada385", "marvell,armada385",
48                      "marvell,armada380";
49
50         chosen {
51                 stdout-path = "serial0:115200n8";
52         };
53
54         memory {
55                 device_type = "memory";
56                 reg = <0x00000000 0x20000000>; /* 512 MB */
57         };
58
59         soc {
60                 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
61                           MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
62                           MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
63                           MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000
64                           MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>;
65
66                 internal-regs {
67
68                         spi@10600 {
69                                 status = "disabled";
70                         };
71
72                         i2c@11000 {
73                                 pinctrl-names = "default";
74                                 pinctrl-0 = <&i2c0_pins>;
75                                 status = "okay";
76
77                                 tmp421@4c {
78                                         compatible = "ti,tmp421";
79                                         reg = <0x4c>;
80                                 };
81
82                                 pca9635@68 {
83                                         #address-cells = <1>;
84                                         #size-cells = <0>;
85                                         compatible = "nxp,pca9635";
86                                         reg = <0x68>;
87
88                                         wan_amber@0 {
89                                                 label = "rango:amber:wan";
90                                                 reg = <0x0>;
91                                         };
92
93                                         wan_white@1 {
94                                                 label = "rango:white:wan";
95                                                 reg = <0x1>;
96                                         };
97
98                                         wlan_2g@2 {
99                                                 label = "rango:white:wlan_2g";
100                                                 reg = <0x2>;
101                                         };
102
103                                         wlan_5g@3 {
104                                                 label = "rango:white:wlan_5g";
105                                                 reg = <0x3>;
106                                         };
107
108                                         usb2@5 {
109                                                 label = "rango:white:usb2";
110                                                 reg = <0x5>;
111                                         };
112
113                                         usb3_1@6 {
114                                                 label = "rango:white:usb3_1";
115                                                 reg = <0x6>;
116                                         };
117
118                                         usb3_2@7 {
119                                                 label = "rango:white:usb3_2";
120                                                 reg = <0x7>;
121                                         };
122
123                                         wps_white@8 {
124                                                 label = "rango:white:wps";
125                                                 reg = <0x8>;
126                                         };
127
128                                         wps_amber@9 {
129                                                 label = "rango:amber:wps";
130                                                 reg = <0x9>;
131                                         };
132                                 };
133                         };
134
135                         /* J10: VCC, NC, RX, NC, TX, GND  */
136                         serial@12000 {
137                                 status = "okay";
138                         };
139
140                         ethernet@70000 {
141                                 status = "okay";
142                                 phy-mode = "rgmii-id";
143                                 buffer-manager = <&bm>;
144                                 bm,pool-long = <0>;
145                                 bm,pool-short = <3>;
146                                 fixed-link {
147                                         speed = <1000>;
148                                         full-duplex;
149                                 };
150                         };
151
152                         ethernet@34000 {
153                                 status = "okay";
154                                 phy-mode = "sgmii";
155                                 buffer-manager = <&bm>;
156                                 bm,pool-long = <2>;
157                                 bm,pool-short = <3>;
158                                 fixed-link {
159                                         speed = <1000>;
160                                         full-duplex;
161                                 };
162                         };
163
164                         mdio {
165                                 status = "okay";
166                         };
167
168                         bm@c8000 {
169                                 status = "okay";
170                         };
171
172                         sata@a8000 {
173                                 status = "okay";
174                         };
175
176                         sdhci@d8000 {
177                                 pinctrl-names = "default";
178                                 pinctrl-0 = <&sdhci_pins>;
179                                 no-1-8-v;
180                                 broken-cd;
181                                 wp-inverted;
182                                 bus-width = <8>;
183                                 status = "okay";
184                         };
185
186                         /* USB part of the eSATA/USB 2.0 port */
187                         usb@58000 {
188                                 status = "okay";
189                         };
190
191                         usb3@f8000 {
192                                 status = "okay";
193                                 usb-phy = <&usb3_phy>;
194                         };
195
196                         flash@d0000 {
197                                 status = "okay";
198                                 num-cs = <1>;
199                                 marvell,nand-keep-config;
200                                 marvell,nand-enable-arbiter;
201                                 nand-on-flash-bbt;
202
203                                 partition@0 {
204                                         label = "u-boot";
205                                         reg = <0x0000000 0x200000>;  /* 2MB */
206                                         read-only;
207                                 };
208
209                                 partition@200000 {
210                                         label = "u_env";
211                                         reg = <0x200000 0x20000>;    /* 128KB */
212                                 };
213
214                                 partition@220000 {
215                                         label = "s_env";
216                                         reg = <0x220000 0x40000>;    /* 256KB */
217                                 };
218
219                                 partition@7e0000 {
220                                         label = "devinfo";
221                                         reg = <0x7e0000 0x40000>;   /* 256KB */
222                                         read-only;
223                                 };
224
225                                 partition@820000 {
226                                         label = "sysdiag";
227                                         reg = <0x820000 0x1e0000>;   /* 1920KB */
228                                         read-only;
229                                 };
230
231                                 /* kernel1 overlaps with rootfs1 by design */
232                                 partition@a00000 {
233                                         label = "kernel1";
234                                         reg = <0xa00000 0x5000000>;  /* 80MB */
235                                 };
236
237                                 partition@1000000 {
238                                         label = "rootfs1";
239                                         reg = <0x1000000 0x4a00000>;  /* 74MB */
240                                 };
241
242                                 /* kernel2 overlaps with rootfs2 by design */
243                                 partition@5a00000 {
244                                         label = "kernel2";
245                                         reg = <0x5a00000 0x5000000>; /* 80MB */
246                                 };
247
248                                 partition@6000000 {
249                                         label = "rootfs2";
250                                         reg = <0x6000000 0x4a00000>; /* 74MB */
251                                 };
252
253                                 /*
254                                  * 86MB, last MB is for the BBT, not writable
255                                  */
256                                 partition@aa00000 {
257                                         label = "syscfg";
258                                         reg = <0xaa00000 0x5600000>;
259                                 };
260
261                                 /*
262                                  * Unused area between "s_env" and "devinfo".
263                                  * Moved here because otherwise the renumbered
264                                  * partitions would break the bootloader
265                                  * supplied bootargs
266                                  */
267                                 partition@180000 {
268                                         label = "unused_area";
269                                         reg = <0x260000 0x5c0000>;   /* 5.75MB */
270                                 };
271                         };
272                 };
273
274                 bm-bppi {
275                         status = "okay";
276                 };
277
278                 pcie-controller {
279                         status = "okay";
280
281                         pcie@1,0 {
282                                 /* Marvell 88W8964, 5GHz-only */
283                                 status = "okay";
284
285                                 mwlwifi {
286                                         marvell,2ghz = <0>;
287                                         marvell,chainmask = <4 4>;
288                                 };
289
290                         };
291
292                         pcie@2,0 {
293                                 /* Marvell 88W8964, 2GHz-only */
294                                 status = "okay";
295
296                                 mwlwifi {
297                                         marvell,5ghz = <0>;
298                                         marvell,chainmask = <4 4>;
299                                 };
300
301                         };
302                 };
303         };
304
305         usb3_phy: usb3_phy {
306                 compatible = "usb-nop-xceiv";
307                 vcc-supply = <&reg_xhci0_vbus>;
308         };
309
310         reg_xhci0_vbus: xhci0-vbus {
311                 compatible = "regulator-fixed";
312                 pinctrl-names = "default";
313                 pinctrl-0 = <&xhci0_vbus_pins>;
314                 regulator-name = "xhci0-vbus";
315                 regulator-min-microvolt = <5000000>;
316                 regulator-max-microvolt = <5000000>;
317                 enable-active-high;
318                 gpio = <&gpio1 16 GPIO_ACTIVE_HIGH>;
319         };
320
321         gpio_keys {
322                 compatible = "gpio-keys";
323                 #address-cells = <1>;
324                 #size-cells = <0>;
325                 pinctrl-0 = <&keys_pin>;
326                 pinctrl-names = "default";
327
328                 button@1 {
329                         label = "WPS";
330                         linux,code = <KEY_WPS_BUTTON>;
331                         gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
332                 };
333
334                 button@2 {
335                         label = "Factory Reset Button";
336                         linux,code = <KEY_RESTART>;
337                         gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
338                 };
339         };
340
341         gpio-leds {
342                 compatible = "gpio-leds";
343                 pinctrl-0 = <&power_led_pin &sata_led_pin>;
344                 pinctrl-names = "default";
345
346                 power {
347                         gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
348                         default-state = "on";
349                 };
350
351                 sata {
352                         gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
353                         default-state = "off";
354                 };
355         };
356
357         dsa@0 {
358                 compatible = "marvell,dsa";
359                 #address-cells = <2>;
360                 #size-cells = <0>;
361
362                 dsa,ethernet = <&eth2>;
363                 dsa,mii-bus = <&mdio>;
364
365                 switch@0 {
366                         #address-cells = <1>;
367                         #size-cells = <0>;
368                         reg = <0x0 0>;  /* MDIO address 0, switch 0 in tree */
369
370                         port@0 {
371                                 reg = <0>;
372                                 label = "lan4";
373                         };
374
375                         port@1 {
376                                 reg = <1>;
377                                 label = "lan3";
378                         };
379
380                         port@2 {
381                                 reg = <2>;
382                                 label = "lan2";
383                         };
384
385                         port@3 {
386                                 reg = <3>;
387                                 label = "lan1";
388                         };
389
390                         port@4 {
391                                 reg = <4>;
392                                 label = "wan";
393                         };
394
395                         port@5 {
396                                 reg = <5>;
397                                 label = "cpu";
398                         };
399                 };
400         };
401
402         gpio-leds {
403                 power {
404                         label = "rango:white:power";
405                 };
406
407                 sata {
408                         label = "rango:white:sata";
409                 };
410         };
411
412         mvsw61xx {
413                 #address-cells = <1>;
414                 #size-cells = <0>;
415                 compatible = "marvell,88e6352";
416                 status = "okay";
417                 reg = <0x10>;
418
419                 mii-bus = <&mdio>;
420                 cpu-port-0 = <5>;
421                 cpu-port-1 = <6>;
422         };
423
424 };
425
426 &pinctrl {
427         keys_pin: keys-pin {
428                 marvell,pins = "mpp24", "mpp29";
429                 marvell,function = "gpio";
430         };
431
432         power_led_pin: power-led-pin {
433                 marvell,pins = "mpp56";
434                 marvell,function = "gpio";
435         };
436
437         sata_led_pin: sata-led-pin {
438                 marvell,pins = "mpp21";
439                 marvell,function = "gpio";
440         };
441
442         xhci0_vbus_pins: xhci0-vbus-pins {
443                 marvell,pins = "mpp47";
444                 marvell,function = "gpio";
445         };
446 };