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