mvebu: add support for 4.1 and switch over
[openwrt/openwrt.git] / target / linux / mvebu / patches-4.1 / 000-new_linksys_boards.patch
1 From 3abdd583312a2830129dc42e1e3d98368a8fda47 Mon Sep 17 00:00:00 2001
2 From: Imre Kaloz <kaloz@openwrt.org>
3 Date: Wed, 20 May 2015 23:14:16 +0200
4 Subject: ARM: mvebu: add support for the new Armada 385 based Linksys boards
5
6 This patch adds support for the Linksys WRT1200AC (Caiman) and
7 the Linksys WRT1900AC v2 (Cobra).
8
9 Both boards have:
10
11 - 2 Marvell 88W8864 radios
12 - 1 USB 3.0 port
13 - 1 USB 2.0/eSATAp port
14 - 2 Ethernet interfaces connected to a 88E6176 switch (1x WAN + 4x LAN)
15 - 128MB NAND flash
16 - 512MB RAM
17
18 gregory.clement@free-electrons.com: use serial0:115200n8 in
19 stdout-path and remove the bootargs part in the chosen node
20
21 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
22 Acked-by: Andrew Lunn <andrew@lunn.ch>
23 Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
24 ---
25 arch/arm/boot/dts/Makefile | 2 +
26 arch/arm/boot/dts/armada-385-linksys-caiman.dts | 114 ++++++++
27 arch/arm/boot/dts/armada-385-linksys-cobra.dts | 114 ++++++++
28 arch/arm/boot/dts/armada-385-linksys.dtsi | 332 ++++++++++++++++++++++++
29 4 files changed, 562 insertions(+)
30 create mode 100644 arch/arm/boot/dts/armada-385-linksys-caiman.dts
31 create mode 100644 arch/arm/boot/dts/armada-385-linksys-cobra.dts
32 create mode 100644 arch/arm/boot/dts/armada-385-linksys.dtsi
33
34 --- a/arch/arm/boot/dts/Makefile
35 +++ b/arch/arm/boot/dts/Makefile
36 @@ -633,6 +633,8 @@ dtb-$(CONFIG_MACH_ARMADA_375) += \
37 armada-375-db.dtb
38 dtb-$(CONFIG_MACH_ARMADA_38X) += \
39 armada-385-db-ap.dtb \
40 + armada-385-linksys-caiman.dtb \
41 + armada-385-linksys-cobra.dtb \
42 armada-388-db.dtb \
43 armada-388-gp.dtb \
44 armada-388-rd.dtb
45 --- /dev/null
46 +++ b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
47 @@ -0,0 +1,114 @@
48 +/*
49 + * Device Tree include for the Linksys WRT1200AC (Caiman)
50 + *
51 + * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.org>
52 + *
53 + *
54 + * This file is dual-licensed: you can use it either under the terms
55 + * of the GPL or the X11 license, at your option. Note that this dual
56 + * licensing only applies to this file, and not this project as a
57 + * whole.
58 + *
59 + * a) This file is licensed under the terms of the GNU General Public
60 + * License version 2. This program is licensed "as is" without
61 + * any warranty of any kind, whether express or implied.
62 + *
63 + * Or, alternatively,
64 + *
65 + * b) Permission is hereby granted, free of charge, to any person
66 + * obtaining a copy of this software and associated documentation
67 + * files (the "Software"), to deal in the Software without
68 + * restriction, including without limitation the rights to use,
69 + * copy, modify, merge, publish, distribute, sublicense, and/or
70 + * sell copies of the Software, and to permit persons to whom the
71 + * Software is furnished to do so, subject to the following
72 + * conditions:
73 + *
74 + * The above copyright notice and this permission notice shall be
75 + * included in all copies or substantial portions of the Software.
76 + *
77 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
78 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
79 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
80 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
81 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
82 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
83 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
84 + * OTHER DEALINGS IN THE SOFTWARE.
85 + */
86 +
87 +/dts-v1/;
88 +#include "armada-385-linksys.dtsi"
89 +
90 +/ {
91 + model = "Linksys WRT1200AC";
92 + compatible = "linksys,caiman", "linksys,armada385", "marvell,armada385",
93 + "marvell,armada380";
94 +
95 + soc {
96 + internal-regs{
97 + i2c@11000 {
98 +
99 + pca9635@68 {
100 + #address-cells = <1>;
101 + #size-cells = <0>;
102 +
103 + wan_amber@0 {
104 + label = "caiman:amber:wan";
105 + reg = <0x0>;
106 + };
107 +
108 + wan_white@1 {
109 + label = "caiman:white:wan";
110 + reg = <0x1>;
111 + };
112 +
113 + wlan_2g@2 {
114 + label = "caiman:white:wlan_2g";
115 + reg = <0x2>;
116 + };
117 +
118 + wlan_5g@3 {
119 + label = "caiman:white:wlan_5g";
120 + reg = <0x3>;
121 + };
122 +
123 + usb2@5 {
124 + label = "caiman:white:usb2";
125 + reg = <0x5>;
126 + };
127 +
128 + usb3_1@6 {
129 + label = "caiman:white:usb3_1";
130 + reg = <0x6>;
131 + };
132 +
133 + usb3_2@7 {
134 + label = "caiman:white:usb3_2";
135 + reg = <0x7>;
136 + };
137 +
138 + wps_white@8 {
139 + label = "caiman:white:wps";
140 + reg = <0x8>;
141 + };
142 +
143 + wps_amber@9 {
144 + label = "caiman:amber:wps";
145 + reg = <0x9>;
146 + };
147 + };
148 + };
149 + };
150 + };
151 +
152 + gpio-leds {
153 + power {
154 + label = "caiman:white:power";
155 + };
156 +
157 + sata {
158 + label = "caiman:white:sata";
159 + };
160 + };
161 +};
162 --- /dev/null
163 +++ b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
164 @@ -0,0 +1,114 @@
165 +/*
166 + * Device Tree file for the Linksys WRT1900ACv2 (Cobra)
167 + *
168 + * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.org>
169 + *
170 + *
171 + * This file is dual-licensed: you can use it either under the terms
172 + * of the GPL or the X11 license, at your option. Note that this dual
173 + * licensing only applies to this file, and not this project as a
174 + * whole.
175 + *
176 + * a) This file is licensed under the terms of the GNU General Public
177 + * License version 2. This program is licensed "as is" without
178 + * any warranty of any kind, whether express or implied.
179 + *
180 + * Or, alternatively,
181 + *
182 + * b) Permission is hereby granted, free of charge, to any person
183 + * obtaining a copy of this software and associated documentation
184 + * files (the "Software"), to deal in the Software without
185 + * restriction, including without limitation the rights to use,
186 + * copy, modify, merge, publish, distribute, sublicense, and/or
187 + * sell copies of the Software, and to permit persons to whom the
188 + * Software is furnished to do so, subject to the following
189 + * conditions:
190 + *
191 + * The above copyright notice and this permission notice shall be
192 + * included in all copies or substantial portions of the Software.
193 + *
194 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
195 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
196 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
197 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
198 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
199 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
201 + * OTHER DEALINGS IN THE SOFTWARE.
202 + */
203 +
204 +/dts-v1/;
205 +#include "armada-385-linksys.dtsi"
206 +
207 +/ {
208 + model = "Linksys WRT1900ACv2";
209 + compatible = "linksys,cobra", "linksys,armada385", "marvell,armada385",
210 + "marvell,armada380";
211 +
212 + soc {
213 + internal-regs{
214 + i2c@11000 {
215 +
216 + pca9635@68 {
217 + #address-cells = <1>;
218 + #size-cells = <0>;
219 +
220 + wan_amber@0 {
221 + label = "cobra:amber:wan";
222 + reg = <0x0>;
223 + };
224 +
225 + wan_white@1 {
226 + label = "cobra:white:wan";
227 + reg = <0x1>;
228 + };
229 +
230 + wlan_2g@2 {
231 + label = "cobra:white:wlan_2g";
232 + reg = <0x2>;
233 + };
234 +
235 + wlan_5g@3 {
236 + label = "cobra:white:wlan_5g";
237 + reg = <0x3>;
238 + };
239 +
240 + usb2@5 {
241 + label = "cobra:white:usb2";
242 + reg = <0x5>;
243 + };
244 +
245 + usb3_1@6 {
246 + label = "cobra:white:usb3_1";
247 + reg = <0x6>;
248 + };
249 +
250 + usb3_2@7 {
251 + label = "cobra:white:usb3_2";
252 + reg = <0x7>;
253 + };
254 +
255 + wps_white@8 {
256 + label = "cobra:white:wps";
257 + reg = <0x8>;
258 + };
259 +
260 + wps_amber@9 {
261 + label = "cobra:amber:wps";
262 + reg = <0x9>;
263 + };
264 + };
265 + };
266 + };
267 + };
268 +
269 + gpio-leds {
270 + power {
271 + label = "cobra:white:power";
272 + };
273 +
274 + sata {
275 + label = "cobra:white:sata";
276 + };
277 + };
278 +};
279 --- /dev/null
280 +++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
281 @@ -0,0 +1,332 @@
282 +/*
283 + * Device Tree include file for Armada 385 based Linksys boards
284 + *
285 + * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.org>
286 + *
287 + *
288 + * This file is dual-licensed: you can use it either under the terms
289 + * of the GPL or the X11 license, at your option. Note that this dual
290 + * licensing only applies to this file, and not this project as a
291 + * whole.
292 + *
293 + * a) This file is licensed under the terms of the GNU General Public
294 + * License version 2. This program is licensed "as is" without
295 + * any warranty of any kind, whether express or implied.
296 + *
297 + * Or, alternatively,
298 + *
299 + * b) Permission is hereby granted, free of charge, to any person
300 + * obtaining a copy of this software and associated documentation
301 + * files (the "Software"), to deal in the Software without
302 + * restriction, including without limitation the rights to use,
303 + * copy, modify, merge, publish, distribute, sublicense, and/or
304 + * sell copies of the Software, and to permit persons to whom the
305 + * Software is furnished to do so, subject to the following
306 + * conditions:
307 + *
308 + * The above copyright notice and this permission notice shall be
309 + * included in all copies or substantial portions of the Software.
310 + *
311 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
312 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
313 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
314 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
315 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
316 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
317 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
318 + * OTHER DEALINGS IN THE SOFTWARE.
319 + */
320 +
321 +#include <dt-bindings/gpio/gpio.h>
322 +#include <dt-bindings/input/input.h>
323 +#include "armada-385.dtsi"
324 +
325 +/ {
326 + model = "Linksys boards based on Armada 385";
327 + compatible = "linksys,armada385", "marvell,armada385",
328 + "marvell,armada380";
329 +
330 + chosen {
331 + stdout-path = "serial0:115200n8";
332 + };
333 +
334 + memory {
335 + device_type = "memory";
336 + reg = <0x00000000 0x20000000>; /* 512 MB */
337 + };
338 +
339 + soc {
340 + ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
341 + MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
342 +
343 + internal-regs {
344 +
345 + spi@10600 {
346 + status = "disabled";
347 + };
348 +
349 + i2c@11000 {
350 + pinctrl-names = "default";
351 + pinctrl-0 = <&i2c0_pins>;
352 + status = "okay";
353 +
354 + tmp421@4c {
355 + compatible = "ti,tmp421";
356 + reg = <0x4c>;
357 + };
358 +
359 + pca9635@68 {
360 + #address-cells = <1>;
361 + #size-cells = <0>;
362 + compatible = "nxp,pca9635";
363 + reg = <0x68>;
364 + };
365 + };
366 +
367 + /* J10: VCC, NC, RX, NC, TX, GND */
368 + serial@12000 {
369 + status = "okay";
370 + };
371 +
372 + ethernet@70000 {
373 + status = "okay";
374 + phy-mode = "rgmii-id";
375 + fixed-link {
376 + speed = <1000>;
377 + full-duplex;
378 + };
379 + };
380 +
381 + ethernet@34000 {
382 + status = "okay";
383 + phy-mode = "sgmii";
384 + fixed-link {
385 + speed = <1000>;
386 + full-duplex;
387 + };
388 + };
389 +
390 + mdio {
391 + status = "okay";
392 + };
393 +
394 + sata@a8000 {
395 + status = "okay";
396 + };
397 +
398 + /* USB part of the eSATA/USB 2.0 port */
399 + usb@50000 {
400 + status = "okay";
401 + };
402 +
403 + usb3@f8000 {
404 + status = "okay";
405 + usb-phy = <&usb3_phy>;
406 + };
407 +
408 + flash@d0000 {
409 + status = "okay";
410 + num-cs = <1>;
411 + marvell,nand-keep-config;
412 + marvell,nand-enable-arbiter;
413 + nand-on-flash-bbt;
414 +
415 + partition@0 {
416 + label = "u-boot";
417 + reg = <0x0000000 0x200000>; /* 2MB */
418 + read-only;
419 + };
420 +
421 + partition@100000 {
422 + label = "u_env";
423 + reg = <0x200000 0x40000>; /* 256KB */
424 + };
425 +
426 + partition@140000 {
427 + label = "s_env";
428 + reg = <0x240000 0x40000>; /* 256KB */
429 + };
430 +
431 + partition@900000 {
432 + label = "devinfo";
433 + reg = <0x900000 0x100000>; /* 1MB */
434 + read-only;
435 + };
436 +
437 + /* kernel1 overlaps with rootfs1 by design */
438 + partition@a00000 {
439 + label = "kernel1";
440 + reg = <0xa00000 0x2800000>; /* 40MB */
441 + };
442 +
443 + partition@1000000 {
444 + label = "rootfs1";
445 + reg = <0x1000000 0x2200000>; /* 34MB */
446 + };
447 +
448 + /* kernel2 overlaps with rootfs2 by design */
449 + partition@3200000 {
450 + label = "kernel2";
451 + reg = <0x3200000 0x2800000>; /* 40MB */
452 + };
453 +
454 + partition@3800000 {
455 + label = "rootfs2";
456 + reg = <0x3800000 0x2200000>; /* 34MB */
457 + };
458 +
459 + /*
460 + * 38MB, last MB is for the BBT, not writable
461 + */
462 + partition@5a00000 {
463 + label = "syscfg";
464 + reg = <0x5a00000 0x2600000>;
465 + };
466 +
467 + /*
468 + * Unused area between "s_env" and "devinfo".
469 + * Moved here because otherwise the renumbered
470 + * partitions would break the bootloader
471 + * supplied bootargs
472 + */
473 + partition@180000 {
474 + label = "unused_area";
475 + reg = <0x280000 0x680000>; /* 6.5MB */
476 + };
477 + };
478 + };
479 +
480 + pcie-controller {
481 + status = "okay";
482 +
483 + pcie@1,0 {
484 + /* Marvell 88W8864, 5GHz-only */
485 + status = "okay";
486 + };
487 +
488 + pcie@2,0 {
489 + /* Marvell 88W8864, 2GHz-only */
490 + status = "okay";
491 + };
492 + };
493 + };
494 +
495 + usb3_phy: usb3_phy {
496 + compatible = "usb-nop-xceiv";
497 + vcc-supply = <&reg_xhci0_vbus>;
498 + };
499 +
500 + reg_xhci0_vbus: xhci0-vbus {
501 + compatible = "regulator-fixed";
502 + pinctrl-names = "default";
503 + pinctrl-0 = <&xhci0_vbus_pins>;
504 + regulator-name = "xhci0-vbus";
505 + regulator-min-microvolt = <5000000>;
506 + regulator-max-microvolt = <5000000>;
507 + enable-active-high;
508 + gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
509 + };
510 +
511 + gpio_keys {
512 + compatible = "gpio-keys";
513 + #address-cells = <1>;
514 + #size-cells = <0>;
515 + pinctrl-0 = <&keys_pin>;
516 + pinctrl-names = "default";
517 +
518 + button@1 {
519 + label = "WPS";
520 + linux,code = <KEY_WPS_BUTTON>;
521 + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
522 + };
523 +
524 + button@2 {
525 + label = "Factory Reset Button";
526 + linux,code = <KEY_RESTART>;
527 + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
528 + };
529 + };
530 +
531 + gpio-leds {
532 + compatible = "gpio-leds";
533 + pinctrl-0 = <&power_led_pin &sata_led_pin>;
534 + pinctrl-names = "default";
535 +
536 + power {
537 + gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
538 + default-state = "on";
539 + };
540 +
541 + sata {
542 + gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
543 + default-state = "off";
544 + };
545 + };
546 +
547 + dsa@0 {
548 + compatible = "marvell,dsa";
549 + #address-cells = <2>;
550 + #size-cells = <0>;
551 +
552 + dsa,ethernet = <&eth2>;
553 + dsa,mii-bus = <&mdio>;
554 +
555 + switch@0 {
556 + #address-cells = <1>;
557 + #size-cells = <0>;
558 + reg = <0x0 0>; /* MDIO address 0, switch 0 in tree */
559 +
560 + port@0 {
561 + reg = <0>;
562 + label = "lan4";
563 + };
564 +
565 + port@1 {
566 + reg = <1>;
567 + label = "lan3";
568 + };
569 +
570 + port@2 {
571 + reg = <2>;
572 + label = "lan2";
573 + };
574 +
575 + port@3 {
576 + reg = <3>;
577 + label = "lan1";
578 + };
579 +
580 + port@4 {
581 + reg = <4>;
582 + label = "wan";
583 + };
584 +
585 + port@5 {
586 + reg = <5>;
587 + label = "cpu";
588 + };
589 + };
590 + };
591 +};
592 +
593 +&pinctrl {
594 + keys_pin: keys-pin {
595 + marvell,pins = "mpp24", "mpp47";
596 + marvell,function = "gpio";
597 + };
598 +
599 + power_led_pin: power-led-pin {
600 + marvell,pins = "mpp55";
601 + marvell,function = "gpio";
602 + };
603 +
604 + sata_led_pin: sata-led-pin {
605 + marvell,pins = "mpp54";
606 + marvell,function = "gpio";
607 + };
608 +
609 + xhci0_vbus_pins: xhci0-vbus-pins {
610 + marvell,pins = "mpp50";
611 + marvell,function = "gpio";
612 + };
613 +};