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