lantiq: tdw90x0: Fix WLAN LED on TP-Link W8970 v1.2 (FS#2232)
[oweals/openwrt.git] / target / linux / lantiq / files-4.14 / arch / mips / boot / dts / TDW89X0.dtsi
1 #include "vr9.dtsi"
2
3 #include <dt-bindings/input/input.h>
4 #include <dt-bindings/mips/lantiq_rcu_gphy.h>
5
6 / {
7         compatible = "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9";
8
9         chosen {
10                 bootargs = "console=ttyLTQ0,115200";
11         };
12
13         aliases {
14                 /* the power led can't be controlled, use the wps led instead */
15                 led-boot = &wps;
16                 led-failsafe = &wps;
17
18                 led-dsl = &dsl;
19                 led-internet = &internet;
20                 led-wifi = &wifi;
21                 led-usb = &led_usb0;
22                 led-usb2 = &led_usb2;
23         };
24
25         memory@0 {
26                 reg = <0x0 0x4000000>;
27         };
28
29         gpio-keys-polled {
30                 compatible = "gpio-keys-polled";
31                 #address-cells = <1>;
32                 #size-cells = <0>;
33                 poll-interval = <100>;
34                 reset {
35                         label = "reset";
36                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
37                         linux,code = <KEY_RESTART>;
38                 };
39
40                 wifi {
41                         label = "wifi";
42                         gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
43                         linux,code = <KEY_RFKILL>;
44                         linux,input-type = <EV_SW>;
45                 };
46
47                 wps {
48                         label = "wps";
49                         gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
50                         linux,code = <KEY_WPS_BUTTON>;
51                 };
52         };
53
54         gpio-leds {
55                 compatible = "gpio-leds";
56                 /*
57                         power is not controllable via gpio
58                 */
59                 dsl: dsl {
60                         label = "tdw89x0:green:dsl";
61                         gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
62                 };
63                 internet: internet {
64                         label = "tdw89x0:green:internet";
65                         gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
66                 };
67
68                 led_usb0: usb0 {
69                         label = "tdw89x0:green:usb";
70                         gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
71                 };
72                 led_usb2: usb2 {
73                         label = "tdw89x0:green:usb2";
74                         gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
75                 };
76                 wps: wps {
77                         label = "tdw89x0:green:wps";
78                         gpios = <&gpio 37 GPIO_ACTIVE_HIGH>;
79                 };
80         };
81
82         wifi-leds {
83                 compatible = "gpio-leds";
84
85                 wifi: wifi {
86                         label = "tdw89x0:green:wifi";
87                         gpios = <&ath9k 0 GPIO_ACTIVE_HIGH>;
88                         linux,default-trigger = "phy0tpt";
89                 };
90         };
91
92
93         usb_vbus: regulator-usb-vbus {
94                 compatible = "regulator-fixed";
95
96                 regulator-name = "USB_VBUS";
97
98                 regulator-min-microvolt = <5000000>;
99                 regulator-max-microvolt = <5000000>;
100
101                 gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
102                 enable-active-high;
103         };
104 };
105
106 &eth0 {
107         lan: interface@0 {
108                 compatible = "lantiq,xrx200-pdi";
109                 #address-cells = <1>;
110                 #size-cells = <0>;
111                 reg = <0>;
112                 mtd-mac-address = <&ath9k_cal 0xf100>;
113                 lantiq,switch;
114
115                 ethernet@0 {
116                         compatible = "lantiq,xrx200-pdi-port";
117                         reg = <0>;
118                         phy-mode = "rgmii";
119                         phy-handle = <&phy0>;
120                         // gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
121                 };
122                 ethernet@5 {
123                         compatible = "lantiq,xrx200-pdi-port";
124                         reg = <5>;
125                         phy-mode = "rgmii";
126                         phy-handle = <&phy5>;
127                 };
128                 ethernet@2 {
129                         compatible = "lantiq,xrx200-pdi-port";
130                         reg = <2>;
131                         phy-mode = "gmii";
132                         phy-handle = <&phy11>;
133                 };
134                 ethernet@3 {
135                         compatible = "lantiq,xrx200-pdi-port";
136                         reg = <4>;
137                         phy-mode = "gmii";
138                         phy-handle = <&phy13>;
139                 };
140         };
141
142         mdio@0 {
143                 #address-cells = <1>;
144                 #size-cells = <0>;
145                 compatible = "lantiq,xrx200-mdio";
146                 reg = <0>;
147
148                 phy0: ethernet-phy@0 {
149                         reg = <0x0>;
150                         compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
151                 };
152                 phy5: ethernet-phy@5 {
153                         reg = <0x5>;
154                         compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
155                 };
156                 phy11: ethernet-phy@11 {
157                         reg = <0x11>;
158                         compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
159                 };
160                 phy13: ethernet-phy@13 {
161                         reg = <0x13>;
162                         compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
163                 };
164         };
165 };
166
167 &gphy0 {
168         lantiq,gphy-mode = <GPHY_MODE_GE>;
169 };
170
171 &gphy1 {
172         lantiq,gphy-mode = <GPHY_MODE_GE>;
173 };
174
175 &gpio {
176         pinctrl-names = "default";
177         pinctrl-0 = <&state_default>;
178
179         state_default: pinmux {
180                 mdio {
181                         lantiq,groups = "mdio";
182                         lantiq,function = "mdio";
183                 };
184                 gphy-leds {
185                         lantiq,groups = "gphy0 led1", "gphy1 led1";
186                         lantiq,function = "gphy";
187                         lantiq,pull = <2>;
188                         lantiq,open-drain = <0>;
189                         lantiq,output = <1>;
190                 };
191                 phy-rst {
192                         lantiq,pins = "io42";
193                         lantiq,pull = <0>;
194                         lantiq,open-drain = <0>;
195                         lantiq,output = <1>;
196                 };
197                 pcie-rst {
198                         lantiq,pins = "io38";
199                         lantiq,pull = <0>;
200                         lantiq,output = <1>;
201                 };
202         };
203         pins_spi_default: pins_spi_default {
204                 spi_in {
205                         lantiq,groups = "spi_di";
206                         lantiq,function = "spi";
207                 };
208                 spi_out {
209                         lantiq,groups = "spi_do", "spi_clk",
210                                 "spi_cs4";
211                         lantiq,function = "spi";
212                         lantiq,output = <1>;
213                 };
214         };
215 };
216
217 &pcie0 {
218         pcie@0 {
219                 reg = <0 0 0 0 0>;
220                 #interrupt-cells = <1>;
221                 #size-cells = <2>;
222                 #address-cells = <3>;
223                 device_type = "pci";
224
225                 ath9k: wifi@168c,002e {
226                         compatible = "pci168c,002e";
227                         reg = <0 0 0 0 0>;
228                         #gpio-cells = <2>;
229                         gpio-controller;
230                         qca,no-eeprom;
231                         qca,disable-5ghz;
232                         mtd-mac-address = <&ath9k_cal 0xf100>;
233                         mtd-mac-address-increment = <2>;
234                 };
235         };
236 };
237
238 &spi {
239         status = "okay";
240
241         pinctrl-names = "default";
242         pinctrl-0 = <&pins_spi_default>;
243
244         m25p80@4 {
245                 #address-cells = <1>;
246                 #size-cells = <1>;
247                 compatible = "jedec,spi-nor";
248                 reg = <4 0>;
249                 spi-max-frequency = <33250000>;
250                 m25p,fast-read;
251
252                 partitions {
253                         compatible = "fixed-partitions";
254                         #address-cells = <1>;
255                         #size-cells = <1>;
256
257                         partition@0 {
258                                 reg = <0x0 0x20000>;
259                                 label = "u-boot";
260                                 read-only;
261                         };
262
263                         partition@20000 {
264                                 reg = <0x20000 0x7a0000>;
265                                 label = "firmware";
266                         };
267
268                         partition@7c0000 {
269                                 reg = <0x7c0000 0x10000>;
270                                 label = "config";
271                                 read-only;
272                         };
273
274                         ath9k_cal: partition@7d0000 {
275                                 reg = <0x7d0000 0x30000>;
276                                 label = "boardconfig";
277                                 read-only;
278                         };
279                 };
280         };
281 };
282
283 &usb_phy0 {
284         status = "okay";
285 };
286
287 &usb_phy1 {
288         status = "okay";
289 };
290
291 &usb0 {
292         status = "okay";
293         vbus-supply = <&usb_vbus>;
294 };
295
296 &usb1 {
297         status = "okay";
298         vbus-supply = <&usb_vbus>;
299 };