ath79: add support for Netgear WNDR4300
[oweals/openwrt.git] / target / linux / ath79 / dts / ar9344_netgear_wndr4300.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 = "netgear,wndr4300", "qca,ar9344";
11         model = "Netgear WNDR4300";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200n8";
15         };
16
17         aliases {
18                 led-boot = &power_amber;
19                 led-failsafe = &power_amber;
20                 led-running = &power_green;
21                 led-upgrade = &power_amber;
22                 label-mac-device = &eth0;
23         };
24
25         keys {
26                 compatible = "gpio-keys";
27
28                 wps {
29                         label = "wps";
30                         linux,code = <KEY_WPS_BUTTON>;
31                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
32                 };
33
34                 reset {
35                         label = "reset";
36                         linux,code = <KEY_RESTART>;
37                         gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
38                 };
39
40                 rfkill {
41                         label = "rfkill";
42                         linux,code = <KEY_RFKILL>;
43                         gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
44                 };
45         };
46
47         leds {
48                 compatible = "gpio-leds";
49
50                 pinctrl-names = "default";
51                 pinctrl-0 = <&enable_gpio_11>;
52
53                 power_green: power_green {
54                         label = "netgear:green:power";
55                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
56                 };
57
58                 power_amber: power_amber {
59                         label = "netgear:amber:power";
60                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
61                         default-state = "keep";
62                 };
63
64                 wan_green {
65                         label = "netgear:green:wan";
66                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
67                 };
68
69                 wan_amber {
70                         label = "netgear:amber:wan";
71                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
72                 };
73
74                 wlan2g_green {
75                         label = "netgear:green:wlan2g";
76                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
77                         linux,default-trigger = "phy0tpt";
78                 };
79
80                 wlan5g_blue {
81                         label = "netgear:blue:wlan5g";
82                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
83                         linux,default-trigger = "phy1tpt";
84                 };
85
86                 wps_green {
87                         label = "netgear:green:wps";
88                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
89                 };
90
91                 wps_amber {
92                         label = "netgear:amber:wps";
93                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
94                 };
95
96                 usb_green {
97                         label = "netgear:green:usb";
98                         gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
99                         trigger-sources = <&hub_port>;
100                         linux,default-trigger = "usbport";
101                 };
102         };
103 };
104
105 &pinmux {
106         enable_gpio_11: pinmux_enable_gpio_11 {
107                 pinctrl-single,bits = <0x8 0x0 0xff000000>;
108         };
109 };
110
111 &nand {
112         status = "okay";
113
114         partitions {
115                 compatible = "fixed-partitions";
116                 #address-cells = <1>;
117                 #size-cells = <1>;
118
119                 partition@0 {
120                         label = "u-boot";
121                         reg = <0x0 0x40000>;
122                         read-only;
123                 };
124
125                 partition@40000 {
126                         label = "u-boot-env";
127                         reg = <0x40000 0x40000>;
128                 };
129
130                 art: partition@80000 {
131                         label = "caldata";
132                         reg = <0x80000 0x40000>;
133                         read-only;
134                 };
135
136                 partition@c0000 {
137                         label = "pot";
138                         reg = <0xc0000 0x80000>;
139                 };
140
141                 partition@140000 {
142                         label = "language";
143                         reg = <0x140000 0x200000>;
144                 };
145
146                 partition@340000 {
147                         label = "config";
148                         reg = <0x340000 0x80000>;
149                 };
150
151                 partition@3c0000 {
152                         label = "traffic_meter";
153                         reg = <0x3c0000 0x300000>;
154                 };
155
156                 kernel@6c0000 {
157                         label = "kernel";
158                         reg = <0x6c0000 0x200000>;
159                 };
160
161                 ubi@8c0000 {
162                         label = "ubi";
163                         reg = <0x8c0000 0x1700000>;
164                 };
165
166                 partition@6c0000 {
167                         label = "firmware";
168                         reg = <0x6c0000 0x1900000>;
169                         compatible = "netgear,uimage";
170                 };
171
172                 partition@1fc0000 {
173                         label = "caldata_backup";
174                         reg = <0x1fc0000 0x40000>;
175                         read-only;
176                 };
177
178                 partition@2000000 {
179                         label = "reserved";
180                         reg = <0x2000000 0x6000000>;
181                         read-only;
182                 };
183         };
184 };
185
186 &ref {
187         clock-frequency = <40000000>;
188 };
189
190 &builtin_switch {
191         resets = <&rst 8>, <&rst 12>;
192         reset-names = "switch", "switch-analog";
193 };
194
195 &mdio0 {
196         status = "okay";
197
198         phy-mask = <0>;
199
200         phy0: ethernet-phy@0 {
201                 reg = <0>;
202                 phy-mode = "rgmii";
203                 qca,mib-poll-interval = <500>;
204
205                 qca,ar8327-initvals = <
206                         0x04 0x07600000
207                         0x0c 0x01000000
208                         0x10 0xc1000000
209                         0x50 0xcc35cc35
210                         0x54 0xcb37cb37
211                         0x58 0x00000000
212                         0x5c 0x00f3cf00
213                         0x7c 0x0000007e
214                         0x94 0x0000007e
215                         >;
216         };
217 };
218
219 &eth0 {
220         status = "okay";
221
222         /* default for ar934x, except for 1000M */
223         pll-data = <0x06000000 0x00000101 0x00001616>;
224
225         mtd-mac-address = <&art 0x0>;
226
227         phy-mode = "rgmii";
228         phy-handle = <&phy0>;
229 };
230
231 &gpio {
232         status = "okay";
233
234         lna0 {
235                 gpio-hog;
236                 line-name = "netgear:ext:lna0";
237                 gpios = <18 GPIO_ACTIVE_HIGH>;
238                 output-high;
239         };
240
241         lna1 {
242                 gpio-hog;
243                 line-name = "netgear:ext:lna1";
244                 gpios = <19 GPIO_ACTIVE_HIGH>;
245                 output-high;
246         };
247 };
248
249 &wmac {
250         status = "okay";
251
252         mtd-mac-address = <&art 0x0>;
253         qca,no-eeprom;
254 };
255
256 &pcie {
257         status = "okay";
258
259         ath9k: wifi@0,0 {
260                 compatible = "pci168c,0033";
261                 reg = <0x0000 0 0 0 0>;
262                 mtd-mac-address = <&art 0xc>;
263                 qca,no-eeprom;
264                 #gpio-cells = <2>;
265                 gpio-controller;
266
267                 usb_power {
268                         gpio-hog;
269                         line-name = "netgear:power:usb";
270                         gpios = <0 GPIO_ACTIVE_HIGH>;
271                         output-high;
272                 };
273         };
274 };
275
276 &usb_phy {
277         status = "okay";
278 };
279
280 &usb {
281         status = "okay";
282         #address-cells = <1>;
283         #size-cells = <0>;
284
285         hub_port: port@1 {
286                 reg = <1>;
287                 #trigger-source-cells = <0>;
288         };
289 };
290
291 &uart {
292         status = "okay";
293 };