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