ath79: convert devices to interrupt-driven gpio-keys
[oweals/openwrt.git] / target / linux / ath79 / dts / ar1022_iodata_wn-ag300dgr.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 "ar9344.dtsi"
8
9 / {
10         compatible = "iodata,wn-ag300dgr", "qca,ar9344";
11         model = "I-O DATA WN-AG300DGR";
12
13         aliases {
14                 led-boot = &router;
15                 led-failsafe = &router;
16                 led-running = &router;
17                 led-upgrade = &router;
18         };
19
20         leds {
21                 compatible = "gpio-leds";
22
23                 router: router {
24                         label = "wn-ag300dgr:green:router";
25                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
26                         default-state = "on";
27                 };
28
29                 children {
30                         label = "wn-ag300dgr:green:children";
31                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
32                 };
33
34                 eco {
35                         label = "wn-ag300dgr:green:eco";
36                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
37                 };
38
39                 notification {
40                         label = "wn-ag300dgr:amber:notification";
41                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
42                 };
43
44                 wlan2g {
45                         label = "wn-ag300dgr:green:wlan2g";
46                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
47                         linux,default-trigger = "phy0tpt";
48                 };
49
50                 wlan5g {
51                         label = "wn-ag300dgr:green:wlan5g";
52                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
53                         linux,default-trigger = "phy1tpt";
54                 };
55         };
56
57         keys {
58                 compatible = "gpio-keys";
59
60                 eco {
61                         label = "eco";
62                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
63                         linux,code = <BTN_1>;
64                         debounce-interval = <60>;
65                 };
66
67                 router {
68                         label = "router";
69                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
70                         linux,code = <BTN_0>;
71                         linux,input-type = <EV_SW>;
72                         debounce-interval = <60>;
73                 };
74
75                 auto {
76                         label = "auto";
77                         gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
78                         linux,code = <BTN_0>;
79                         linux,input-type = <EV_SW>;
80                         debounce-interval = <60>;
81                 };
82
83                 wps {
84                         label = "wps";
85                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
86                         linux,code = <KEY_WPS_BUTTON>;
87                         debounce-interval = <60>;
88                 };
89
90                 reset {
91                         label = "reset";
92                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
93                         linux,code = <KEY_RESTART>;
94                         debounce-interval = <60>;
95                 };
96
97                 children {
98                         label = "children";
99                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
100                         linux,code = <BTN_1>;
101                         debounce-interval = <60>;
102                 };
103         };
104 };
105
106 &ref {
107         clock-frequency = <25000000>;
108 };
109
110 &spi {
111         num-cs = <1>;
112         status = "okay";
113
114         flash@0 {
115                 compatible = "jedec,spi-nor";
116                 reg = <0>;
117                 spi-max-frequency = <25000000>;
118
119                 partitions {
120                         compatible = "fixed-partitions";
121                         #address-cells = <1>;
122                         #size-cells = <1>;
123
124                         partition@0 {
125                                 label = "u-boot";
126                                 reg = <0x000000 0x030000>;
127                                 read-only;
128                         };
129
130                         partition@30000 {
131                                 label = "u-boot-env";
132                                 reg = <0x030000 0x010000>;
133                                 read-only;
134                         };
135
136                         partition@40000 {
137                                 compatible = "denx,uimage";
138                                 label = "firmware";
139                                 reg = <0x040000 0xf10000>;
140                         };
141
142                         partition@f50000 {
143                                 label = "manufacture";
144                                 reg = <0xf50000 0x40000>;
145                                 read-only;
146                         };
147
148                         partition@f90000 {
149                                 label = "backup";
150                                 reg = <0xf90000 0x10000>;
151                                 read-only;
152                         };
153
154                         partition@fa0000 {
155                                 label = "storage";
156                                 reg = <0xfa0000 0x50000>;
157                                 read-only;
158                         };
159
160                         partition@ff0000 {
161                                 label = "art";
162                                 reg = <0xff0000 0x010000>;
163                                 read-only;
164                         };
165                 };
166         };
167 };
168
169 &mdio0 {
170         status = "okay";
171
172         phy0: ethernet-phy@0 {
173                 reg = <0>;
174                 phy-mode = "rgmii";
175
176                 qca,ar8327-initvals = <
177                         0x04 0x07a00000 /* PORT0 PAD MODE CTRL */
178                         0x7c 0x000000fe /* PORT0_STATUS */
179                 >;
180         };
181 };
182
183 &eth0 {
184         status = "okay";
185
186         pll-data = <0x06000000 0x00000101 0x00001616>;
187
188         phy-mode = "rgmii";
189         phy-handle = <&phy0>;
190
191         gmac-config {
192                 device = <&gmac>;
193                 rgmii-gmac0 = <1>;
194         };
195 };
196
197 &pcie {
198         status = "okay";
199 };
200
201 &uart {
202         status = "okay";
203 };
204
205 &usb {
206         status = "okay";
207 };
208
209 &usb_phy {
210         status = "okay";
211 };
212
213 &wmac {
214         status = "okay";
215         qca,no-eeprom;
216 };