ramips: set usb led trigger via devicetree
[oweals/openwrt.git] / target / linux / ramips / dts / WSR-1166.dts
1 /dts-v1/;
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "buffalo,wsr-1166dhp", "mediatek,mt7621-soc";
10         model = "Buffalo WSR-1166DHP";
11
12         aliases {
13                 led-status = &led_power;
14         };
15
16         memory@0 {
17                 device_type = "memory";
18                 reg = <0x0 0x8000000>;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,57600";
23         };
24
25         gpio-leds {
26                 compatible = "gpio-leds";
27
28                 internet_g {
29                         label = "wsr-1166:green:internet";
30                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
31                 };
32
33                 router_g {
34                         label = "wsr-1166:green:router";
35                         gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
36                 };
37
38                 router_o {
39                         label = "wsr-1166:orange:router";
40                         gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
41                 };
42
43                 internet_o {
44                         label = "wsr-1166:orange:internet";
45                         gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
46                 };
47
48                 wifi_o {
49                         label = "wsr-1166:orange:wifi";
50                         gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
51                 };
52
53                 led_power: power {
54                         label = "wsr-1166:green:power";
55                         gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
56                 };
57
58                 diag {
59                         label = "wsr-1166:orange:diag";
60                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
61                 };
62
63                 wifi_g {
64                         label = "wsr-1166:green:wifi";
65                         gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
66                 };
67         };
68
69         gpio-keys-polled {
70                 compatible = "gpio-keys-polled";
71                 poll-interval = <20>;
72
73                 power {
74                         label = "power";
75                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
76                         linux,code = <KEY_POWER>;
77                 };
78
79                 reset {
80                         label = "reset";
81                         gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
82                         linux,code = <KEY_RESTART>;
83                 };
84
85                 aoss {
86                         label = "aoss";
87                         gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
88                         linux,code = <KEY_WPS_BUTTON>;
89                 };
90
91                 auto {
92                         label = "mode";
93                         gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
94                         linux,code = <BTN_0>;
95                         linux,input-type = <EV_SW>;
96                 };
97
98                 ap {
99                         label = "ap";
100                         gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
101                         linux,code = <BTN_0>;
102                         linux,input-type = <EV_SW>;
103                 };
104
105                 router {
106                         label = "router";
107                         gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
108                         linux,code = <BTN_0>;
109                         linux,input-type = <EV_SW>;
110                 };
111         };
112
113         gpio_poweroff {
114                 compatible = "gpio-poweroff";
115                 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
116         };
117 };
118
119 &spi0 {
120         status = "okay";
121
122         m25p80@0 {
123                 compatible = "jedec,spi-nor";
124                 reg = <0>;
125                 spi-max-frequency = <10000000>;
126                 m25p,chunked-io = <32>;
127
128                 partitions {
129                         compatible = "fixed-partitions";
130                         #address-cells = <1>;
131                         #size-cells = <1>;
132
133                         partition@0 {
134                                 label = "u-boot";
135                                 reg = <0x0 0x30000>;
136                                 read-only;
137                         };
138
139                         partition@30000 {
140                                 label = "u-boot-env";
141                                 reg = <0x30000 0x10000>;
142                                 read-only;
143                         };
144
145                         factory: partition@40000 {
146                                 label = "factory";
147                                 reg = <0x40000 0x10000>;
148                                 read-only;
149                         };
150
151                         partition@50000 {
152                                 label = "firmware";
153                                 reg = <0x50000 0xf90000>;
154                         };
155
156                         partition@fe0000 {
157                                 label = "board_data";
158                                 reg = <0xfe0000 0x20000>;
159                         };
160                 };
161         };
162 };
163
164 &pinctrl {
165         state_default: pinctrl0 {
166                 gpio {
167                         ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
168                         ralink,function = "gpio";
169                 };
170         };
171 };
172
173 &pcie {
174         status = "okay";
175 };
176
177 &pcie0 {
178         mt76@0,0 {
179                 reg = <0x0000 0 0 0 0>;
180                 mediatek,mtd-eeprom = <&factory 0x8000>;
181                 ieee80211-freq-limit = <5000000 6000000>;
182         };
183 };
184
185 &pcie1 {
186         mt76@0,0 {
187                 reg = <0x0000 0 0 0 0>;
188                 mediatek,mtd-eeprom = <&factory 0x0000>;
189         };
190 };
191
192 &xhci {
193         status = "disabled";
194 };