ath79: dts: Unify naming of gpio-keys nodes
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7161_buffalo_wzr-hp-ag300h.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar7100.dtsi"
8
9 / {
10         compatible = "buffalo,wzr-hp-ag300h", "qca,ar7161";
11         model = "Buffalo WZR-HP-AG300H/WZR-600DHP";
12
13         aliases {
14                 led-boot = &diag;
15                 led-failsafe = &diag;
16                 led-upgrade = &diag;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         extosc: ref {
24                 compatible = "fixed-clock";
25                 #clock-cells = <0>;
26                 clock-output-names = "ref";
27                 clock-frequency = <40000000>;
28         };
29
30         gpio-leds {
31                 compatible = "gpio-leds";
32
33                 diag: diag {
34                         label = "buffalo:red:diag";
35                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
36                 };
37         };
38
39         ath9k-leds {
40                 // those leds are indeed attached to the wifi chips
41
42                 compatible = "gpio-leds";
43                 band2g_a {
44                         label = "buffalo:amber:band2g";
45                         gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>;
46                 };
47
48                 usb {
49                         label = "buffalo:green:usb";
50                         gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>;
51                         trigger-sources = <&usb_ochi_port>, <&usb_echi_port>;
52                         linux,default-trigger = "usbport";
53                 };
54
55                 band2g_g {
56                         label = "buffalo:green:band2g";
57                         gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>;
58                         linux,default-trigger = "phy0tpt";
59                 };
60
61                 band5g_g {
62                         label = "buffalo:green:band5g";
63                         gpios = <&ath9k1 1 GPIO_ACTIVE_LOW>;
64                         linux,default-trigger = "phy1tpt";
65                 };
66
67                 router {
68                         label = "buffalo:green:router";
69                         gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>;
70                 };
71
72                 movie_engine {
73                         label = "buffalo:blue:movie_engine";
74                         gpios = <&ath9k1 4 GPIO_ACTIVE_LOW>;
75                 };
76
77                 band5g_a {
78                         label = "buffalo:amber:band5g";
79                         gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>;
80                 };
81         };
82
83         keys {
84                 compatible = "gpio-keys-polled";
85                 poll-interval = <20>;
86
87                 reset {
88                         linux,code = <KEY_RESTART>;
89                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
90                         debounce-interval = <60>;
91                 };
92
93                 usb {
94                         linux,code = <BTN_2>;
95                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
96                         debounce-interval = <60>;
97                 };
98
99                 aoss {
100                         linux,code = <KEY_WPS_BUTTON>;
101                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
102                         debounce-interval = <60>;
103                 };
104
105                 router_auto {
106                         linux,code = <BTN_6>;
107                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
108                         debounce-interval = <60>;
109                 };
110
111                 router_off {
112                         linux,code = <BTN_5>;
113                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
114                         debounce-interval = <60>;
115                 };
116
117                 movie_engine {
118                         linux,code = <BTN_7>;
119                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
120                         debounce-interval = <60>;
121                 };
122         };
123
124         gpio-export {
125                 compatible = "gpio-export";
126
127                 gpio_usb_power {
128                         gpio-export,name = "buffalo:power:usb";
129                         gpio-export,output = <1>;
130                         gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
131                 };
132         };
133
134         flash {
135                 compatible = "mtd-concat";
136
137                 devices = <&flash0 &flash1>;
138
139                 partitions {
140                         compatible = "fixed-partitions";
141                         #address-cells = <1>;
142                         #size-cells = <1>;
143                         partition@0 {
144                                 label = "u-boot";
145                                 reg = <0x0000000 0x0040000>;
146                                 read-only;
147                         };
148
149                         partition@40000 {
150                                 label = "u-boot-env";
151                                 reg = <0x0040000 0x0010000>;
152                                 read-only;
153                         };
154
155                         art: partition@50000 {
156                                 label = "art";
157                                 reg = <0x0050000 0x0010000>;
158                                 read-only;
159                         };
160
161                         partition@60000 {
162                                 compatible = "denx,uimage";
163                                 label = "firmware";
164                                 reg = <0x0060000 0x1f90000>;
165                         };
166
167                         partition@1ff0000 {
168                                 label = "user_property";
169                                 reg = <0x1ff0000 0x0010000>;
170                                 read-only;
171                         };
172                 };
173         };
174 };
175
176 &usb_phy {
177         status = "okay";
178 };
179
180 &usb1 {
181         #address-cells = <1>;
182         #size-cells = <0>;
183         status = "okay";
184
185         usb_ochi_port: port@1 {
186                 reg = <1>;
187                 #trigger-source-cells = <0>;
188         };
189 };
190
191 &usb2 {
192         #address-cells = <1>;
193         #size-cells = <0>;
194         status = "okay";
195
196         usb_echi_port: port@1 {
197                 reg = <1>;
198                 #trigger-source-cells = <0>;
199         };
200 };
201
202 &pcie0 {
203         status = "okay";
204
205         ath9k0: wifi@0,11 {
206                 compatible = "pci168c,0029";
207                 reg = <0x8800 0 0 0 0>;
208                 qca,no-eeprom;
209                 #gpio-cells = <2>;
210                 gpio-controller;
211         };
212
213         ath9k1: wifi@0,12 {
214                 compatible = "pci168c,0029";
215                 reg = <0x9000 0 0 0 0>;
216                 qca,no-eeprom;
217                 #gpio-cells = <2>;
218                 gpio-controller;
219         };
220 };
221
222 &uart {
223         status = "okay";
224 };
225
226 &pll {
227         clocks = <&extosc>;
228 };
229
230 &spi {
231         status = "okay";
232         num-cs = <2>;
233         cs-gpios = <0>, <0>;
234
235         flash0: flash@0 {
236                 compatible = "jedec,spi-nor";
237                 reg = <0>;
238                 spi-max-frequency = <104000000>;
239                 m25p,fast-read;
240         };
241
242         flash1: flash@1 {
243                 compatible = "jedec,spi-nor";
244                 reg = <1>;
245                 spi-max-frequency = <104000000>;
246                 m25p,fast-read;
247         };
248 };
249
250 &mdio0 {
251         status = "okay";
252
253         phy4: ethernet-phy@4 {
254                 reg = <4>;
255                 phy-mode = "rgmii";
256         };
257 };
258
259 &eth0 {
260         status = "okay";
261
262         mtd-mac-address = <&art 0x120c>;
263
264         fixed-link {
265                 speed = <1000>;
266                 full-duplex;
267         };
268 };
269
270 &eth1 {
271         status = "okay";
272
273         mtd-mac-address = <&art 0x520c>;
274         mtd-mac-address-increment = <1>;
275
276         phy-handle = <&phy4>;
277 };