ramips: set usb led trigger via devicetree
[oweals/openwrt.git] / target / linux / ramips / dts / WHR-1166D.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "buffalo,whr-1166d", "ralink,mt7620a-soc";
10         model = "Buffalo WHR-1166D";
11
12         aliases {
13                 led-status = &led_power_green;
14         };
15
16         gpio-leds {
17                 compatible = "gpio-leds";
18
19                 power {
20                         label = "whr-1166d:red:power";
21                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
22                 };
23
24                 wifi {
25                         label = "whr-1166d:green:wifi";
26                         gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
27                 };
28
29                 led_power_green: power2 {
30                         label = "whr-1166d:green:power";
31                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
32                 };
33
34                 wifi2 {
35                         label = "whr-1166d:orange:wifi";
36                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
37                 };
38
39                 internet {
40                         label = "whr-1166d:green:internet";
41                         gpios = <&gpio2 17 GPIO_ACTIVE_LOW>;
42                 };
43
44                 router {
45                         label = "whr-1166d:orange:router";
46                         gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
47                 };
48
49                 router2 {
50                         label = "whr-1166d:green:router";
51                         gpios = <&gpio2 19 GPIO_ACTIVE_LOW>;
52                 };
53         };
54
55         gpio-keys-polled {
56                 compatible = "gpio-keys-polled";
57                 poll-interval = <20>;
58
59                 reset {
60                         label = "reset";
61                         gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
62                         linux,code = <KEY_RESTART>;
63                 };
64
65                 aoss {
66                         label = "aoss";
67                         gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
68                         linux,code = <KEY_WPS_BUTTON>;
69                 };
70
71                 ap {
72                         label = "ap";
73                         gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
74                         linux,code = <BTN_0>;
75                         linux,input-type = <EV_SW>;
76                 };
77
78                 bridge {
79                         label = "bridge";
80                         gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
81                         linux,code = <BTN_0>;
82                         linux,input-type = <EV_SW>;
83                 };
84         };
85 };
86
87 &gpio2 {
88         status = "okay";
89 };
90
91 &spi0 {
92         status = "okay";
93
94         m25p80@0 {
95                 compatible = "jedec,spi-nor";
96                 reg = <0>;
97                 spi-max-frequency = <10000000>;
98
99                 partitions {
100                         compatible = "fixed-partitions";
101                         #address-cells = <1>;
102                         #size-cells = <1>;
103
104                         partition@0 {
105                                 label = "u-boot";
106                                 reg = <0x0 0x30000>;
107                                 read-only;
108                         };
109
110                         partition@30000 {
111                                 label = "u-boot-env";
112                                 reg = <0x30000 0x10000>;
113                                 read-only;
114                         };
115
116                         factory: partition@40000 {
117                                 label = "factory";
118                                 reg = <0x40000 0x10000>;
119                                 read-only;
120                         };
121
122                         partition@50000 {
123                                 label = "firmware";
124                                 reg = <0x50000 0xfb0000>;
125                         };
126                 };
127         };
128 };
129
130 &pinctrl {
131         state_default: pinctrl0 {
132                 gpio {
133                         ralink,group = "i2c", "uartf", "wled", "nd_sd";
134                         ralink,function = "gpio";
135                 };
136         };
137 };
138
139 &ethernet {
140         pinctrl-names = "default";
141         pinctrl-0 = <&rgmii1_pins &mdio_pins>;
142
143         port@5 {
144                 status = "okay";
145                 phy-handle = <&phy5>;
146                 phy-mode = "rgmii";
147         };
148
149         mdio-bus {
150                 status = "okay";
151
152                 phy5: ethernet-phy@5 {
153                         reg = <5>;
154                         phy-mode = "rgmii-rxid";
155                 };
156         };
157 };
158
159 &gsw {
160         mediatek,port4 = "ephy";
161 };
162
163 &wmac {
164         ralink,mtd-eeprom = <&factory 0>;
165 };
166
167 &pcie {
168         status = "okay";
169 };
170
171 &pcie0 {
172         wifi@0,0 {
173                 compatible = "pci0,0";
174                 reg = <0x0000 0 0 0 0>;
175                 mediatek,mtd-eeprom = <&factory 0x8000>;
176                 ieee80211-freq-limit = <5000000 6000000>;
177         };
178 };