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