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