847458d084d6edffec3bc27473130d389ac82715
[openwrt/staging/chunkeey.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 compatible = "denx,uimage";
171 label = "firmware";
172 reg = <0x0060000 0x1f90000>;
173 };
174
175 partition@1ff0000 {
176 label = "user_property";
177 reg = <0x1ff0000 0x0010000>;
178 read-only;
179 };
180 };
181 };
182 };
183
184 &usb_phy {
185 status = "okay";
186 };
187
188 &usb1 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 status = "okay";
192
193 usb_ochi_port: port@1 {
194 reg = <1>;
195 #trigger-source-cells = <0>;
196 };
197 };
198
199 &usb2 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 status = "okay";
203
204 usb_echi_port: port@1 {
205 reg = <1>;
206 #trigger-source-cells = <0>;
207 };
208 };
209
210 &pcie0 {
211 status = "okay";
212
213 ath9k0: wifi@0,11 {
214 compatible = "pci168c,0029";
215 reg = <0x8800 0 0 0 0>;
216 qca,no-eeprom;
217 #gpio-cells = <2>;
218 gpio-controller;
219 };
220
221 ath9k1: wifi@0,12 {
222 compatible = "pci168c,0029";
223 reg = <0x9000 0 0 0 0>;
224 qca,no-eeprom;
225 #gpio-cells = <2>;
226 gpio-controller;
227 };
228 };
229
230 &uart {
231 status = "okay";
232 };
233
234 &pll {
235 clocks = <&extosc>;
236 };
237
238 &spi {
239 status = "okay";
240 num-cs = <2>;
241 cs-gpios = <0>, <0>;
242
243 flash0: flash@0 {
244 compatible = "jedec,spi-nor";
245 reg = <0>;
246 spi-max-frequency = <104000000>;
247 m25p,fast-read;
248 };
249
250 flash1: flash@1 {
251 compatible = "jedec,spi-nor";
252 reg = <1>;
253 spi-max-frequency = <104000000>;
254 m25p,fast-read;
255 };
256 };
257
258 &mdio0 {
259 status = "okay";
260
261 phy4: ethernet-phy@4 {
262 reg = <4>;
263 phy-mode = "rgmii";
264 };
265 };
266
267 &eth0 {
268 status = "okay";
269
270 mtd-mac-address = <&art 0x120c>;
271
272 fixed-link {
273 speed = <1000>;
274 full-duplex;
275 };
276 };
277
278 &eth1 {
279 status = "okay";
280
281 mtd-mac-address = <&art 0x520c>;
282 mtd-mac-address-increment = <1>;
283
284 phy-handle = <&phy4>;
285 };