lantiq: dts: assign the MDIO pins to the gsw node
[openwrt/staging/rmilecki.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 gphy-leds {
179 lantiq,groups = "gphy0 led1", "gphy1 led1";
180 lantiq,function = "gphy";
181 lantiq,pull = <2>;
182 lantiq,open-drain = <0>;
183 lantiq,output = <1>;
184 };
185 phy-rst {
186 lantiq,pins = "io42";
187 lantiq,pull = <0>;
188 lantiq,open-drain = <0>;
189 lantiq,output = <1>;
190 };
191 pcie-rst {
192 lantiq,pins = "io38";
193 lantiq,pull = <0>;
194 lantiq,output = <1>;
195 };
196 };
197 pins_spi_default: pins_spi_default {
198 spi_in {
199 lantiq,groups = "spi_di";
200 lantiq,function = "spi";
201 };
202 spi_out {
203 lantiq,groups = "spi_do", "spi_clk",
204 "spi_cs4";
205 lantiq,function = "spi";
206 lantiq,output = <1>;
207 };
208 };
209 };
210
211 &pcie0 {
212 pcie@0 {
213 reg = <0 0 0 0 0>;
214 #interrupt-cells = <1>;
215 #size-cells = <2>;
216 #address-cells = <3>;
217 device_type = "pci";
218
219 ath9k: wifi@168c,002e {
220 compatible = "pci168c,002e";
221 reg = <0 0 0 0 0>;
222 #gpio-cells = <2>;
223 gpio-controller;
224 qca,no-eeprom;
225 qca,disable-5ghz;
226 mtd-mac-address = <&ath9k_cal 0xf100>;
227 mtd-mac-address-increment = <2>;
228 };
229 };
230 };
231
232 &spi {
233 status = "okay";
234
235 pinctrl-names = "default";
236 pinctrl-0 = <&pins_spi_default>;
237
238 flash@4 {
239 compatible = "jedec,spi-nor";
240 reg = <4>;
241 spi-max-frequency = <33250000>;
242 m25p,fast-read;
243
244 partitions {
245 compatible = "fixed-partitions";
246 #address-cells = <1>;
247 #size-cells = <1>;
248
249 partition@0 {
250 reg = <0x0 0x20000>;
251 label = "u-boot";
252 read-only;
253 };
254
255 partition@20000 {
256 reg = <0x20000 0x7a0000>;
257 label = "firmware";
258 };
259
260 partition@7c0000 {
261 reg = <0x7c0000 0x10000>;
262 label = "config";
263 read-only;
264 };
265
266 ath9k_cal: partition@7d0000 {
267 reg = <0x7d0000 0x30000>;
268 label = "boardconfig";
269 read-only;
270 };
271 };
272 };
273 };
274
275 &usb_phy0 {
276 status = "okay";
277 };
278
279 &usb_phy1 {
280 status = "okay";
281 };
282
283 &usb0 {
284 status = "okay";
285 vbus-supply = <&usb_vbus>;
286 };
287
288 &usb1 {
289 status = "okay";
290 vbus-supply = <&usb_vbus>;
291 };