001-add_mamba_support.patch 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. From 4824140f4bd1caaf900215aabe27e4bdd1677704 Mon Sep 17 00:00:00 2001
  2. From: Imre Kaloz <kaloz@openwrt.org>
  3. Date: Mon, 16 Feb 2015 13:31:04 +0100
  4. Subject: [PATCH] ARM: mvebu: add Linksys WRT1900AC (Mamba) support
  5. The Linksys WRT1900AC (Mamba) is a router that has
  6. - 2 mini-PCIe slots with Marvell 88W8864 radios
  7. - 1 USB 3.0 port
  8. - 1 USB 2.0/eSATAp port
  9. - 2 Ethernet interfaces connected to a 88E6172 switch (1x WAN + 4x LAN)
  10. - 128MB NAND flash
  11. - 256MB RAM
  12. gregory.clement@free-electrons.com: - add ARM to the title
  13. - fix the reference to CONFIG_DEBUG_MVEBU_UART0_ALTERNATE
  14. - fix the unbalanced comment for the syscfg partition
  15. Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
  16. Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
  17. Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
  18. ---
  19. arch/arm/boot/dts/Makefile | 1 +
  20. arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 348 ++++++++++++++++++++++++++
  21. 2 files changed, 349 insertions(+)
  22. create mode 100644 arch/arm/boot/dts/armada-xp-linksys-mamba.dts
  23. --- a/arch/arm/boot/dts/Makefile
  24. +++ b/arch/arm/boot/dts/Makefile
  25. @@ -506,6 +506,7 @@ dtb-$(CONFIG_MACH_ARMADA_XP) += \
  26. armada-xp-db.dtb \
  27. armada-xp-gp.dtb \
  28. armada-xp-lenovo-ix4-300d.dtb \
  29. + armada-xp-linksys-mamba.dtb \
  30. armada-xp-matrix.dtb \
  31. armada-xp-netgear-rn2120.dtb \
  32. armada-xp-openblocks-ax3-4.dtb
  33. --- /dev/null
  34. +++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
  35. @@ -0,0 +1,348 @@
  36. +/*
  37. + * Device Tree file for the Linksys WRT1900AC (Mamba).
  38. + *
  39. + * Note: this board is shipped with a new generation boot loader that
  40. + * remaps internal registers at 0xf1000000. Therefore, if earlyprintk
  41. + * is used, the CONFIG_DEBUG_MVEBU_UART0_ALTERNATE option should be
  42. + * used.
  43. + *
  44. + * Copyright (C) 2014 Imre Kaloz <kaloz@openwrt.org>
  45. + *
  46. + * Based on armada-xp-axpwifiap.dts:
  47. + *
  48. + * Copyright (C) 2013 Marvell
  49. + *
  50. + * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  51. + *
  52. + * This file is dual-licensed: you can use it either under the terms
  53. + * of the GPL or the X11 license, at your option. Note that this dual
  54. + * licensing only applies to this file, and not this project as a
  55. + * whole.
  56. + *
  57. + * a) This file is licensed under the terms of the GNU General Public
  58. + * License version 2. This program is licensed "as is" without
  59. + * any warranty of any kind, whether express or implied.
  60. + *
  61. + * Or, alternatively,
  62. + *
  63. + * b) Permission is hereby granted, free of charge, to any person
  64. + * obtaining a copy of this software and associated documentation
  65. + * files (the "Software"), to deal in the Software without
  66. + * restriction, including without limitation the rights to use,
  67. + * copy, modify, merge, publish, distribute, sublicense, and/or
  68. + * sell copies of the Software, and to permit persons to whom the
  69. + * Software is furnished to do so, subject to the following
  70. + * conditions:
  71. + *
  72. + * The above copyright notice and this permission notice shall be
  73. + * included in all copies or substantial portions of the Software.
  74. + *
  75. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  76. + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  77. + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  78. + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  79. + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  80. + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  81. + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  82. + * OTHER DEALINGS IN THE SOFTWARE.
  83. + */
  84. +
  85. +/dts-v1/;
  86. +#include <dt-bindings/gpio/gpio.h>
  87. +#include <dt-bindings/input/input.h>
  88. +#include "armada-xp-mv78230.dtsi"
  89. +
  90. +/ {
  91. + model = "Linksys WRT1900AC";
  92. + compatible = "linksys,mamba", "marvell,armadaxp-mv78230",
  93. + "marvell,armadaxp", "marvell,armada-370-xp";
  94. +
  95. + chosen {
  96. + bootargs = "console=ttyS0,115200";
  97. + stdout-path = &uart0;
  98. + };
  99. +
  100. + memory {
  101. + device_type = "memory";
  102. + reg = <0x00000000 0x00000000 0x00000000 0x10000000>; /* 256MB */
  103. + };
  104. +
  105. + soc {
  106. + ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
  107. + MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
  108. +
  109. + pcie-controller {
  110. + status = "okay";
  111. +
  112. + /* Etron EJ168 USB 3.0 controller */
  113. + pcie@1,0 {
  114. + /* Port 0, Lane 0 */
  115. + status = "okay";
  116. + };
  117. +
  118. + /* First mini-PCIe port */
  119. + pcie@2,0 {
  120. + /* Port 0, Lane 1 */
  121. + status = "okay";
  122. + };
  123. +
  124. + /* Second mini-PCIe port */
  125. + pcie@3,0 {
  126. + /* Port 0, Lane 3 */
  127. + status = "okay";
  128. + };
  129. + };
  130. +
  131. + internal-regs {
  132. +
  133. + /* J10: VCC, NC, RX, NC, TX, GND */
  134. + serial@12000 {
  135. + status = "okay";
  136. + };
  137. +
  138. + sata@a0000 {
  139. + nr-ports = <1>;
  140. + status = "okay";
  141. + };
  142. +
  143. + ethernet@70000 {
  144. + pinctrl-0 = <&ge0_rgmii_pins>;
  145. + pinctrl-names = "default";
  146. + status = "okay";
  147. + phy-mode = "rgmii-id";
  148. + fixed-link {
  149. + speed = <1000>;
  150. + full-duplex;
  151. + };
  152. + };
  153. +
  154. + ethernet@74000 {
  155. + pinctrl-0 = <&ge1_rgmii_pins>;
  156. + pinctrl-names = "default";
  157. + status = "okay";
  158. + phy-mode = "rgmii-id";
  159. + fixed-link {
  160. + speed = <1000>;
  161. + full-duplex;
  162. + };
  163. + };
  164. +
  165. + /* USB part of the eSATA/USB 2.0 port */
  166. + usb@50000 {
  167. + status = "okay";
  168. + };
  169. +
  170. + i2c@11000 {
  171. + status = "okay";
  172. + clock-frequency = <100000>;
  173. +
  174. + tmp421@4c {
  175. + compatible = "ti,tmp421";
  176. + reg = <0x4c>;
  177. + };
  178. +
  179. + tlc59116@68 {
  180. + #address-cells = <1>;
  181. + #size-cells = <0>;
  182. + #gpio-cells = <2>;
  183. + compatible = "ti,tlc59116";
  184. + reg = <0x68>;
  185. +
  186. + wan_amber@0 {
  187. + label = "mamba:amber:wan";
  188. + reg = <0x0>;
  189. + };
  190. +
  191. + wan_white@1 {
  192. + label = "mamba:white:wan";
  193. + reg = <0x1>;
  194. + };
  195. +
  196. + wlan_2g@2 {
  197. + label = "mamba:white:wlan_2g";
  198. + reg = <0x2>;
  199. + };
  200. +
  201. + wlan_5g@3 {
  202. + label = "mamba:white:wlan_5g";
  203. + reg = <0x3>;
  204. + };
  205. +
  206. + esata@4 {
  207. + label = "mamba:white:esata";
  208. + reg = <0x4>;
  209. + };
  210. +
  211. + usb2@5 {
  212. + label = "mamba:white:usb2";
  213. + reg = <0x5>;
  214. + };
  215. +
  216. + usb3_1@6 {
  217. + label = "mamba:white:usb3_1";
  218. + reg = <0x6>;
  219. + };
  220. +
  221. + usb3_2@7 {
  222. + label = "mamba:white:usb3_2";
  223. + reg = <0x7>;
  224. + };
  225. +
  226. + wps_white@8 {
  227. + label = "mamba:white:wps";
  228. + reg = <0x8>;
  229. + };
  230. +
  231. + wps_amber@9 {
  232. + label = "mamba:amber:wps";
  233. + reg = <0x9>;
  234. + };
  235. + };
  236. + };
  237. +
  238. + nand@d0000 {
  239. + status = "okay";
  240. + num-cs = <1>;
  241. + marvell,nand-keep-config;
  242. + marvell,nand-enable-arbiter;
  243. + nand-on-flash-bbt;
  244. + nand-ecc-strength = <4>;
  245. + nand-ecc-step-size = <512>;
  246. +
  247. + partition@0 {
  248. + label = "u-boot";
  249. + reg = <0x0000000 0x100000>; /* 1MB */
  250. + read-only;
  251. + };
  252. +
  253. + partition@100000 {
  254. + label = "u_env";
  255. + reg = <0x100000 0x40000>; /* 256KB */
  256. + };
  257. +
  258. + partition@140000 {
  259. + label = "s_env";
  260. + reg = <0x140000 0x40000>; /* 256KB */
  261. + };
  262. +
  263. + partition@900000 {
  264. + label = "devinfo";
  265. + reg = <0x900000 0x100000>; /* 1MB */
  266. + read-only;
  267. + };
  268. +
  269. + /* kernel1 overlaps with rootfs1 by design */
  270. + partition@a00000 {
  271. + label = "kernel1";
  272. + reg = <0xa00000 0x2800000>; /* 40MB */
  273. + };
  274. +
  275. + partition@d00000 {
  276. + label = "rootfs1";
  277. + reg = <0xd00000 0x2500000>; /* 37MB */
  278. + };
  279. +
  280. + /* kernel2 overlaps with rootfs2 by design */
  281. + partition@3200000 {
  282. + label = "kernel2";
  283. + reg = <0x3200000 0x2800000>; /* 40MB */
  284. + };
  285. +
  286. + partition@3500000 {
  287. + label = "rootfs2";
  288. + reg = <0x3500000 0x2500000>; /* 37MB */
  289. + };
  290. +
  291. + /*
  292. + * 38MB, last MB is for the BBT, not writable
  293. + */
  294. + partition@5a00000 {
  295. + label = "syscfg";
  296. + reg = <0x5a00000 0x2600000>;
  297. + };
  298. +
  299. + /*
  300. + * Unused area between "s_env" and "devinfo".
  301. + * Moved here because otherwise the renumbered
  302. + * partitions would break the bootloader
  303. + * supplied bootargs
  304. + */
  305. + partition@180000 {
  306. + label = "unused_area";
  307. + reg = <0x180000 0x780000>; /* 7.5MB */
  308. + };
  309. + };
  310. +
  311. + spi0: spi@10600 {
  312. + status = "okay";
  313. +
  314. + spi-flash@0 {
  315. + #address-cells = <1>;
  316. + #size-cells = <1>;
  317. + compatible = "everspin,mr25h256";
  318. + reg = <0>; /* Chip select 0 */
  319. + spi-max-frequency = <40000000>;
  320. + };
  321. + };
  322. + };
  323. + };
  324. +
  325. + gpio_keys {
  326. + compatible = "gpio-keys";
  327. + #address-cells = <1>;
  328. + #size-cells = <0>;
  329. + pinctrl-0 = <&keys_pin>;
  330. + pinctrl-names = "default";
  331. +
  332. + button@1 {
  333. + label = "WPS";
  334. + linux,code = <KEY_WPS_BUTTON>;
  335. + gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
  336. + };
  337. +
  338. + button@2 {
  339. + label = "Factory Reset Button";
  340. + linux,code = <KEY_RESTART>;
  341. + gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
  342. + };
  343. + };
  344. +
  345. + gpio-leds {
  346. + compatible = "gpio-leds";
  347. + pinctrl-0 = <&power_led_pin>;
  348. + pinctrl-names = "default";
  349. +
  350. + power {
  351. + label = "mamba:white:power";
  352. + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
  353. + default-state = "on";
  354. + };
  355. + };
  356. +
  357. + gpio_fan {
  358. + /* SUNON HA4010V4-0000-C99 */
  359. + compatible = "gpio-fan";
  360. + gpios = <&gpio0 24 0>;
  361. +
  362. + gpio-fan,speed-map = <0 0
  363. + 4500 1>;
  364. + };
  365. +};
  366. +
  367. +&pinctrl {
  368. +
  369. + keys_pin: keys-pin {
  370. + marvell,pins = "mpp32", "mpp33";
  371. + marvell,function = "gpio";
  372. + };
  373. +
  374. + power_led_pin: power-led-pin {
  375. + marvell,pins = "mpp40";
  376. + marvell,function = "gpio";
  377. + };
  378. +
  379. + gpio_fan_pin: gpio-fan-pin {
  380. + marvell,pins = "mpp24";
  381. + marvell,function = "gpio";
  382. + };
  383. +};