ramips: add support for TP-Link TL-WR840N v5
[oweals/openwrt.git] / target / linux / ramips / dts / TL-WR840NV5.dts
1 /dts-v1/;
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "tplink,tl-wr840n-v5", "mediatek,mt7628an-soc";
10         model = "TP-Link TL-WR840N v5";
11
12         chosen {
13                 bootargs = "console=ttyS0,115200";
14         };
15
16         memory@0 {
17                 device_type = "memory";
18                 reg = <0x0 0x4000000>;
19         };
20
21         gpio-keys-polled {
22                 compatible = "gpio-keys-polled";
23                 #address-cells = <1>;
24                 #size-cells = <0>;
25                 poll-interval = <20>;
26
27                 reset {
28                         label = "reset";
29                         gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
30                         linux,code = <KEY_RESTART>;
31                 };
32         };
33         /* LED used is dual-color,dual lead LED */
34         gpio-leds {
35                 compatible = "gpio-leds";
36
37                 power {
38                         label = "tl-wr840n-v5:green:power";
39                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
40                 };
41
42                 orange {
43                         label = "tl-wr840n-v5:orange:power";
44                         gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
45                 };
46         };
47 };
48
49 &spi0 {
50         status = "okay";
51
52         m25p80@0 {
53                 #address-cells = <1>;
54                 #size-cells = <1>;
55                 compatible = "jedec,spi-nor";
56                 reg = <0>;
57                 spi-max-frequency = <10000000>;
58                 m25p,chunked-io = <32>;
59
60                 partition@0 {
61                         label = "boot";
62                         reg = <0x0 0x20000>;
63                         read-only;
64                 };
65
66                 partition@20000 {
67                         label = "firmware";
68                         reg = <0x20000 0x3c0000>;
69                 };
70
71                 partition@3e0000 {
72                         label = "config";
73                         reg = <0x3e0000 0x10000>;
74                         read-only;
75                 };
76
77                 factory: partition@3f0000 {
78                         label = "factory";
79                         reg = <0x3f0000 0x10000>;
80                         read-only;
81                 };
82         };
83 };
84
85 &ehci {
86         status = "disabled";
87 };
88
89 &ohci {
90         status = "disabled";
91 };
92
93 &wmac {
94         status = "okay";
95         mtd-mac-address = <&factory 0xf100>;
96         mediatek,mtd-eeprom = <&factory 0x10000>;
97 };
98
99 &ethernet {
100         mtd-mac-address = <&factory 0xf100>;
101         mediatek,portmap = "wllll";
102 };
103
104 &pinctrl {
105         state_default: pinctrl0 {
106                 gpio {
107                         ralink,group = "p0led_an", "p2led_an", "perst";
108                         ralink,function = "gpio";
109                 };
110         };
111 };