ramips: add support for TP-Link Archer C20 v1
[openwrt/staging/chunkeey.git] / target / linux / ramips / dts / ArcherC20.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "tplink,c20", "ralink,mt7620a-soc";
10 model = "TP-Link Archer C20";
11
12 chosen {
13 bootargs = "console=ttyS0,115200";
14 };
15
16 gpio-leds {
17 compatible = "gpio-leds";
18
19 lan {
20 label = "c20:blue:lan";
21 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
22 };
23
24 power {
25 label = "c20:blue:power";
26 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
27 };
28
29 usb {
30 label = "c20:blue:usb";
31 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
32 };
33
34 wan {
35 label = "c20:blue:wan";
36 gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
37 };
38
39 wan_orange {
40 label = "c20:orange:wan";
41 gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
42 };
43
44 wlan5g {
45 label = "c20:blue:wlan5g";
46 gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
47 };
48
49 wlan2g {
50 label = "c20:blue:wlan2g";
51 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
52 };
53
54 wps {
55 label = "c20:blue:wps";
56 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
57 };
58 };
59
60 gpio-keys-polled {
61 compatible = "gpio-keys-polled";
62 #address-cells = <1>;
63 #size-cells = <0>;
64 poll-interval = <20>;
65
66 reset {
67 label = "reset";
68 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_RESTART>;
70 };
71
72 rfkill {
73 label = "rfkill";
74 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
75 linux,code = <KEY_RFKILL>;
76 }; };
77 };
78
79 &gpio1 {
80 status = "okay";
81 };
82
83 &gpio2 {
84 status = "okay";
85 };
86
87 &gpio3 {
88 status = "okay";
89 };
90
91 &spi0 {
92 status = "okay";
93
94 m25p80@0 {
95 #address-cells = <1>;
96 #size-cells = <1>;
97 compatible = "jedec,spi-nor";
98 reg = <0>;
99 spi-max-frequency = <10000000>;
100
101 partition@0 {
102 label = "u-boot";
103 reg = <0x0 0x20000>;
104 read-only;
105 };
106
107 partition@20000 {
108 label = "firmware";
109 reg = <0x20000 0x7a0000>;
110 };
111
112 partition@7c0000 {
113 label = "config";
114 reg = <0x7c0000 0x10000>;
115 read-only;
116 };
117
118 rom: partition@7d0000 {
119 label = "rom";
120 reg = <0x7d0000 0x10000>;
121 read-only;
122 };
123
124 partition@7e0000 {
125 label = "romfile";
126 reg = <0x7e0000 0x10000>;
127 read-only;
128 };
129
130 radio: partition@7f0000 {
131 label = "radio";
132 reg = <0x7f0000 0x10000>;
133 read-only;
134 };
135 };
136 };
137
138 &pinctrl {
139 state_default: pinctrl0 {
140 gpio {
141 ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk", "wdt";
142 ralink,function = "gpio";
143 };
144
145 pa {
146 ralink,group = "pa";
147 ralink,function = "pa";
148 };
149 };
150 };
151
152 &ethernet {
153 pinctrl-names = "default";
154 mtd-mac-address = <&rom 0xf100>;
155 mediatek,portmap = "wllll";
156 };
157
158 &ehci {
159 status = "okay";
160 };
161
162 &ohci {
163 status = "okay";
164 };
165
166 &gsw {
167 mediatek,port4 = "ephy";
168 };
169
170 &wmac {
171 ralink,mtd-eeprom = <&radio 0>;
172 mtd-mac-address = <&rom 0xf100>;
173 mtd-mac-address-increment = <(-2)>;
174 };
175
176 &pcie {
177 status = "okay";
178
179 pcie-bridge {
180 mt76@0,0 {
181 reg = <0x0000 0 0 0 0>;
182 device_type = "pci";
183 mediatek,mtd-eeprom = <&radio 32768>;
184 ieee80211-freq-limit = <5000000 6000000>;
185 mtd-mac-address = <&rom 0xf100>;
186 mtd-mac-address-increment = <(-1)>;
187 };
188 };
189 };