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