000-new_linksys_boards.patch 15 KB

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