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