ath79: add support for Buffalo WZR-HP-G302H A1A0
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7242_buffalo_wzr-hp-g302h-a1a0.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 "ar7242.dtsi"
8
9 / {
10         compatible = "buffalo,wzr-hp-g302h-a1a0", "qca,ar7242";
11         model = "Buffalo WZR-HP-G302H A1A0";
12
13         aliases {
14                 led-boot = &diag;
15                 led-failsafe = &diag;
16                 led-upgrade = &diag;
17         };
18
19         extosc: ref {
20                 compatible = "fixed-clock";
21                 #clock-cells = <0>;
22                 clock-frequency = <40000000>;
23         };
24
25         keys {
26                 compatible = "gpio-keys-polled";
27                 poll-interval = <20>;
28
29                 reset {
30                         label = "reset";
31                         linux,code = <KEY_RESTART>;
32                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
33                         debounce-interval = <60>;
34                 };
35
36                 button_usb {
37                         label = "usb";
38                         linux,code = <BTN_2>;
39                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
40                         debounce-interval = <60>;
41                 };
42
43                 router_on {
44                         label = "router_on";
45                         linux,code = <BTN_5>;
46                         linux,input-type = <EV_SW>;
47                         gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
48                         debounce-interval = <60>;
49                 };
50
51                 movie_engine {
52                         label = "movie_engine";
53                         linux,code = <BTN_3>;
54                         linux,input-type = <EV_SW>;
55                         gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
56                         debounce-interval = <60>;
57                 };
58
59                 wps {
60                         label = "wps";
61                         linux,code = <KEY_WPS_BUTTON>;
62                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
63                         debounce-interval = <60>;
64                 };
65         };
66
67         leds {
68                 compatible = "gpio-leds";
69
70                 diag: diag {
71                         label = "buffalo:red:diag";
72                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
73                         default-state = "off";
74                 };
75         };
76
77         ath9k-leds {
78                 compatible = "gpio-leds";
79
80                 usb {
81                         label = "buffalo:blue:usb";
82                         gpios = <&ath9k 4 GPIO_ACTIVE_LOW>;
83                         default-state = "off";
84                         trigger-sources = <&hub_port>;
85                         linux,default-trigger = "usbport";
86                 };
87
88                 wireless {
89                         label = "buffalo:green:wireless";
90                         gpios = <&ath9k 5 GPIO_ACTIVE_LOW>;
91                         default-state = "off";
92                         linux,default-trigger = "phy0tpt";
93                 };
94
95                 security {
96                         label = "buffalo:orange:security";
97                         gpios = <&ath9k 6 GPIO_ACTIVE_LOW>;
98                         default-state = "off";
99                 };
100
101                 router {
102                         label = "buffalo:green:router";
103                         gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
104                         default-state = "off";
105                 };
106
107                 movie_engine_on {
108                         label = "buffalo:blue:movie_engine_on";
109                         gpios = <&ath9k 8 GPIO_ACTIVE_LOW>;
110                         default-state = "off";
111                 };
112
113                 movie_engine_off {
114                         label = "buffalo:blue:movie_engine_off";
115                         gpios = <&ath9k 9 GPIO_ACTIVE_LOW>;
116                         default-state = "off";
117                 };
118         };
119
120         gpio-export {
121                 compatible = "gpio-export";
122                 #size-cells = <0>;
123
124                 gpio_usb_power {
125                         gpio-export,name = "buffalo:usb-power";
126                         gpio-export,output = <1>;
127                         gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
128                 };
129         };
130
131         virtual_flash {
132                 compatible = "mtd-concat";
133                 devices = <&flash0 &flash1>;
134
135                 partitions {
136                         compatible = "fixed-partitions";
137                         #address-cells = <1>;
138                         #size-cells = <1>;
139
140                         partition@0 {
141                                 reg = <0x0 0x40000>;
142                                 label = "u-boot";
143                                 read-only;
144                         };
145
146                         partition@40000 {
147                                 reg = <0x40000 0x10000>;
148                                 label = "u-boot-env";
149                         };
150
151                         art: partition@50000 {
152                                 reg = <0x50000 0x10000>;
153                                 label = "art";
154                                 read-only;
155                         };
156
157                         partition@60000 {
158                                 reg = <0x60000 0x1f60000>;
159                                 label = "firmware";
160                         };
161
162                         partition@1fc0000 {
163                                 reg = <0x1fc0000 0x40000>;
164                                 label = "user_property";
165                                 read-only;
166                         };
167                 };
168         };
169 };
170
171 &spi {
172         status = "okay";
173         cs-gpios = <0>, <0>;
174         num-cs = <2>;
175
176         flash0: flash@0 {
177                 compatible = "jedec,spi-nor";
178                 reg = <0>;
179                 spi-max-frequency = <25000000>;
180         };
181
182         flash1: flash@1 {
183                 compatible = "jedec,spi-nor";
184                 reg = <1>;
185                 spi-max-frequency = <25000000>;
186         };
187 };
188
189 &mdio0 {
190         status = "okay";
191
192         phy-mask = <0x1>;
193
194         phy0: ethernet-phy@0 {
195                 reg = <0>;
196                 phy-mode = "rgmii";
197         };
198 };
199
200 &eth0 {
201         status = "okay";
202
203         pll-data = <0x1c000000 0x00000101 0x00001616>;
204
205         mtd-mac-address = <&art 0x120c>;
206
207         phy-mode = "rgmii";
208         phy-handle = <&phy0>;
209 };
210
211 &pcie {
212         status = "okay";
213
214         ath9k: wifi@0,0 {
215                 compatible = "pci168c,002a";
216                 reg = <0x0000 0 0 0 0>;
217                 mtd-mac-address = <&art 0x120c>;
218                 qca,no-eeprom;
219                 #gpio-cells = <2>;
220                 gpio-controller;
221         };
222 };
223
224 &pll {
225         clocks = <&extosc>;
226 };
227
228 &uart {
229         status = "okay";
230 };
231
232 &usb_phy {
233         status = "okay";
234 };
235
236 &usb {
237         #address-cells = <1>;
238         #size-cells = <0>;
239         status = "okay";
240
241         hub_port: port@1 {
242                 reg = <1>;
243                 #trigger-source-cells = <0>;
244         };
245 };