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