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