ath79: split ubnt outdoor device leds into separate dtsi
[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                                 compatible = "denx,uimage";
159                                 reg = <0x60000 0x1f60000>;
160                                 label = "firmware";
161                         };
162
163                         partition@1fc0000 {
164                                 reg = <0x1fc0000 0x40000>;
165                                 label = "user_property";
166                                 read-only;
167                         };
168                 };
169         };
170 };
171
172 &spi {
173         status = "okay";
174         cs-gpios = <0>, <0>;
175         num-cs = <2>;
176
177         flash0: flash@0 {
178                 compatible = "jedec,spi-nor";
179                 reg = <0>;
180                 spi-max-frequency = <25000000>;
181         };
182
183         flash1: flash@1 {
184                 compatible = "jedec,spi-nor";
185                 reg = <1>;
186                 spi-max-frequency = <25000000>;
187         };
188 };
189
190 &mdio0 {
191         status = "okay";
192
193         phy-mask = <0x1>;
194
195         phy0: ethernet-phy@0 {
196                 reg = <0>;
197                 phy-mode = "rgmii";
198         };
199 };
200
201 &eth0 {
202         status = "okay";
203
204         pll-data = <0x1c000000 0x00000101 0x00001616>;
205
206         mtd-mac-address = <&art 0x120c>;
207
208         phy-mode = "rgmii";
209         phy-handle = <&phy0>;
210 };
211
212 &pcie {
213         status = "okay";
214
215         ath9k: wifi@0,0 {
216                 compatible = "pci168c,002a";
217                 reg = <0x0000 0 0 0 0>;
218                 mtd-mac-address = <&art 0x120c>;
219                 qca,no-eeprom;
220                 #gpio-cells = <2>;
221                 gpio-controller;
222         };
223 };
224
225 &pll {
226         clocks = <&extosc>;
227 };
228
229 &uart {
230         status = "okay";
231 };
232
233 &usb_phy {
234         status = "okay";
235 };
236
237 &usb {
238         #address-cells = <1>;
239         #size-cells = <0>;
240         status = "okay";
241
242         hub_port: port@1 {
243                 reg = <1>;
244                 #trigger-source-cells = <0>;
245         };
246 };